"""Wrapper: load main patch then inject extra fixes for tiktok-right position, kill duplicate slides, progress toast.""" from ai_runtime_patch_fast import * from ai_runtime_patch_fast import app, f5, f6, rt, PATCH_INJECT from patch_extra import EXTRA_FIX from fastapi.responses import HTMLResponse # Remove old root and re-register with EXTRA_FIX appended. app.router.routes=[r for r in app.router.routes if not (getattr(r,'path',None)=='/' and 'GET' in getattr(r,'methods',set()))] @app.get('/') async def _index_final(): html=f5.f4.f3.f2.f1._load_index_html() body=getattr(rt.old,'PATCH_INJECT','')+f5.f4.f3.f2.f1.FINAL_INJECT+f5.f4.f3.FINAL3_INJECT+f5.f4.FINAL4_INJECT+f5.FINAL5_INJECT body+=getattr(f6,'FINAL6_INJECT','');body+=getattr(f6,'FINAL6_FAST_HOME_INJECT','');body+=getattr(f6,'FINAL6E_INJECT','') body+=PATCH_INJECT body+=EXTRA_FIX return HTMLResponse(html.replace('',body+'\n') if '' in html else html+body)