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ACP,KAAM,KACN,OAAQ,IACR,KAAM,KACN,MAAO,GACR,EACD,WAAY,CACV,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,mBAAoB,CAClB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,eAAgB,CACd,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,SAAU,CACR,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,gBAAiB,YACjB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAA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WsmB,GAAM7iB,IAC/CgB,GAAK,CAAC1H,KAAI,OAAQiD,UAAWynB,EAAQ,MAEzC","names":["TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","options","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","v","x","y","w","h","convertColorToRgba","color","a","b","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","node","properties","div","key","driver","target","property","value","receiver","props","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","res","uni","trPropSetterDefaults","state","TextRenderer","stage","propSetters","setter","status","error","renderable","eventName","WebTrFontFace","TrFontFace","fontFamily","descriptors","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","context","ff","ffs","i","n","fontSetting","err","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","j","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","results","eff","index","fxClass","uniInfo","p","fxProp","propInfo","propsA","propsB","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","val","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","name","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","e","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","start","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","parentHasRenderTexture","framebufferDimensions","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","d","validTypes","keys","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_L","_K","_N","_M","_O","_Q","_P","_S","_R","_T","_V","_U","_X","_W","_Y","_Z","textureType","id","desc","shaderType","CoreAnimation","propName","getTimingFunction","startValue","endValue","s","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","child","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","rtt","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","RenderTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","equalFn","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","root","updateFn","untrack","cleanNode","runUpdates","createSignal","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","setError","track","trigger","setState","loadEnd","completeLoad","read","SuspenseContext","load","refetching","lookup","castError","createSelector","subs","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","createProvider","useContext","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","FALLBACK","dispose","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","resolveSource","resolveSources","length","mergeProps","sources","proxy","sourcesMap","defined","sourceKeys","definedKeys","splitProps","blocked","k","otherObject","objects","isDefaultDesc","objectIndex","narrowedError","For","fallback","Show","keyed","condition","DEV","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","__super","_key","stateIndexToRemove","calculateFlex","hasOrder","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","changedLayout","stylesToUndo","styleKey","newStyles","styles","handler","inode","radius","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useLocation","useMatch","matchers","matcher","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","startsWith","r$","_ref$","_ref$2","_ref$3","materialBrand","objectFromEntries","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","axis","lastItem","updateLastIndex","rootPosition","selectedPosition","selectedSize","direct","currentChildIndex","currentChild","currentChildSize","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","_c2","num","getWidthByUpCount$1","theme2","upCount","screenW","columnCount","marginX","gutterX","columnWidth","columnGapTotal","defaultTone$f","themeStyles$e","container$f","defaultTone$e","themeStyles$d","container$e","text$7","icon$2","defaultTone$d","themeStyles$c","surfaceDefaultTone","surfaceThemeStyles$1","container$d","content","text$6","Container$c","Content","Text$5","styles$c","Button","Text$7","defaultTone$c","themeStyles$b","strokeWidth","container$c","icon$1","defaultTone$b","themeStyles$a","container$b","defaultTone$a","themeStyles$9","container$a","Container$9","styles$9","Column","onUp","onDown","defaultTone$9","themeStyles$8","container$9","text$5","themeStyles$7","defaultTone$8","container$8","text$4","icon","defaultTone$7","themeStyles$6","container$7","text$3","defaultTone$6","themeStyles$5","container$6","titleText","descriptionText","defaultTone$5","themeStyles$4","container$5","progress","defaultTone$4","themeStyles$3","container$4","Container$3","styles$3","Row","onLeft","onRight","defaultTone$3","themeStyles$2","container$3","text$2","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","isLoadedCount","setIsLoadedCount","isLoadingCount","setIsLoadingCount","isFailedCount","setIsFailedCount","count","totalFps","calcFps","fps2","calcPerformanceMetrics","isLoadedCount2","isLoadingCount2","isFailedCount2","setupFPS","FPSCounter","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","handleNavigate","page","focusPage","flexItem","showWidgets","onEnter","Gradient","App","Menu","Escape","Backspace","Left","Right","Up","Down","Enter","announcer","enabled","navDrawer","lastFocused","focusNavDrawer","has","setShowWidgets","showOnPaths","currentPath","matchesPartial","some","window","APP","onAnnouncer","onLast","history","back","onMenu","onBackspace","mountX","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","setPage","setEnd","contents","blockWidth","HeadlineStyles","typography","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","Badge","borderRadius","border","MetaTextStyle","body2","Metadata","display","flexDirection","voteAverage","voteCount","metaText","badges","ContentBlock","title","description","minutesToHMM","minutes","hours","remainingMinutes","formatDate","dateString","parts","justYear","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","delayedBackgrounds","delayedHero","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","ballStatus","setBallStatus","styleBall","mount","lineheight","randomIntBetween","Math","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","marginRight","FlexSizePage","randSize","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","entityActions","onEnterTrailer","RowTitle","People","autosize","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[59,70,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,96,98],"sources":["../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (let i=0; i < this.children.length; i++) {\n const child = this.children[i];\n if (child instanceof ElementNode) {\n if (child.id === id) {\n return child;\n }\n\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwK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png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI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57AqACkRvBvB2p7hrDzI6yzU7s90EUPNBxtnR4SjwrgGo9EK1Qca8cM4ByU4mkuz++F93ZHELyZX3iW31n+S+sKWZWfNBxkCbNeUq6ekArugo1I0kH1xT8EkBKj1R80HGGkFbtZVkZ3bb2d2r0tUkn1hTh8kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import { View, Text } from \"@lightningjs/solid\";\nimport { For, Show } from \"solid-js\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-DxDEf8-k.js"} \ No newline at end of file +{"version":3,"mappings":"8tCAqBO,MAAMA,EAAoB,CAE7B,YAAYC,EAAiB,CAD7BC,EAAA,wBAEI,KAAK,gBAAkBD,CAC1B,CACL,CCHO,MAAME,WAAuCH,EAAoB,CAIpE,YAAYC,EAAiBG,EAAS,SAClC,MAAMH,CAAe,EAJzBC,EAAA,kBAAa,IAAI,KACjBA,EAAA,+BAA0B,IAAI,KAC9BA,EAAA,gBAGI,KAAK,QAAU,CACX,0BAA0BG,EAAAD,EAAQ,2BAAR,KAAAC,EAAoC,IAC9D,+BAA+BC,EAAAF,EAAQ,gCAAR,KAAAE,EAAyC,GACpF,EAGQ,YAAY,IAAM,CACd,MAAMC,EAAM,KAAK,MACXC,EAAc,KAAK,QAAQ,8BACjC,UAAWC,KAAkB,KAAK,wBAC1BF,EAAME,EAAe,WAAaD,IAClC,KAAK,gBAAgBC,EAAe,EAAE,EACtC,KAAK,WAAW,OAAOA,EAAe,EAAE,EACxC,KAAK,wBAAwB,OAAOA,CAAc,EAGtE,EAAW,KAAK,QAAQ,wBAAwB,CAC3C,CACD,gBAAgBC,EAAS,OACrB,MAAMC,GAAYN,EAAAK,EAAQ,UAAR,YAAAL,EAAiB,GAEnC,GADAO,EAAaD,EAAW,0CAA0C,EAC9D,CAAC,KAAK,WAAW,IAAIA,CAAS,EAAG,CACjC,MAAMF,EAAiB,CACnB,GAAIE,EACJ,aAAc,EACd,WAAY,KAAK,IAAK,CACtC,EACY,KAAK,WAAW,IAAIA,EAAWF,CAAc,EAC7C,KAAK,wBAAwB,IAAIA,CAAc,CAClD,CACJ,CACD,yBAAyBC,EAAS,OAC9B,M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ACN,MAAO,GACP,KAAM,IACN,OAAQ,GACR,KAAM,IACN,MAAO,EACR,EACD,MAAO,CACL,KAAM,EACN,MAAO,IACP,KAAM,KACN,OAAQ,IACR,KAAM,KACN,MAAO,GACR,EACD,WAAY,CACV,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,mBAAoB,CAClB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,eAAgB,CACd,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,SAAU,CACR,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,gBAAiB,YACjB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAA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AAK,CAAC1H,KAAI,oBAAqBiD,UAAWqnB,GAAM5jB,IAChDgB,GAAK,CAAC1H,KAAI,mBAAoBiD,UAAWsmB,GAAM7iB,IAC/CgB,GAAK,CAAC1H,KAAI,OAAQiD,UAAWynB,EAAQ,MAEzC","names":["TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","options","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","v","x","y","w","h","convertColorToRgba","color","a","b","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","node","properties","div","key","driver","target","property","value","receiver","props","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","res","uni","trPropSetterDefaults","state","TextRenderer","stage","propSetters","setter","status","error","renderable","eventName","WebTrFontFace","TrFontFace","fontFamily","descriptors","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","context","ff","ffs","i","n","fontSetting","err","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","j","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","results","eff","index","fxClass","uniInfo","p","fxProp","propInfo","propsA","propsB","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","val","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","name","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","e","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","start","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","parentHasRenderTexture","framebufferDimensions","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","d","validTypes","keys","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_L","_K","_N","_M","_O","_Q","_P","_S","_R","_T","_V","_U","_X","_W","_Y","_Z","textureType","id","desc","shaderType","CoreAnimation","propName","getTimingFunction","startValue","endValue","s","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","child","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","rtt","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","RenderTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","equalFn","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","root","updateFn","untrack","cleanNode","runUpdates","createSignal","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","setError","track","trigger","setState","loadEnd","completeLoad","read","SuspenseContext","load","refetching","lookup","castError","createSelector","subs","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","createProvider","useContext","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","FALLBACK","dispose","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","resolveSource","resolveSources","length","mergeProps","sources","proxy","sourcesMap","defined","sourceKeys","definedKeys","splitProps","blocked","k","otherObject","objects","isDefaultDesc","objectIndex","narrowedError","For","fallback","Show","keyed","condition","DEV","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","__super","_key","stateIndexToRemove","calculateFlex","hasOrder","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","changedLayout","stylesToUndo","styleKey","newStyles","styles","handler","inode","radius","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useLocation","useMatch","matchers","matcher","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","startsWith","r$","_ref$","_ref$2","_ref$3","materialBrand","objectFromEntries","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","axis","lastItem","updateLastIndex","rootPosition","selectedPosition","selectedSize","direct","currentChildIndex","currentChild","currentChildSize","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","_c2","num","getWidthByUpCount$1","theme2","upCount","screenW","columnCount","marginX","gutterX","columnWidth","columnGapTotal","defaultTone$f","themeStyles$e","container$f","defaultTone$e","themeStyles$d","container$e","text$7","icon$2","defaultTone$d","themeStyles$c","surfaceDefaultTone","surfaceThemeStyles$1","container$d","content","text$6","Container$c","Content","Text$5","styles$c","Button","Text$7","defaultTone$c","themeStyles$b","strokeWidth","container$c","icon$1","defaultTone$b","themeStyles$a","container$b","defaultTone$a","themeStyles$9","container$a","Container$9","styles$9","Column","onUp","onDown","defaultTone$9","themeStyles$8","container$9","text$5","themeStyles$7","defaultTone$8","container$8","text$4","icon","defaultTone$7","themeStyles$6","container$7","text$3","defaultTone$6","themeStyles$5","container$6","titleText","descriptionText","defaultTone$5","themeStyles$4","container$5","progress","defaultTone$4","themeStyles$3","container$4","Container$3","styles$3","Row","onLeft","onRight","defaultTone$3","themeStyles$2","container$3","text$2","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","isLoadedCount","setIsLoadedCount","isLoadingCount","setIsLoadingCount","isFailedCount","setIsFailedCount","count","totalFps","calcFps","fps2","calcPerformanceMetrics","isLoadedCount2","isLoadingCount2","isFailedCount2","setupFPS","FPSCounter","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","handleNavigate","page","focusPage","flexItem","showWidgets","onEnter","Gradient","App","Menu","Escape","Backspace","Left","Right","Up","Down","Enter","announcer","enabled","navDrawer","lastFocused","focusNavDrawer","has","setShowWidgets","showOnPaths","currentPath","matchesPartial","some","window","APP","onAnnouncer","onLast","history","back","onMenu","onBackspace","mountX","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","setPage","setEnd","contents","blockWidth","HeadlineStyles","typography","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","Badge","borderRadius","border","MetaTextStyle","body2","Metadata","display","flexDirection","voteAverage","voteCount","metaText","badges","ContentBlock","title","description","minutesToHMM","minutes","hours","remainingMinutes","formatDate","dateString","parts","justYear","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","delayedBackgrounds","delayedHero","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","ballStatus","setBallStatus","styleBall","mount","lineheight","randomIntBetween","Math","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","marginRight","FlexSizePage","randSize","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","entityActions","onEnterTrailer","RowTitle","People","autosize","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[59,70,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,96,98],"sources":["../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (let i=0; i < this.children.length; i++) {\n const child = this.children[i];\n if (child instanceof ElementNode) {\n if (child.id === id) {\n return child;\n }\n\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDI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BkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92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gs8pQ06lxY3N4QtCWZBRgPDezdnHvPr+alV2EiaL0DlF2Dbn20bdB40XtHwQ5nOHqAC0SyCjEM1Wkv57AqACkRvBvB2p7hrDzI6yzU7s90EUPNBxtnR4SjwrgGo9EK1Qca8cM4ByU4mkuz++F93ZHELyZX3iW31n+S+sKWZWfNBxkCbNeUq6ekArugo1I0kH1xT8EkBKj1R80HGGkFbtZVkZ3bb2d2r0tUkn1hTh8kBKhB9DMBLnQWfJMjoLFuTZpJsO/ONAB7UUcBLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import { View, Text } from \"@lightningjs/solid\";\nimport { For, Show } from \"solid-js\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\n// withPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-DxDEf8-k.js"} \ No newline at end of file diff --git a/assets/index-legacy-D9A9AaUs.js.map b/assets/index-legacy-D9A9AaUs.js.map index 75f9b56..3ce9c75 100644 --- a/assets/index-legacy-D9A9AaUs.js.map +++ b/assets/index-legacy-D9A9AaUs.js.map @@ -1 +1 @@ -{"version":3,"file":"index-legacy-D9A9AaUs.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (let i=0; i < this.children.length; i++) {\n const child = this.children[i];\n if (child instanceof ElementNode) {\n if (child.id === id) {\n return child;\n }\n\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAA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Mj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8lMAx5P8s9N+Y8wk2cTjfQDu66z080h+zml7yKwpgCSdCOByZyX+BuBRJH/otN84M0kWN/s0gOc4Kv8Nko922B1m0gxAkh4I4AcVwcL9JA/UVnjT7CXdHYD9yEzfVUkAjib5uxqNmgCoBAu/CeBhzsJ/kORZTtuNN5Nk70bXAZ0Hy59G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91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import { View, Text } from \"@lightningjs/solid\";\nimport { For, Show } from \"solid-js\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["getUnicodeCodepoints","TextureUsageTracker","constructor","releaseCallback","_defineProperty","this","ManualCountTextureUsageTracker","options","_options$textureClean","_options$textureClean2","super","Map","Set","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step4","now","Date","thresholdMs","_iterator4","_createForOfIteratorHelper","zeroReferenceTextureSet","s","n","done","textureRefInfo","value","lastUpdate","id","textureMap","delete","err","e","f","registerTexture","texture","_texture$options","textureId","assertTruthy","has","nodeRefCount","set","add","incrementTextureRefCount","_texture$options2","get","txType","props","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","v","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","Error","Math","ceil","appHeight","deviceLogicalPixelRatio","appWidth","root","document","createElement","setRootPosition","body","appendChild","MutationObserver","bind","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","node","properties","div","key","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Proxy","target","property","Reflect","receiver","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","getEffectKey","getMethodParameters","uniforms","res","u","uni","define","size","push","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","name","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","state","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","_objectSpread","getPropertySetters","Object","freeze","fromEntries","entries","map","setter","requestRender","setStatus","status","error","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","forEach","eventName","off","scheduleUpdateState","updateScheduled","queueMicrotask","updateState","WebTrFontFace","TrFontFace","descriptors","fontUrl","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","weight","stretch","unicodeRange","variant","featureSettings","display","fontFace","FontFace","load","then","loaded","catch","calcHeight","numLines","max","LightningTextTextureRenderer","context","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","ffs","i","length","_load","fonts","fontSetting","check","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","l","split","lines","usedLines","slice","otherLines","measureText","al","j","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","min","draw","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","concat","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalThis","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","fontInfo","undefined","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","pop","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step5","_iterator5","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","getImageData","preload","renderQuads","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","_state$fontInfo","_state$fontInfo2","DefaultShader","WebGlCoreShader","bindTextures","textures","glw","activeTexture","bindTexture","ctxTexture","vertex","fragment","DefaultShaderBatched","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","Array","from","keys","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","results","eff","index","_eff$props","fxClass","uniInfo","p","fxProp","propInfo","validator","isArray","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","values","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","$alpha","makeCacheKey","_props$effects","RoundedRectangle","radius","IDENTITY_MATRIX_3x3","SdfShader","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","args","_props$radius","fillMask","boxDist","BorderEffect","_props$width","_props$color2","rgba","LinearGradientEffect","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","val","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_props$amount","BorderRightEffect","_props$width2","_props$color3","rectDist","BorderTopEffect","_props$width3","_props$color4","BorderBottomEffect","_props$width4","_props$color5","BorderLeftEffect","_props$width5","_props$color6","GlitchEffect","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","time","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","getRegisteredShaders","loadShader","ShaderClass","loadDynamicShader","cacheKey","shCache","useShader","attachedShader","detach","attach","ContextSpy","reset","data","getData","loadCompressedTexture","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","prev","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","apply","arguments","_ref3","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref4","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","Texture","hasAlphaChannel","mimeType","getTextureData","_this","_callee4","_this$props","blob","img","_callee4$","_context4","ImageData","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","substr","crossOrigin","Promise","resolve","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","start","codePoint","getUnicodeCodepoints$","_context5","codePointAt","_marked","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step6","_iterator6","glyph","mapped","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","resolveFontToUse","familyMapsByPriority","family","weightIn","_step7","_iterator7","fontFaces","_step8","weightMap","_iterator8","fontFamilyWeight","msg","TrFontManager","textRenderers","trId","tr","resolveFontFace","tmpRect","SdfTextRenderer","ssdfFontFamilies","msdfFontFamilies","sdfShader","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","parentHasRenderTexture","framebufferDimensions","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee12","coreExtensionModule","module$1","ExtensionClass","coreExtension","_callee12$","_context13","log","__vitePreload","module","default","classExtendsCoreExtension","prototype","CoreExtension","run","santizeCustomDataMap","d","validTypes","boolean","string","number","valueType","RendererMain","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","init","_this2","_callee5","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref5","_ref6","_props$colorTl","_ref7","_ref8","_props$colorTr","_ref9","_ref10","_props$colorBl","_ref11","_ref12","_props$colorBr","_props$data","_ref13","_props$parent$rtt","_props$parent","_props$parent2","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$autosize","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent3","_props$texture","_props$shader","_props$src2","_props$scale2","_ref14","_props$scaleX","_ref15","_props$scaleY","_props$mount","_ref16","_props$mountX","_ref17","_props$mountY","_props$pivot2","_ref18","_props$pivotX","_ref19","_props$pivotY","_props$rotation2","_props$rtt","colorTop","colorLeft","colorRight","colorBottom","rtt","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","desc","descType","shaderType","getNodeById","toggleFreeze","advanceFrame","rerender","CoreAnimation","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","restore","reverse","startValue","endValue","stopMethod","applyEasing","dt","_this$settings","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","pause","waitUntilStarted","promise","startedPromise","waitUntilStopped","stoppedPromise","startedResolve","_this$animation$setti","Matrix3d","temp","tempMatrix","multiply","a","b","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","identity","sx","sy","cos","sin","copy","dst","transpose","other","transformPoint","CoreNodeRenderState","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","All","autosizeNode","setRTTUpdates","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","on","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","children","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","_this$props$parent","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","child","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent4","_props$parent5","z","destroy","removeAllListeners","_this$props2","renderToTextureActive","parentRenderTexture","activeRttNode","absX","_this$props$parent2","_this$props$parent3","absY","_this$props$parent$ab","_this$props$parent4","newParent","oldParent","splice","_this$stage$renderer","hasRTTupdates","renderToTexture","_this$parent","_this$parent2","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","flipY","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","_slicedToArray","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","getNextWorker","workerIndex","convertUrlToAbsolute","location","href","absoluteSrcUrl","postMessage","NoiseTexture","_this3","_callee6","_this3$props","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","RenderTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","removeTextureIdFromCache","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","getDebugInfo","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","runLoop","rootNode","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","requestAnimationFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","rttNodes","renderRTTNodes","addQuads","render","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i8","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","_this$props$parent5","_this$localTransform","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","SuspenseContext","equalFn","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","updateFn","untrack","cleanNode","runUpdates","createSignal","observers","observerSlots","comparator","assign","readSignal","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","user","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","_ref21","storage","initialValue","setValue","_createSignal2","setError","_createSignal3","_createSignal4","track","trigger","_createSignal6","setState","loadEnd","onHydrated","_step9","_iterator9","decrement","clear","completeLoad","read","refetching","lookup","castError","defineProperties","loading","latest","refetch","mutate","createSelector","subs","_step10","_iterator10","_step10$value","_iterator11","_step11","pure","onCleanup","deps","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prevListener","handleError","startTransition","createContext","defaultValue","Provider","createProvider","useContext","memo","resolveChildren","toArray","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","nextValue","updatedAt","runComputation","runTop","suspense","inFallback","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","cause","FALLBACK","dispose","createComponent","Comp","trueFn","propTraps","_","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","disposers","len","indexes","newItems","newIndices","newIndicesNext","tempdisposers","tempIndexes","end","newEnd","item","newLen","disposer","mapper","_createSignal8","mapArray","each","Show","keyed","condition","when","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","_createSignal10","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","_renderProps","_effects","lng","_p$lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationRunning","_animationQueue","_animationQueueSettings","_this5","_callee8","_callee8$","_context9","setFocus","forwardFocus","focusedIndex","autofocus","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","found","states","_states","_stateChanged","_animationSettings","_this$parent3","changedLayout","onBeforeLayout","hasOrder","flexItem","flexOrder","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","flexBoundary","calculatedSize","toPad","calculateFlex","_this$parent4","onLayout","forwardStates","_undoStyles","_iterator14","_step14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_autosized","marginBottom","isNaN","onFail","onLoad","onCreate","handler","_node$lng","inode","solid","_loop2","_i17","_LightningRendererNum","_loop3","_i18","_LightningRendererNon","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","Text","_el$","_$createElement","View","createRenderer$1","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","spread","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref22","_callee9","_context10","rendererOptions","_x7","_x8","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step15","defaultPrevented","preventDefault","_iterator15","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useLocation","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step17","_iterator17","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step18","_iterator18","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref23","_callee10","_context11","finish","_x9","_createSignal14","reference","setReference","_createSignal16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","routerState","router","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","intercept","createRouter","keepDepth","hashIndex","notify","bindEvent","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i20","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step19","finalFocusElm","_iterator19","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","marginLeft","maxHeight","marginTop","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee11","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee11$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","debounced","voiceOutDisabled","debounceWithFlush","scopedValue","newValue","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","notification","_currentlySpeaking","textToSpeech","finally","refresh","setupTimers","focusDebounce","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_q","_r","_createSignal22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","r$","objectFromEntries","_step20","_iterator20","_step20$value","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles","themeStyles2","modeKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","generateSolidStylesFromLookupObject","base2","modes2","tones2","themeStyles3","themeComponentStyles","variantName","styles2","convertedStyles","styleName","modeName","modeStyles","baseStyles","makeBaseStyles","makeModeStyles","mode","toneStyles","makeToneStyles","tone","_ref25","_ref26","_a2","_b2","_ref27","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_componentRef$axis","_ref28","_ref29","axis","_updateLastIndex","lastItem","updateLastIndex","_updateLastIndex2","rootPosition","selectedPosition","selectedSize","direct","scrollIndex","abs","currentChildIndex","_currentChild$dimensi","chainFunctions","onlyFunctions","func","innerArgs","_step21","_iterator21","onGridFocus","skipFocus","handleNavigation","_c2","onSelectedChanged","plinko","num","_ref30$Artwork","Artwork","_ref30$Artwork2","themeStyles$e","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$d","_excluded2","container$e","inverse","brand","text$7","icon$2","_ref32$Button","Button","_ref32$Button2","defaultTone$d","themeStyles$c","_excluded3","_ref33$Surface","Surface","_ref33$Surface2","surfaceDefaultTone","surfaceThemeStyles$1","_excluded4","container$d","contentColor","focus","content","text$6","styles$c","Container","Content","_props$tone","flat","Text$7","_props$tone2","_ref34$Checkbox","Checkbox","_ref34$Checkbox2","themeStyles$b","_excluded5","strokeWidth","container$c","checked","neutral","icon$1","_ref35$Icon","Icon","_ref35$Icon2","themeStyles$a","_excluded6","_ref36$Column","Column","_ref36$Column2","defaultTone$a","themeStyles$9","_excluded7","styles$9","itemTransition","onUp","onDown","_props$selected","_props$selected2","_props$tone3","_ref37$Label","Label","_ref37$Label2","themeStyles$8","_excluded8","container$9","backgroundColor","text$5","_ref38$Rating","Rating","_ref38$Rating2","themeStyles$7","container$8","itemSpacing","toneModes","text$4","_ref39$Details","Details","_ref39$Details2","themeStyles$6","_excluded9","container$7","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$3","_ref40$Metadata","Metadata","_ref40$Metadata2","themeStyles$5","_excluded10","container$6","titleText","descriptionText","_ref41$ProgressBar","ProgressBar","_ref41$ProgressBar2","themeStyles$4","_excluded11","container$5","_ref42$Row","Row","_ref42$Row2","defaultTone$4","themeStyles$3","_excluded12","styles$3","onLeft","onRight","_props$selected3","_props$selected4","_props$tone4","_props$tone5","_ref43$Keyboard","_ref43$Keyboard2","themeStyles$2","_excluded13","container$3","keySpacing","baseWidth","sizes","paddingX","text$2","_ref44$Key","Key","_ref44$Key2","themeStyles$1","_excluded14","container$2","text$1","_ref45$Input","Input","_ref45$Input2","_excluded15","container$1","actualTitle","theme2","upCount","getWidthByUpCount$1","_ref46$Tile","Tile","_ref46$Tile2","tileThemeStyles","_excluded16","_ref47$Surface","_ref47$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded17","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","_createSignal32","isLoadedCount","setIsLoadedCount","_createSignal34","isLoadingCount","setIsLoadingCount","_createSignal36","isFailedCount","setIsFailedCount","totalFps","setupFPS","isLoadedCount2","isLoadingCount2","isFailedCount2","fps2","calcFps","FPSCounter","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","handleNavigate","page","isOnPage","matchers","_step16","_iterator16","focusPage","showWidgets","onEnter","App","Menu","Left","Right","Up","Down","announcer","navDrawer","lastFocused","focusNavDrawer","_createSignal38","setShowWidgets","showOnPaths","currentPath","matchesPartial","_ref$","APP","onAnnouncer","onLast","back","onMenu","onBackspace","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step12","otherObject","objects","_iterator12","_step13","isDefaultDesc","writable","objectIndex","_iterator13","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","posterSize","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal40","pages","setPages","_createSignal42","setPage","_createSignal44","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","voteAverage","voteCount","metaText","badges","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","rtCrit","rtFan","backgroundImage","vote_average","vote_count","minutes","runtime","remainingMinutes","minutesToHMM","release_date","parts","first_air_date","last_air_date","reviews","Browse","_createSignal46","columnY","setcolumnY","_createSignal48","entityProvider","_createSignal50","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","delayedBackgrounds","delayedHero","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal52","setColor","_createSignal54","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal56","insertTest","setInsertTest","_createSignal58","emptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal60","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal62","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal64","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal66","_this$children$select4","_createSignal68","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal70","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","entityActions","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"ihVAsBiBA,sQCDV,MAAMC,GAETC,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,CAAC3I,KAAI,iBAAkBgD,UAAW89B,KAAkBl5B,GACzDe,GAAK,CAAC3I,KAAI,aAAcgD,UAAW66B,KAAcj2B,GACjDe,GAAK,CAAC3I,KAAI,kBAAmBgD,UAAW+9B,KAAmBn5B,GAC3De,GAAK,CAAC3I,KAAI,oBAAqBgD,UAAWw9B,KAAM54B,GAChDe,GAAK,CAAC3I,KAAI,mBAAoBgD,UAAWo8B,KAAMx3B,GAC/Ce,GAAK,CAAC3I,KAAI,OAAQgD,UAAWy9B,KAAQ","x_google_ignoreList":[59,70,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,99,102]} \ No newline at end of file +{"version":3,"file":"index-legacy-D9A9AaUs.js","sources":["../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../../renderer/dist/src/main-api/Inspector.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../../renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../../renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../../renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../../renderer/dist/src/core/CoreShaderManager.js","../../../../../renderer/dist/src/core/lib/ContextSpy.js","../../../../../renderer/dist/src/core/lib/textureCompression.js","../../../../../renderer/dist/src/core/textures/ImageTexture.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../../renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../../renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../../renderer/dist/src/render-drivers/utils.js","../../../../../renderer/dist/src/main-api/RendererMain.js","../../../../../renderer/dist/src/core/animations/CoreAnimation.js","../../../../../renderer/dist/src/core/animations/CoreAnimationController.js","../../../../../renderer/dist/src/core/lib/Matrix3d.js","../../../../../renderer/dist/src/core/CoreNode.js","../../../../../renderer/dist/src/core/lib/RenderCoords.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../../renderer/dist/src/core/animations/AnimationManager.js","../../../../../renderer/dist/src/core/lib/ImageWorker.js","../../../../../renderer/dist/src/core/textures/NoiseTexture.js","../../../../../renderer/dist/src/core/CoreTextureManager.js","../../../../../renderer/dist/src/core/TextureMemoryManager.js","../../../../../renderer/dist/src/core/Stage.js","../../../../../renderer/dist/src/core/platform.js","../../../../../renderer/dist/src/core/CoreTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../../renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.12.1_@babel+core@7.24.4_@lightningjs+renderer@0.8.2_@lightningjs+soli_l6qk66ywnsrdb5zvon2uxgrjiy/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.4_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.6_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio;\n vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);\n\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n gl_Position = vec4(normalized.x * screenSpace.x - 1.0, normalized.y * -abs(screenSpace.y) + 1.0, 0.0, 1.0);\n gl_Position.y = -sign(screenSpace.y) * gl_Position.y;\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n\n // Calculate screen space with pixel ratio\n vec2 screenSpace = (transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1);\n\n gl_Position = vec4(screenSpace, 0.0, 1.0);\n v_texcoord = a_textureCoordinate;\n\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n if (!(src.substr(0, 5) == \"data:\")) {\n // Base64.\n img.crossOrigin = \"Anonymous\";\n }\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha, parentHasRenderTexture, framebufferDimensions) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex, false, parentHasRenderTexture, framebufferDimensions);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n const parentHasRenderTexture = props.parent?.rtt ?? props.parent?.parentHasRenderTexture ?? false;\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n rtt: props.rtt ?? false,\n parentHasRenderTexture,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n hasRTTupdates = false;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n // Assign a default value to parentHasRenderTexture\n parentHasRenderTexture: false,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n // Allow for Render Texture to be processed appropriately\n this.rtt = props.rtt;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // If parent has a render texture, flag that we need to update\n // @todo: Reserve type for RTT updates\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(1);\n }\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n queueMicrotask(() => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n // If node is part of RTT texture\n // Flag that we need to update\n if (this.parentHasRenderTexture) {\n this.setRTTUpdates(type);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n }\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children &&\n this.children.length &&\n !this.rtt) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps, rtt, parentHasRenderTexture, } = this.props;\n // Prevent quad rendering if parent has a render texture\n // and renderer is not currently rendering to a texture\n if (parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n rtt,\n parentHasRenderTexture,\n framebufferDimensions: this.framebufferDimensions,\n });\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n if (newParent.rtt || newParent.parentHasRenderTexture) {\n this.setRTTUpdates(UpdateType.All);\n }\n }\n this.parentHasRenderTexture =\n newParent?.rtt || newParent?.parentHasRenderTexture;\n this.updateScaleRotateTransform();\n }\n get rtt() {\n return this.props.rtt;\n }\n set rtt(value) {\n if (!value) {\n return;\n }\n this.props.rtt = true;\n this.hasRTTupdates = true;\n // Store RTT nodes in a separate list\n this.stage.renderer?.renderToTexture(this);\n }\n set parentHasRenderTexture(value) {\n this.props.parentHasRenderTexture = !!value;\n }\n get parentHasRenderTexture() {\n return this.props.parentHasRenderTexture;\n }\n /**\n * Returns the framebuffer dimensions of the node.\n * If the node has a render texture, the dimensions are the same as the node's dimensions.\n * If the node does not have a render texture, the dimensions are inherited from the parent.\n * If the node parent has a render texture and the node is a render texture, the nodes dimensions are used.\n */\n get framebufferDimensions() {\n if (this.parentHasRenderTexture && !this.rtt) {\n return this.parent?.framebufferDimensions;\n }\n return { width: this.width, height: this.height };\n }\n /**\n * Returns the parent render texture node if it exists.\n */\n get parentRenderTexture() {\n let parent = this.parent;\n while (parent) {\n if (parent.rtt) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n get texture() {\n return this.props.texture;\n }\n setRTTUpdates(type) {\n this.hasRTTupdates = true;\n this.parent?.setRTTUpdates(type);\n }\n}\n//# sourceMappingURL=CoreNode.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n rtt: props.rtt,\n parentHasRenderTexture: props.parentHasRenderTexture,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this.rtt = props.rtt;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n get rtt() {\n return this.coreNode.rtt;\n }\n set rtt(value) {\n if (value) {\n this.texture = this.rendererMain.createTexture('RenderTexture', {\n width: this.width,\n height: this.height,\n }, { preload: true, flipY: true });\n }\n this.coreNode.rtt = value;\n }\n get parentHasRenderTexture() {\n return this.coreNode.parentHasRenderTexture;\n }\n set parentHasRenderTexture(value) {\n this.coreNode.parentHasRenderTexture = value;\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nimport { RenderTexture } from './textures/RenderTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n this.registerTextureType('RenderTexture', RenderTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // Reset render operations and clear the canvas\n renderer?.reset();\n // If we have RTT nodes draw them first\n // So we can use them as textures in the main scene\n if (renderer.rttNodes.length > 0) {\n renderer.renderRTTNodes();\n }\n // Fill quads buffer\n this.addQuads(this.root);\n // Perform render pass\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n // Prevent quad rendering if parent has a render texture\n // and this node is not the render texture\n if (this.parentHasRenderTexture) {\n if (!renderer.renderToTextureActive) {\n return;\n }\n // Prevent quad rendering if parent render texture is not the active render texture\n if (this.parentRenderTexture !== renderer.activeRttNode) {\n return;\n }\n }\n if (this.parentHasRenderTexture && this.props.parent?.rtt) {\n this.globalTransform = Matrix3d.identity();\n this.globalTransform.multiply(this.localTransform ?? Matrix3d.identity());\n }\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha, this.parentHasRenderTexture, this.framebufferDimensions);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n rtt: false,\n parentHasRenderTexture: false,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'autosize',\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n flexOrder?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n autofocus?: boolean;\n flexItem?: boolean;\n flexOrder?: number;\n flexBoundary?: 'contain' | 'fixed'; // default is undefined - contained for flex calculated size\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this._renderProps = {};\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.lng) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.lng) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (let i=0; i < this.children.length; i++) {\n const child = this.children[i];\n if (child instanceof ElementNode) {\n if (child.id === id) {\n return child;\n }\n\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.lng) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n let changedLayout = false;\n if (isFunc(this.onBeforeLayout)) {\n changedLayout = this.onBeforeLayout.call(\n this,\n child,\n dimensions,\n ) as boolean;\n }\n\n if (this.display === 'flex') {\n if (calculateFlex(this) || changedLayout) {\n this.parent?.updateLayout();\n }\n } else if (changedLayout) {\n this.parent?.updateLayout();\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, stylesToUndo, newStyles);\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.lng) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.lng) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n const props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n props.x = props.x || 0;\n props.y = props.y || 0;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n if (config.fontSettings) {\n for (const key in config.fontSettings) {\n if (props[key] === undefined) {\n props[key] = config.fontSettings[key];\n }\n }\n }\n props.text = node.getText();\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - props.x - (props.marginRight || 0);\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - props.y - (props.marginBottom || 0);\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (!props.width || !props.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - props.x;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - props.y;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n }\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n // clean up after first render;\n delete this._renderProps;\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v: number) {\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return this.lng ? this.lng[key] : this._renderProps[key];\n },\n set(v) {\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n let hasOrder = false;\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n if (c.flexOrder !== undefined) {\n hasOrder = true;\n }\n\n children.push(c);\n }\n\n if (hasOrder) {\n children.sort((a, b) => (a.flexOrder || 0) - (b.flexOrder || 0));\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node.flexBoundary !== 'fixed') {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.lng && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n // let flex know we need to re-layout\n return true;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;\nimport { ElementNode, createComponent, View, mergeProps, Text as Text$7, createElement, use, spread, memo, insert, Show, For, hexColor } from \"@lightningjs/solid\";\nimport { createMemo, For as For$1, createSignal } from \"solid-js\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nfunction objectFromEntries(entries) {\n if (!entries || !entries[Symbol.iterator]) {\n throw new Error(\"objectFromEntries requires a single iterable argument\");\n }\n const obj = {};\n for (const [key2, value] of entries) {\n obj[key2] = value;\n }\n return obj;\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return objectFromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = objectFromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => objectFromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = objectFromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected = 0, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const dimension = componentRef.flexDirection === \"row\" ? \"width\" : \"height\";\n const axis = componentRef.flexDirection === \"row\" ? \"x\" : \"y\";\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, containerSize] = updateLastIndex(componentRef);\n let rootPosition = componentRef[axis] ?? 0;\n const selectedPosition = (selectedElement == null ? void 0 : selectedElement[axis]) ?? 0;\n const selectedSize = (selectedElement == null ? void 0 : selectedElement[dimension]) ?? 0;\n const direct = lastSelected === void 0 ? \"none\" : selected > lastSelected ? \"positive\" : \"negative\";\n let next = rootPosition;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = rootPosition - selectedSize - gap;\n } else {\n next = rootPosition + selectedSize + gap;\n }\n }\n } else if (Math.abs(rootPosition) + containerSize < lastItem.position + lastItem.size || selectedPosition < Math.abs(rootPosition)) {\n next = -selectedPosition + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(rootPosition) > selectedPosition) {\n next = -selectedPosition + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n next = rootPosition - selectedSize - gap;\n } else if (scroll === \"edge\" && direct === \"none\") {\n let currentChildIndex = 0;\n let currentChild, currentChildSize;\n while (currentChildIndex < componentRef.children.length && Math.abs(rootPosition) + containerSize < selectedPosition + selectedSize) {\n currentChild = componentRef.children[currentChildIndex++];\n currentChildSize = currentChild[dimension] ?? 0;\n rootPosition -= currentChildSize + gap;\n }\n next = rootPosition;\n }\n if (axis === \"x\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (axis === \"y\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, containerSize;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n containerSize = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n containerSize = items.height;\n }\n return [lastItem, containerSize];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n if (onlyFunctions.length === 1) {\n return onlyFunctions[0];\n }\n return function(...innerArgs) {\n let result;\n for (const func of onlyFunctions) {\n result = func.apply(this, innerArgs);\n if (result === true) {\n return result;\n }\n }\n return result;\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n return true;\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2, _c2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if ((_c2 = this.children[this.selected]) == null ? void 0 : _c2.states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nfunction getWidthByUpCount$1(theme2, upCount = 1) {\n const screenW = theme2.layout.screenW;\n const columnCount = theme2.layout.columnCount;\n const marginX = theme2.layout.marginX;\n const gutterX = theme2.layout.gutterX;\n if (upCount < 1 || upCount > columnCount) {\n console.error(`Column expects a number between 1 & ${columnCount}. Received ${upCount}`);\n return;\n }\n const columnWidth = screenW - marginX * 2;\n const columnGapTotal = (upCount - 1) * gutterX;\n const totalColumnsWidth = columnWidth - columnGapTotal;\n return totalColumnsWidth / upCount;\n}\nfunction getItemRatioDimensions(ratioX, ratioY, upCount) {\n let w, h;\n if (ratioX && ratioY && upCount) {\n w = Math.round(getWidthByUpCount$1(theme, upCount) ?? 0);\n h = Math.round(w / ratioX * ratioY);\n } else {\n w = 0;\n h = 0;\n }\n return { w, h };\n}\nfunction getDimensions(obj = {}, fallback = {}) {\n const { w, h, ratioX, ratioY, upCount } = obj;\n const fallbackW = fallback.w || 0;\n const fallbackH = fallback.h || 0;\n let dimensions = {};\n if (w && h) {\n dimensions = {\n w,\n h\n };\n } else if (h && ratioX && ratioY) {\n dimensions = {\n w: Math.round(h * ratioX / ratioY),\n h\n };\n } else if (ratioX && ratioY && upCount) {\n dimensions = getItemRatioDimensions(ratioX, ratioY, upCount);\n } else if (h && upCount) {\n dimensions = {\n w: Math.round(getWidthByUpCount(theme, upCount)),\n h\n };\n } else if (h) {\n dimensions = {\n w: fallbackW,\n h\n };\n } else if (w) {\n dimensions = {\n w,\n h: fallbackH\n };\n } else {\n dimensions = {\n w: fallbackW,\n h: fallbackH\n };\n }\n dimensions = {\n ...dimensions,\n ratioX,\n ratioY,\n upCount\n };\n return dimensions;\n}\nconst { Artwork: { defaultTone: defaultTone$f, ...themeStyles$e } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$f = {\n themeKeys: {\n fillColor: \"fillColor\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$e\n};\nconst Container$e = makeComponentStyles(container$f);\nconst styles$e = {\n tone: defaultTone$f || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Badge: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$e = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$d\n};\nconst text$7 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$d\n};\nconst Container$d = makeComponentStyles(container$e);\nconst Icon$3 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$7);\nconst styles$d = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$d,\n Icon: Icon$3,\n Text: Text$6\n};\nconst BadgeContainer = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$d.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$d.tone]) == null ? void 0 : _b2.padding) ?? styles$d.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$d.Container.tones[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n \"forwardStates\": true\n }), false);\n return _el$;\n })();\n};\nconst Badge = (props) => {\n return createComponent(BadgeContainer, {\n get padding() {\n return props.padding;\n },\n get tone() {\n return props.tone;\n },\n get style() {\n return props.style;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n return [styles$d.Text.tones[props.tone ?? styles$d.tone], styles$d.Text.base];\n },\n get tone() {\n return props.tone || styles$d.tone;\n },\n get children() {\n return props.title;\n }\n });\n }\n });\n};\nconst { Button: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst { Surface: { surfaceDefaultTone, ...surfaceThemeStyles$1 } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$d = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: {\n ...surfaceThemeStyles$1,\n ...themeStyles$c\n }\n};\nconst Container$c = makeComponentStyles(container$d);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$d || surfaceDefaultTone || \"neutral\",\n Container: Container$c,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$c.Text.tones[props.tone ?? styles$c.tone],\n styles$c.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$c.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n styles$c.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$c = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$b\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$b = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$1);\nconst styles$b = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$b,\n Icon: Icon$2\n};\nconst { Icon: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$b = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$a = makeComponentStyles(container$b);\nconst styles$a = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$a\n};\nconst Icon$1 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$a.Container.tones) == null ? void 0 : _a2[props.tone || styles$a.tone],\n styles$a.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$b.Container.tones[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$1, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$b.Icon.tones[props.tone || styles$b.tone],\n styles$b.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$a = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$9 = makeComponentStyles(container$a);\nconst styles$9 = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.y).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$9 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$8\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$8 = makeComponentStyles(container$9);\nconst Text$4 = makeComponentStyles(text$5);\nconst styles$8 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$7, defaultTone: defaultTone$8 } = { styles: {}, defaultTone: \"neutral\" } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$8 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$7\n};\nconst Container$7 = makeComponentStyles(container$8);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$4);\nconst styles$7 = {\n tone: defaultTone$8,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$1, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$7, ...themeStyles$6 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$7 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$6\n};\nconst Container$6 = makeComponentStyles(container$7);\nconst Text$2 = makeComponentStyles(text$3);\nconst styles$6 = {\n tone: defaultTone$7 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$6 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$5\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$5 = makeComponentStyles(container$6);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$5 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$4\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$4 = makeComponentStyles(container$5);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$4 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n flexBoundary: \"fixed\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$3 = makeComponentStyles(container$4);\nconst styles$3 = {\n tone: defaultTone$4,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onCreate() {\n return chainFunctions((elm) => withScrolling(props.x).call(elm, elm, elm.children[props.selected ?? 0], props.selected ?? 0, void 0), props.onCreate);\n },\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$3 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$2\n};\nconst Container$2 = makeComponentStyles(container$3);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$2);\nconst styles$2 = {\n tone: defaultTone$3,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.md],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles: themeStyles$1\n};\nconst Container$1 = makeComponentStyles(container$2);\nconst Text = makeComponentStyles(text$1);\nconst styles$1 = {\n tone: defaultTone$2 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n scroll: \"none\",\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get width() {\n return props.width;\n },\n get children() {\n return createComponent(For$1, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get width() {\n return props.width;\n },\n get justifyContent() {\n return props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For$1, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n onEnter: () => props.keySignal[1](typeof key2 === \"string\" ? key2 : key2.title ?? \"\"),\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Input: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container$1 = {\n themeKeys: {\n justifyContent: \"justifyContent\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n width: 100,\n height: 100,\n actualTitle: \"\"\n },\n themeStyles\n};\nconst input = {\n themeKeys: {\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\"\n },\n base: {\n width: getWidthByUpCount$1(theme, 4),\n height: 100,\n display: \"flex\",\n flexDirection: \"column\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n contentColor: theme.color.fillInverse,\n borderRadius: theme.radius.sm,\n marginX: theme.spacer.xxxl\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n themeStyles\n};\nmakeComponentStyles(container$1);\nmakeComponentStyles(input);\nmakeComponentStyles(text);\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_q = theme) == null ? void 0 : _q.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_r = theme) == null ? void 0 : _r.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get states() {\n return props.states;\n },\n get style() {\n return props.style;\n },\n get tone() {\n return props.tone ?? styles.tone;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst fpsStyle = {\n color: 255,\n height: 150,\n width: 330,\n x: 1910,\n y: 10,\n mountX: 1,\n alpha: 0.8,\n zIndex: 100\n};\nconst fpsLabel = {\n x: 10,\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst fpsValue = {\n fontSize: 22,\n textColor: hexColor(\"#f6f6f6\")\n};\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\nconst [isLoadedCount, setIsLoadedCount] = createSignal(0);\nconst [isLoadingCount, setIsLoadingCount] = createSignal(0);\nconst [isFailedCount, setIsFailedCount] = createSignal(0);\nlet count = 0;\nlet totalFps = 0;\nconst resetCounter = () => {\n totalFps = 0;\n count = 0;\n setMinFps(99);\n};\nconst calcFps = (fps2) => {\n if (!fps2)\n return;\n setFps(fps2);\n setMinFps((prev) => Math.min(fps2, prev));\n setMaxFps((prev) => Math.max(fps2, prev));\n totalFps += fps2;\n count++;\n setAvgFps(Math.round(totalFps / count));\n};\nconst calcPerformanceMetrics = (stage) => {\n let isLoadedCount2 = 0;\n let isLoadingCount2 = 0;\n let isFailedCount2 = 0;\n stage.txManager.textureIdCache.forEach((value, key2, map) => {\n if (value.state === \"loaded\") {\n isLoadedCount2++;\n }\n if (value.state === \"loading\") {\n isLoadingCount2++;\n }\n if (value.state === \"failed\") {\n isFailedCount2++;\n }\n });\n setIsLoadedCount(isLoadedCount2);\n setIsLoadingCount(isLoadingCount2);\n setIsFailedCount(isFailedCount2);\n};\nfunction setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps2 = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps2 > 5) {\n calcFps(fps2);\n calcPerformanceMetrics(target.root.stage);\n }\n });\n}\nconst FPSCounter = (props) => {\n return createComponent(View, mergeProps(props, {\n style: fpsStyle,\n get children() {\n return [createComponent(View, {\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"FPS:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return fps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"AVG:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return avgFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MIN:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 90,\n get children() {\n return minFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 160,\n y: 20,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"MAX:\"\n }), createComponent(Text$7, {\n style: fpsValue,\n x: 100,\n get children() {\n return maxFps();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 50,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loaded Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadedCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 80,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Loading Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isLoadingCount();\n }\n })];\n }\n }), createComponent(View, {\n x: 0,\n y: 110,\n get children() {\n return [createComponent(Text$7, {\n style: fpsLabel,\n children: \"Failed Textures Cnt:\"\n }), createComponent(Text$7, {\n style: fpsLabel,\n x: 270,\n get children() {\n return isFailedCount();\n }\n })];\n }\n })];\n }\n }));\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n FPSCounter,\n Icon$1 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$d as badgeStyles,\n styles$c as buttonStyles,\n chainFunctions,\n styles$b as checkboxStyles,\n styles$9 as columnStyles,\n getDimensions,\n getItemRatioDimensions,\n getWidthByUpCount$1 as getWidthByUpCount,\n handleNavigation,\n styles$a as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n resetCounter,\n styles$3 as rowStyles,\n scrollToIndex,\n setupFPS,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7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ZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8lMAx5P8s9N+Y8wk2cTjfQDu66z080h+zml7yKwpgCSdCOByZyX+BuBRJH/otN84M0kWN/s0gOc4Kv8Nko922B1m0gxAkh4I4AcVwcL9JA/UVnjT7CXdHYD9yEzfVUkAjib5uxqNmgCoBAu/CeBhzsJ/kORZTtuNN5Nk70bXAZ0Hy59G8qIawVoB6LMAnu8suE3tH0/y3077NAMg6esAuoaoC0la7M2dJgdI0ssAXOgs8W8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iJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n Text,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n changeBackgrounds(img);\n },\n { defer: true }\n )\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useMatch, useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n function handleNavigate(page: string) {\n const isOnPage = useMatch(() => page);\n if (isOnPage()) {\n return props.focusPage();\n }\n\n navigate(page);\n }\n\n return (\n <>\n \n \n Built With:\n \n \n \n \n handleNavigate(\"/browse/all\")}\n icon=\"trending\"\n >\n Trending\n \n handleNavigate(\"/browse/movie\")}>\n Movies\n \n handleNavigate(\"/browse/tv\")}>\n TV\n \n handleNavigate(\"/examples\")}\n >\n Examples\n \n \n \n \n );\n}\n","import { useLocation, useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FPSCounter, setupFPS } from \"@lightningjs/solid-ui\";\nimport { createEffect, createSignal } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: (string | number)[];\n Menu: (string | number)[];\n Escape: (string | number)[];\n Backspace: (string | number)[];\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: [\"a\"],\n Menu: [\"m\"],\n Escape: [\"Escape\", 27],\n Backspace: [\"Backspace\", 8],\n Left: [\"ArrowLeft\", 37],\n Right: [\"ArrowRight\", 39],\n Up: [\"ArrowUp\", 38],\n Down: [\"ArrowDown\", 40],\n Enter: [\"Enter\", 13],\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let navDrawer, lastFocused;\n\n setupFPS({ renderer });\n\n function focusNavDrawer() {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n return navDrawer.setFocus();\n }\n\n const [showWidgets, setShowWidgets] = createSignal(true);\n const location = useLocation();\n const showOnPaths = [\"/browse\", \"/entity\"];\n createEffect(() => {\n const currentPath = location.pathname;\n let matchesPartial = showOnPaths.some((path) =>\n currentPath.startsWith(path)\n );\n if (currentPath === \"/\") {\n matchesPartial = true;\n }\n setShowWidgets(matchesPartial);\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onBackspace={focusNavDrawer}\n onLeft={focusNavDrawer}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n lastFocused.setFocus()}\n showWidgets={showWidgets()}\n />\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginBottom: -40,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 64,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: \"normal\",\n contain: \"both\",\n width: 780,\n height: 340,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import { View, Text } from \"@lightningjs/solid\";\nimport { For, Show } from \"solid-js\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\n// withPadding;\n\nconst blockWidth = 900;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n fontFamily: \"Ubuntu\",\n fontWeight: 700,\n maxLines: 1,\n width: blockWidth,\n contain: \"width\",\n};\nconst Headline = (props) => ;\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n lineHeight: 32,\n width: blockWidth,\n maxLines: 3,\n contain: \"width\",\n};\n\nconst BadgeStyle = {\n fontSize: 16,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = {\n ...theme.typography.body2,\n fontFamily: \"Ubuntu\",\n fontWeight: 400,\n};\n\nconst Metadata = (props) => (\n \n \n \n \n \n {props.voteCount} reviews\n {props.metaText}\n {(item) => {item}}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 220,\n gap: 16,\n };\n\n return (\n \n {props.title}\n {props.description}\n \n \n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"min\"\n );\n}\n\nfunction formatDate(dateString) {\n const parts = dateString.split(\"-\");\n return parts[1] + \"/\" + parts[2] + \"/\" + parts[0];\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"w1280\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\", \"CC\"],\n voteAverage: data.vote_average,\n voteCount: data.vote_count,\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" \" + formatDate(data.release_date)\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n const delayedBackgrounds = debounce(\n (img: string) => setGlobalBackground(img),\n 400\n );\n const delayedHero = debounce((content: {}) => setHeroContent(content), 200);\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n delayedBackgrounds(elm.backdrop);\n }\n\n if (elm.heroContent) {\n delayedHero(elm.heroContent);\n }\n },\n { defer: true }\n )\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n return true;\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n // This doesnt work yet - need to make states reactive\n return elm.states.has(\"focus\");\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column, Button, Row } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true }\n )\n );\n\n const columnY = 640;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: -160,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n entityActions.setFocus();\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, entityActions;\n\n return (\n \n entityActions.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n \n \n \n\n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createResource, onMount } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 800,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n return (\n \n \n \n \n {data().name}\n \n \n {data().biography}\n \n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#f6f6f6\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 200 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["getUnicodeCodepoints","TextureUsageTracker","constructor","releaseCallback","_defineProperty","this","ManualCountTextureUsageTracker","options","_options$textureClean","_options$textureClean2","super","Map","Set","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step4","now","Date","thresholdMs","_iterator4","_createForOfIteratorHelper","zeroReferenceTextureSet","s","n","done","textureRefInfo","value","lastUpdate","id","textureMap","delete","err","e","f","registerTexture","texture","_texture$options","textureId","assertTruthy","has","nodeRefCount","set","add","incrementTextureRefCount","_texture$options2","get","txType","props","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","v","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","Error","Math","ceil","appHeight","deviceLogicalPixelRatio","appWidth","root","document","createElement","setRootPosition","body","appendChild","MutationObserver","bind","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","node","properties","div","key","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Proxy","target","property","Reflect","receiver","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","getEffectKey","getMethodParameters","uniforms","res","u","uni","define","size","push","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","name","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","state","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","_objectSpread","getPropertySetters","Object","freeze","fromEntries","entries","map","setter","requestRender","setStatus","status","error","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","forEach","eventName","off","scheduleUpdateState","updateScheduled","queueMicrotask","updateState","WebTrFontFace","TrFontFace","descriptors","fontUrl","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","weight","stretch","unicodeRange","variant","featureSettings","display","fontFace","FontFace","load","then","loaded","catch","calcHeight","numLines","max","LightningTextTextureRenderer","context","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","ffs","i","length","_load","fonts","fontSetting","check","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","l","split","lines","usedLines","slice","otherLines","measureText","al","j","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","min","draw","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","concat","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalThis","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","fontInfo","undefined","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","pop","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step5","_iterator5","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","getImageData","preload","renderQuads","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","_state$fontInfo","_state$fontInfo2","DefaultShader","WebGlCoreShader","bindTextures","textures","glw","activeTexture","bindTexture","ctxTexture","vertex","fragment","DefaultShaderBatched","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","Array","from","keys","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","results","eff","index","_eff$props","fxClass","uniInfo","p","fxProp","propInfo","validator","isArray","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","values","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","$alpha","makeCacheKey","_props$effects","RoundedRectangle","radius","IDENTITY_MATRIX_3x3","SdfShader","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","args","_props$radius","fillMask","boxDist","BorderEffect","_props$width","_props$color2","rgba","LinearGradientEffect","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","val","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_props$amount","BorderRightEffect","_props$width2","_props$color3","rectDist","BorderTopEffect","_props$width3","_props$color4","BorderBottomEffect","_props$width4","_props$color5","BorderLeftEffect","_props$width5","_props$color6","GlitchEffect","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","time","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","getRegisteredShaders","loadShader","ShaderClass","loadDynamicShader","cacheKey","shCache","useShader","attachedShader","detach","attach","ContextSpy","reset","data","getData","loadCompressedTexture","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","prev","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","apply","arguments","_ref3","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref4","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","Texture","hasAlphaChannel","mimeType","getTextureData","_this","_callee4","_this$props","blob","img","_callee4$","_context4","ImageData","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","substr","crossOrigin","Promise","resolve","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","start","codePoint","getUnicodeCodepoints$","_context5","codePointAt","_marked","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step6","_iterator6","glyph","mapped","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","resolveFontToUse","familyMapsByPriority","family","weightIn","_step7","_iterator7","fontFaces","_step8","weightMap","_iterator8","fontFamilyWeight","msg","TrFontManager","textRenderers","trId","tr","resolveFontFace","tmpRect","SdfTextRenderer","ssdfFontFamilies","msdfFontFamilies","sdfShader","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","parentHasRenderTexture","framebufferDimensions","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee12","coreExtensionModule","module$1","ExtensionClass","coreExtension","_callee12$","_context13","log","__vitePreload","module","default","classExtendsCoreExtension","prototype","CoreExtension","run","santizeCustomDataMap","d","validTypes","boolean","string","number","valueType","RendererMain","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","init","_this2","_callee5","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref5","_ref6","_props$colorTl","_ref7","_ref8","_props$colorTr","_ref9","_ref10","_props$colorBl","_ref11","_ref12","_props$colorBr","_props$data","_ref13","_props$parent$rtt","_props$parent","_props$parent2","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$autosize","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent3","_props$texture","_props$shader","_props$src2","_props$scale2","_ref14","_props$scaleX","_ref15","_props$scaleY","_props$mount","_ref16","_props$mountX","_ref17","_props$mountY","_props$pivot2","_ref18","_props$pivotX","_ref19","_props$pivotY","_props$rotation2","_props$rtt","colorTop","colorLeft","colorRight","colorBottom","rtt","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","desc","descType","shaderType","getNodeById","toggleFreeze","advanceFrame","rerender","CoreAnimation","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","restore","reverse","startValue","endValue","stopMethod","applyEasing","dt","_this$settings","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","pause","waitUntilStarted","promise","startedPromise","waitUntilStopped","stoppedPromise","startedResolve","_this$animation$setti","Matrix3d","temp","tempMatrix","multiply","a","b","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","identity","sx","sy","cos","sin","copy","dst","transpose","other","transformPoint","CoreNodeRenderState","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","All","autosizeNode","setRTTUpdates","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","on","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","children","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","_this$props$parent","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","child","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent4","_props$parent5","z","destroy","removeAllListeners","_this$props2","renderToTextureActive","parentRenderTexture","activeRttNode","absX","_this$props$parent2","_this$props$parent3","absY","_this$props$parent$ab","_this$props$parent4","newParent","oldParent","splice","_this$stage$renderer","hasRTTupdates","renderToTexture","_this$parent","_this$parent2","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","flipY","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","_slicedToArray","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","getNextWorker","workerIndex","convertUrlToAbsolute","location","href","absoluteSrcUrl","postMessage","NoiseTexture","_this3","_callee6","_this3$props","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","RenderTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","removeTextureIdFromCache","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","getDebugInfo","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","runLoop","rootNode","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","requestAnimationFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","rttNodes","renderRTTNodes","addQuads","render","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i8","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","_this$props$parent5","_this$localTransform","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","SuspenseContext","equalFn","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","updateFn","untrack","cleanNode","runUpdates","createSignal","observers","observerSlots","comparator","assign","readSignal","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","user","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","_ref21","storage","initialValue","setValue","_createSignal2","setError","_createSignal3","_createSignal4","track","trigger","_createSignal6","setState","loadEnd","onHydrated","_step9","_iterator9","decrement","clear","completeLoad","read","refetching","lookup","castError","defineProperties","loading","latest","refetch","mutate","createSelector","subs","_step10","_iterator10","_step10$value","_iterator11","_step11","pure","onCleanup","deps","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prevListener","handleError","startTransition","createContext","defaultValue","Provider","createProvider","useContext","memo","resolveChildren","toArray","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","nextValue","updatedAt","runComputation","runTop","suspense","inFallback","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","cause","FALLBACK","dispose","createComponent","Comp","trueFn","propTraps","_","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","disposers","len","indexes","newItems","newIndices","newIndicesNext","tempdisposers","tempIndexes","end","newEnd","item","newLen","disposer","mapper","_createSignal8","mapArray","each","Show","keyed","condition","when","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","_createSignal10","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","_renderProps","_effects","lng","_p$lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationRunning","_animationQueue","_animationQueueSettings","_this5","_callee8","_callee8$","_context9","setFocus","forwardFocus","focusedIndex","autofocus","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","found","states","_states","_stateChanged","_animationSettings","_this$parent3","changedLayout","onBeforeLayout","hasOrder","flexItem","flexOrder","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","flexBoundary","calculatedSize","toPad","calculateFlex","_this$parent4","onLayout","forwardStates","_undoStyles","_iterator14","_step14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_autosized","marginBottom","isNaN","onFail","onLoad","onCreate","handler","_node$lng","inode","solid","_loop2","_i17","_LightningRendererNum","_loop3","_i18","_LightningRendererNon","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","Text","_el$","_$createElement","View","createRenderer$1","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","spread","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref22","_callee9","_context10","rendererOptions","_x7","_x8","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step15","defaultPrevented","preventDefault","_iterator15","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useLocation","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step17","_iterator17","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step18","_iterator18","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref23","_callee10","_context11","finish","_x9","_createSignal14","reference","setReference","_createSignal16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","routerState","router","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","intercept","createRouter","keepDepth","hashIndex","notify","bindEvent","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i20","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step19","finalFocusElm","_iterator19","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","marginLeft","maxHeight","marginTop","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee11","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee11$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","debounced","voiceOutDisabled","debounceWithFlush","scopedValue","newValue","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","notification","_currentlySpeaking","textToSpeech","finally","refresh","setupTimers","focusDebounce","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_q","_r","_createSignal22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","r$","objectFromEntries","_step20","_iterator20","_step20$value","key2","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles","themeStyles2","modeKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","generateSolidStylesFromLookupObject","base2","modes2","tones2","themeStyles3","themeComponentStyles","variantName","styles2","convertedStyles","styleName","modeName","modeStyles","baseStyles","makeBaseStyles","makeModeStyles","mode","toneStyles","makeToneStyles","tone","_ref25","_ref26","_a2","_b2","_ref27","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_componentRef$axis","_ref28","_ref29","axis","_updateLastIndex","lastItem","updateLastIndex","_updateLastIndex2","rootPosition","selectedPosition","selectedSize","direct","scrollIndex","abs","currentChildIndex","_currentChild$dimensi","chainFunctions","onlyFunctions","func","innerArgs","_step21","_iterator21","onGridFocus","skipFocus","handleNavigation","_c2","onSelectedChanged","plinko","num","_ref30$Artwork","Artwork","_ref30$Artwork2","themeStyles$e","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$d","_excluded2","container$e","inverse","brand","text$7","icon$2","_ref32$Button","Button","_ref32$Button2","defaultTone$d","themeStyles$c","_excluded3","_ref33$Surface","Surface","_ref33$Surface2","surfaceDefaultTone","surfaceThemeStyles$1","_excluded4","container$d","contentColor","focus","content","text$6","styles$c","Container","Content","_props$tone","flat","Text$7","_props$tone2","_ref34$Checkbox","Checkbox","_ref34$Checkbox2","themeStyles$b","_excluded5","strokeWidth","container$c","checked","neutral","icon$1","_ref35$Icon","Icon","_ref35$Icon2","themeStyles$a","_excluded6","_ref36$Column","Column","_ref36$Column2","defaultTone$a","themeStyles$9","_excluded7","styles$9","itemTransition","onUp","onDown","_props$selected","_props$selected2","_props$tone3","_ref37$Label","Label","_ref37$Label2","themeStyles$8","_excluded8","container$9","backgroundColor","text$5","_ref38$Rating","Rating","_ref38$Rating2","themeStyles$7","container$8","itemSpacing","toneModes","text$4","_ref39$Details","Details","_ref39$Details2","themeStyles$6","_excluded9","container$7","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$3","_ref40$Metadata","Metadata","_ref40$Metadata2","themeStyles$5","_excluded10","container$6","titleText","descriptionText","_ref41$ProgressBar","ProgressBar","_ref41$ProgressBar2","themeStyles$4","_excluded11","container$5","_ref42$Row","Row","_ref42$Row2","defaultTone$4","themeStyles$3","_excluded12","styles$3","onLeft","onRight","_props$selected3","_props$selected4","_props$tone4","_props$tone5","_ref43$Keyboard","_ref43$Keyboard2","themeStyles$2","_excluded13","container$3","keySpacing","baseWidth","sizes","paddingX","text$2","_ref44$Key","Key","_ref44$Key2","themeStyles$1","_excluded14","container$2","text$1","_ref45$Input","Input","_ref45$Input2","_excluded15","container$1","actualTitle","theme2","upCount","getWidthByUpCount$1","_ref46$Tile","Tile","_ref46$Tile2","tileThemeStyles","_excluded16","_ref47$Surface","_ref47$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded17","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","_createSignal32","isLoadedCount","setIsLoadedCount","_createSignal34","isLoadingCount","setIsLoadingCount","_createSignal36","isFailedCount","setIsFailedCount","totalFps","setupFPS","isLoadedCount2","isLoadingCount2","isFailedCount2","fps2","calcFps","FPSCounter","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","handleNavigate","page","isOnPage","matchers","_step16","_iterator16","focusPage","showWidgets","onEnter","App","Menu","Left","Right","Up","Down","announcer","navDrawer","lastFocused","focusNavDrawer","_createSignal38","setShowWidgets","showOnPaths","currentPath","matchesPartial","_ref$","APP","onAnnouncer","onLast","back","onMenu","onBackspace","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step12","otherObject","objects","_iterator12","_step13","isDefaultDesc","writable","objectIndex","_iterator13","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","posterSize","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal40","pages","setPages","_createSignal42","setPage","_createSignal44","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","voteAverage","voteCount","metaText","badges","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","rtCrit","rtFan","backgroundImage","vote_average","vote_count","minutes","runtime","remainingMinutes","minutesToHMM","release_date","parts","first_air_date","last_air_date","reviews","Browse","_createSignal46","columnY","setcolumnY","_createSignal48","entityProvider","_createSignal50","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","delayedBackgrounds","delayedHero","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal52","setColor","_createSignal54","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal56","insertTest","setInsertTest","_createSignal58","emptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal60","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal62","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal64","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal66","_this$children$select4","_createSignal68","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal70","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","entityActions","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"ihVAsBiBA,sQCDV,MAAMC,GAETC,WAAAA,CAAYC,GAAiBC,EAAAC,KAAA,uBAAA,GACzBA,KAAKF,gBAAkBA,C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