clipoox-render 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/package.json +1 -1
  2. package/scripts/render-local.mjs +1512 -1292
  3. package/web/assets/{FxEmbed-DbfuM8Yo.js → FxEmbed-ROS6C_HI.js} +1 -1
  4. package/web/assets/{MotionEmbed-CBQ-8Tzh.js → MotionEmbed-E2hCysi-.js} +1 -1
  5. package/web/assets/{PluginStore-OOEx0lP5.js → PluginStore-CwUSpwPp.js} +1 -1
  6. package/web/assets/{ShotComposer-Cng515xa.js → ShotComposer-DLxWpdYH.js} +8 -8
  7. package/web/assets/{TemplateEmbed-hjwM2b0o.js → TemplateEmbed-qG1AXdtf.js} +1 -1
  8. package/web/assets/{TimelinePlugins-D-NakABP.js → TimelinePlugins-CB1b6-Cb.js} +3 -3
  9. package/web/assets/{TimelineShotFx-D3kGhHN3.js → TimelineShotFx-CyHTgJHj.js} +2 -2
  10. package/web/assets/{TransitionEmbed-DR26yI3a.js → TransitionEmbed-Dym9P7--.js} +1 -1
  11. package/web/assets/{Whiteboard-BhxY0D0Z.js → Whiteboard-BdGjJZXW.js} +1 -1
  12. package/web/assets/{aerial-BisYSXzG.js → aerial-yLD_gDzw.js} +2 -2
  13. package/web/assets/{agentTools-CPFQeiDP.js → agentTools-B7g6tXTR.js} +2 -2
  14. package/web/assets/{aiInbetween-AOOM1e6p.js → aiInbetween-6eKDYbYS.js} +2 -2
  15. package/web/assets/{analyzerRun-Dtp2o7gT.js → analyzerRun-Cr-_79RH.js} +1 -1
  16. package/web/assets/{analyzerSandbox-BG_3Cea1.js → analyzerSandbox-N92T6amg.js} +1 -1
  17. package/web/assets/{api-BFN7blbw.js → api-Dnl2uaKO.js} +3 -3
  18. package/web/assets/auraTrack-C8eAEIWQ.js +1 -0
  19. package/web/assets/{breakthrough-0qFpZW-V.js → breakthrough-DSiuVwEX.js} +2 -2
  20. package/web/assets/{cameraPresets-eK3mP7qb.js → cameraPresets-Cfn7qhXK.js} +1 -1
  21. package/web/assets/{cameraTracker-BAQHuTV-.js → cameraTracker-DHdF8Zqx.js} +5 -5
  22. package/web/assets/{captionLayout-CWPcbid-.js → captionLayout-cckQ7p-t.js} +1 -1
  23. package/web/assets/{clientExport-DvpTTndR.js → clientExport-pkLbOmEF.js} +1 -1
  24. package/web/assets/{clientJobs-CIrYTMpn.js → clientJobs-CcsLDqFM.js} +2 -2
  25. package/web/assets/{depthEstimate-B7D7cGCl.js → depthEstimate-Cav4MmQ1.js} +1 -1
  26. package/web/assets/{directorTools-CJD4Huqk.js → directorTools-DMsatulF.js} +1 -1
  27. package/web/assets/{distortFrames-BLt1icUb.js → distortFrames-D_v-aSVO.js} +2 -2
  28. package/web/assets/{distortGL-BA5molk-.js → distortGL-vhnBRB59.js} +1 -1
  29. package/web/assets/domino-DBrinEUu.js +1 -0
  30. package/web/assets/{editTools-NKLsWZD1.js → editTools-BNnAvCw-.js} +1 -1
  31. package/web/assets/{engine-DioUF2mX.js → engine-Co-ivzlQ.js} +1 -1
  32. package/web/assets/{exportGlb-BOdI9cVS.js → exportGlb-D3PrWUvi.js} +1 -1
  33. package/web/assets/{faceTracker-D7CbF-qX.js → faceTracker-ClR-lS6Y.js} +1 -1
  34. package/web/assets/fightDirector-BlpVAURl.js +1 -0
  35. package/web/assets/{fightDrama-DIPcRKnc.js → fightDrama-BK0QidpM.js} +2 -2
  36. package/web/assets/{focusTool-vfabPqQ5.js → focusTool-sVOb2GGS.js} +1 -1
  37. package/web/assets/{frameSink-DYs2gTzq.js → frameSink-CSRqCnwI.js} +3 -3
  38. package/web/assets/{glTransitionSources.generated-DM5sRMX2.js → glTransitionSources.generated-q0H-ZbnZ.js} +2 -2
  39. package/web/assets/{gpuCompose-DbnZuelB.js → gpuCompose-B5bgbHdQ.js} +1 -1
  40. package/web/assets/{gpuExport-CQ7ZhpsX.js → gpuExport-oA2mUsdm.js} +7 -7
  41. package/web/assets/{handMatte-DIbMuqCu.js → handMatte-Dj2taFoC.js} +1 -1
  42. package/web/assets/handTracker-c6_rvuwA.js +2 -0
  43. package/web/assets/i18n-C9zFX25m.js +3 -0
  44. package/web/assets/{index-BfrDwjDI.js → index-Ds_8isyf.js} +1 -1
  45. package/web/assets/layer-worker-ClVZG6ZW.js +5 -0
  46. package/web/assets/library-BK0QVG4O.js +1 -0
  47. package/web/assets/{lottieLayer-C2YbiXhK.js → lottieLayer-Cv8ub9f6.js} +1 -1
  48. package/web/assets/{main-B27kf5aL.css → main-B_MAOvi6.css} +1 -1
  49. package/web/assets/{main-BKatDoGw.js → main-CwrkBJ63.js} +104 -104
  50. package/web/assets/{mapBake-C-G7WpFM.js → mapBake-DtQboFIX.js} +1 -1
  51. package/web/assets/{maskTrack-LMrwm5ub.js → maskTrack-D4QZfMWc.js} +1 -1
  52. package/web/assets/{matteFixRun-B38CbeEt.js → matteFixRun-CytaeRzS.js} +1 -1
  53. package/web/assets/{objectLocate-CKi3OTnL.js → objectLocate-XuAcemlO.js} +1 -1
  54. package/web/assets/{objectSegmenter-CziPuM61.js → objectSegmenter-D66spD7o.js} +1 -1
  55. package/web/assets/{objectTrack.worker-b7DJ-ub6.js → objectTrack.worker-BZS6WZ6l.js} +547 -327
  56. package/web/assets/{pathTracer-bqau16sX.js → pathTracer-DykgPkkh.js} +2 -2
  57. package/web/assets/{pendingMatte-CQb7jPg1.js → pendingMatte-BWBIWajI.js} +2 -2
  58. package/web/assets/{personAi-CQntGDqK.js → personAi-EhBknW6X.js} +2 -2
  59. package/web/assets/{personHq-B1c0QVJT.js → personHq-Ca351o06.js} +2 -2
  60. package/web/assets/{plateCamera-D7iLiNBy.js → plateCamera-BcdXD1uI.js} +1 -1
  61. package/web/assets/{plateCameraMatch-BM88dx-a.js → plateCameraMatch-GPZl1fQQ.js} +2 -2
  62. package/web/assets/{plateFollow-4iGUDTu1.js → plateFollow-CJUilsNV.js} +2 -2
  63. package/web/assets/{plateMatte-zTyuHHqh.js → plateMatte-CoEoVjxZ.js} +2 -2
  64. package/web/assets/{pluginAutomation-DSg-sYLF.js → pluginAutomation-DAPHWZPN.js} +1 -1
  65. package/web/assets/{poseTracker-DZl8l2qS.js → poseTracker-CzEKvJph.js} +1 -1
  66. package/web/assets/{productTools-B-jh8ukh.js → productTools-ce-zyZO0.js} +2 -2
  67. package/web/assets/remote-8XzEAnAJ.js +974 -0
  68. package/web/assets/{rigTrack-XaMj1yaH.js → rigTrack-DMyqb0pb.js} +1 -1
  69. package/web/assets/{rotoMaskStore-DdpmT9C3.js → rotoMaskStore-pE1AIt3I.js} +1 -1
  70. package/web/assets/{rotoMatte-i-cJTYmK.js → rotoMatte-7b7Ow64f.js} +1 -1
  71. package/web/assets/{rotoscope-DqRSWmHR.js → rotoscope-BUqNTKLd.js} +1 -1
  72. package/web/assets/{sceneTrack-DIPzBmMK.js → sceneTrack-CA21MCOP.js} +1 -1
  73. package/web/assets/{sceneTrack-Bbov7zET.js → sceneTrack-DlAH5s74.js} +1 -1
  74. package/web/assets/{sceneTrack.worker-Bav9h0pv.js → sceneTrack.worker-COlhlHRe.js} +547 -327
  75. package/web/assets/{shot-worker-m-q77W9f.js → shot-worker-DL1ZoIym.js} +1 -1
  76. package/web/assets/{shotFxAgent-DIMS7BGA.js → shotFxAgent-DqngnGFb.js} +1 -1
  77. package/web/assets/{skin-DrUzJE1u.js → skin-xFScwS3T.js} +1 -1
  78. package/web/assets/{spark.module-Y1SEI8Xz.js → spark.module-DjaIF6J1.js} +1 -1
  79. package/web/assets/{spellDuel-DNnyQDVr.js → spellDuel-BYNtnE8f.js} +2 -2
  80. package/web/assets/{store-GFMJzaWS.js → store-CpqHUcA2.js} +1 -1
  81. package/web/assets/{surfaceLight-C--moyc9.js → surfaceLight-C7YI9SV8.js} +1 -1
  82. package/web/assets/{surfacePin-B4-1UqXD.js → surfacePin-CzpUj1Cw.js} +2 -2
  83. package/web/assets/{textAnimators-BVXTl8bU.js → textAnimators-B9vO_hbP.js} +1 -1
  84. package/web/assets/{thumb-CTfDJgLp.js → thumb-BTFsBS1u.js} +1 -1
  85. package/web/assets/{timeline3d-Dn7PqmEe.js → timeline3d-DrFaMPPB.js} +2 -2
  86. package/web/assets/{timeline3dExport-DCOr6ARB.js → timeline3dExport-Uo0S0CR0.js} +1 -1
  87. package/web/assets/{timelineComp-Dx_kED5V.js → timelineComp-i-zdaoB2.js} +1 -1
  88. package/web/assets/timelineOps-DSSaDsU2.js +525 -0
  89. package/web/assets/{timelineProps-eYgO6gs5.js → timelineProps-0v-s69pw.js} +1 -1
  90. package/web/assets/{timelineText-RKyRP988.js → timelineText-DurRhyuh.js} +1 -1
  91. package/web/assets/{titleArt-CUtA0C3I.js → titleArt-CnC0A7x7.js} +3 -3
  92. package/web/assets/{titleFrameBudget-X7HLSDre.js → titleFrameBudget-DsM0V482.js} +801 -581
  93. package/web/assets/{titleFrames-aMG7HdVe.js → titleFrames-C8kvflgT.js} +1 -1
  94. package/web/assets/{tool-DpFjybaq.js → tool-D1FpErrX.js} +1 -1
  95. package/web/assets/{tools-CeOU0p13.js → tools-DIvrRu-5.js} +1 -1
  96. package/web/assets/toonTools-D9MNdRty.js +2 -0
  97. package/web/assets/{trackAnchor-hAOtEhKO.js → trackAnchor-XvUuvkWP.js} +1 -1
  98. package/web/assets/{userFonts-1kuRjWOo.js → userFonts-Djka6RJX.js} +1 -1
  99. package/web/assets/{vfxAlpha-DxS5-QwY.js → vfxAlpha-B-JzzRI1.js} +1 -1
  100. package/web/assets/vfxBackground-b053ziDK.js +2 -0
  101. package/web/assets/{videoExport-Cg4B2Nyh.js → videoExport-NN-QijHd.js} +1 -1
  102. package/web/assets/{views-CUXyRb9x.js → views-RQBs4zva.js} +1 -1
  103. package/web/assets/{weaponDuel-nFECu9nk.js → weaponDuel-DKAEYJjO.js} +1 -1
  104. package/web/assets/{windowFrames-1wAkkWnv.js → windowFrames-DhhJLIs-.js} +1 -1
  105. package/web/layer-worker.html +3 -3
  106. package/web/shot-worker.html +23 -23
  107. package/web/assets/auraTrack-D_gxHNVe.js +0 -1
  108. package/web/assets/fightDirector-CYP8jxo8.js +0 -1
  109. package/web/assets/handTracker-DY_g5Xmg.js +0 -2
  110. package/web/assets/i18n-BJppIrtF.js +0 -3
  111. package/web/assets/layer-worker-DLSnp1D-.js +0 -5
  112. package/web/assets/library-B6KsZUKq.js +0 -1
  113. package/web/assets/remote-DJd9xWjn.js +0 -963
  114. package/web/assets/timelineOps-afzSo188.js +0 -525
  115. package/web/assets/toonTools-DLmo37Z_.js +0 -2
  116. package/web/assets/vfxBackground-CYpaQaTa.js +0 -2
@@ -1,14 +1,14 @@
1
- (function(){"use strict";const Ta=(t=7)=>()=>(t=t*1664525+1013904223>>>0)/4294967296;function $i(t){const e=t.w>>1,c=t.h>>1,a=new Float32Array(e*c),o=t.data,s=t.w;for(let i=0;i<c;i++)for(let l=0;l<e;l++){const p=2*i*s+2*l;a[i*e+l]=(o[p]+o[p+1]+o[p+s]+o[p+s+1])/4}return{w:e,h:c,data:a}}function fo(t,e=3){const c=[t];for(;c.length<e&&c.at(-1).w>=40;)c.push($i(c.at(-1)));return c}const fc=(t,e,c)=>{e=Math.max(0,Math.min(t.w-1.001,e)),c=Math.max(0,Math.min(t.h-1.001,c));const a=e|0,o=c|0,s=e-a,i=c-o,l=o*t.w+a,p=t.data;return(p[l]*(1-s)+p[l+1]*s)*(1-i)+(p[l+t.w]*(1-s)+p[l+t.w+1]*s)*i};function Uo(t,{cols:e=14,rows:c=9,border:a=10,minScore:o=2e-4,skip:s=null}={}){const{w:i,h:l,data:p}=t,x=[];for(let f=0;f<c;f++)for(let d=0;d<e;d++){let r=null;const g=Math.max(a,Math.floor(d*i/e)),u=Math.min(i-a,Math.floor((d+1)*i/e)),v=Math.max(a,Math.floor(f*l/c)),b=Math.min(l-a,Math.floor((f+1)*l/c));for(let S=v;S<b;S+=2)for(let T=g;T<u;T+=2){if(s&&s(T/i,S/l))continue;let D=0,P=0,K=0;for(let M=-2;M<=2;M++)for(let y=-2;y<=2;y++){const z=(S+M)*i+T+y,h=(p[z+1]-p[z-1])/2,w=(p[z+i]-p[z-i])/2;D+=h*h,P+=h*w,K+=w*w}const n=(D+K)/2-Math.sqrt(((D-K)/2)**2+P*P);n>o&&(!r||n>r[2])&&(r=[T,S,n])}r&&x.push([r[0],r[1]])}return x}function Ko(t,e,c,a=5,o=12){let s=0,i=0;for(let f=t.length-1;f>=0;f--){const d=t[f],r=e[f],g=2**f,u=c[0]/g,v=c[1]/g;let b=0,S=0,T=0;const D=[],P=[],K=[];for(let z=-a;z<=a;z++)for(let h=-a;h<=a;h++){const w=(fc(d,u+h+1,v+z)-fc(d,u+h-1,v+z))/2,k=(fc(d,u+h,v+z+1)-fc(d,u+h,v+z-1))/2;b+=w*w,S+=w*k,T+=k*k,D.push(w),P.push(k),K.push(fc(d,u+h,v+z))}const n=b*T-S*S;if(n<1e-9)return null;let M=0,y=0;for(let z=0;z<o;z++){let h=0,w=0,k=0;for(let Y=-a;Y<=a;Y++)for(let lt=-a;lt<=a;lt++,k++){const et=K[k]-fc(r,u+s+M+lt,v+i+y+Y);h+=et*D[k],w+=et*P[k]}const m=(T*h-S*w)/n,B=(b*w-S*h)/n;if(M+=m,y+=B,m*m+B*B<1e-4)break}s=(s+M)*(f?2:1),i=(i+y)*(f?2:1)}const l=[c[0]+s,c[1]+i],p=t[0].w,x=t[0].h;return l[0]<2||l[1]<2||l[0]>p-3||l[1]>x-3?null:l}function jo(t,e,c){return c.map(a=>{const o=Ko(t,e,a);if(!o)return null;const s=Ko(e,t,o);return s&&Math.hypot(s[0]-a[0],s[1]-a[1])<.8?o:null})}const Va=t=>{const e=Math.hypot(t[0],t[1],t[2])||1;return[t[0]/e,t[1]/e,t[2]/e]},vc=(t,e,c,a)=>Va([(t[0]-c)/e,-(t[1]-a)/e,-1]);function $a(t,e){const[c,a,o,s]=t,i=s*e[0]+a*e[2]-o*e[1],l=s*e[1]+o*e[0]-c*e[2],p=s*e[2]+c*e[1]-a*e[0],x=-c*e[0]-a*e[1]-o*e[2];return[i*s+x*-c+l*-o-p*-a,l*s+x*-a+p*-c-i*-o,p*s+x*-o+i*-a-l*-c]}const Xi=(t,e)=>[t[3]*e[0]+t[0]*e[3]+t[1]*e[2]-t[2]*e[1],t[3]*e[1]-t[0]*e[2]+t[1]*e[3]+t[2]*e[0],t[3]*e[2]+t[0]*e[1]-t[1]*e[0]+t[2]*e[3],t[3]*e[3]-t[0]*e[0]-t[1]*e[1]-t[2]*e[2]],Fi=t=>[-t[0],-t[1],-t[2],t[3]];function Yi(t){const e=t.map(o=>[...o]),c=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(let o=0;o<30;o++){let s=0;for(let i=0;i<4;i++)for(let l=i+1;l<4;l++)s+=e[i][l]**2;if(s<1e-20)break;for(let i=0;i<4;i++)for(let l=i+1;l<4;l++){if(Math.abs(e[i][l])<1e-12)continue;const p=(e[l][l]-e[i][i])/(2*e[i][l]),x=Math.sign(p||1)/(Math.abs(p)+Math.sqrt(p*p+1)),f=1/Math.sqrt(x*x+1),d=x*f;for(let r=0;r<4;r++){const g=e[r][i],u=e[r][l];e[r][i]=f*g-d*u,e[r][l]=d*g+f*u}for(let r=0;r<4;r++){const g=e[i][r],u=e[l][r];e[i][r]=f*g-d*u,e[l][r]=d*g+f*u}for(let r=0;r<4;r++){const g=c[r][i],u=c[r][l];c[r][i]=f*g-d*u,c[r][l]=d*g+f*u}}}let a=0;for(let o=1;o<4;o++)e[o][o]>e[a][a]&&(a=o);return[c[0][a],c[1][a],c[2][a],c[3][a]]}function po(t,e){const c=[[0,0,0],[0,0,0],[0,0,0]];for(let v=0;v<t.length;v++)for(let b=0;b<3;b++)for(let S=0;S<3;S++)c[b][S]+=t[v][b]*e[v][S];const[[a,o,s],[i,l,p],[x,f,d]]=c,r=Yi([[a+l+d,p-f,x-s,o-i],[p-f,a-l-d,o+i,x+s],[x-s,o+i,-a+l-d,p+f],[o-i,x+s,p+f,-a-l+d]]),g=[r[1],r[2],r[3],r[0]],u=Math.hypot(...g)||1;return g.map(v=>v/u*(g[3]<0?-1:1))}const Xa=(t,e)=>Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])));function Fa(t,e,{thr:c=.0035,iters:a=120,min:o=8,rand:s=Ta(11)}={}){if(t.length<o)return null;let i=[];for(let x=0;x<a;x++){const f=Math.floor(s()*t.length),d=Math.floor(s()*t.length);if(f===d||Xa(t[f],t[d])<.02)continue;const r=po([t[f],t[d]],[e[f],e[d]]),g=[];for(let u=0;u<t.length;u++)Xa($a(r,t[u]),e[u])<c&&g.push(u);g.length>i.length&&(i=g)}if(i.length<o)return null;let l=po(i.map(x=>t[x]),i.map(x=>e[x]));const p=[];for(let x=0;x<t.length;x++)Xa($a(l,t[x]),e[x])<c*1.5&&p.push(x);return p.length>=o&&(l=po(p.map(x=>t[x]),p.map(x=>e[x]))),{q:l,inliers:p}}function Vo(t,e,c,a,o,s,i){const l=[];for(let x=0;x<t.length;x++){const f=$a(c,t[x]);if(f[2]>-.001)continue;const d=o+a*f[0]/-f[2],r=s-a*f[1]/-f[2],g=Math.hypot(d-o,r-s),u=Math.hypot(e[x][0]-o,e[x][1]-s);g>i*.15&&l.push(u/g)}if(l.length<6)return 1;l.sort((x,f)=>x-f);const p=l[l.length>>1];return Math.abs(p-1)<.0015?1:Math.max(.8,Math.min(1.25,p))}function _i(t,e,{skip:c=null,rand:a=Ta(13)}={}){const o=t[0].w,s=t[0].h,i=o/2,l=s/2,p=[{q:[0,0,0,1],f:e,inliers:0,lost:!1}];let x={q:[0,0,0,1],f:e,bear:[],pts:[]};const f=(r,g,u,v)=>{const b=Uo(r,{skip:v});x={q:g,f:u,bear:b.map(S=>vc(S,u,i,l)),pts:b,start:b.length}};let d=fo(t[0]);f(t[0],p[0].q,e,c?.(0));for(let r=1;r<t.length;r++){const g=fo(t[r]),u=jo(d,g,x.pts),v=u.map((n,M)=>n?M:-1).filter(n=>n>=0),b=p[r-1];let S=b.q,T=b.f,D=0,P=!0;if(v.length>=8){const n=v.map(h=>x.bear[h]),M=v.map(h=>u[h]);let y=M.map(h=>vc(h,b.f,i,l)),z=Fa(n,y,{rand:a});if(z){for(let w=0;w<3;w++){const k=Vo(z.inliers.map(B=>n[B]),z.inliers.map(B=>M[B]),z.q,x.f,i,l,o),m=x.f*k;if(Math.abs(m-T)<T*5e-4)break;T=m,y=M.map(B=>vc(B,T,i,l)),z=Fa(n,y,{rand:a})??z}S=Xi(x.q,Fi(z.q)),D=z.inliers.length,P=!1;const h=new Set(z.inliers.map(w=>v[w]));x={...x,pts:x.pts.map((w,k)=>h.has(k)?u[k]:null),bear:x.bear}}}p.push({q:S.map(n=>Math.round(n*1e6)/1e6),f:Math.round(T*100)/100,inliers:D,lost:P});const K=x.pts.filter(Boolean).length;if(P||K<Math.max(16,x.start*.45))f(t[r],S,T,c?.(r));else{const n=x.pts.map((M,y)=>M?y:-1).filter(M=>M>=0);x={...x,pts:n.map(M=>x.pts[M]),bear:n.map(M=>x.bear[M])}}d=g}return p}const he=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],Yc=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],pt=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],$t=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],go=(t,e)=>[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]],be=(t,e)=>[pt(t[0],e),pt(t[1],e),pt(t[2],e)],Ae=t=>[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]],aa=(t,e)=>t.map(c=>[0,1,2].map(a=>c[0]*e[0][a]+c[1]*e[1][a]+c[2]*e[2][a])),Qi=t=>pt(t[0],go(t[1],t[2])),uo=()=>[[1,0,0],[0,1,0],[0,0,1]];function Ya(t){const e=t.length,c=t.map(o=>[...o]),a=Array.from({length:e},(o,s)=>Array.from({length:e},(i,l)=>s===l?1:0));for(let o=0;o<60;o++){let s=0;for(let i=0;i<e;i++)for(let l=i+1;l<e;l++)s+=c[i][l]**2;if(s<1e-22)break;for(let i=0;i<e;i++)for(let l=i+1;l<e;l++){if(Math.abs(c[i][l])<1e-300)continue;const p=(c[l][l]-c[i][i])/(2*c[i][l]),x=Math.sign(p||1)/(Math.abs(p)+Math.sqrt(p*p+1)),f=1/Math.sqrt(x*x+1),d=x*f;for(let r=0;r<e;r++){const g=c[r][i],u=c[r][l];c[r][i]=f*g-d*u,c[r][l]=d*g+f*u}for(let r=0;r<e;r++){const g=c[i][r],u=c[l][r];c[i][r]=f*g-d*u,c[l][r]=d*g+f*u}for(let r=0;r<e;r++){const g=a[r][i],u=a[r][l];a[r][i]=f*g-d*u,a[r][l]=d*g+f*u}}}return{values:c.map((o,s)=>o[s]),vectors:a}}const Ca=(t,e)=>t.map(c=>c[e]);function $o(t){const{values:e,vectors:c}=Ya(aa(Ae(t),t)),a=[0,1,2].sort((f,d)=>e[d]-e[f]),o=a.map(f=>Ca(c,f)),s=a.map(f=>Math.sqrt(Math.max(0,e[f]))),i=Va(be(t,o[0])),l=be(t,o[1]),p=Va(he(l,$t(i,pt(i,l)))),x=go(i,p);return{U:Ae([i,p,x]),S:s,V:Ae([o[0],o[1],o[2]])}}function Xo(t){const e=Math.hypot(t[0],t[1],t[2]);if(e<1e-12)return uo();const c=$t(t,1/e),a=Math.cos(e),o=Math.sin(e),s=1-a;return[[a+c[0]*c[0]*s,c[0]*c[1]*s-c[2]*o,c[0]*c[2]*s+c[1]*o],[c[1]*c[0]*s+c[2]*o,a+c[1]*c[1]*s,c[1]*c[2]*s-c[0]*o],[c[2]*c[0]*s-c[1]*o,c[2]*c[1]*s+c[0]*o,a+c[2]*c[2]*s]]}function Zi(t){const e=t[0][0]+t[1][1]+t[2][2];let c;if(e>0){const o=Math.sqrt(e+1)*2;c=[(t[2][1]-t[1][2])/o,(t[0][2]-t[2][0])/o,(t[1][0]-t[0][1])/o,o/4]}else if(t[0][0]>t[1][1]&&t[0][0]>t[2][2]){const o=Math.sqrt(1+t[0][0]-t[1][1]-t[2][2])*2;c=[o/4,(t[0][1]+t[1][0])/o,(t[0][2]+t[2][0])/o,(t[2][1]-t[1][2])/o]}else if(t[1][1]>t[2][2]){const o=Math.sqrt(1+t[1][1]-t[0][0]-t[2][2])*2;c=[(t[0][1]+t[1][0])/o,o/4,(t[1][2]+t[2][1])/o,(t[0][2]-t[2][0])/o]}else{const o=Math.sqrt(1+t[2][2]-t[0][0]-t[1][1])*2;c=[(t[0][2]+t[2][0])/o,(t[1][2]+t[2][1])/o,o/4,(t[1][0]-t[0][1])/o]}const a=Math.hypot(...c);return c.map(o=>o/a*(c[3]<0?-1:1))}function Ji(t){const[e,c,a,o]=t;return[[1-2*(c*c+a*a),2*(e*c-a*o),2*(e*a+c*o)],[2*(e*c+a*o),1-2*(e*e+a*a),2*(c*a-e*o)],[2*(e*a-c*o),2*(c*a+e*o),1-2*(e*e+c*c)]]}function tl(t,e,c=_a.r){const a=(2*c+1)**2,o=new Float32Array(a),s=Array.from({length:6},()=>new Float32Array(a));let i=0,l=0;for(let d=-c;d<=c;d++)for(let r=-c;r<=c;r++,i++){const g=(fc(t,e[0]+r+1,e[1]+d)-fc(t,e[0]+r-1,e[1]+d))/2,u=(fc(t,e[0]+r,e[1]+d+1)-fc(t,e[0]+r,e[1]+d-1))/2;o[i]=fc(t,e[0]+r,e[1]+d),l+=o[i],s[0][i]=g*r,s[1][i]=u*r,s[2][i]=g*d,s[3][i]=u*d,s[4][i]=g,s[5][i]=u}l/=a;let p=0;for(let d=0;d<a;d++)o[d]-=l,p+=o[d]*o[d];if(p=Math.sqrt(p/a),p<.001)return null;const x=Array.from({length:6},(d,r)=>Array.from({length:6},(g,u)=>{let v=0;for(let b=0;b<a;b++)v+=s[r][b]*s[u][b];return v})),f=el(x);return f?{r:c,v:o,sd:s,Hi:f,sdv:p,A:[1,0,0,1]}:null}function el(t){const e=t.length,c=t.map((a,o)=>[...a,...Array.from({length:e},(s,i)=>o===i?1:0)]);for(let a=0;a<e;a++){let o=a;for(let s=a+1;s<e;s++)Math.abs(c[s][a])>Math.abs(c[o][a])&&(o=s);if(Math.abs(c[o][a])<1e-14)return null;[c[a],c[o]]=[c[o],c[a]];for(let s=0;s<e;s++)if(s!==a){const i=c[s][a]/c[a][a];for(let l=a;l<2*e;l++)c[s][l]-=i*c[a][l]}}return c.map((a,o)=>a.slice(e).map(s=>s/a[o]))}function cl(t,e,c){const{r:a,v:o,sd:s,Hi:i}=t,l=o.length,p=new Float32Array(l),x=new Float64Array(6),f=new Float64Array(6),d=e.data,r=e.w,g=e.w-1.001,u=e.h-1.001;let[v,b,S,T]=t.A,D=c[0],P=c[1],K=0;for(let M=0;M<_a.iters;M++){let y=0,z=0;for(let N=-a;N<=a;N++)for(let Q=-a;Q<=a;Q++,y++){let mt=D+v*Q+S*N,X=P+b*Q+T*N;mt=mt<0?0:mt>g?g:mt,X=X<0?0:X>u?u:X;const at=mt|0,Ce=X|0,Sc=mt-at,Yt=X-Ce,_t=Ce*r+at;p[y]=(d[_t]*(1-Sc)+d[_t+1]*Sc)*(1-Yt)+(d[_t+r]*(1-Sc)+d[_t+r+1]*Sc)*Yt,z+=p[y]}z/=l;let h=0,w=0;for(let N=0;N<l;N++)p[N]-=z,h+=p[N]*p[N],w+=p[N]*o[N];const k=Math.sqrt(h/l);if(k<1e-4)return null;K=w/l/(k*t.sdv);const m=t.sdv/k;x.fill(0);for(let N=0;N<6;N++){const Q=s[N];let mt=0;for(let X=0;X<l;X++)mt+=Q[X]*(p[X]*m-o[X]);x[N]=mt}for(let N=0;N<6;N++){const Q=i[N];f[N]=Q[0]*x[0]+Q[1]*x[1]+Q[2]*x[2]+Q[3]*x[3]+Q[4]*x[4]+Q[5]*x[5]}const B=1+f[0],Y=f[1],lt=f[2],et=1+f[3],C=B*et-Y*lt;if(Math.abs(C)<1e-6)return null;const G=et/C,E=-Y/C,j=-lt/C,ct=B/C,wt=v*G+S*E,bt=b*G+T*E,I=v*j+S*ct,$=b*j+T*ct,J=G*f[4]+j*f[5],Mt=E*f[4]+ct*f[5];if(D-=wt*J+I*Mt,P-=bt*J+$*Mt,v=wt,b=bt,S=I,T=$,f[4]*f[4]+f[5]*f[5]<25e-6)break}const n=Math.abs(v*T-b*S);return!(K>=_a.ncc)||n<.4||n>2.5||Math.hypot(D-c[0],P-c[1])>_a.jump?null:{p:[D,P],A:[v,b,S,T]}}const _a=Object.freeze({r:6,iters:12,ncc:.85,jump:2});function bo(t,{skip:e=null,keep:c=140,onProgress:a=null,cols:o=16,rows:s=10,anchor:i=!1}={}){const l=t.map(()=>new Map);let p=0,x=[],f=null;for(let d=0;d<t.length;d++){const r=fo(t[d]);if(f){const g=jo(f,r,x.map(u=>u.p));x=x.map((u,v)=>{if(!g[v])return null;if(!u.tpl)return{...u,p:g[v]};const b=cl(u.tpl,t[d],g[v]);return b?(u.tpl.A=b.A,{...u,p:b.p}):null}).filter(Boolean)}if(x.length<c*.75){const g=t[d].w,u=t[d].h,v=e?.(d);for(const b of Uo(t[d],{cols:o,rows:s,skip:v})){if(!(!x.some(T=>Math.abs(T.p[0]-b[0])<8&&Math.abs(T.p[1]-b[1])<8)&&b[0]>4&&b[1]>4&&b[0]<g-5&&b[1]<u-5))continue;const S=i?tl(t[d],b):null;i&&!S||x.push({id:p++,p:b,tpl:S})}}for(const g of x)l[d].set(g.id,g.p);f=r,a?.((d+1)/t.length)}return l}const Fo=(t,e,c)=>[...t[e].keys()].filter(a=>t[c].has(a));function al(t,e,c,a,o,s,i){const l=Fo(t,e,c);if(l.length<20)return null;const p=l.map(b=>vc(t[e].get(b),a,o,s)),x=l.map(b=>t[c].get(b)),f=l.map(b=>t[e].get(b)),d=[];for(let b=0;b<400;b++){const S=Math.floor(i()*l.length),T=Math.floor(i()*l.length),D=Math.hypot(f[S][0]-f[T][0],f[S][1]-f[T][1]);D>o*.3&&d.push(Math.hypot(x[S][0]-x[T][0],x[S][1]-x[T][1])/D)}d.sort((b,S)=>b-S);let r=d.length>20?Math.max(.7,Math.min(1.4,d[d.length>>1])):1,g=x.map(b=>vc(b,a*r,o,s)),u=Fa(p,g,{thr:.02,rand:i});if(!u)return null;for(let b=0;b<5;b++){const S=Vo(u.inliers.map(T=>p[T]),u.inliers.map(T=>x[T]),u.q,a,o,s,o*2);if(Math.abs(S-r)<.001)break;r=S,g=x.map(T=>vc(T,a*r,o,s)),u=Fa(p,g,{thr:.02,rand:i})??u}const v=p.map((b,S)=>Xa($a(u.q,b),g[S])).sort((b,S)=>b-S);return{value:v[Math.floor(v.length*.8)],ids:l.length,zoom:r}}function Yo(t,e){const c=Array.from({length:9},()=>new Array(9).fill(0));for(let p=0;p<t.length;p++){const x=[];for(let f=0;f<3;f++)for(let d=0;d<3;d++)x.push(e[p][f]*t[p][d]);for(let f=0;f<9;f++)for(let d=0;d<9;d++)c[f][d]+=x[f]*x[d]}const{values:a,vectors:o}=Ya(c),s=Ca(o,a.indexOf(Math.min(...a))),{U:i,V:l}=$o([[s[0],s[1],s[2]],[s[3],s[4],s[5]],[s[6],s[7],s[8]]]);return aa(aa(i,[[1,0,0],[0,1,0],[0,0,0]]),Ae(l))}const ol=(t,e,c)=>{const a=be(t,e),o=Math.hypot(a[0],a[1],a[2])||1;return Math.abs(pt(c,a))/o};function _o(t,e,c,a){const o=he(t,c),s=pt(e,a),i=pt(e,o),l=pt(a,o),p=1-s*s;if(p<1e-9)return null;const x=(s*l-i)/p,f=(l-s*i)/p;return x<=0||f<=0?null:$t(Yc(Yc(t,$t(e,x)),Yc(c,$t(a,f))),.5)}const Qa=(t,e)=>({o:t.C,d:Va(be(Ae(t.R),e))});function Mo(t,e,c,a,o){const s=be(t.R,he(e,t.C));return s[2]>-1e-6?null:[a+c*s[0]/-s[2],o-c*s[1]/-s[2]]}function nl(t,e,c,a,o,s,i){const l=Fo(t,e,c),p=l.map(T=>vc(t[e].get(T),a,o,s)),x=l.map(T=>vc(t[c].get(T),a,o,s)),f=1.5/a;let d=[];for(let T=0;T<300;T++){const D=new Set;for(;D.size<8;)D.add(Math.floor(i()*l.length));const P=[...D],K=Yo(P.map(M=>p[M]),P.map(M=>x[M])),n=[];for(let M=0;M<l.length;M++)ol(K,p[M],x[M])<f&&n.push(M);n.length>d.length&&(d=n)}if(d.length<15)return null;const r=Yo(d.map(T=>p[T]),d.map(T=>x[T])),{U:g,V:u}=$o(r),v=[[0,-1,0],[1,0,0],[0,0,1]],b=Ca(g,2);let S=null;for(const T of[v,Ae(v)])for(const D of[1,-1]){let P=aa(aa(g,T),Ae(u));Qi(P)<0&&(P=P.map(h=>h.map(w=>-w)));const K=$t(b,D),n=$t(be(Ae(P),K),-1),M={R:uo(),C:[0,0,0]},y={R:P,C:n},z=new Map;for(const h of d){const w=Qa(M,p[h]),k=Qa(y,x[h]),m=_o(w.o,w.d,k.o,k.d);m&&z.set(l[h],m)}(!S||z.size>S.points.size)&&(S={pose:y,points:z})}return S&&S.points.size>=15?S:null}function yo(t,e,c,a,o,s){let i={R:e.R.map(d=>[...d]),C:[...e.C]};const l=d=>{const r=[];for(const{X:g,px:u}of t){const v=Mo(d,g,c,a,o);r.push(v?v[0]-u[0]:50,v?v[1]-u[1]:50)}return r},p=(d,r)=>({R:aa(Xo([r[0],r[1],r[2]]),d.R),C:Yc(d.C,[r[3]*s,r[4]*s,r[5]*s])});for(let d=0;d<12;d++){const r=l(i),g=r.map((T,D)=>D%2?null:Math.hypot(T,r[D+1])).flatMap(T=>T===null?[]:[T<=2?1:2/T,T<=2?1:2/T]),u=[];for(let T=0;T<6;T++){const D=[0,0,0,0,0,0];D[T]=1e-5;const P=l(p(i,D));u.push(P.map((K,n)=>(K-r[n])/1e-5))}const v=Array.from({length:6},()=>new Array(6).fill(0)),b=new Array(6).fill(0);for(let T=0;T<r.length;T++)for(let D=0;D<6;D++){b[D]+=u[D][T]*r[T]*g[T];for(let P=0;P<6;P++)v[D][P]+=u[D][T]*u[P][T]*g[T]}for(let T=0;T<6;T++)v[T][T]*=1.0001;const S=Qo(v,b.map(T=>-T));if(!S||(i=p(i,S),Math.hypot(...S)<1e-7))break}const x=l(i),f=[];for(let d=0;d<t.length;d++)Math.hypot(x[2*d],x[2*d+1])<2.5&&f.push(d);return{pose:i,inliers:f}}function Qo(t,e){const c=e.length,a=t.map((s,i)=>Float64Array.from([...s,e[i]]));for(let s=0;s<c;s++){let i=s;for(let x=s+1;x<c;x++)Math.abs(a[x][s])>Math.abs(a[i][s])&&(i=x);if(Math.abs(a[i][s])<1e-14)return null;[a[s],a[i]]=[a[i],a[s]];const l=a[s],p=l[s];for(let x=s+1;x<c;x++){const f=a[x],d=f[s]/p;if(d!==0)for(let r=s;r<=c;r++)f[r]-=d*l[r]}}const o=new Array(c);for(let s=c-1;s>=0;s--){const i=a[s];let l=i[c];for(let p=s+1;p<c;p++)l-=i[p]*o[p];o[s]=l/i[s]}return o}function sl(t,e,c,a=Ta(17),o=.75){const s=[...t.values()];if(s.length<30)return null;const i=s.map(r=>Math.hypot(...he(r,c))).sort((r,g)=>r-g)[s.length>>1],l=i*.015;let p=null;for(let r=0;r<1e3;r++){const g=s[Math.floor(a()*s.length)],u=s[Math.floor(a()*s.length)],v=s[Math.floor(a()*s.length)];let b=go(he(u,g),he(v,g));const S=Math.hypot(...b);if(S<1e-9||(b=$t(b,1/S),pt(b,e)<0&&(b=$t(b,-1)),pt(b,e)<o))continue;const T=-pt(b,g);if(pt(b,c)+T<=l)continue;let D=0;for(const P of s)Math.abs(pt(b,P)+T)<l&&D++;(!p||D>p.count)&&(p={n:b,d:T,count:D})}if(!p||p.count<Math.max(20,s.length*.12))return null;let{n:x,d:f}=p,d=[];for(let r=0,g=l;r<4&&(d=s.filter(P=>Math.abs(pt(x,P)+f)<g),!(d.length<12));r++,g*=.6){const u=d.map(P=>1/Math.max(1e-6,pt(he(P,c),he(P,c)))),v=u.reduce((P,K)=>P+K,0),b=$t(d.reduce((P,K,n)=>Yc(P,$t(K,u[n])),[0,0,0]),1/v),S=[[0,0,0],[0,0,0],[0,0,0]];d.forEach((P,K)=>{const n=he(P,b);for(let M=0;M<3;M++)for(let y=0;y<3;y++)S[M][y]+=u[K]*n[M]*n[y]});const{values:T,vectors:D}=Ya(S);x=Ca(D,T.indexOf(Math.min(...T))),pt(x,e)<0&&(x=$t(x,-1)),f=-pt(x,b)}return d.length<Math.max(15,s.length*.08)||pt(x,e)<o?null:{n:x,d:f,count:d.length}}function ia(t,e,c,a,o,s,i,l=12,{focal:p=!1}={}){const x=a.filter(M=>t[M]),f=x.length;if(f<3)return o;const d=new Map(x.map((M,y)=>[M,y])),r=[...e.keys()].filter(M=>x.filter(y=>c[y].has(M)).length>=2),g=r.length;if(g<10)return o;const u=[];r.forEach((M,y)=>{for(const z of x)c[z].has(M)&&u.push({c:d.get(z),p:y,px:c[z].get(M)})});const v=x.map(M=>t[M].R.map(y=>[...y])),b=x.map(M=>[...t[M].C]),S=r.map(M=>[...e.get(M)]),T=(M,y,z,h)=>{let w=0;for(const k of u){const m=be(M[k.c],he(z[k.p],y[k.c]));if(m[2]>-1e-6){w+=100;continue}const B=s-h*m[0]/m[2]-k.px[0],Y=i+h*m[1]/m[2]-k.px[1],lt=Math.hypot(B,Y);w+=lt<=2?lt*lt:4*lt-4}return w};let D=.001,P=T(v,b,S,o);const K=6*(f-1)+(p?1:0),n=K-1;for(let M=0;M<l;M++){const y=Array.from({length:K},()=>new Array(K).fill(0)),z=new Array(K).fill(0),h=S.map(()=>[[0,0,0],[0,0,0],[0,0,0]]),w=S.map(()=>[0,0,0]),k=new Map,m=p?S.map(()=>[[0,0,0]]):null;for(const I of u){const $=be(v[I.c],he(S[I.p],b[I.c])),[J,Mt,N]=$;if(N>-1e-6)continue;const Q=s-o*J/N-I.px[0],mt=i+o*Mt/N-I.px[1],X=Math.hypot(Q,mt),at=X<=2?1:2/X,Ce=[-o/N,0,o*J/(N*N)],Sc=[0,o/N,-o*Mt/(N*N)],Yt=v[I.c],_t=[be(Ae(Yt),Ce),be(Ae(Yt),Sc)],Yx=[[0,-N,Mt],[N,0,-J],[-Mt,J,0]],ji=St=>[...be(Ae(Yx),St).map(sa=>-sa),...$t(be(Ae(Yt),St),-1)],va=I.c?[ji(Ce),ji(Sc)]:null,No=[Q,mt],ja=[-J/N,Mt/N];for(let St=0;St<2;St++){for(let vt=0;vt<3;vt++){w[I.p][vt]+=at*_t[St][vt]*No[St];for(let Qt=0;Qt<3;Qt++)h[I.p][vt][Qt]+=at*_t[St][vt]*_t[St][Qt]}if(p){z[n]+=at*ja[St]*No[St],y[n][n]+=at*ja[St]*ja[St];for(let vt=0;vt<3;vt++)m[I.p][0][vt]+=at*ja[St]*_t[St][vt]}if(!va)continue;const sa=6*(I.c-1),Vi=I.c*g+I.p;let Io=k.get(Vi);Io||k.set(Vi,Io=Array.from({length:6},()=>[0,0,0]));for(let vt=0;vt<6;vt++){z[sa+vt]+=at*va[St][vt]*No[St];for(let Qt=0;Qt<6;Qt++)y[sa+vt][sa+Qt]+=at*va[St][vt]*va[St][Qt];for(let Qt=0;Qt<3;Qt++)Io[vt][Qt]+=at*va[St][vt]*_t[St][Qt];if(p){const Qt=at*va[St][vt]*ja[St];y[sa+vt][n]+=Qt,y[n][sa+vt]+=Qt}}}}const B=h.map(I=>{const $=I.map((J,Mt)=>J.map((N,Q)=>N+(Mt===Q?D*(N+1e-9)+1e-9:0)));return il($)}),Y=y.map((I,$)=>I.map((J,Mt)=>J+($===Mt?D*(J+1e-9):0))),lt=z.map(I=>-I),et=new Map;for(const[I,$]of k){const J=I%g;et.has(J)||et.set(J,[]),et.get(J).push({o:6*(Math.floor(I/g)-1),B:$})}p&&m.forEach((I,$)=>{et.has($)||et.set($,[]),et.get($).push({o:n,B:I})});for(const[I,$]of et){const J=B[I],Mt=$.map(({o:N,B:Q})=>({o:N,M:Q.map(mt=>be(Ae(J),mt))}));for(const N of Mt)for(let Q=0;Q<N.M.length;Q++)lt[N.o+Q]+=pt(N.M[Q],w[I]);for(const N of Mt)for(const Q of $)for(let mt=0;mt<N.M.length;mt++)for(let X=0;X<Q.B.length;X++)Y[N.o+mt][Q.o+X]-=pt(N.M[mt],Q.B[X])}const C=Qo(Y,lt);if(!C){D*=10;continue}const G=w.map(I=>$t(I,-1));for(const[I,$]of et)for(const{o:J,B:Mt}of $)for(let N=0;N<3;N++)for(let Q=0;Q<Mt.length;Q++)G[I][N]-=Mt[Q][N]*C[J+Q];const E=v.map((I,$)=>$?aa(Xo(C.slice(6*($-1),6*($-1)+3)),I):I),j=b.map((I,$)=>$?Yc(I,C.slice(6*($-1)+3,6*$)):I),ct=S.map((I,$)=>Yc(I,be(B[$],G[$]))),wt=p?o+C[n]:o,bt=wt>0?T(E,j,ct,wt):1/0;bt<P?(P=bt,v.splice(0,f,...E),b.splice(0,f,...j),S.splice(0,g,...ct),o=wt,D=Math.max(1e-7,D/3)):D*=8}return x.forEach((M,y)=>{t[M]={...t[M],R:v[y],C:b[y]}}),r.forEach((M,y)=>e.set(M,S[y])),o}function il(t){const[[e,c,a],[o,s,i],[l,p,x]]=t,f=s*x-i*p,d=-(o*x-i*l),r=o*p-s*l,g=e*f+c*d+a*r;return Math.abs(g)<1e-18?[[0,0,0],[0,0,0],[0,0,0]]:[[f/g,-(c*x-a*p)/g,(c*i-a*s)/g],[d/g,(e*x-a*l)/g,-(e*i-a*o)/g],[r/g,-(e*p-c*l)/g,(e*s-c*o)/g]]}function Zo(t,e,{skip:c=null,rand:a=Ta(19),minParallax:o=2.2/e,obs:s=null,w:i=0,h:l=0}={}){const p=i||t[0].w,x=l||t[0].h,f=p/2,d=x/2,r=s??bo(t,{skip:c}),g=r.length;let u=null;for(const w of[0,Math.floor(g/4),Math.floor(g/2)]){let k=null;for(let m=w+2;m<Math.min(g,w+45);m++){const B=al(r,w,m,e,f,d,a);if(!B||B.ids<30)break;(!k||B.value>k.value)&&(k={b:m,value:B.value})}if(k&&k.value>o){u=[w,k.b];break}}if(!u)return{mode:"tripod",obs:r};const v=nl(r,u[0],u[1],e,f,d,a);if(!v)return{mode:"tripod",obs:r};const b=new Array(g).fill(null),S=v.points;b[u[0]]={R:uo(),C:[0,0,0]},b[u[1]]=v.pose;const T=Math.hypot(...v.pose.C),D=w=>{for(const[k,m]of r[w])if(!S.has(k))for(let B=0;B<g;B++){if(B===w||!b[B]||!r[B].has(k))continue;const Y=Qa(b[B],vc(r[B].get(k),e,f,d)),lt=Qa(b[w],vc(m,e,f,d));if(Math.acos(Math.min(1,pt(Y.d,lt.d)))<.02)continue;const et=_o(Y.o,Y.d,lt.o,lt.d);if(!et)continue;const C=Mo(b[B],et,e,f,d),G=Mo(b[w],et,e,f,d);if(C&&G&&Math.hypot(C[0]-r[B].get(k)[0],C[1]-r[B].get(k)[1])<2&&Math.hypot(G[0]-m[0],G[1]-m[1])<2){S.set(k,et);break}}},P=(w,k)=>{const m=[];for(const[Y,lt]of r[w])S.has(Y)&&m.push({X:S.get(Y),px:lt,id:Y});if(m.length<10)return!1;let B=yo(m,b[k],e,f,d,T);return B.inliers.length<m.length*.6&&B.inliers.length>=10&&(B=yo(B.inliers.map(Y=>m[Y]),B.pose,e,f,d,T)),B.inliers.length<10?!1:(b[w]=B.pose,!0)};let K=0;const n=()=>{if(++K<15)return;K=0;const w=b.map((m,B)=>m?B:-1).filter(m=>m>=0),k=Math.max(1,Math.ceil(w.length/30));ia(b,S,r,[u[0],...w.filter((m,B)=>m!==u[0]&&(B%k===0||B===w.length-1))],e,f,d,4)};D(u[1]);for(let w=u[0]+1;w<u[1];w++)P(w,b[w-1]?w-1:u[0])&&(D(w),n());for(let w=u[1]+1;w<g;w++)P(w,b[w-1]?w-1:u[1])&&(D(w),n());for(let w=u[0]-1;w>=0;w--)P(w,b[w+1]?w+1:u[0])&&(D(w),n());const M=b.filter(w=>!w).length;if(M>g*.2)return{mode:"tripod",obs:r,reason:"lost"};const y=b.map((w,k)=>w?k:-1).filter(w=>w>=0),z=Math.max(1,Math.ceil(y.length/60)),h=[u[0],...y.filter((w,k)=>w!==u[0]&&(k%z===0||k===y.length-1))];ia(b,S,r,h,e,f,d);for(const w of y)h.includes(w)||P(w,w);ia(b,S,r,y.length<=90?[u[0],...y.filter(w=>w!==u[0])]:h,e,f,d,6);for(let w=0;w<g;w++)if(!b[w]){const k=b.findIndex((m,B)=>m&&Math.abs(B-w)===Math.min(...b.map((Y,lt)=>Y?Math.abs(lt-w):1/0)));b[w]={...b[k],lost:!0}}return{mode:"free",poses:b,points:S,obs:r,pair:u,lost:M}}function ll(t,e,c){const a=[...t.values()],s=a.map(P=>pt(e,he(P,c))).map((P,K)=>({h:P,i:K})).filter(P=>P.h<0).sort((P,K)=>P.h-K.h);if(s.length<20)return null;const i=s[s.length>>1].h*-1,l=Math.max(1e-6,i*.04),p=Math.max(12,s.length*.12);let x=null;for(let P=0;P<s.length;P++){let K=0;for(const n of s)Math.abs(n.h-s[P].h)<l&&K++;if(K>=p){x=s[P].h;break}}if(x===null)return null;const f=s.filter(P=>Math.abs(P.h-x)<l*1.5),d=f.map(P=>P.h).sort((P,K)=>P-K)[f.length>>1],r=s.filter(P=>Math.abs(P.h-d)<l*1.5).map(P=>a[P.i]),g=r.map(P=>1/Math.max(1e-6,pt(he(P,c),he(P,c)))),u=g.reduce((P,K)=>P+K,0),v=$t(r.reduce((P,K,n)=>Yc(P,$t(K,g[n])),[0,0,0]),1/u),b=[[0,0,0],[0,0,0],[0,0,0]];r.forEach((P,K)=>{const n=he(P,v);for(let M=0;M<3;M++)for(let y=0;y<3;y++)b[M][y]+=g[K]*n[M]*n[y]});const{values:S,vectors:T}=Ya(b);let D=Ca(T,S.indexOf(Math.min(...S)));return pt(D,e)<0&&(D=$t(D,-1)),(r.length<12||pt(D,e)<Math.cos(8*Math.PI/180))&&(D=e),{n:D,d:-pt(D,v),count:r.length}}const Jo=Object.freeze({ink:{width:1,tip:.12,press:.45,wobble:.06,alpha:1,retrace:!1,grain:0},pen:{width:.7,tip:.9,press:.04,wobble:.03,alpha:1,retrace:!1,grain:0},crayon:{width:1.1,tip:.7,press:.15,wobble:.14,alpha:.92,retrace:!0,grain:.55},chalk:{width:1.05,tip:.75,press:.12,wobble:.12,alpha:.88,retrace:!1,grain:.7},charcoal:{width:1.2,tip:.4,press:.3,wobble:.18,alpha:.9,retrace:!0,grain:.45},watercolor:{width:1.25,tip:.35,press:.35,wobble:.2,alpha:.55,retrace:!1,grain:0,wet:!0}});Object.freeze(["pencil","marker","brush",...Object.keys(Jo)]);const Zt=(t,e,c,a)=>Object.freeze({id:t,vi:e,en:c,...a}),tn=Object.freeze([Zt("watercolor-garden","Màu nước vườn","Watercolour garden",{about:["Màu nước loang trên giấy cotton, viền đậm nơi màu đọng","Translucent washes on cotton paper, darker pooled edges"],palette:["#f6efe0","#8fb39a","#e59b8b","#8fb5d4","#e8c170","#b07fa8"],ink:"#5b4a3f",brush:{style:"watercolor",width:.8,taper:.6,press:.5},outline:!0,texture:{type:"wash",amount:.7},paper:{color:"#f6efe0",texture:{type:"paper",amount:.6}},boil:{amount:1.2,fps:6},step:2,tags:["soft","editorial"]}),Zt("ink-wash","Thủy mặc","Ink wash",{about:["Mực tàu trên giấy dó, sắc độ xám, một điểm đỏ ấn","Brush ink on rice paper, grey tones, one red seal"],palette:["#f1ece0","#3c3c3c","#7d7d78","#c0392b","#dcd8cd","#5a6b5d"],ink:"#1d1d1b",brush:{style:"ink",width:1.1,taper:.85,press:.7},outline:!0,texture:{type:"wash",amount:.5},paper:{color:"#f1ece0",texture:{type:"paper",amount:.7}},boil:{amount:.8,fps:4},step:2,tags:["minimal","cinematic"]}),Zt("crayon-book","Sách sáp màu","Crayon book",{about:["Nét sáp màu thiếu nhi, tô gạch, giấy trắng ngà","Kids’ crayon lines and scribbled fills on warm paper"],palette:["#fbf6ea","#f2a93b","#4f9fd8","#e8504b","#cfe8ff","#6b4f8f"],ink:"#3a3226",brush:{style:"crayon",width:1,taper:.3,press:.3},outline:!0,texture:{type:"hatch",scale:.8,angle:-35,amount:.55},paper:{color:"#fbf6ea",texture:{type:"grain",amount:.5}},boil:{amount:2.4,fps:8},step:2,tags:["playful"]}),Zt("midcentury-flat","Phẳng thập niên 50","Midcentury flat",{about:["Mảng màu phẳng không viền, hạt in nhẹ, tông mù tạt – xanh két","Flat shapes without outlines, light print grain, mustard and teal"],palette:["#f3e7cf","#e2a33a","#2f7d79","#d9573b","#a9d6d0","#2c3e50"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:{type:"grain",amount:.35},paper:{color:"#f3e7cf",texture:{type:"grain",amount:.4}},boil:null,step:1,tags:["retro","clean"]}),Zt("rubber-hose","Hoạt hình ống cao su","Rubber-hose toon",{about:["Thập niên 30: đen trắng ngà, viền mực dày, chuyển động trên 2","1930s cartoon: cream greys, thick ink outlines, animated on twos"],palette:["#efe4cc","#e2d7bf","#a69c86","#5b5346","#fbf7ee","#2a251f"],ink:"#14110d",brush:{style:"ink",width:1.3,taper:.2,press:.2},outline:!0,texture:null,paper:{color:"#d8ccb2",texture:{type:"paper",amount:.8}},boil:{amount:1.6,fps:12},step:2,tags:["retro","playful"]}),Zt("riso-print","In riso","Riso print",{about:["Hai–ba màu mực in chồng, chấm tram, lệch bản nhẹ","Two or three overprinted inks, halftone, slight misregistration"],palette:["#f4eee2","#ff4f9a","#2a6fd6","#ffd23f","#ffc2dd","#1d3c78"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"riso",amount:.7},paper:{color:"#f4eee2",texture:{type:"grain",amount:.45}},boil:{amount:.6,fps:6},step:2,tags:["editorial","street"]}),Zt("papercut","Giấy cắt","Papercut",{about:["Lớp giấy cắt đỏ – kem, vân giấy, chuyển động stop-motion","Red and cream cut-paper layers, paper fibres, stop-motion timing"],palette:["#f5e9d4","#c8102e","#8b0a1f","#f0c05a","#ec9a78","#2b2b2b"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"paper",amount:.8},paper:{color:"#f5e9d4",texture:{type:"paper",amount:.9}},boil:{amount:.8,fps:4},step:3,tags:["editorial","playful"]}),Zt("whiteboard","Bảng trắng bút lông","Whiteboard marker",{about:["Bút lông đen – xanh – đỏ trên bảng trắng, tô gạch thưa","Black, blue and red markers on a whiteboard, loose hatching"],palette:["#fbfbf8","#1f5fbf","#d6332f","#2e9e5b","#f2b705","#555555"],ink:"#1b1b1b",brush:{style:"marker",width:.9,taper:.2,press:.1},outline:!0,texture:{type:"hatch",scale:1.2,angle:-45,amount:.35},paper:{color:"#fbfbf8",texture:{type:"grain",amount:.15}},boil:{amount:.8,fps:8},step:1,tags:["clean","corporate"]}),Zt("chalkboard","Bảng phấn","Chalkboard",{about:["Phấn trắng – vàng – hồng trên bảng xanh đen","White, yellow and pink chalk on a green-black board"],palette:["#24342c","#f4f1e8","#f6d65a","#f29bb6","#8fd3e8","#b6e388"],ink:"#f4f1e8",brush:{style:"chalk",width:1,taper:.3,press:.2},outline:!0,texture:{type:"stipple",scale:1,amount:.5},paper:{color:"#24342c",texture:{type:"grain",amount:.55}},boil:{amount:1.6,fps:8},step:2,tags:["retro","playful"]}),Zt("blueprint","Bản vẽ kỹ thuật","Blueprint",{about:["Nét trắng mảnh trên nền xanh lưới kỹ thuật","Thin white lines on blue grid paper"],palette:["#1d4f91","#e9f2ff","#9cc3ff","#ffd166","#6fb1ff","#c8dcff"],ink:"#e9f2ff",brush:{style:"pen",width:.6,taper:0,press:0},outline:!0,texture:{type:"hatch",scale:.7,angle:45,amount:.35},paper:{color:"#1d4f91",texture:{type:"grid",amount:.5}},boil:null,step:1,tags:["tech","minimal"]}),Zt("woodcut","Khắc gỗ","Woodcut",{about:["Mực đen dày, gạch khắc dày đặc, điểm đỏ","Heavy black ink, dense carved hatching, a red accent"],palette:["#efe6d2","#1a1714","#b8322a","#8a7a62","#e3d6b8","#5c4a3a"],ink:"#1a1714",brush:{style:"ink",width:1.4,taper:.6,press:.5},outline:!0,texture:{type:"crosshatch",scale:.8,angle:30,amount:.6},paper:{color:"#efe6d2",texture:{type:"paper",amount:.6}},boil:{amount:.6,fps:4},step:2,tags:["retro","editorial"]}),Zt("one-line","Một nét","One line",{about:["Một nét bút liền, không tô, vẽ dần","A single continuous pen line, no fills, drawn on"],palette:["#f7f4ee","#222222","#d64545","#3b6ea5","#999999","#555555"],ink:"#222222",brush:{style:"pen",width:.8,taper:.4,press:.1},outline:!0,texture:null,fillNone:!0,paper:{color:"#f7f4ee",texture:{type:"grain",amount:.2}},boil:null,step:1,tags:["minimal","clean"]}),Zt("isotype","Biểu tượng isotype","Isotype pictogram",{about:["Biểu tượng phẳng kiểu thống kê, 3 màu, gọn","Flat statistical pictograms, three colours, tidy"],palette:["#eceae4","#1d3557","#e63946","#457b9d","#a8dadc","#f1a208"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:null,paper:{color:"#eceae4",texture:null},boil:null,step:1,tags:["clean","corporate","minimal"]}),Zt("stained-glass","Kính màu","Stained glass",{about:["Viền chì đen dày, mảng màu ngọc rực, vân kính","Thick black leading, jewel colours, glass grain"],palette:["#121212","#1f6fb2","#c0392b","#f1c40f","#a3d9ff","#8e44ad"],ink:"#101010",brush:{style:"pen",width:1.8,taper:0,press:0},outline:!0,texture:{type:"grain",scale:1.6,amount:.5},paper:{color:"#151515",texture:{type:"grain",amount:.3}},boil:null,step:1,text:"#f6e7b4",tags:["bold","luxury"]}),Zt("pencil-sketch","Phác chì","Pencil sketch",{about:["Nét chì than mảnh, tô gạch đan nhạt, giấy vẽ","Graphite lines, light cross-hatching, sketch paper"],palette:["#f5f2ea","#8a8a86","#b9b7b0","#6e6a63","#c9a27e","#9fb0bf"],ink:"#3d3b38",brush:{style:"pencil",width:1.1,taper:.5,press:.4},outline:!0,texture:{type:"crosshatch",scale:1,angle:-40,amount:.45},paper:{color:"#f5f2ea",texture:{type:"paper",amount:.5}},boil:{amount:1.4,fps:8},step:2,tags:["soft","editorial"]}),Zt("pop-halftone","Pop chấm tram","Pop halftone",{about:["Viền đen đậm, chấm tram, vàng – đỏ – xanh rực","Bold black outlines, halftone dots, bright primaries"],palette:["#ffe14d","#ff3b3b","#1e90ff","#ff9f1c","#ffffff","#1a1a1a"],ink:"#111111",brush:{style:"marker",width:1.3,taper:0,press:0},outline:!0,texture:{type:"halftone",scale:1,angle:45,amount:.45},paper:{color:"#ffe14d",texture:{type:"halftone",scale:1.4,amount:.25,color:"#ffcc00"}},boil:null,step:1,tags:["bold","playful"]})]);Object.freeze(tn.map(t=>t.id));const Aa=(t,e,c,a)=>Object.freeze({id:t,vi:e,en:c,prompt:a}),rl=Object.freeze([Aa("anime-cel","Anime cel","Anime cel","Japanese anime, clean cel shading, crisp ink line art, flat colour with one shadow tone"),Aa("cartoon-2d","Hoạt hình 2D","2D cartoon","Western 2D cartoon, bold clean outlines, flat bright colours, simple shapes"),Aa("chibi","Chibi","Chibi","cute chibi proportions (big head, small body), soft cel shading, clean outlines"),Aa("comic","Truyện tranh","Comic book","comic book art, heavy ink outlines, halftone shading, strong contrast"),...tn.map(t=>Aa(t.id,t.vi,t.en,`${t.en}: ${t.about?.[1]||t.en}`))]);Object.freeze(rl.map(t=>t.id));const wo=(t,e,c,a,o,s)=>Object.freeze({id:t,label:e,min:c,max:a,vi:o,en:s}),xl=Object.freeze({kling:wo("kling","Kling 4.0",3,15,"Mặc định","Default"),seedance:wo("seedance","Seedance 2.5",4,30,"Chân thực nhất","Most realistic"),wan:wo("wan","Wan 3.0 Prime",2,15,"Bản nháp rẻ","Cheap draft")});Object.freeze(Object.keys(xl));const la="The person keeps exactly the same speech, lip movements, facial expressions, gestures, actions and timing as in the reference video.",ra=(t,e,c,a,o,s,i)=>Object.freeze({id:t,vi:e,en:c,image:a,hintVi:o,hintEn:s,build:i}),hl=Object.freeze([ra("scene","Đổi cảnh/nền","Change scene","optional","VD: quán cà phê ấm áp buổi tối","e.g. a cosy café at night",(t,e)=>`Edit the reference video: replace only the background and surroundings with ${e?`the place shown in the reference image${t?` — ${t}`:""}`:t||"a bright, modern interior"}. ${la} Keep the same person, face, hair and clothes, the same camera framing and camera motion. Match the light on the person to the new background. Photorealistic, no text.`),ra("camera","Đổi góc máy","Camera angle","optional","VD: cận mặt từ bên trái","e.g. a close-up from the left",(t,e)=>`Re-film the same moment from a different camera angle: ${t||"a closer shot from a slightly different angle"}. ${la} Same person, clothes, location and lighting${e?"; the reference image shows the look of the new angle":""}. Smooth camera, photorealistic, no text.`),ra("character","Thay nhân vật","Swap character","required","VD: giữ giọng nói, đổi trang phục công sở","e.g. keep the office outfit",t=>`Edit the reference video: replace the person with the character in the reference image — the same face, hair, body and outfit as in the image${t?` (${t})`:""}. ${la} Keep the same body positions, background, camera framing and camera motion. One person only, shown once. Photorealistic, no text.`),ra("relight","Đổi ánh sáng","Relight","optional","VD: nắng vàng hoàng hôn từ cửa sổ","e.g. golden sunset light from a window",(t,e)=>`Edit the reference video: change only the lighting to ${t||"warm golden-hour light from the side"}${e?", like the light in the reference image":""}. ${la} Keep everything else the same — person, clothes, background, camera framing and camera motion. Photorealistic, no text.`),ra("dof","Xoá phông","Blur background","optional","VD: phông xoá mạnh hơn","e.g. an even softer background",t=>`Edit the reference video: keep the person sharp and in focus and give the background a shallow depth of field — soft, creamy bokeh like a full-frame camera with an f/1.8 lens${t?`; ${t}`:""}. ${la} Keep the same person, background layout, camera framing and camera motion. Photorealistic, no text.`),ra("custom","Tự viết","Custom","optional","Mô tả thay đổi (tiếng Anh cho kết quả tốt nhất)","Describe the change",t=>`${t||"Edit the reference video."}${/lip|speech|timing/i.test(t)?"":` ${la}`}`)]);Object.freeze(hl.map(t=>t.id));const fl=Object.freeze({overcast:{azimuth:35,elevation:62,intensity:1.6,color:"#f1f4f8",ambient:"#c9d2dc",ambientIntensity:1.25,shadow:.45,softness:.85,contact:.75,env:.9,exposure:1},sun:{azimuth:40,elevation:48,intensity:3.4,color:"#fff3df",ambient:"#bcd2ec",ambientIntensity:.75,shadow:.7,softness:.25,contact:.8,env:.8,exposure:1},golden:{azimuth:70,elevation:16,intensity:3,color:"#ffc58a",ambient:"#8fa6c9",ambientIntensity:.7,shadow:.62,softness:.4,contact:.8,env:.7,exposure:1},night:{azimuth:20,elevation:55,intensity:1.4,color:"#ffd9a8",ambient:"#334866",ambientIntensity:.55,shadow:.5,softness:.55,contact:.85,env:.35,exposure:.85},studio:{azimuth:30,elevation:45,intensity:2.6,color:"#ffffff",ambient:"#ffffff",ambientIntensity:1,shadow:.35,softness:.6,contact:.6,env:1,exposure:1}});Object.freeze({preset:"overcast",...fl.overcast,blur:.5});const F=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,Ra=F(12,12,9),pl=[["noodles","Mì / phở","Noodles",["M3 11h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M9 21h6","M14 3l5 6M17 3l4 5"],"phở bún mì hủ_tiếu noodle noodles ramen soup canh","food"],["rice","Cơm","Rice bowl",["M3 12h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M5 12c0-3 3-5.5 7-5.5s7 2.5 7 5.5","M9 21h6"],"cơm gạo cơm_tấm rice meal bữa_ăn","food"],["coffee","Cà phê","Coffee",["M4 9h12v6a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5Z","M16 11h2a2.5 2.5 0 0 1 0 5h-2","M8 3c-1 1 0 2 0 3M12 3c-1 1 0 2 0 3"],"cà_phê cafe coffee espresso latte quán_cà_phê","food"],["tea","Trà","Tea",["M5 8h12v5a6 6 0 0 1-12 0Z","M3 21h18","M17 9h1.5a2 2 0 0 1 0 4H17"],"trà chè tea trà_chiều","food"],["bubble-tea","Trà sữa","Bubble tea",["M6 7h12l-1.5 14h-9Z","M5 7h14","M12 7l2-5h3","M9.5 17h.01M12 18h.01M14.5 17h.01"],"trà_sữa trân_châu bubble_tea milk_tea đồ_uống","food"],["cake","Bánh kem","Cake",["M4 12h16v8H4Z","M4 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 4 0","M12 12V8","M12 5.5c.8-.8.8-1.8 0-2.5-.8.7-.8 1.7 0 2.5Z"],"bánh_kem bánh_sinh_nhật sinh_nhật cake birthday tiệm_bánh","food"],["pizza","Pizza","Pizza",["M12 21 3 6c6-3 12-3 18 0Z","M4.5 8.5c5-2.2 10-2.2 15 0",F(10,10.5,1),F(14,13,1)],"pizza","food"],["burger","Burger","Burger",["M4 11a8 6 0 0 1 16 0Z","M3 14h18","M4 17h16a2 2 0 0 1-2 3H6a2 2 0 0 1-2-3Z"],"burger hamburger bánh_mì_kẹp đồ_ăn_nhanh fast_food","food"],["fries","Khoai tây chiên","Fries",["M6 10h12l-1.5 11h-9Z","M8 10 7 3M11 10V2M14 10l1-7M17 10l1.5-5"],"khoai_tây_chiên fries snack ăn_vặt","food"],["drumstick","Gà rán","Fried chicken",["M17 4a5 5 0 0 1 0 7l-3.5 3.5a3 3 0 0 1-4-4L13 7a5 5 0 0 1 4-3Z","M10.5 13.5l-5 5",F(4.5,19.5,1.6),F(6.5,20.8,1.2)],"gà gà_rán thịt_gà chicken fried_chicken","food"],["fish","Cá / hải sản","Fish",["M3 12c3-5 9-6 14 0-5 6-11 5-14 0Z","M17 12l4-3v6Z",F(8,11,.6)],"cá hải_sản fish seafood sushi","food"],["steak","Thịt bò","Steak",["M5 8c2-4 10-5 14-1s1 11-6 11-10-6-8-10Z",F(14,10,2),"M7 13c2 1 4 1 6-1M9 16c2 .5 4 0 5-1.5"],"thịt bò bít_tết steak beef thịt_nướng bbq","food"],["egg","Trứng","Egg",["M5 10c0-4 4-6 7-5s6-1 7 3-1 9-7 9-7-3-7-7Z",F(12,12,2.5)],"trứng trứng_ốp egg breakfast bữa_sáng","food"],["bread","Bánh mì","Bread",["M4 11a4 4 0 0 1 2-7h12a4 4 0 0 1 2 7v9H4Z","M9 8v3M13 8v3"],"bánh_mì bread bakery tiệm_bánh","food"],["apple","Trái cây","Fruit",["M12 7c-3-2-8-1-8 5s3 9 5 9c1 0 2-.6 3-.6s2 .6 3 .6c2 0 5-3 5-9s-5-7-8-5Z","M12 7c0-2 1-4 3-4"],"trái_cây hoa_quả táo apple fruit healthy lành_mạnh","food"],["carrot","Rau củ","Vegetables",["M14 7c-3 1-9 7-11 14 7-2 13-8 14-11a2.5 2.5 0 0 0-3-3Z","M15.5 7.5l3.5-4M16.5 8.5l4.5-1.5M15 6.5l.5-4.5","M8 13l2 1.5M6 16.5l2 1.5"],"rau rau_củ cà_rốt vegetable vegetables organic","food"],["chili","Cay","Spicy",["M18 5c-1 7-6 14-14 15 4-3 7-7 9-13","M13 7c1-2 3-3 5-2","M18 5c0-1 1-2 2-2"],"cay ớt spicy chili hot","food"],["wine","Rượu vang","Wine",["M7 3h10l-.5 5a4.5 4.5 0 0 1-9 0Z","M12 13v8M8 21h8"],"rượu rượu_vang vang wine bar nhà_hàng","food"],["beer","Bia","Beer",["M5 8h10v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1Z","M15 11h2a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-2","M5 8a2.5 2.5 0 0 1 3-3 3 3 0 0 1 5 0 2.5 2.5 0 0 1 2 3","M9 12v5M11.5 12v5"],"bia beer nhậu quán_nhậu","food"],["cocktail","Cocktail","Cocktail",["M4 4h16l-8 9Z","M12 13v7M8 20h8","M17 4l2-2"],"cocktail mocktail đồ_uống drink pha_chế","food"],["ice-cream","Kem","Ice cream",["M7 10a5 5 0 0 1 10 0Z","M7 10l5 12 5-12"],"kem ice_cream tráng_miệng dessert","food"],["donut","Bánh ngọt","Donut",[Ra,F(12,12,3),"M7 8h.01M16 7h.01M8 16h.01M17 15h.01"],"bánh_ngọt donut bánh_vòng snack","food"],["chef","Đầu bếp","Chef",["M7 14a4 4 0 0 1-1-7.8A5 5 0 0 1 12 3a5 5 0 0 1 6 3.2A4 4 0 0 1 17 14Z","M7 14v6h10v-6","M7 17h10"],"đầu_bếp bếp nấu_ăn chef cook công_thức recipe","food"],["cutlery","Nhà hàng","Restaurant",["M7 3v8M5 3v5a2 2 0 0 0 4 0V3","M7 11v10","M17 3c-2 2-2 6 0 8v10"],"nhà_hàng quán_ăn ăn ăn_uống restaurant dining thực_đơn menu","food"],["pot","Nồi","Pot",["M4 10h16v7a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3Z","M2 10h20","M9 7h6","M10 4c-.8.8 0 1.6 0 2.4M14 4c-.8.8 0 1.6 0 2.4"],"nồi lẩu nấu hầm hot_pot","food"],["pan","Chảo","Pan",[F(9,13,6),"M15 13h7"],"chảo xào chiên rán pan fry","food"],["store","Cửa hàng","Shop",["M3 9 5 3h14l2 6","M3 9a3 3 0 0 0 6 0 3 3 0 0 0 6 0 3 3 0 0 0 6 0","M5 12v9h14v-9","M10 21v-5h4v5"],"cửa_hàng shop store tiệm kinh_doanh bán_hàng","food"],["receipt","Hoá đơn","Receipt",["M6 2h12v20l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5-2 1.5Z","M9 7h6M9 11h6M9 15h3"],"hoá_đơn bill receipt thanh_toán đơn_hàng","food"],["scooter","Xe máy giao hàng","Scooter",[F(6,17,2.5),F(18,17,2.5),"M8.5 17h7","M15.5 17 13 9h-3","M13 9l3-4h3","M3 12h7"],"xe_máy shipper giao_đồ_ăn grab xe_ôm scooter motorbike","food"],["pulse","Nhịp tim","Heartbeat",["M2 12h4l2-5 4 10 2-5h8"],"nhịp_tim tim_mạch heartbeat pulse sức_khoẻ health","care"],["stethoscope","Khám bệnh","Doctor",["M6 3v6a4 4 0 0 0 8 0V3","M10 13v3a5 5 0 0 0 10 0v-2",F(20,12,2)],"bác_sĩ khám khám_bệnh phòng_khám doctor clinic y_tế","care"],["pill","Thuốc","Medicine",["M4.6 12.9 12.9 4.6a4.6 4.6 0 0 1 6.5 6.5l-8.3 8.3a4.6 4.6 0 0 1-6.5-6.5Z","M8.8 8.8l6.4 6.4"],"thuốc viên_uống thực_phẩm_chức_năng medicine pill vitamin","care"],["syringe","Tiêm","Injection",["M15 4l5 5-10 10-5-5Z","M18 2l4 4","M5 19l-2 2","M8 11l2 2M11 8l2 2"],"tiêm vắc_xin filler botox injection vaccine","care"],["medical","Y tế","Medical",["M9 3h6v6h6v6h-6v6H9v-6H3V9h6Z"],"y_tế bệnh_viện cấp_cứu medical hospital","care"],["tooth","Răng","Teeth",["M7 3c-3 0-4 3-3.5 6S5 15 6 19c.5 2 2 2 2.5 0l1-4c.4-1.5 2.6-1.5 3 0l1 4c.5 2 2 2 2.5 0 1-4 2-7 2.5-10S20 3 17 3c-2 0-3 1-5 1S9 3 7 3Z"],"răng nha_khoa niềng_răng tẩy_trắng dental teeth","care"],["brain","Trí não","Brain",["M12 5a3 3 0 0 0-5.5-1.5A3.5 3.5 0 0 0 4 9a3.5 3.5 0 0 0 1 6.5A3.5 3.5 0 0 0 9 20a3 3 0 0 0 3-1.5Z","M12 5a3 3 0 0 1 5.5-1.5A3.5 3.5 0 0 1 20 9a3.5 3.5 0 0 1-1 6.5A3.5 3.5 0 0 1 15 20a3 3 0 0 1-3-1.5Z","M12 5v13.5"],"não trí_não tư_duy tâm_lý trí_nhớ brain mind psychology","care"],["dna","Gen / DNA","DNA",["M7 2c0 7 10 7 10 14 0 3-1 5-1 6","M17 2c0 7-10 7-10 14 0 3 1 5 1 6","M9 6h6M8 11h8M8.5 18h7"],"dna gen di_truyền khoa_học tế_bào science","care"],["thermometer","Nhiệt độ","Temperature",["M10 14V5a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0Z","M12 14V9"],"sốt nhiệt_độ nhiệt_kế temperature fever","care"],["bandage","Băng dán","Bandage",["M4.5 14.5 14.5 4.5a3.5 3.5 0 0 1 5 5l-10 10a3.5 3.5 0 0 1-5-5Z","M10 10h.01M14 10h.01M10 14h.01M14 14h.01"],"vết_thương băng_dán sơ_cứu bandage","care"],["first-aid","Sơ cứu","First aid",["M3 7h18v13H3Z","M8 7V4h8v3","M12 10v7M8.5 13.5h7"],"sơ_cứu hộp_thuốc bảo_hiểm first_aid insurance","care"],["dumbbell","Tập gym","Workout",["M2 12h20","M5 8v8M8 6v12M16 6v12M19 8v8"],"gym tập tập_luyện tạ thể_hình workout fitness cơ_bắp","care"],["running","Chạy bộ","Running",[F(15,4,2),"M8 21l3-5 3 2v4","M11 16l1-6 3 2 3 1","M12 10l-4 1-2 3"],"chạy chạy_bộ cardio running marathon vận_động","care"],["yoga","Yoga / thiền","Yoga",[F(12,4.5,2),"M12 7.5V13","M12 9.5l-4 3.5 1.5 1.5M12 9.5l4 3.5-1.5 1.5","M5 18.5c2-2 4.5-2.5 7-2.5s5 .5 7 2.5c-2 1-4.5 1.5-7 1.5s-5-.5-7-1.5Z"],"yoga thiền meditation thư_giãn cân_bằng","care"],["bicycle","Đạp xe","Cycling",[F(5.5,16,3.5),F(18.5,16,3.5),"M5.5 16l4-7h6l3 7","M9.5 9 12 16H5.5","M14 6h2l-.5 3"],"xe_đạp đạp_xe cycling bike","care"],["stopwatch","Bấm giờ","Stopwatch",[F(12,14,7),"M12 14v-4","M10 3h4","M12 3v4","M18 7l1.5-1.5"],"bấm_giờ đồng_hồ_bấm_giờ phút giây timer stopwatch interval","care"],["scale","Cân nặng","Weight",["M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z","M8 10a4 4 0 0 1 8 0Z","M12 10l1.5-2.5"],"cân cân_nặng giảm_cân kg béo weight scale","care"],["drop","Nước","Water",["M12 3c3 4.5 6 8 6 11a6 6 0 0 1-12 0c0-3 3-6.5 6-11Z","M9.5 15a2.5 2.5 0 0 0 2.5 2.5"],"nước uống_nước cấp_nước cấp_ẩm water hydration giọt","care"],["lotion","Mỹ phẩm","Skincare",["M9 3h6v3H9Z","M8 6h8l1 3v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9Z","M10 13h4"],"mỹ_phẩm kem serum dưỡng_da skincare chăm_sóc_da sữa_rửa_mặt","care"],["lipstick","Son môi","Lipstick",["M9 11h6v10H9Z","M10 11V6l4-3v8","M9 15h6"],"son son_môi trang_điểm makeup lipstick","care"],["mirror","Gương","Mirror",[F(12,9,6),"M12 15v6M8 21h8"],"gương làm_đẹp beauty ngoại_hình","care"],["scissors","Cắt tóc","Haircut",[F(6,6,3),F(6,18,3),"M8.2 8.2 20 18M8.2 15.8 20 6"],"cắt cắt_tóc salon tóc barber haircut","care"],["comb","Chải tóc","Comb",["M3 9h18v4H3Z","M5 13v6M8 13v6M11 13v6M14 13v6M17 13v6"],"lược chải_tóc tóc hair","care"],["lotus","Spa","Spa",["M12 20c-5 0-9-3-9-7 3 0 6 1 9 4 3-3 6-4 9-4 0 4-4 7-9 7Z","M12 17c-2-3-2-7 0-11 2 4 2 8 0 11Z"],"spa massage thư_giãn liệu_trình wellness sen","care"],["moon","Giấc ngủ","Sleep",["M20 14a8 8 0 1 1-10-10 6.5 6.5 0 0 0 10 10Z","M16 3h3l-3 3h3"],"ngủ giấc_ngủ mất_ngủ ban_đêm sleep night","care"],["smile","Vui vẻ","Happy",[Ra,"M8.5 14a4 4 0 0 0 7 0","M9 9.5h.01M15 9.5h.01"],"vui hạnh_phúc hài_lòng cười happy smile","social"],["book","Sách","Book",["M4 4h11a3 3 0 0 1 3 3v14H7a3 3 0 0 1-3-3Z","M4 18a3 3 0 0 1 3-3h11"],"sách tài_liệu ebook book đọc_sách","learn"],["book-open","Bài học","Lesson",["M2 5h7a3 3 0 0 1 3 3v12a2.5 2.5 0 0 0-2.5-2.5H2Z","M22 5h-7a3 3 0 0 0-3 3v12a2.5 2.5 0 0 1 2.5-2.5H22Z"],"bài_học học đọc kiến_thức lesson learn study","learn"],["graduation","Tốt nghiệp","Graduation",["M2 9l10-5 10 5-10 5Z","M6 11v5c3 2.5 9 2.5 12 0v-5","M22 9v6"],"tốt_nghiệp khoá_học đại_học học_viên course graduation education giáo_dục","learn"],["pencil","Viết","Write",["M4 20l1-5L16 4l4 4L9 19Z","M14 6l4 4"],"viết bút ghi_chú bài_tập write note homework","learn"],["ruler","Đo lường","Ruler",["M3 16 16 3l5 5L8 21Z","M7 12l2 2M10 9l2 2M13 6l2 2"],"thước đo kích_thước ruler measure","learn"],["backpack","Học sinh","Student",["M6 8a6 6 0 0 1 12 0v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1Z","M9 4V3h6v1","M8 14h8v4H8Z"],"học_sinh sinh_viên đi_học balo student school","learn"],["school","Trường học","School",["M3 21V10l9-6 9 6v11","M3 21h18","M10 21v-5h4v5",F(12,11,1.8)],"trường trường_học trung_tâm school academy","learn"],["certificate","Chứng chỉ","Certificate",["M4 4h16v12H4Z","M8 8h8M8 11h5",F(16,17,2.5),"M14.5 19 14 22l2-1 2 1-.5-3"],"chứng_chỉ bằng_cấp chứng_nhận certificate diploma","learn"],["robot","AI / robot","AI robot",["M5 8h14v11H5Z","M12 8V5",F(12,3.5,1),"M9 13h.01M15 13h.01","M9.5 16.5h5","M2 12v3M22 12v3"],"ai trí_tuệ_nhân_tạo robot chatbot tự_động automation bot","learn"],["laptop","Máy tính","Laptop",["M5 5h14v10H5Z","M2 19h20l-2-4H4Z"],"laptop máy_tính làm_việc online computer","learn"],["monitor","Màn hình","Screen",["M3 4h18v12H3Z","M8 21h8M12 16v5"],"màn_hình desktop screen dashboard","learn"],["code","Lập trình","Code",["m8 7-5 5 5 5","m16 7 5 5-5 5","m14 4-4 16"],"code lập_trình developer website phần_mềm programming","learn"],["wifi","Internet","Wi-Fi",["M2 9a15 15 0 0 1 20 0","M5 12.5a10 10 0 0 1 14 0","M8.5 16a5 5 0 0 1 7 0","M12 19.5h.01"],"wifi internet mạng kết_nối online","learn"],["server","Dữ liệu","Server",["M4 4h16v6H4Z","M4 14h16v6H4Z","M8 7h.01M8 17h.01"],"máy_chủ server dữ_liệu lưu_trữ hosting database","learn"],["cursor","Click","Click",["M5 3l14 8-6 2-2 6Z","M13 13l5 5"],"click bấm nhấn_vào link chuột cursor","learn"],["gamepad","Game","Game",["M7 7h10a5 5 0 0 1 4.9 6l-.8 4a2.5 2.5 0 0 1-4.3 1.2L14 15h-4l-2.8 3.2A2.5 2.5 0 0 1 2.9 17l-.8-4A5 5 0 0 1 7 7Z","M8 10v4M6 12h4","M15 11h.01M17 13h.01"],"game chơi_game gaming trò_chơi esport","learn"],["headphones","Nghe","Listen",["M4 15v-3a8 8 0 0 1 16 0v3","M4 15h3v6H5a1 1 0 0 1-1-1Z","M20 15h-3v6h2a1 1 0 0 0 1-1Z"],"nghe tai_nghe podcast audio listen","learn"],["mic","Micro","Microphone",["M12 2a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V5a3 3 0 0 1 3-3Z","M5 11a7 7 0 0 0 14 0","M12 18v4"],"micro nói giọng_nói thu_âm voice speak livestream","learn"],["video-cam","Quay video","Recording",["M3 7h12v10H3Z","M15 10l6-3v10l-6-3"],"quay quay_video camera vlog recording","learn"],["link","Liên kết","Link",["M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1","M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"],"link liên_kết kết_nối đường_dẫn connect","learn"],["puzzle","Giải pháp","Puzzle",["M4 7h4a2 2 0 1 1 4 0h4v4a2 2 0 1 1 0 4v4H4v-4a2 2 0 1 0 0-4Z"],"giải_pháp mảnh_ghép tích_hợp puzzle solution integration","learn"],["search","Tìm kiếm","Search",[F(10.5,10.5,6.5),"m15.5 15.5 5 5"],"tìm tìm_kiếm search google nghiên_cứu research","learn"],["gear","Cài đặt","Settings",[F(12,12,3),F(12,12,7),"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1"],"cài_đặt thiết_lập quy_trình vận_hành settings process setup","learn"],["calculator","Tính toán","Calculator",["M5 3h14v18H5Z","M8 6h8v3H8Z","M8 13h.01M12 13h.01M16 13h.01M8 17h.01M12 17h.01M16 17h.01"],"tính tính_toán máy_tính_tiền kế_toán calculator accounting","learn"],["translate","Ngôn ngữ","Language",["M3 5h10M8 3v2","M5 5c1 4 4 7 7 8","M11 5c-1 4-4 7-7 8","M13 21l4-9 4 9","M14.5 18h5"],"ngôn_ngữ tiếng_anh dịch ngoại_ngữ language translate english","learn"],["download","Tải về","Download",["M12 3v12","m7 10 5 5 5-5","M4 21h16"],"tải tải_về download cài_app","learn"],["battery","Năng lượng","Battery",["M3 7h15v10H3Z","M21 10v4","M6 10v4M9 10v4"],"pin năng_lượng sạc battery energy","learn"],["door","Cửa","Door",["M6 3h12v18H6Z","M14 12h.01","M3 21h18"],"cửa cửa_ra_vào door entrance","place"],["bed","Phòng ngủ","Bedroom",["M3 18V6","M3 13h18v5","M21 18v-5a3 3 0 0 0-3-3h-8v3",F(6.5,10.5,1.5)],"phòng_ngủ giường khách_sạn homestay bedroom hotel","place"],["sofa","Phòng khách","Living room",["M5 11V8a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v3","M3 11a2 2 0 0 1 2 2v2h14v-2a2 2 0 1 1 4 0v5H1v-5a2 2 0 0 1 2-2Z","M5 20v1M19 20v1"],"phòng_khách sofa nội_thất living_room furniture","place"],["bath","Phòng tắm","Bathroom",["M3 12h18v3a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5Z","M6 12V5a2 2 0 0 1 4 0","M7 20l-1 2M17 20l1 2"],"phòng_tắm bồn_tắm wc toilet bathroom","place"],["area","Diện tích","Floor area",["M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5","M4 4l6 6M20 4l-6 6M20 20l-6-6M4 20l6-6"],"diện_tích m2 mét_vuông rộng area size","place"],["plane","Máy bay","Flight",["M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5Z"],"máy_bay bay chuyến_bay vé_máy_bay du_lịch flight travel","place"],["suitcase","Hành lý","Luggage",["M4 7h16v13H4Z","M9 7V4h6v3","M9 7v13M15 7v13"],"vali hành_lý đi_du_lịch luggage trip","place"],["ticket","Vé","Ticket",["M3 7h18v3a2 2 0 0 0 0 4v3H3v-3a2 2 0 0 0 0-4Z","M14 7v2M14 11v2M14 15v2"],"vé voucher sự_kiện ticket event","place"],["map","Bản đồ","Map",["M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3Z","M9 3v15M15 6v15"],"bản_đồ lộ_trình hành_trình map route","place"],["mountain","Núi","Mountain",["M2 20 9 8l4 6 3-4 6 10Z","M7.5 10.5 9 12l1.5-1.5"],"núi leo_núi trekking phượt mountain","place"],["umbrella","Biển","Beach",["M3 11a9 9 0 0 1 18 0Z","M12 11v10","M12 2v2"],"biển bãi_biển nghỉ_dưỡng resort beach ô_dù","place"],["palm","Nhiệt đới","Tropical",["M12 21c0-5 .5-9 1-12","M13 9c-2-3-6-4-9-2 3 0 5 1 6 3","M13 9c1-3 4-5 8-4-3 1-5 3-5 5","M13 9c-1-2-1-5 1-7 1 2 1 5-1 7","M7 21h12"],"dừa nhiệt_đới đảo kỳ_nghỉ tropical island vacation","place"],["sun","Nắng","Sunny",[F(12,12,4),"M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"],"nắng mặt_trời mùa_hè thời_tiết sunny summer weather","place"],["rain","Mưa","Rain",["M7 14a4 4 0 0 1 .5-8A6 6 0 0 1 18.5 8a3.5 3.5 0 0 1-.5 6Z","M8 17l-1 3M12 17l-1 3M16 17l-1 3"],"mưa mùa_mưa bão rain storm","place"],["pool","Hồ bơi","Pool",["M8 12V4M16 12V4M8 6h8M8 10h8","M2 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0","M2 19c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0"],"hồ_bơi bể_bơi bơi pool swimming tiện_ích","place"],["tent","Cắm trại","Camping",["M12 3 2 21h20Z","M9 21l3-6 3 6"],"cắm_trại camping glamping dã_ngoại","place"],["tree","Cây xanh","Greenery",["M12 22v-6","M12 2l6 8h-3l4 6H5l4-6H6Z"],"cây cây_xanh công_viên thiên_nhiên tree park green","place"],["train","Tàu","Train",["M6 3h12a2 2 0 0 1 2 2v10a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V5a2 2 0 0 1 2-2Z","M4 10h16","M8 14h.01M16 14h.01","M8 18l-2 3M16 18l2 3"],"tàu tàu_hoả metro tàu_điện train","place"],["bus","Xe buýt","Bus",["M5 3h14a1 1 0 0 1 1 1v13H4V4a1 1 0 0 1 1-1Z","M4 10h16","M7 14h.01M17 14h.01","M6 17v3M18 17v3"],"xe_buýt xe_khách bus tour","place"],["car","Ô tô","Car",["M3 13l2-5a2 2 0 0 1 2-1h10a2 2 0 0 1 2 1l2 5v5H3Z","M3 13h18",F(7.5,16,1),F(16.5,16,1),"M5 18v2M19 18v2"],"ô_tô xe_hơi xe car vehicle lái_xe","place"],["fuel","Xăng","Fuel",["M4 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M3 21h12","M7 7h4v4H7Z","M14 9h2a2 2 0 0 1 2 2v6a1.5 1.5 0 0 0 3 0V8l-3-3"],"xăng nhiên_liệu đổ_xăng tiết_kiệm_xăng fuel gas","place"],["ev-charge","Xe điện","EV charging",["M5 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M4 21h12","M10 7l-2 4h4l-2 4","M15 10h2a2 2 0 0 1 2 2v4a1.5 1.5 0 0 0 3 0V9"],"xe_điện sạc_xe trạm_sạc vinfast ev electric","place"],["road","Đường đi","Road",["M8 3 4 21M16 3l4 18","M12 4v2M12 10v3M12 17v3"],"con_đường đường_đi đường_phố đường_cao_tốc cao_tốc hành_trình road highway street","place"],["parking","Đỗ xe","Parking",["M4 4h16v16H4Z","M9 17V7h4a3 3 0 0 1 0 6H9"],"đỗ_xe bãi_xe hầm_xe parking","place"],["steering","Lái xe","Driving",[Ra,F(12,12,2),"M3.5 10h6.5M14 10h6.5M12 14v7"],"lái lái_xe vô_lăng học_lái driving","place"],["speedometer","Tốc độ","Speed",["M4 18a9 9 0 1 1 16 0","M12 14l4-5","M12 14h.01"],"tốc_độ km/h vận_tốc speed performance hiệu_suất","place"],["traffic-light","Giao thông","Traffic",["M8 2h8v20H8Z",F(12,6.5,1.6),F(12,12,1.6),F(12,17.5,1.6)],"giao_thông đèn_đỏ kẹt_xe traffic","place"],["ship","Tàu thuỷ","Ship",["M3 15h18l-3 5H6Z","M5 15V9h14v6","M9 9V5h6v4","M12 2v3"],"tàu_thuỷ du_thuyền cảng xuất_khẩu logistics ship cruise","place"],["megaphone","Thông báo","Announcement",["M3 10v4h4l9 5V5l-9 5Z","M7 14l1.5 6H11l-1-5","M19 9a4 4 0 0 1 0 6"],"thông_báo quảng_cáo marketing loa announce ads","social"],["bell","Chuông","Notification",["M6 16v-5a6 6 0 0 1 12 0v5l2 2H4Z","M10 21h4"],"chuông thông_báo nhắc subscribe đăng_ký_kênh notification","social"],["hashtag","Hashtag","Hashtag",["M5 9h14M5 15h14M10 3 8 21M16 3l-2 18"],"hashtag xu_hướng tag trending","social"],["at","Tài khoản","Mention",[F(12,12,4),"M16 8v5a2.5 2.5 0 0 0 5 0v-1a9 9 0 1 0-3.5 7.1"],"tài_khoản tag nhắc_tên username mention","social"],["user-plus","Theo dõi","Follow",[F(9,8,4),"M2 21a7 7 0 0 1 14 0","M19 8v6M16 11h6"],"follow theo_dõi kết_bạn follower người_theo_dõi","social"],["live","Livestream","Live",[F(12,12,2),"M7.8 7.8a6 6 0 0 0 0 8.4M16.2 7.8a6 6 0 0 1 0 8.4","M4.9 4.9a10 10 0 0 0 0 14.2M19.1 4.9a10 10 0 0 1 0 14.2"],"live livestream phát_sóng trực_tiếp broadcast","social"],["share","Chia sẻ","Share",[F(6,12,2.5),F(18,6,2.5),F(18,18,2.5),"M8.2 10.8l7.6-3.6M8.2 13.2l7.6 3.6"],"chia_sẻ share lan_toả viral","social"],["sad","Buồn","Sad",[Ra,"M8.5 16a4 4 0 0 1 7 0","M9 9.5h.01M15 9.5h.01"],"buồn thất_vọng chán sad upset","social"],["wow","Bất ngờ","Surprise",[Ra,F(12,15.5,1.8),"M9 9.5h.01M15 9.5h.01"],"bất_ngờ ngạc_nhiên wow sốc shock","social"],["crown","Đẳng cấp","Premium",["M3 8l4.5 4L12 5l4.5 7L21 8l-2 11H5Z","M5 19h14"],"vương_miện đẳng_cấp vip cao_cấp king queen","money"],["medal","Huy chương","Medal",[F(12,15,5),"M8.5 11 5 3h4l3 6 3-6h4l-3.5 8","M12 13v4"],"huy_chương giải thành_tích medal achievement","money"],["flag","Cột mốc","Milestone",["M5 21V4","M5 4h12l-2 4 2 4H5"],"cột_mốc mục_tiêu về_đích bắt_đầu milestone flag","money"],["handshake","Hợp tác","Partnership",["M2 11l4-4 4 2 3-2 4 1 5 4","M7 12l4 4a1.5 1.5 0 0 0 2-2","M10 14l2 2a1.5 1.5 0 0 0 2-2l-3-3","M13 13l1.5 1.5a1.5 1.5 0 0 0 2-2L13 9"],"hợp_tác đối_tác thoả_thuận deal partner partnership","money"],["briefcase","Công việc","Work",["M3 7h18v13H3Z","M8 7V4h8v3","M3 13h18"],"công_việc việc_làm tuyển_dụng doanh_nghiệp job business office","money"],["wallet","Ví tiền","Wallet",["M3 6a2 2 0 0 1 2-2h12v4","M3 6v12a2 2 0 0 0 2 2h16V8H5a2 2 0 0 1-2-2Z","M16 14h.01"],"ví ví_tiền chi_tiêu ví_điện_tử wallet spending","money"],["card","Thẻ","Card",["M2 5h20v14H2Z","M2 10h20","M6 15h4"],"thẻ thẻ_tín_dụng thanh_toán quẹt_thẻ card payment","money"],["bank","Ngân hàng","Bank",["M3 10 12 4l9 6","M4 10h16","M6 10v8M10 10v8M14 10v8M18 10v8","M3 21h18"],"ngân_hàng vay lãi_suất bank loan","money"],["piggy","Heo đất","Piggy bank",["M5 11a7 6 0 0 1 12-3h2l1 3h1v4h-2l-1 3h-3v2h-3v-2H9v2H6v-3a6 6 0 0 1-1-6Z","M14 9h.01","M9 7h4"],"heo_đất để_dành tích_luỹ piggy saving","money"],["document","Tài liệu","Document",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 13h7M9 17h5"],"tài_liệu hồ_sơ giấy_tờ báo_cáo document file","money"],["contract","Hợp đồng","Contract",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 17c1-2 2 1 3-1s2 1 3 0"],"hợp_đồng ký ký_kết pháp_lý contract sign legal","money"],["folder","Thư mục","Folder",["M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v11H3Z"],"thư_mục lưu_trữ folder","money"],["clipboard","Danh sách","Checklist",["M8 4H6v17h12V4h-2","M9 3h6v3H9Z","m9 13 2 2 4-4"],"checklist danh_sách việc_cần_làm todo kế_hoạch plan","money"],["pie","Tỷ trọng","Pie chart",["M21 12a9 9 0 1 1-9-9v9Z","M15 3a9 9 0 0 1 6 6h-6Z"],"tỷ_trọng thị_phần cơ_cấu pie market_share","money"],["funnel","Phễu","Funnel",["M3 4h18l-7 9v6l-4 2v-8Z"],"phễu lọc chuyển_đổi khách_hàng_tiềm_năng funnel filter conversion","money"],["magnet","Thu hút","Attract",["M5 4v8a7 7 0 0 0 14 0V4h-5v8a2 2 0 0 1-4 0V4Z","M5 8h5M14 8h5"],"thu_hút hút_khách nam_châm attract magnet lead","money"],["hourglass","Chờ đợi","Waiting",["M6 3h12M6 21h12","M7 3c0 5 10 5 10 9s-10 4-10 9","M17 3c0 5-10 5-10 9s10 4 10 9"],"chờ chờ_đợi hạn sắp_hết thời_hạn countdown deadline","money"],["infinity","Không giới hạn","Unlimited",["M12 12c-2-2.7-4-4-6-4a4 4 0 0 0 0 8c2 0 4-1.3 6-4Zm0 0c2 2.7 4 4 6 4a4 4 0 0 0 0-8c-2 0-4 1.3-6 4Z"],"không_giới_hạn mãi_mãi vô_hạn unlimited forever","money"],["refresh","Lặp lại","Repeat",["M21 12a9 9 0 0 1-15.5 6.3L3 16","M3 12a9 9 0 0 1 15.5-6.3L21 8","M3 21v-5h5M21 3v5h-5"],"lặp_lại đổi_trả hoàn_tiền cập_nhật refund repeat update","money"],["paw","Thú cưng","Pets",[F(7,9,1.8),F(17,9,1.8),F(10,5,1.6),F(14,5,1.6),"M12 12c-3 0-5 3-5 5.5 0 2 1.5 2.5 3 2 1-.3 1.5-.5 2-.5s1 .2 2 .5c1.5.5 3 0 3-2 0-2.5-2-5.5-5-5.5Z"],"thú_cưng chó mèo pet dog cat","social"]],Dt=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,oa=Dt(12,12,9),dl={money:"Tiền",coins:"Tiết kiệm",percent:"Phần trăm",growth:"Tăng trưởng",decline:"Giảm",chart:"Biểu đồ",target:"Mục tiêu",clock:"Thời gian",calendar:"Lịch",user:"Cá nhân",users:"Đội nhóm",cart:"Giỏ hàng",bag:"Sản phẩm",gift:"Quà tặng",tag:"Giảm giá",rocket:"Ra mắt",bulb:"Ý tưởng",bolt:"Nhanh",star:"Ngôi sao",heart:"Trái tim",shield:"Uy tín",lock:"Riêng tư",key:"Bí quyết",check:"Hoàn thành",cross:"Sai",warning:"Lưu ý",question:"Câu hỏi",phone:"Điện thoại",chat:"Tin nhắn",mail:"Email",globe:"Toàn cầu",home:"Nhà",location:"Địa điểm",truck:"Giao hàng",fire:"Nổi bật",trophy:"Chiến thắng",sparkle:"Mới",chip:"Công nghệ",play:"Video",camera:"Ảnh",eye:"Lượt xem",like:"Thích",leaf:"Tự nhiên",music:"Âm nhạc"},gl={money:"money",coins:"money",percent:"money",growth:"money",decline:"money",chart:"money",target:"money",tag:"money",cart:"money",bag:"money",gift:"money",trophy:"money",user:"social",users:"social",heart:"social",like:"social",chat:"social",mail:"social",phone:"social",eye:"social",fire:"social",play:"social",camera:"social",music:"social",chip:"learn",bulb:"learn",rocket:"learn",question:"learn",globe:"learn",home:"place",location:"place",truck:"place",leaf:"place"},_=(t,e,c,a)=>[t,{name:dl[t],en:e,d:c,hints:a,group:gl[t]??"general"}],Za=Object.freeze(Object.fromEntries([_("money","Money",["M2.5 6.5h19v11h-19Z",Dt(12,12,2.6),"M6 12h.01M18 12h.01"],"tiền giá triệu tỷ nghìn vnd usd $ money price cash cost chi_phí thu_nhập lương giá_tiền"),_("coins","Savings",["M5 7a7 3 0 1 0 14 0a7 3 0 1 0 -14 0Z","M5 7v5c0 1.7 3.1 3 7 3s7-1.3 7-3V7","M5 12v5c0 1.7 3.1 3 7 3s7-1.3 7-3v-5"],"tiết_kiệm đầu_tư vốn ngân_sách save savings coin invest budget"),_("percent","Percent",["M19 5 5 19",Dt(6.5,6.5,2.5),Dt(17.5,17.5,2.5)],"% phần_trăm tỷ_lệ percent rate"),_("growth","Growth",["M3 17l6-6 4 4 8-8","M15 7h6v6"],"tăng tăng_trưởng doanh_thu lợi_nhuận lãi gấp_đôi gấp growth revenue profit increase scale x2 x3 x10"),_("decline","Decline",["M3 7l6 6 4-4 8 8","M15 17h6v-6"],"giảm thua_lỗ lỗ sụt tụt drop loss decline fall"),_("chart","Chart",["M4.5 20V11M10 20V5M15.5 20v-6M2.5 20h19"],"số_liệu báo_cáo thống_kê dữ_liệu kết_quả data report stats result analytics"),_("target","Target",[oa,Dt(12,12,4.5),Dt(12,12,.6)],"mục_tiêu chính_xác tập_trung target goal aim focus"),_("clock","Time",[oa,"M12 7.5V12l3 2"],"thời_gian phút giờ giây đồng_hồ time minute hour second deadline watch"),_("calendar","Calendar",["M4 5.5h16v15H4Z","M4 10h16M8 3v4M16 3v4"],"ngày lịch tuần tháng năm lịch_hẹn date day week month year schedule"),_("user","Person",[Dt(12,8,4),"M4.5 20.5a7.5 7.5 0 0 1 15 0"],"khách khách_hàng customer user person client founder"),_("users","Team",[Dt(9,8.5,3.5),"M2.5 20a6.5 6.5 0 0 1 13 0","M16 5.2a3.5 3.5 0 0 1 0 6.6","M18 14.3a6.5 6.5 0 0 1 3.5 5.7"],"đội đội_ngũ nhóm cộng_đồng nhân_viên team community people staff"),_("cart","Cart",["M3 4h2.2l2.3 11h10.8l2.2-8H6.3",Dt(10,19.5,1.5),Dt(17,19.5,1.5)],"mua đặt_hàng đơn_hàng giỏ_hàng mua_sắm buy order cart checkout"),_("bag","Product",["M5 8h14l-1 13H6Z","M9 8V6.5a3 3 0 0 1 6 0V8"],"sản_phẩm mặt_hàng túi product item bag"),_("gift","Gift",["M3.5 8.5h17v4h-17Z","M5 12.5v8h14v-8M12 8.5v12","M12 8.5C10.5 4.5 6 4.5 6.5 7c.3 1.5 3.5 1.5 5.5 1.5ZM12 8.5c1.5-4 6-4 5.5-1.5-.3 1.5-3.5 1.5-5.5 1.5Z"],"quà quà_tặng tặng miễn_phí ưu_đãi phần_thưởng free gift bonus"),_("tag","Sale",["M3 12.5V3.5h9l9 9-9 9Z",Dt(7.5,8,.9)],"giảm_giá khuyến_mãi sale discount deal voucher mã_giảm"),_("rocket","Launch",["M12 2.5c3.5 2.5 5 6.5 3.5 12h-7C7 9 8.5 5 12 2.5Z","M8.5 14.5 6 17l1 4 3-2.5M15.5 14.5 18 17l-1 4-3-2.5",Dt(12,9,1.6)],"ra_mắt khởi_nghiệp bứt_phá phóng launch startup boost"),_("bulb","Idea",["M9 18h6M10 21h4","M12 3a6 6 0 0 0-3.8 10.6c.6.5.8 1.3.8 2.4h6c0-1.1.2-1.9.8-2.4A6 6 0 0 0 12 3Z"],"ý_tưởng mẹo bí_kíp sáng_tạo idea tip hack creative insight"),_("bolt","Fast",["M13 2 4.5 13.5H11L10 22l8.5-11.5H12Z"],"nhanh ngay lập_tức năng_lượng tốc_độ fast instant energy power quick speed"),_("star","Star",["m12 3 2.8 5.8 6.2.9-4.5 4.4 1.1 6.2L12 17.4l-5.6 2.9 1.1-6.2L3 9.7l6.2-.9Z"],"đánh_giá chất_lượng tốt_nhất xuất_sắc cao_cấp star review rating best quality premium"),_("heart","Love",["M12 20.5S4 15.9 4 10a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 5.9-8 10.5-8 10.5Z"],"yêu thích tim sức_khoẻ sức_khỏe chăm_sóc love like health care"),_("shield","Trust",["M12 2.5 4 5.5v6c0 5 3.4 8.7 8 10 4.6-1.3 8-5 8-10v-6Z","m8.5 12 2.5 2.5 4.5-5"],"an_toàn bảo_mật bảo_hành uy_tín chính_hãng secure safe trust guarantee warranty"),_("lock","Private",["M5 10.5h14v10H5Z","M8 10.5V7a4 4 0 0 1 8 0v3.5"],"riêng_tư mật_khẩu khoá private lock password privacy"),_("key","Key",[Dt(7.5,15.5,4),"M10.5 12.5 20 3M16.5 6.5 19 9M14 9l2 2"],"chìa_khoá chìa_khóa bí_quyết bí_mật key secret unlock"),_("check","Done",[oa,"m8 12.5 2.8 2.8L16.5 9.5"],"hoàn_thành hiệu_quả chính_xác xong đúng đạt done ok correct works"),_("cross","Wrong",[oa,"m9 9 6 6M15 9l-6 6"],"sai lỗi đừng không_nên tránh sai_lầm mistake wrong error avoid"),_("warning","Warning",["M12 3.5 2.5 20h19Z","M12 10v4.5M12 17.5h.01"],"lưu_ý cảnh_báo chú_ý nguy_hiểm rủi_ro warning risk careful"),_("question","Question",[oa,"M9.5 9.2a2.6 2.6 0 0 1 5 .8c0 1.8-2.5 2.2-2.5 4","M12 17h.01"],"câu_hỏi tại_sao vì_sao thế_nào làm_sao question why how"),_("phone","Phone",["M8.5 2.5h7A1.5 1.5 0 0 1 17 4v16a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 7 20V4a1.5 1.5 0 0 1 1.5-1.5Z","M11 18.5h2"],"điện_thoại ứng_dụng app gọi mobile phone call smartphone"),_("chat","Message",["M4 4.5h16V16H10l-5 4v-4H4Z","M8 10.2h.01M12 10.2h.01M16 10.2h.01"],"tin_nhắn nhắn_tin inbox bình_luận chat message comment dm"),_("mail","Email",["M3 5.5h18v13H3Z","m3 6.5 9 6.5 9-6.5"],"email thư mail newsletter"),_("globe","Global",[oa,"M3 12h18","M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3Z"],"toàn_cầu quốc_tế thế_giới online website web global world international"),_("home","Home",["m3 11 9-8 9 8","M5 9.5V21h14V9.5","M10 21v-6h4v6"],"nhà ngôi_nhà gia_đình home house family"),_("location","Location",["M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z",Dt(12,10,2.5)],"địa_chỉ cửa_hàng chi_nhánh vị_trí bản_đồ location address store map"),_("truck","Delivery",["M2.5 6h11v10h-11Z","M13.5 9.5h4l3 3.5v3h-7",Dt(6.8,18,1.8),Dt(17.3,18,1.8)],"giao_hàng vận_chuyển ship delivery shipping freeship"),_("fire","Hot",["M12 21.5c4 0 7-2.8 7-6.8 0-3.6-2.4-5.8-4-8.7-.7 1.8-1.7 2.8-2.9 3C12.2 6.4 11 4.2 9 2.5c.2 3.8-4 6-4 12.2 0 4 3 6.8 7 6.8Z"],"hot bán_chạy xu_hướng viral trend cháy_hàng"),_("trophy","Winner",["M8 3.5h8v6a4 4 0 0 1-8 0Z","M8 5H4.5v1.5A3.5 3.5 0 0 0 8 10M16 5h3.5v1.5A3.5 3.5 0 0 1 16 10","M12 13.5v4M9 21h6M10 17.5h4V21h-4Z"],"chiến_thắng số_1 top giải_thưởng vô_địch winner trophy award champion"),_("sparkle","New",["m12 2.5 2.2 6.3L20.5 11l-6.3 2.2L12 19.5l-2.2-6.3L3.5 11l6.3-2.2Z","m19 16 .8 2.2L22 19l-2.2.8L19 22l-.8-2.2L16 19l2.2-.8Z"],"mới đặc_biệt thông_minh phép_màu ai new special magic smart"),_("chip","Tech",["M7 7h10v10H7Z","M10 10h4v4h-4Z","M9 3v4M15 3v4M9 17v4M15 17v4M3 9h4M3 15h4M17 9h4M17 15h4"],"công_nghệ phần_mềm máy_tính tech technology software computer"),_("play","Video",[oa,"m10 8.5 5.5 3.5-5.5 3.5Z"],"video clip kênh youtube tiktok play watch"),_("camera","Photo",["M3 7.5h4l1.5-2.5h7L17 7.5h4v12H3Z",Dt(12,13.3,3.5)],"ảnh hình_ảnh chụp máy_ảnh photo camera picture"),_("eye","View",["M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12Z",Dt(12,12,3)],"lượt_xem nhìn view views see"),_("like","Like",["M7 10.5v10H3.5v-10Z","M7 10.5 11 3c1.7 0 2.8 1.3 2.5 3l-.7 3.5H19a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.8 21H7"],"đồng_ý tuyệt_vời like thumbs good great"),_("leaf","Natural",["M5 19c0-8 5-14 15-14 0 10-6 15-14 15","M5 19c3-4 6-7 10-9"],"tự_nhiên thiên_nhiên hữu_cơ organic eco natural green"),_("music","Music",["M9 18V5l11-2v13",Dt(6,18,3),Dt(17,16,3)],"âm_nhạc bài_hát âm_thanh nhạc music song sound audio"),...pl.map(([t,e,c,a,o,s])=>[t,{name:e,en:c,d:a,hints:o,group:s}])].sort((t,e)=>t[0].localeCompare(e[0])))),ul=Object.keys(Za),bl=t=>String(t).normalize("NFC").toLowerCase();ul.flatMap(t=>Za[t].hints.split(" ").map(e=>[bl(e).replace(/_/g," "),t])),new Set("và của là có không được cho một những các này đó để trong với khi thì mà như cũng đã sẽ rất hơn nhiều tôi bạn mình anh chị em ở từ ra vào lên xuống nên nếu vì nhưng hay còn đang lại cái con người gì sao thế vậy rồi nè nha ạ à ơi ai đâu nào bị bởi tại theo về qua sau trước the a an and or of to in on is are was were for with that this it as at by be i you we they he she my your our not but so if do does did have has had will can just very more".split(" "));const en=Object.freeze([["cube","Cube","Hộp 3D xoay","3D cube turn",1,["3d","cube","rotate"]],["inside-cube","InsideCube","Trong lòng hộp","Inside the cube",1,["3d","cube","room"]],["cross-warp","CrossWarp","Kéo giãn chéo","Cross warp",.8,["warp","zoom"]],["cross-zoom","CrossZoom","Zoom nhoè chéo","Cross zoom blur",.8,["zoom","blur","impact"]],["doorway","Doorway","Cửa đôi mở","Doorway",1,["3d","door","open"]],["dreamy","Dreamy","Mộng mơ gợn sóng","Dreamy wave",1,["dream","wave","soft"]],["dreamy-zoom","DreamyZoom","Zoom mộng mơ","Dreamy zoom",1,["dream","zoom","flash"]],["ripple","Ripple","Gợn sóng lan","Spreading ripple",1,["water","wave"]],["water-drop","WaterDrop","Giọt nước","Water drop",1.2,["water","drop","ripple"]],["shockwave","Shockwave","Sóng xung kích kính vỡ","Glass shockwave",1.2,["glass","shatter","impact"]],["kaleidoscope","Kaleidoscope","Kính vạn hoa","Kaleidoscope",1,["kaleidoscope","spin","psychedelic"]],["morph","Morph","Biến hình","Morph",1,["morph","liquid"]],["mosaic","Mosaic","Ghép mảnh xoay","Mosaic pan",1.2,["tiles","pan"]],["hexagonalize","Hexagonalize","Lục giác hoá","Hexagonalize",1,["hexagon","pixel","tech"]],["honeycomb","Honeycomb","Tổ ong","Honeycomb",1.2,["hexagon","tiles","tech"]],["puzzle","Puzzle","Ghép hình rơi","Puzzle pieces",1.4,["puzzle","pieces","fall"]],["shatter","Shatter","Vỡ kính","Shatter",1.2,["glass","break","impact"]],["tile-blast","TileBlast","Ô vuông bung ra","Tile blast",1.2,["tiles","explode","3d"]],["tunnel","Tunnel","Đường hầm","Tunnel",1.2,["tunnel","3d","fly"]],["vortex","Vortex","Lốc xoáy mảnh","Vortex",1.4,["tornado","pieces","wind"]],["warp-speed","WarpSpeed","Tốc độ ánh sáng","Warp speed",1.2,["space","speed","stars"]],["gravity-lens","GravityLens","Thấu kính hấp dẫn","Gravity lens",1.2,["space","black hole","warp"]],["fisheye","Fisheye","Mắt cá phồng","Fisheye bulge",1,["lens","bulge"]],["film-burn","FilmBurn","Cháy phim loé","Film burn flare",1.2,["film","retro","light"]],["film-strip","FilmStrip","Cuộn phim trượt","Film strip slip",1.2,["film","retro","projector"]],["glitch-memories","GlitchMemories","Glitch ký ức","Glitch memories",.8,["glitch","digital"]],["datamosh","StripDatamoshGlitch","Datamosh xé dải","Datamosh strips",1,["glitch","datamosh","digital"]],["vhs-tracking","VhsTracking","Nhiễu băng VHS","VHS tracking",1,["vhs","retro","noise"]],["tv-turn-off","TvTurnOff","Tắt TV cũ","Old TV off",1,["tv","retro"]],["ink-bleed","InkBleed","Mực loang nước","Ink bleed",1.4,["ink","organic","art"]],["watercolor","WatercolorDissolve","Màu nước","Watercolour",1.4,["paint","art","soft"]],["smoke","SmokeDissolve","Khói tràn","Smoke dissolve",1.4,["smoke","organic"]],["paper-tear","PaperTear","Xé giấy đôi","Paper tear",1.2,["paper","tear","collage"]],["crumple","Crumple","Vò giấy","Crumple",1.2,["paper","3d"]],["sphere","Sphere","Cuộn thành cầu","Sphere roll",1.2,["3d","ball"]],["book-flip","BookFlip","Lật trang sách","Book page flip",1.2,["book","page","3d"]],["split-flap","SplitFlap","Bảng lật sân bay","Split-flap board",1.4,["board","flip","retro"]],["disintegrate","Disintegrate","Tan thành bụi","Disintegrate",1.4,["dust","particles"]],["vaporize","Vaporize","Bốc hơi","Vaporize",1.4,["smoke","particles"]],["light-rays","LightRays","Tia sáng toả","Light rays",1.2,["light","glow"]],["prisms","Prisms","Lăng trụ xoay","Prism billboard",1.2,["3d","billboard"]],["reeded-glass","ReededGlass","Kính gân","Reeded glass",1,["glass","refraction"]],["swim","Swim","Hoá cá bơi","Swim away",1.4,["fun","organic"]],["heat-haze","HeatHaze","Hơi nóng","Heat haze",1,["heat","distortion"]]].map(([t,e,c,a,o,s])=>Object.freeze({id:t,file:e,name:c,nameEn:a,duration:o,tags:Object.freeze(s)})));Object.freeze(en.map(t=>t.id));const Ml=t=>`gl-${t}`;Object.freeze(en.map((t,e)=>Object.freeze({id:Ml(t.id),version:1,name:t.name,category:"Shader GPU",duration:t.duration,tags:["gpu","shader",...t.tags],sortOrder:5e3+e*10,gl:{id:t.id}}))),Object.freeze([{id:"whip",n:1,vi:"Quất",en:"Whip",pts:[[0,0],[.25,.08],[.4,.35],[.5,1],[.6,.35],[.75,.08],[1,0]],fx:{blurH:.8,rgbShift:.3}},{id:"whip-out",n:2,vi:"Quất ra",en:"Whip out",pts:[[0,0],[.3,.25],[.45,.7],[.5,1],[.56,.3],[.65,0],[1,0]],fx:{blurH:.9,shake:.3}},{id:"whip-in",n:3,vi:"Quất vào",en:"Whip in",pts:[[0,0],[.35,0],[.44,.3],[.5,1],[.55,.7],[.7,.25],[1,0]],fx:{blurH:.9,zoomBlur:.3}},{id:"slow-fast-slow",n:4,vi:"Chậm – nhanh – chậm",en:"Slow – fast – slow",pts:[[0,0],[.15,-.6],[.32,-.6],[.5,1],[.68,-.6],[.85,-.6],[1,0]],fx:{blurH:.7,flash:.35}},{id:"punch",n:5,vi:"Đấm",en:"Punch",pts:[[0,0],[.4,0],[.46,1],[.54,1],[.6,0],[1,0]],fx:{zoomBlur:.8,flash:.6,shake:.5}},{id:"double-hit",n:6,vi:"Hai nhịp",en:"Double hit",pts:[[0,0],[.18,.55],[.3,.05],[.42,.2],[.5,1],[.6,.2],[.75,0],[1,0]],fx:{blurH:.6,rgbShift:.5,shake:.4}},{id:"bounce",n:7,vi:"Nảy",en:"Bounce",pts:[[0,0],[.3,.15],[.5,1],[.62,-1],[.8,-.6],[1,0]],fx:{blurV:.7,zoomBlur:.3}},{id:"linear-burst",n:8,vi:"Bùng thẳng",en:"Linear burst",pts:[[0,0],[.5,1],[1,0]],fx:{blurH:.6,zoomBlur:.4}},{id:"plateau",n:9,vi:"Giữ tốc",en:"Plateau",pts:[[0,0],[.2,.85],[.5,1],[.8,.85],[1,0]],fx:{blurH:.5,rgbShift:.25}},{id:"stutter",n:10,vi:"Bậc thang",en:"Stutter",pts:[[0,0],[.2,0],[.23,.35],[.33,.35],[.36,.7],[.45,.7],[.48,1],[.52,1],[.55,.5],[.66,.5],[.69,0],[1,0]],fx:{rgbShift:.6,shake:.6}},{id:"drift",n:11,vi:"Trôi rồi vọt",en:"Drift & rush",pts:[[0,0],[.2,-.8],[.38,-.8],[.5,1],[.7,.3],[1,0]],fx:{blurH:.7,blurV:.3}},{id:"snap",n:12,vi:"Bật",en:"Snap",pts:[[0,0],[.25,-1],[.44,-1],[.5,1],[.56,0],[1,0]],fx:{zoomBlur:.6,flash:.5,rgbShift:.3}}]).map(t=>t.id);const cn=Object.freeze([.2126,.7152,.0722]),yl=t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16));function Pa(t){const[e,c,a]=cn;return[[e+(1-e)*t,c-c*t,a-a*t],[e-e*t,c+(1-c)*t,a-a*t],[e-e*t,c-c*t,a+(1-a)*t]]}function wl(t){const e=t*Math.PI/180,c=Math.cos(e),a=Math.sin(e);return[[.213+c*.787-a*.213,.715-c*.715-a*.715,.072-c*.072+a*.928],[.213-c*.213+a*.143,.715+c*.285+a*.14,.072-c*.072-a*.283],[.213-c*.213-a*.787,.715-c*.715+a*.715,.072+c*.928+a*.072]]}const an=(t,e,c)=>[[t,0,0],[0,e,0],[0,0,c]],ml=Object.freeze({"wash-red":"#ff2a1f","wash-magenta":"#e81ccf","wash-yellow":"#ffd21a","wash-lime":"#a3ff00"});function kl(t,e,c=1.2){const a=yl(t);return[0,1,2].map(o=>cn.map((s,i)=>(o===i?1-e:0)+e*c*a[o]/255*s))}const _c=t=>[t,t,t];Object.freeze({hue:t=>({m:wl(t*180)}),vivid:t=>({m:Pa(1+.9*t),c:_c([["s",.15*t]])}),warm:t=>({m:an(1+.08*t,1+.01*t,1-.12*t),c:[[["add",10*t]],[["add",2*t]],[["add",-6*t]]]}),cool:t=>({m:an(1-.08*t,1+.01*t,1+.1*t),c:[[["add",-6*t]],[["add",t]],[["add",10*t]]]}),"teal-orange":t=>({m:Pa(1+.15*t),c:[[["s",.5*t]],[["s",.12*t]],[["s",-.45*t]]]}),fade:t=>({m:Pa(1-.35*t),c:_c([["lift",36*t,255-22*t]])}),contrast:t=>({c:_c([["s",.7*t]])}),bleach:t=>({m:Pa(1-.55*t),c:_c([["s",.55*t]])}),posterize:t=>({c:_c([["post",Math.round(11-9*t)]])}),threshold:t=>({m:Pa(0),c:_c([["add",255*(.5-t)],["post",1]])}),exposure:t=>({c:_c([["lift",0,255*2**(2*t)]])}),...Object.fromEntries(Object.entries(ml).map(([t,e])=>[t,c=>({m:kl(e,c),c:_c([["s",.3*c]])})]))});const Sl=Object.freeze(["split","film","circle","rect","star","heart"]);Object.freeze([...Sl,"text"]),[...Object.keys(Jo)];const vl=Object.freeze({sway:{vi:"Đung đưa",en:"Sway",amount:6,period:3.2,unit:"deg",pivot:"bottom"},swing:{vi:"Lắc con lắc",en:"Swing",amount:9,period:2.4,unit:"deg",pivot:"top"},breathe:{vi:"Thở",en:"Breathe",amount:.025,period:3.6,unit:"ratio",pivot:"bottom"},bob:{vi:"Nhấp nhô",en:"Bob",amount:10,period:2,unit:"box",pivot:"center"},wave:{vi:"Vẫy tay",en:"Wave",amount:22,period:1.1,unit:"deg",pivot:"top"},nod:{vi:"Gật đầu",en:"Nod",amount:4,period:2.6,unit:"deg",pivot:"bottom"},blink:{vi:"Chớp mắt",en:"Blink",amount:.92,period:3.8,unit:"ratio",pivot:"center"},rise:{vi:"Bốc lên (hơi, khói)",en:"Rise (steam, smoke)",amount:150,period:2.6,unit:"box",pivot:"center"},wiggle:{vi:"Rung nhẹ",en:"Wiggle",amount:3,period:.5,unit:"box",pivot:"center"},flicker:{vi:"Nhấp nháy",en:"Flicker",amount:.35,period:.25,unit:"ratio",pivot:"center"},spin:{vi:"Quay tròn",en:"Spin",amount:1,period:6,unit:"turns",pivot:"center"},drift:{vi:"Trôi qua lại",en:"Drift",amount:30,period:8,unit:"box",pivot:"center"}});Object.freeze(Object.keys(vl)),[["red",0],["yellow",60],["green",120],["cyan",180],["blue",240],["magenta",300]].map(t=>t[0]);const Tl=Object.freeze([{id:"cinematic",name:"Điện ảnh",en:"Cinematic",p:{contrast:1.4,sat:1.05,split:{shadow:[-.07,.01,.08],highlight:[.07,.03,-.05]},hues:[{h:25,w:30,sat:1.18},{h:0,w:18,sat:1.3,lum:-.03},{h:200,w:40,sat:.8}],black:.015}},{id:"teal-orange",name:"Teal & Orange",en:"Teal & Orange",p:{contrast:1.25,sat:1.2,split:{shadow:[-.12,.03,.12],highlight:[.12,.04,-.1]},hues:[{h:30,w:35,sat:1.3},{h:120,w:45,sat:.6,shift:60}]}},{id:"warm-film",name:"Phim ấm",en:"Warm film",p:{wb:[1.14,1.02,.8],contrast:1.15,sat:.95,split:{shadow:[.04,.01,-.04],highlight:[.06,.03,-.05]},black:.04,white:.97}},{id:"cool-noir",name:"Lạnh trinh thám",en:"Cool noir",p:{wb:[.82,.97,1.18],contrast:1.35,sat:.45,split:{shadow:[-.04,.01,.08],highlight:[-.02,0,.03]},black:.015}},{id:"print-film",name:"Phim chiếu rạp",en:"Print film",p:{contrast:1.3,sat:1,split:{shadow:[-.05,.02,.05],highlight:[.05,.02,-.04]},hues:[{h:120,w:50,sat:.7},{h:25,w:30,sat:1.15}],black:.03,white:.95}},{id:"bleach-bypass",name:"Bleach bypass",en:"Bleach bypass",p:{sat:.3,contrast:1.6,black:.02,white:.98}},{id:"matte-fade",name:"Matte nhạt",en:"Faded matte",p:{contrast:.85,sat:.7,black:.14,white:.9,split:{shadow:[0,.03,.05],highlight:[.02,.02,0]}}},{id:"vintage-70s",name:"Cổ điển 70s",en:"Vintage 70s",p:{wb:[1.12,1.04,.74],sat:.75,contrast:1.08,split:{shadow:[.02,.06,-.02],highlight:[.07,.04,-.06]},black:.1,white:.92}},{id:"golden-hour",name:"Giờ vàng",en:"Golden hour",p:{wb:[1.16,1.02,.78],contrast:1.1,sat:1.15,hues:[{h:35,w:40,sat:1.3}],split:{shadow:[.02,0,-.02],highlight:[.06,.03,-.05]},white:.98}},{id:"moonlight",name:"Ánh trăng",en:"Moonlight",p:{wb:[.72,.9,1.25],sat:.4,contrast:1.2,split:{shadow:[-.04,0,.1]},white:.9}},{id:"vivid",name:"Quảng cáo rực rỡ",en:"Vivid commercial",p:{contrast:1.25,sat:1.6,hues:[{h:25,w:25,sat:.9}],black:0,white:1}},{id:"pastel",name:"Pastel mềm",en:"Soft pastel",p:{contrast:.78,sat:.7,black:.12,white:1,split:{shadow:[.06,.02,.06],highlight:[.05,.02,.04]}}},{id:"neon",name:"Neon đêm",en:"Neon night",p:{contrast:1.3,sat:1.5,split:{shadow:[-.04,.02,.14],highlight:[.14,-.04,.1]},hues:[{h:300,w:40,sat:1.4},{h:190,w:40,sat:1.4}]}},{id:"desert",name:"Sa mạc",en:"Desert",p:{wb:[1.14,1,.76],contrast:1.25,sat:.95,hues:[{h:35,w:45,sat:1.3},{h:210,w:40,sat:.5}],black:.03}},{id:"forest",name:"Rừng xanh",en:"Forest green",p:{wb:[.92,1.08,.94],contrast:1.15,sat:1,hues:[{h:110,w:45,sat:1.35,shift:-18},{h:25,w:30,sat:1.05}],split:{shadow:[-.03,.06,.03]}}},{id:"bw-classic",name:"Đen trắng cổ điển",en:"Classic B&W",p:{sat:0,contrast:1.15,black:.02,white:.98}},{id:"bw-contrast",name:"Đen trắng tương phản",en:"High-contrast B&W",p:{sat:0,contrast:1.8}},{id:"sepia",name:"Nâu sepia",en:"Sepia",p:{sat:0,contrast:1.08,tint:[1.15,.97,.72],black:.05,white:.94}}]);new Map(Tl.map(t=>[t.id,t]));const Qc=t=>String(Math.round(t*10)/10),ot=(t,e)=>`${Qc(t)} ${Qc(e)}`,Me=t=>t*Math.PI/180,A=(t,e,c)=>`M${ot(t-c,e)}A${Qc(c)} ${Qc(c)} 0 1 0 ${ot(t+c,e)}A${Qc(c)} ${Qc(c)} 0 1 0 ${ot(t-c,e)}Z`,Rt=(t,e,c,a,o)=>{o=Math.min(o,c/2,a/2);const s=`A${Qc(o)} ${Qc(o)} 0 0 1 `;return`M${ot(t+o,e)}L${ot(t+c-o,e)}${s}${ot(t+c,e+o)}L${ot(t+c,e+a-o)}${s}${ot(t+c-o,e+a)}L${ot(t+o,e+a)}${s}${ot(t,e+a-o)}L${ot(t,e+o)}${s}${ot(t+o,e)}Z`},Tt=(...t)=>"M"+t.map(([e,c])=>ot(e,c)).join("L")+"Z",nt=(...t)=>"M"+t.map(([e,c])=>ot(e,c)).join("L"),mo=(t,e,c,a,o=-90)=>Tt(...Array.from({length:a},(s,i)=>[t+c*Math.cos(Me(o+i*360/a)),e+c*Math.sin(Me(o+i*360/a))])),De=(t,e,c,a,o,s=-90)=>Tt(...Array.from({length:o*2},(i,l)=>{const p=Me(s+l*180/o),x=l%2?a:c;return[t+x*Math.cos(p),e+x*Math.sin(p)]})),pc=(t,e,c,a=.16)=>{const o=c*a;return`M${ot(t,e-c)}Q${ot(t+o,e-o)} ${ot(t+c,e)}Q${ot(t+o,e+o)} ${ot(t,e+c)}Q${ot(t-o,e+o)} ${ot(t-c,e)}Q${ot(t-o,e-o)} ${ot(t,e-c)}Z`},on=(t,e,c,a=190,o=34)=>{const s=Me(c+180-o),i=Me(c+180+o);return`M${ot(t+a*Math.cos(s),e+a*Math.sin(s))}L${ot(t,e)}L${ot(t+a*Math.cos(i),e+a*Math.sin(i))}`},Ee=(t,e,c,a,o)=>Tt(...[[-c/2,-a/2],[c/2,-a/2],[c/2,a/2],[-c/2,a/2]].map(([s,i])=>[t+s*Math.cos(Me(o))-i*Math.sin(Me(o)),e+s*Math.sin(Me(o))+i*Math.cos(Me(o))])),xa=(t,e,c,a)=>mo(t,e,c,3,a),ko=(t,e,c,a)=>t.replace(/(-?\d*\.?\d+)[ ,]+(-?\d*\.?\d+)/g,(o,s,i)=>ot(+s*e+c,+i*e+a)),nn="M500 880C140 600 100 330 280 220C400 150 480 220 500 300C520 220 600 150 720 220C900 330 860 600 500 880Z",Zc=(t,e,c)=>ko(nn,c,t-500*c,e-540*c),sn="M500 90C640 90 740 190 740 340L740 500C740 600 800 650 860 700L140 700C200 650 260 600 260 500L260 340C260 190 360 90 500 90Z",ln="M400 780C420 860 580 860 600 780Z",Cl=(t,e,c,a,o,s)=>{const i=[],l=(p,x,f,d)=>{const r=Math.hypot(f-p,d-x),g=(f-p)/r,u=(d-x)/r;for(let v=0;v<r-1;v+=o+s){const b=Math.min(r,v+o);i.push(`M${ot(p+g*v,x+u*v)}L${ot(p+g*b,x+u*b)}`)}};return l(t,e,c,e),l(c,e,c,a),l(c,a,t,a),l(t,a,t,e),i.join("")},H=(t,e,c={})=>({d:t,f:e,...c}),L=(t,e,c,a={})=>({d:t,s:e,w:c,...a}),W=(t,e,c,a,o={})=>({d:t,f:e,s:c,w:a,...o}),R=(t,e,c,a,o,s,i,l)=>({id:t,cat:e,name:c,kw:a,primary:o,secondary:s,p:i,...l?{anim:l}:{}}),rt=(t,e=30,c={})=>L(t,"a",e,{h:"marker",...c}),Al={in:"draw",out:"fade",loop:"none"},Jt=(t,e,c,a)=>R(t,"doodle",e,`${c} vẽ tay hand drawn doodle`,"#e2382f","#1c1c22",a,Al),q="#1c1c22",Rl=(t,e,c,a,o,s)=>Array.from({length:c},(i,l)=>{const p=l*360/c,x=l%2?o:a;return`M${ot(t,e)}L${ot(t+x*Math.cos(Me(p-s)),e+x*Math.sin(Me(p-s)))}L${ot(t+x*Math.cos(Me(p+s)),e+x*Math.sin(Me(p+s)))}Z`}).join(""),Jc=()=>W(A(500,500,430),"a","b",30),rn="M290 600C380 780 620 780 710 600",ha=(t,e,c,a=64)=>[L(t,"b",a+46),L(on(...e,c),"b",a+46),L(t,"a",a),L(on(...e,c),"a",a)],xn=[A(300,420,190),A(500,330,210),A(720,420,200),A(540,520,200),A(340,530,150)].join(""),So="M500 120C260 120 90 260 90 430C90 560 170 660 290 710C290 790 250 850 180 900C300 890 410 840 470 760C480 760 490 760 500 760C740 760 910 620 910 430C910 260 740 120 500 120Z",vo="M180 140L820 140Q900 140 900 220L900 560Q900 640 820 640L440 640L260 840L280 640L180 640Q100 640 100 560L100 220Q100 140 180 140Z",fa=t=>({a:[Ee(180,200,90,40,30),xa(700,140,60,10),A(870,420,28),Ee(300,760,80,34,-40)].join(""),b:[Ee(520,180,70,34,-20),A(120,520,30),xa(820,760,56,70),Ee(640,880,84,32,18)].join(""),y:[A(380,320,30),Ee(900,160,80,34,50),xa(150,780,58,-20),Ee(560,620,74,30,-60)].join(""),r:[xa(400,600,62,30),Ee(780,300,80,34,-30),A(240,420,26),Ee(470,880,70,30,40)].join(""),g:[Ee(260,100,80,34,-10),A(640,400,30),xa(920,620,56,-40),Ee(120,640,70,30,60)].join(""),u:[xa(560,100,56,-70),Ee(720,560,80,32,20),A(380,860,28),Ee(880,900,60,28,-20)].join("")})[t],hn=[R("arrow-bold","arrow","Mũi tên dày","arrow right chỉ hướng bold","#ffd23f",q,[W(Tt([100,380],[560,380],[560,190],[920,500],[560,810],[560,620],[100,620]),"a","b",36)]),R("arrow-curve","arrow","Mũi tên cong","arrow curve chỉ vào","#ff4b55","#ffffff",ha("M150 830C130 480 360 280 800 300",[800,300],3)),R("arrow-down","arrow","Mũi tên xuống","arrow down bấm vào dưới","#ffd23f",q,[W(Tt([380,100],[620,100],[620,480],[820,480],[500,900],[180,480],[380,480]),"a","b",36)]),R("arrow-chevrons","arrow","Chevron xuống","chevron down swipe vuốt","#ffffff",q,[L(nt([200,60],[500,300],[800,60]),"a",90),L(nt([200,360],[500,600],[800,360]),"a",90,{o:.65}),L(nt([200,660],[500,900],[800,660]),"a",90,{o:.35})]),R("arrow-diagonal","arrow","Mũi tên chéo","arrow diagonal up tăng trưởng","#31c76a","#ffffff",ha(nt([160,840],[840,160]),[840,160],-45)),R("arrow-loop","arrow","Mũi tên vòng","arrow loop hand drawn vẽ tay","#ffd23f",q,ha("M120 840C280 880 440 780 440 620C440 480 310 440 280 540C250 640 380 720 520 620C660 520 720 400 830 250",[830,250],-54,56)),R("arrow-zigzag","arrow","Mũi tên zigzag","arrow zigzag răng cưa","#3aa8ff","#ffffff",ha(nt([110,820],[270,420],[430,740],[600,340],[860,260]),[860,260],-17,56)),R("arrow-uturn","arrow","Mũi tên quay đầu","arrow u turn quay lại","#ff4b55","#ffffff",ha("M220 880L220 440C220 270 340 190 500 190C660 190 780 270 780 440L780 700",[780,700],90)),Jt("doodle-circle","Vòng khoanh vẽ tay","khoanh tròn circle highlight",[rt("M330 230C480 140 760 170 850 380C930 570 790 800 540 840C300 880 120 720 140 480C155 320 300 210 470 190C560 180 640 200 700 230")]),Jt("doodle-oval","Khoanh dẹt vẽ tay","khoanh oval ellipse chữ",[rt("M250 340C420 270 760 290 880 420C980 530 830 680 520 700C250 715 70 620 110 480C140 380 300 330 480 320C590 315 680 330 760 360")]),Jt("doodle-underline","Gạch chân vẽ tay","gạch chân underline nhấn",[rt("M90 560C260 530 470 545 650 535C760 528 850 520 920 530",34)]),Jt("doodle-double-underline","Gạch chân đôi vẽ tay","gạch chân đôi double underline",[rt("M90 520C300 495 620 500 910 515",30),rt("M150 600C360 580 640 585 860 598",26)]),Jt("doodle-wavy","Gạch sóng vẽ tay","gạch sóng wavy squiggle",[rt("M80 520C140 460 200 460 250 520C300 580 360 580 410 520C460 460 520 460 570 520C620 580 680 580 730 520C780 460 840 460 920 520",30)]),Jt("doodle-arrow","Mũi tên vẽ tay","mũi tên chỉ arrow pointer",[rt("M150 820C180 600 360 380 760 260",30),rt("M600 230L770 255L690 410",30)]),Jt("doodle-loop-arrow","Mũi tên xoắn vẽ tay","mũi tên xoắn loop arrow",[rt("M120 820C300 860 470 760 450 600C430 470 300 470 300 560C300 660 470 690 600 560C700 460 740 360 820 250",28),rt("M700 250L825 245L800 370",28)]),Jt("doodle-cross","Gạch chéo vẽ tay","gạch bỏ cross out sai",[rt("M170 230C380 420 600 610 850 790",34),rt("M820 210C620 400 400 610 180 800",34)]),Jt("doodle-check","Dấu tích vẽ tay","dấu tích check đúng",[rt("M170 520C260 600 340 680 410 780C520 560 660 360 860 190",38)]),Jt("doodle-star","Ngôi sao vẽ tay","ngôi sao star nổi bật",[rt("M500 130L590 400L870 410L640 570L730 850L500 680L270 850L360 570L130 410L410 400L505 140",26)]),Jt("doodle-sparks","Tia nhấn vẽ tay","tia nhấn emphasis spark",[rt("M500 360L500 140",30),rt("M330 420L190 270",30),rt("M670 420L810 270",30)]),Jt("doodle-hatch","Gạch bóng vẽ tay","gạch bóng hatching shading",[rt("M160 700L330 300",20),rt("M260 740L450 300",20),rt("M370 770L570 310",20),rt("M480 790L690 320",20),rt("M600 800L800 340",20)]),Jt("doodle-dots","Chấm nguệch ngoạc","chấm scribble dots",[rt("M210 520C170 470 230 420 270 460C310 500 250 560 215 525",26),rt("M480 500C440 450 500 400 540 440C580 480 520 540 485 505",26),rt("M750 520C710 470 770 420 810 460C850 500 790 560 755 525",26)]),Jt("doodle-bracket","Ngoặc vẽ tay","ngoặc bracket nhóm",[rt("M330 140C220 150 210 260 220 380C230 460 200 500 150 505C200 512 230 550 220 630C210 760 230 860 340 870",28),rt("M670 140C780 150 790 260 780 380C770 460 800 500 850 505C800 512 770 550 780 630C790 760 770 860 660 870",28)]),Jt("doodle-box","Khung vẽ tay","khung box hộp",[rt("M140 210C380 190 640 195 880 215C870 420 870 620 885 800C640 815 380 812 120 795C130 600 128 400 150 190",28)]),Jt("doodle-heart","Tim vẽ tay","tim heart thích",[rt("M500 840C200 620 120 400 260 260C380 150 480 230 500 330C520 230 620 150 740 260C880 400 800 620 500 840",28)]),R("arrow-refresh","arrow","Mũi tên làm mới","refresh reload lặp lại","#31c76a","#ffffff",ha("M712 247A330 330 0 1 1 288 247",[288,247],-40)),R("badge-star","badge","Huy hiệu sao","badge star ngôi sao best","#ffd23f",q,[W(A(500,500,420),"a","b",34),L(A(500,500,350),"b",14,{o:.5}),H(De(500,500,250,105,5),"w")]),R("badge-burst","badge","Nổ sao","burst starburst sale nổ","#ff4b55",q,[W(De(500,500,470,390,18),"a","b",30),L(A(500,500,300),"w",16,{o:.8})]),R("badge-ribbon","badge","Ruy băng","ribbon banner dải băng","#ff4b55","#a31f2b",[H(Tt([40,380],[220,380],[220,620],[40,620],[120,500]),"b"),H(Tt([960,380],[780,380],[780,620],[960,620],[880,500]),"b"),W(Tt([160,300],[840,300],[840,700],[160,700]),"a","k",30),L(nt([260,440],[740,440]),"w",34,{o:.9}),L(nt([320,560],[680,560]),"w",34,{o:.9})]),R("badge-pill","badge","Nhãn viên thuốc","label pill nhãn tag","#3aa8ff",q,[W(Rt(80,340,840,320,160),"a","b",32),H(A(250,500,70),"w"),L(nt([390,500],[760,500]),"w",50)]),R("badge-shield","badge","Khiên bảo vệ","shield bảo hành guarantee","#3aa8ff",q,[W("M500 90L860 210L860 520C860 720 700 860 500 930C300 860 140 720 140 520L140 210Z","a","b",34),L(nt([320,500],[450,630],[690,380]),"w",70)]),R("badge-medal","badge","Huy chương","medal huy chương giải thưởng","#ffd23f",q,[W(Tt([260,60],[430,60],[620,520],[450,520]),"b","k",14),W(Tt([740,60],[570,60],[380,520],[550,520]),"r","k",14),W(A(500,670,260),"a","b",34),H(De(500,670,150,65,5),"w")]),R("badge-hexagon","badge","Lục giác","hexagon badge huy hiệu","#a56bff",q,[W(mo(500,500,440,6),"a","b",34),L(mo(500,500,340,6),"w",16,{o:.8}),H(De(500,500,150,64,5),"w")]),R("badge-tag","badge","Nhãn mũi tên","label tag nhãn mới new","#31c76a",q,[W(Tt([100,300],[760,300],[900,500],[760,700],[100,700]),"a","b",34),H(A(250,500,60),"w"),L(nt([380,500],[700,500]),"w",50)]),R("icon-check","icon","Tích tròn","check đúng ok done","#31c76a",q,[W(A(500,500,420),"a","b",34),L(nt([270,520],[440,690],[740,330]),"w",100)]),R("icon-cross","icon","X tròn","cross sai wrong close","#ff4b55",q,[W(A(500,500,420),"a","b",34),L("M330 330L670 670M670 330L330 670","w",100)]),R("icon-bulb","icon","Bóng đèn","lightbulb ý tưởng idea tip","#ffd23f",q,[W("M500 100C320 100 220 230 220 380C220 500 300 560 340 640L340 700L660 700L660 640C700 560 780 500 780 380C780 230 680 100 500 100Z","a","b",34),L("M360 790L640 790M410 870L590 870","b",54),L("M420 560L420 420L500 500L580 420L580 560","w",34,{o:.8})]),R("icon-pin","icon","Ghim vị trí","pin location địa điểm map","#ff4b55",q,[W("M500 90C300 90 200 240 200 400C200 600 420 800 500 920C580 800 800 600 800 400C800 240 700 90 500 90Z","a","b",34),H(A(500,400,115),"w")]),R("icon-clock","icon","Đồng hồ giờ","clock time giờ thời gian","#3aa8ff",q,[W(A(500,500,420),"w","b",40),L("M500 500L500 250M500 500L690 590","a",58),H(A(500,500,40),"b"),L("M500 120L500 160M500 840L500 880M120 500L160 500M840 500L880 500","b",30)]),R("icon-bolt","icon","Tia chớp","bolt lightning nhanh flash","#ffd23f",q,[W(Tt([590,60],[220,560],[470,560],[400,940],[790,400],[530,400]),"a","b",36)]),R("icon-flame","icon","Ngọn lửa","fire flame hot lửa","#ff7a1a",q,[W("M500 60C560 220 760 320 760 580C760 780 650 920 500 920C350 920 240 780 240 600C240 480 300 400 360 340C370 420 420 460 450 440C400 320 430 180 500 60Z","a","b",34),H("M500 520C560 600 620 660 620 740C620 820 570 880 500 880C430 880 380 820 380 740C380 660 450 600 500 520Z","y")]),R("icon-crown","icon","Vương miện","crown vip king","#ffd23f",q,[W(Tt([120,760],[80,300],[330,520],[500,200],[670,520],[920,300],[880,760]),"a","b",34),H(A(80,290,50)+A(500,190,50)+A(920,290,50),"a"),L(nt([200,660],[800,660]),"b",30,{o:.6})]),R("icon-search","icon","Kính lúp","magnifier search tìm kiếm zoom","#3aa8ff",q,[L(nt([620,620],[880,880]),"b",150),L(nt([620,620],[880,880]),"a",100),W(A(420,420,270),"w","b",70)]),R("icon-gift","icon","Hộp quà","gift quà tặng present","#ff4b55",q,[W(Rt(150,430,700,470,30),"a","b",30),W(Rt(100,310,800,150,30),"a","b",30),H(Rt(440,310,120,590,10),"w"),W("M500 310C380 130 210 190 300 310Z","w","b",24),W("M500 310C620 130 790 190 700 310Z","w","b",24)]),R("icon-trophy","icon","Cúp","trophy winner cúp vô địch","#ffd23f",q,[L("M290 190C110 190 110 420 310 440M710 190C890 190 890 420 690 440","b",50),W("M280 100L720 100L700 400C690 540 600 600 500 600C400 600 310 540 300 400Z","a","b",34),W("M440 600L560 600L580 780L420 780Z","a","b",30),W(Rt(300,780,400,110,30),"a","b",30)]),R("icon-exclaim","icon","Dấu chấm than","exclamation chú ý attention","#ff4b55",q,[W(Rt(370,90,260,540,130),"a","b",34),W(A(500,790,100),"a","b",34)]),R("icon-question","icon","Dấu hỏi","question hỏi thắc mắc","#3aa8ff",q,[L("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","b",170),L("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","a",110),W(A(510,840,80),"a","b",30)]),R("icon-target","icon","Mục tiêu","target bullseye đích","#ff4b55",q,[W(A(500,500,430),"w","b",34),H(A(500,500,320),"a"),H(A(500,500,210),"w"),H(A(500,500,100),"a"),L(A(500,500,100),"b",20)]),R("face-smile","emotion","Cười tươi","smile happy vui emoji","#ffcf3a","#3a2a10",[Jc(),H(A(360,410,52)+A(640,410,52),"b"),L(rn,"b",56)]),R("face-laugh","emotion","Cười lớn","laugh haha cười","#ffcf3a","#3a2a10",[Jc(),L("M270 450Q360 340 450 450M550 450Q640 340 730 450","b",52),H("M250 590L750 590C750 780 640 850 500 850C360 850 250 780 250 590Z","b"),H("M380 790C430 720 570 720 620 790C590 830 410 830 380 790Z","r")]),R("face-wink","emotion","Nháy mắt","wink nháy tinh nghịch","#ffcf3a","#3a2a10",[Jc(),H(A(360,410,52),"b"),L("M560 440Q640 360 720 440","b",52),L(rn,"b",56),H(A(250,570,38)+A(750,570,38),"r",{o:.35})]),R("face-sad","emotion","Buồn","sad cry khóc buồn","#ffcf3a","#3a2a10",[Jc(),H(A(360,440,50)+A(640,440,50),"b"),L("M270 360L430 320M730 360L570 320","b",40),L("M310 740C400 620 600 620 690 740","b",56),H("M290 540C250 620 240 670 290 690C340 670 330 620 290 540Z","u")]),R("face-angry","emotion","Giận dữ","angry mad giận","#ff6b4d","#3a1208",[Jc(),L("M250 330L450 430M750 330L550 430","b",62),H(A(380,510,42)+A(620,510,42),"b"),L("M320 750Q500 600 680 750","b",56)]),R("face-surprised","emotion","Ngạc nhiên","surprised wow ngạc nhiên","#ffcf3a","#3a2a10",[Jc(),W(A(360,410,82)+A(640,410,82),"w","b",26),H(A(360,410,34)+A(640,410,34),"b"),L("M260 260Q360 200 450 260M550 260Q640 200 740 260","b",40),H("M425 700A75 100 0 1 0 575 700A75 100 0 1 0 425 700Z","b")]),R("face-cool","emotion","Ngầu","cool sunglasses kính râm ngầu","#ffcf3a","#3a2a10",[Jc(),H(Rt(150,340,320,190,80)+Rt(530,340,320,190,80),"b"),L(nt([470,400],[530,400]),"b",40),L(nt([220,410],[320,410]),"w",26,{o:.5}),L("M310 650C400 770 600 770 690 650","b",52)]),R("face-love","emotion","Mắt trái tim","love heart eyes yêu thích","#ffcf3a","#3a2a10",[Jc(),H(Zc(360,420,.23)+Zc(640,420,.23),"r"),L("M290 630C380 800 620 800 710 630","b",52)]),R("bubble-round","bubble","Bóng thoại tròn","speech bubble hội thoại nói","#ffffff",q,[W(So,"a","b",34)]),R("bubble-rect","bubble","Bóng thoại vuông","speech box bubble chat","#ffffff",q,[W(vo,"a","b",34)]),R("bubble-cloud","bubble","Bóng suy nghĩ","thought cloud nghĩ mây","#ffffff",q,[L(xn,"b",70),H(xn,"a"),W(A(250,810,66),"a","b",30),W(A(130,915,40),"a","b",26)]),R("bubble-shout","bubble","Bóng hét","shout burst hét la","#ffd23f",q,[W(Tt(...Array.from({length:28},(t,e)=>{const c=Me(-90+e*360/28),a=e%2?290:470;return[500+a*Math.cos(c),480+a*Math.sin(c)]})),"a","b",30)]),R("bubble-typing","bubble","Đang nhập","typing dots ba chấm","#ffffff",q,[W(Tt([200,620],[170,800],[350,660]),"a","b",30),W(Rt(100,260,800,400,200),"a","b",34),H(A(340,460,48)+A(500,460,48)+A(660,460,48),"b")]),R("bubble-chat","bubble","Bình luận màu","comment chat message tin nhắn","#3aa8ff",q,[W(vo,"a","b",34),L(nt([240,300],[760,300]),"w",48),L(nt([240,430],[600,430]),"w",48,{o:.8})]),R("bubble-exclaim","bubble","Bóng chú ý","notice attention lưu ý","#ff4b55",q,[W(So,"a","b",34),L(nt([500,270],[500,470]),"w",92),H(A(500,600,52),"w")]),R("bubble-heart","bubble","Bóng yêu thích","love bubble tim","#ffffff",q,[W(So,"a","b",34),H(Zc(500,430,.42),"r")]),R("social-like","social","Thích","like thumbs up ngón cái thích","#3aa8ff",q,[W(Tt([90,440],[290,440],[290,900],[90,900]),"b","k",30),W("M340 460L520 100C600 100 640 160 620 260L600 380L840 380C920 380 960 450 930 520L860 800C840 870 800 900 740 900L340 900Z","a","b",34)]),R("social-heart","social","Tim","heart love yêu thích tim","#ff4b55",q,[W(nn,"a","b",34),L("M250 330C250 280 290 250 340 250","w",36,{o:.7})]),R("social-comment","social","Bình luận","comment bình luận chat","#3aa8ff",q,[W(vo,"a","b",34),H(A(330,390,52)+A(500,390,52)+A(670,390,52),"w")]),R("social-share","social","Chia sẻ","share chia sẻ forward","#31c76a",q,[W("M520 150L920 450L520 750L520 590C300 590 160 680 100 860C130 560 300 380 520 350Z","a","b",34)]),R("social-bell","social","Chuông","bell notification thông báo","#ffd23f",q,[W(sn,"a","b",34),W(ln,"a","b",30)]),R("social-subscribe","social","Nút đăng ký","subscribe follow đăng ký theo dõi","#ff4b55",q,[W(Rt(60,330,880,340,170),"a","b",34),H(ko(sn,.38,230-500*.38,500-470*.38),"w"),H(ko(ln,.38,230-500*.38,500-470*.38),"w"),L(nt([420,450],[820,450]),"w",50),L(nt([420,560],[700,560]),"w",50,{o:.65})]),R("social-save","social","Lưu","save bookmark lưu","#ffd23f",q,[W("M240 100L760 100L760 900L500 720L240 900Z","a","b",34)]),R("social-play","social","Nút phát","play video phát","#ff4b55",q,[W(A(500,500,430),"a","b",34),H(Tt([410,310],[410,690],[740,500]),"w")]),R("social-follow","social","Theo dõi","follow add friend kết bạn","#3aa8ff",q,[W(A(390,300,170),"a","b",30),W("M80 900C80 660 230 570 390 570C550 570 700 660 700 900Z","a","b",30),L("M830 300L830 560M700 430L960 430","b",100),L("M830 300L830 560M700 430L960 430","w",58)]),R("social-views","social","Lượt xem","views eye mắt xem","#3aa8ff",q,[W("M50 500C220 250 780 250 950 500C780 750 220 750 50 500Z","w","b",34),W(A(500,500,170),"a","b",24),H(A(500,500,70),"b"),H(A(540,460,26),"w")]),R("price-tag","price","Thẻ giá","price tag giá nhãn","#ffd23f",q,[W("M110 110L520 110L910 500L500 910L110 520Z","a","b",34),W(A(270,270,62),"w","b",26)]),R("price-percent","price","Huy hiệu %","percent discount giảm giá","#ff4b55",q,[W(A(500,500,430),"a","b",34),L(A(340,340,78),"w",44),L(A(660,660,78),"w",44),L(nt([720,280],[280,720]),"w",56)]),R("price-sale","price","Nổ sale %","sale burst khuyến mãi","#ff4b55",q,[W(De(500,500,480,400,20),"a","b",30),L(A(380,380,60),"w",38),L(A(620,620,60),"w",38),L(nt([670,320],[330,680]),"w",50)]),R("price-coin","price","Đồng xu","coin dollar tiền xu","#ffd23f",q,[W(A(500,500,430),"a","b",34),L(A(500,500,340),"b",16,{o:.5}),L("M630 360C610 290 400 280 390 385C380 490 620 510 610 625C600 730 390 730 370 635","w",64),L(nt([500,230],[500,770]),"w",42)]),R("price-cart","price","Giỏ hàng","cart shop mua hàng","#31c76a",q,[L("M70 140L220 140L330 620L820 620","b",70),W(Tt([270,260],[930,260],[830,580],[360,580]),"a","b",34),W(A(420,790,70),"w","b",30),W(A(740,790,70),"w","b",30)]),R("price-coupon","price","Phiếu giảm giá","coupon voucher mã giảm","#a56bff",q,[W("M70 250L930 250L930 410A100 100 0 0 0 930 590L930 750L70 750L70 590A100 100 0 0 0 70 410Z","a","b",34),L("M650 310L650 360M650 420L650 470M650 530L650 580M650 640L650 690","w",28),L(nt([180,420],[520,420]),"w",50),L(nt([180,540],[440,540]),"w",50,{o:.7})]),R("price-truck","price","Giao hàng","truck delivery freeship vận chuyển","#3aa8ff",q,[W(Tt([60,260],[600,260],[600,720],[60,720]),"a","b",34),W(Tt([600,380],[780,380],[930,540],[930,720],[600,720]),"a","b",34),H(Tt([670,440],[760,440],[850,540],[670,540]),"w"),W(A(250,740,95),"w","b",34),W(A(750,740,95),"w","b",34)]),R("price-star","price","Sao giá","star price best seller bán chạy","#ffd23f",q,[W(De(500,510,480,215,5),"a","b",34),L(De(500,510,330,150,5),"w",16,{o:.6})]),R("frame-corners","frame","Khung ngắm","viewfinder corners góc","#ffffff",q,[L("M120 340L120 120L340 120M660 120L880 120L880 340M880 660L880 880L660 880M340 880L120 880L120 660","a",70)]),R("frame-polaroid","frame","Khung polaroid","polaroid photo ảnh","#ffffff",q,[W("M110 90L890 90L890 910L110 910ZM190 170L810 170L810 700L190 700Z","a","b",30,{eo:!0})]),R("frame-border","frame","Viền bo góc","border rounded viền","#ffd23f",q,[H(Rt(60,60,880,880,120)+Rt(150,150,700,700,60),"a",{eo:!0}),L(Rt(150,150,700,700,60),"b",14)]),R("frame-film","frame","Khung phim","film cinema phim","#ffd23f",q,[H(`M60 160L940 160L940 840L60 840ZM160 300L840 300L840 700L160 700Z${Array.from({length:8},(t,e)=>Rt(100+e*105,200,55,60,10)+Rt(100+e*105,740,55,60,10)).join("")}`,"b",{eo:!0}),L("M60 160L940 160L940 840L60 840Z","a",16)]),R("frame-ticket","frame","Khung vé","ticket vé coupon","#ff4b55",q,[W("M70 160L930 160L930 400A100 100 0 0 0 930 600L930 840L70 840L70 600A100 100 0 0 0 70 400ZM170 260L830 260L830 740L170 740Z","a","b",30,{eo:!0})]),R("frame-circle","frame","Khung tròn","circle ring vòng tròn","#ffffff",q,[W(A(500,500,440)+A(500,500,340),"a","b",20,{eo:!0})]),R("frame-tv","frame","Khung TV","tv television màn hình","#3aa8ff",q,[L(nt([330,60],[500,210],[670,60]),"b",44),W(Rt(70,220,860,680,130)+Rt(160,310,680,500,70),"a","b",30,{eo:!0})]),R("frame-dashed","frame","Khung nét đứt","dashed viền đứt","#ffffff",q,[L(Cl(100,100,900,900,70,50),"a",36)]),R("fx-sparkle","sparkle","Lấp lánh","sparkle twinkle lấp lánh","#fff3a8","#ffffff",[H(A(500,500,260),"a",{o:.4,bl:70}),H(pc(500,500,470,.1),"a"),H(pc(500,500,200,.14),"b")]),R("fx-sparkles","sparkle","Cụm lấp lánh","sparkles cluster nhiều sao","#ffe066","#ffffff",[H(A(400,560,300),"a",{o:.25,bl:80}),H(pc(400,560,340,.12),"a"),H(pc(750,260,190,.14),"a"),H(pc(770,800,120,.16),"b"),H(pc(400,560,120,.16),"b")]),R("fx-shine","sparkle","Tia lấp loáng","shine flare tia sáng","#ffe066","#ffffff",[H(A(500,500,230),"a",{o:.35,bl:70}),H(De(500,500,470,60,8,-90),"a"),H(De(500,500,330,50,8,-67.5),"b",{o:.9}),H(A(500,500,90),"b")]),R("fx-light-leak","sparkle","Rò sáng","light leak ánh sáng loá","#ffb347","#ff5da2",[H(A(330,340,260),"a",{o:.6,bl:100}),H(A(680,640,240),"b",{o:.55,bl:100}),H(A(520,520,150),"w",{o:.45,bl:80})]),R("fx-rays","sparkle","Tia nắng","rays sunburst chói","#ffe066","#ffffff",[H(Rl(500,500,16,480,360,6),"a",{o:.9}),H(A(500,500,130),"a",{o:.5,bl:40}),H(A(500,500,80),"b")]),R("fx-confetti","sparkle","Pháo giấy","confetti party mừng","#ff4b55","#3aa8ff",[H(fa("a"),"a"),H(fa("b"),"b"),H(fa("y"),"y"),H(fa("r"),"r"),H(fa("g"),"g"),H(fa("u"),"u")]),R("fx-glow-ring","sparkle","Vòng sáng","glow ring halo","#7cf0ff","#ffffff",[L(A(500,500,330),"a",90,{o:.55,bl:40}),L(A(500,500,330),"b",20)]),R("fx-lens-flare","sparkle","Chói ống kính","lens flare anamorphic","#ffd08a","#ffffff",[L(nt([40,300],[620,300]),"b",16,{o:.7,bl:6}),H(A(300,300,150),"b",{o:.85,bl:50}),H(A(300,300,70),"b"),H(A(540,540,60),"a",{o:.6,bl:8}),H(A(680,680,110),"a",{o:.4,bl:12}),H(A(820,820,40),"a",{o:.8,bl:4})]),R("fx-twinkle","sparkle","Sao nhấp nháy","twinkle stars sao nhỏ","#ffe066","#ffffff",[H(pc(250,300,150,.16)+pc(560,620,120,.16),"a"),H(pc(700,220,200,.14)+pc(300,800,100,.18),"b"),H(pc(820,760,170,.14),"a")]),R("fx-heart-burst","sparkle","Tim bay","hearts float like tim bay","#ff4b55","#ff9cc2",[H(Zc(500,600,.55),"a"),H(Zc(250,370,.28),"b",{o:.9}),H(Zc(760,300,.36),"a",{o:.8}),H(Zc(830,660,.2),"w"),H(Zc(170,720,.2),"a",{o:.7})]),R("status-stars","status","5 sao","rating stars đánh giá 5 sao","#ffd23f",q,[W(Array.from({length:5},(t,e)=>De(140+e*180,500,92,40,5)).join(""),"a","b",12)]),R("status-stars-4","status","4 sao","rating four stars 4 sao","#ffd23f",q,[W(Array.from({length:4},(t,e)=>De(140+e*180,500,92,40,5)).join(""),"a","b",12),W(De(860,500,92,40,5),"b","b",12,{o:.3})]),R("status-progress","status","Thanh tiến trình","progress bar loading thanh","#31c76a",q,[W(Rt(60,400,880,200,100),"w","b",24),H(Rt(84,424,540,152,76),"a")]),R("status-ring","status","Vòng tiến trình","progress ring vòng phần trăm","#31c76a",q,[L(A(500,500,410),"b",100,{o:.3}),L("M500 90A410 410 0 1 1 90 500","a",100)]),R("status-check","status","Dấu tích lớn","checkmark tick đúng","#31c76a",q,[L(nt([140,540],[400,800],[880,200]),"b",200),L(nt([140,540],[400,800],[880,200]),"a",130)]),R("status-cross","status","Dấu X lớn","cross x sai","#ff4b55",q,[L("M200 200L800 800M800 200L200 800","b",200),L("M200 200L800 800M800 200L200 800","a",130)]),R("status-checkbox","status","Ô tích","checkbox ô chọn","#31c76a",q,[W(Rt(110,110,780,780,170),"w","b",34),L(nt([270,520],[440,690],[740,320]),"a",110)]),R("status-crossbox","status","Ô gạch X","crossbox ô sai","#ff4b55",q,[W(Rt(110,110,780,780,170),"w","b",34),L("M310 310L690 690M690 310L310 690","a",110)]),R("status-warning","status","Cảnh báo","warning cảnh báo lưu ý","#ffd23f",q,[W(Tt([500,100],[930,850],[70,850]),"a","b",40),L(nt([500,370],[500,600]),"b",84),H(A(500,730,46),"b")]),R("status-dots","status","Ba chấm tải","loading dots đang tải","#ffffff",q,[H(A(200,500,80),"a"),H(A(500,500,80),"a",{o:.6}),H(A(800,500,80),"a",{o:.3})])];new Map(hn.map(t=>[t.id,t])),hn.map(t=>t.id);const Pl=Object.freeze({emitter:"point",ex:.5,ey:.5,esize:.2,text:"CLIPOOX",rate:80,burst:0,prerun:0,life:2,speed:220,direction:-90,spread:60,gravity:0,wind:0,drag:.4,turbulence:.2,shape:"glow",size:8,sizeEnd:.3,color:"#fff3c4",colorEnd:"#ff7a1a",opacity:1,blend:"add",seed:1}),zl={particles:"Custom particles — a free particle system: choose the emitter (point, box, disc, line, ring or text), rate, burst, life, speed, direction, gravity, wind, drag, turbulence, shape and colours","pt-dust":"Floating glow dust particles — soft glowing motes drift and swirl over the whole frame (dust, bokeh, ambience)","pt-sparks":"Spark fountain particles — hot sparks shoot up from the bottom and fall back under gravity (sparks, fire, welding)","pt-firework":"Fireworks burst particles — one burst of sparks explodes outward, slows and falls (fireworks, celebration, new year)","pt-snow":"Snowfall particles — snowflakes fall softly over the whole frame with a light wind (snow, winter, christmas)","pt-rain":"Rain particles — fast rain streaks fall at a slight angle over the whole frame (rain, storm, weather)","pt-smoke":"Rising smoke particles — soft smoke puffs rise from the bottom, grow and fade (smoke, steam, fog, mist)","pt-magic":"Magic swirl dust particles — star sparkles circle a ring and twirl (magic, fairy dust, sparkle, glitter)","pt-text":"Particle text — glowing particles form the words (text = the words; logo text, title made of particles)","pt-hearts":"Floating hearts particles — hearts rise from the bottom and sway (love, like, valentine, wedding)","pt-fireflies":"Fireflies particles — small glowing lights wander slowly in the dark (fireflies, night, glow)","pt-confetti":"Confetti particles — paper confetti bursts in and tumbles down (confetti, party, celebration, winner)"},qe=(t,e,c,a)=>Object.freeze({id:t,name:e,category:"Hạt",duration:c,params:Object.freeze({...Pl,...a}),code:`function render(ctx,t,env){
1
+ (function(){"use strict";const Ta=(t=7)=>()=>(t=t*1664525+1013904223>>>0)/4294967296;function $i(t){const e=t.w>>1,c=t.h>>1,a=new Float32Array(e*c),o=t.data,s=t.w;for(let i=0;i<c;i++)for(let l=0;l<e;l++){const p=2*i*s+2*l;a[i*e+l]=(o[p]+o[p+1]+o[p+s]+o[p+s+1])/4}return{w:e,h:c,data:a}}function fo(t,e=3){const c=[t];for(;c.length<e&&c.at(-1).w>=40;)c.push($i(c.at(-1)));return c}const fc=(t,e,c)=>{e=Math.max(0,Math.min(t.w-1.001,e)),c=Math.max(0,Math.min(t.h-1.001,c));const a=e|0,o=c|0,s=e-a,i=c-o,l=o*t.w+a,p=t.data;return(p[l]*(1-s)+p[l+1]*s)*(1-i)+(p[l+t.w]*(1-s)+p[l+t.w+1]*s)*i};function Uo(t,{cols:e=14,rows:c=9,border:a=10,minScore:o=2e-4,skip:s=null}={}){const{w:i,h:l,data:p}=t,x=[];for(let f=0;f<c;f++)for(let d=0;d<e;d++){let r=null;const g=Math.max(a,Math.floor(d*i/e)),u=Math.min(i-a,Math.floor((d+1)*i/e)),v=Math.max(a,Math.floor(f*l/c)),b=Math.min(l-a,Math.floor((f+1)*l/c));for(let S=v;S<b;S+=2)for(let T=g;T<u;T+=2){if(s&&s(T/i,S/l))continue;let D=0,P=0,K=0;for(let M=-2;M<=2;M++)for(let y=-2;y<=2;y++){const z=(S+M)*i+T+y,h=(p[z+1]-p[z-1])/2,w=(p[z+i]-p[z-i])/2;D+=h*h,P+=h*w,K+=w*w}const n=(D+K)/2-Math.sqrt(((D-K)/2)**2+P*P);n>o&&(!r||n>r[2])&&(r=[T,S,n])}r&&x.push([r[0],r[1]])}return x}function Ko(t,e,c,a=5,o=12){let s=0,i=0;for(let f=t.length-1;f>=0;f--){const d=t[f],r=e[f],g=2**f,u=c[0]/g,v=c[1]/g;let b=0,S=0,T=0;const D=[],P=[],K=[];for(let z=-a;z<=a;z++)for(let h=-a;h<=a;h++){const w=(fc(d,u+h+1,v+z)-fc(d,u+h-1,v+z))/2,k=(fc(d,u+h,v+z+1)-fc(d,u+h,v+z-1))/2;b+=w*w,S+=w*k,T+=k*k,D.push(w),P.push(k),K.push(fc(d,u+h,v+z))}const n=b*T-S*S;if(n<1e-9)return null;let M=0,y=0;for(let z=0;z<o;z++){let h=0,w=0,k=0;for(let Y=-a;Y<=a;Y++)for(let lt=-a;lt<=a;lt++,k++){const et=K[k]-fc(r,u+s+M+lt,v+i+y+Y);h+=et*D[k],w+=et*P[k]}const m=(T*h-S*w)/n,B=(b*w-S*h)/n;if(M+=m,y+=B,m*m+B*B<1e-4)break}s=(s+M)*(f?2:1),i=(i+y)*(f?2:1)}const l=[c[0]+s,c[1]+i],p=t[0].w,x=t[0].h;return l[0]<2||l[1]<2||l[0]>p-3||l[1]>x-3?null:l}function jo(t,e,c){return c.map(a=>{const o=Ko(t,e,a);if(!o)return null;const s=Ko(e,t,o);return s&&Math.hypot(s[0]-a[0],s[1]-a[1])<.8?o:null})}const Va=t=>{const e=Math.hypot(t[0],t[1],t[2])||1;return[t[0]/e,t[1]/e,t[2]/e]},vc=(t,e,c,a)=>Va([(t[0]-c)/e,-(t[1]-a)/e,-1]);function $a(t,e){const[c,a,o,s]=t,i=s*e[0]+a*e[2]-o*e[1],l=s*e[1]+o*e[0]-c*e[2],p=s*e[2]+c*e[1]-a*e[0],x=-c*e[0]-a*e[1]-o*e[2];return[i*s+x*-c+l*-o-p*-a,l*s+x*-a+p*-c-i*-o,p*s+x*-o+i*-a-l*-c]}const Xi=(t,e)=>[t[3]*e[0]+t[0]*e[3]+t[1]*e[2]-t[2]*e[1],t[3]*e[1]-t[0]*e[2]+t[1]*e[3]+t[2]*e[0],t[3]*e[2]+t[0]*e[1]-t[1]*e[0]+t[2]*e[3],t[3]*e[3]-t[0]*e[0]-t[1]*e[1]-t[2]*e[2]],Fi=t=>[-t[0],-t[1],-t[2],t[3]];function Yi(t){const e=t.map(o=>[...o]),c=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(let o=0;o<30;o++){let s=0;for(let i=0;i<4;i++)for(let l=i+1;l<4;l++)s+=e[i][l]**2;if(s<1e-20)break;for(let i=0;i<4;i++)for(let l=i+1;l<4;l++){if(Math.abs(e[i][l])<1e-12)continue;const p=(e[l][l]-e[i][i])/(2*e[i][l]),x=Math.sign(p||1)/(Math.abs(p)+Math.sqrt(p*p+1)),f=1/Math.sqrt(x*x+1),d=x*f;for(let r=0;r<4;r++){const g=e[r][i],u=e[r][l];e[r][i]=f*g-d*u,e[r][l]=d*g+f*u}for(let r=0;r<4;r++){const g=e[i][r],u=e[l][r];e[i][r]=f*g-d*u,e[l][r]=d*g+f*u}for(let r=0;r<4;r++){const g=c[r][i],u=c[r][l];c[r][i]=f*g-d*u,c[r][l]=d*g+f*u}}}let a=0;for(let o=1;o<4;o++)e[o][o]>e[a][a]&&(a=o);return[c[0][a],c[1][a],c[2][a],c[3][a]]}function po(t,e){const c=[[0,0,0],[0,0,0],[0,0,0]];for(let v=0;v<t.length;v++)for(let b=0;b<3;b++)for(let S=0;S<3;S++)c[b][S]+=t[v][b]*e[v][S];const[[a,o,s],[i,l,p],[x,f,d]]=c,r=Yi([[a+l+d,p-f,x-s,o-i],[p-f,a-l-d,o+i,x+s],[x-s,o+i,-a+l-d,p+f],[o-i,x+s,p+f,-a-l+d]]),g=[r[1],r[2],r[3],r[0]],u=Math.hypot(...g)||1;return g.map(v=>v/u*(g[3]<0?-1:1))}const Xa=(t,e)=>Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])));function Fa(t,e,{thr:c=.0035,iters:a=120,min:o=8,rand:s=Ta(11)}={}){if(t.length<o)return null;let i=[];for(let x=0;x<a;x++){const f=Math.floor(s()*t.length),d=Math.floor(s()*t.length);if(f===d||Xa(t[f],t[d])<.02)continue;const r=po([t[f],t[d]],[e[f],e[d]]),g=[];for(let u=0;u<t.length;u++)Xa($a(r,t[u]),e[u])<c&&g.push(u);g.length>i.length&&(i=g)}if(i.length<o)return null;let l=po(i.map(x=>t[x]),i.map(x=>e[x]));const p=[];for(let x=0;x<t.length;x++)Xa($a(l,t[x]),e[x])<c*1.5&&p.push(x);return p.length>=o&&(l=po(p.map(x=>t[x]),p.map(x=>e[x]))),{q:l,inliers:p}}function Vo(t,e,c,a,o,s,i){const l=[];for(let x=0;x<t.length;x++){const f=$a(c,t[x]);if(f[2]>-.001)continue;const d=o+a*f[0]/-f[2],r=s-a*f[1]/-f[2],g=Math.hypot(d-o,r-s),u=Math.hypot(e[x][0]-o,e[x][1]-s);g>i*.15&&l.push(u/g)}if(l.length<6)return 1;l.sort((x,f)=>x-f);const p=l[l.length>>1];return Math.abs(p-1)<.0015?1:Math.max(.8,Math.min(1.25,p))}function _i(t,e,{skip:c=null,rand:a=Ta(13)}={}){const o=t[0].w,s=t[0].h,i=o/2,l=s/2,p=[{q:[0,0,0,1],f:e,inliers:0,lost:!1}];let x={q:[0,0,0,1],f:e,bear:[],pts:[]};const f=(r,g,u,v)=>{const b=Uo(r,{skip:v});x={q:g,f:u,bear:b.map(S=>vc(S,u,i,l)),pts:b,start:b.length}};let d=fo(t[0]);f(t[0],p[0].q,e,c?.(0));for(let r=1;r<t.length;r++){const g=fo(t[r]),u=jo(d,g,x.pts),v=u.map((n,M)=>n?M:-1).filter(n=>n>=0),b=p[r-1];let S=b.q,T=b.f,D=0,P=!0;if(v.length>=8){const n=v.map(h=>x.bear[h]),M=v.map(h=>u[h]);let y=M.map(h=>vc(h,b.f,i,l)),z=Fa(n,y,{rand:a});if(z){for(let w=0;w<3;w++){const k=Vo(z.inliers.map(B=>n[B]),z.inliers.map(B=>M[B]),z.q,x.f,i,l,o),m=x.f*k;if(Math.abs(m-T)<T*5e-4)break;T=m,y=M.map(B=>vc(B,T,i,l)),z=Fa(n,y,{rand:a})??z}S=Xi(x.q,Fi(z.q)),D=z.inliers.length,P=!1;const h=new Set(z.inliers.map(w=>v[w]));x={...x,pts:x.pts.map((w,k)=>h.has(k)?u[k]:null),bear:x.bear}}}p.push({q:S.map(n=>Math.round(n*1e6)/1e6),f:Math.round(T*100)/100,inliers:D,lost:P});const K=x.pts.filter(Boolean).length;if(P||K<Math.max(16,x.start*.45))f(t[r],S,T,c?.(r));else{const n=x.pts.map((M,y)=>M?y:-1).filter(M=>M>=0);x={...x,pts:n.map(M=>x.pts[M]),bear:n.map(M=>x.bear[M])}}d=g}return p}const pe=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],_c=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],pt=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],$t=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],go=(t,e)=>[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]],ye=(t,e)=>[pt(t[0],e),pt(t[1],e),pt(t[2],e)],Ae=t=>[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]],aa=(t,e)=>t.map(c=>[0,1,2].map(a=>c[0]*e[0][a]+c[1]*e[1][a]+c[2]*e[2][a])),Qi=t=>pt(t[0],go(t[1],t[2])),uo=()=>[[1,0,0],[0,1,0],[0,0,1]];function Ya(t){const e=t.length,c=t.map(o=>[...o]),a=Array.from({length:e},(o,s)=>Array.from({length:e},(i,l)=>s===l?1:0));for(let o=0;o<60;o++){let s=0;for(let i=0;i<e;i++)for(let l=i+1;l<e;l++)s+=c[i][l]**2;if(s<1e-22)break;for(let i=0;i<e;i++)for(let l=i+1;l<e;l++){if(Math.abs(c[i][l])<1e-300)continue;const p=(c[l][l]-c[i][i])/(2*c[i][l]),x=Math.sign(p||1)/(Math.abs(p)+Math.sqrt(p*p+1)),f=1/Math.sqrt(x*x+1),d=x*f;for(let r=0;r<e;r++){const g=c[r][i],u=c[r][l];c[r][i]=f*g-d*u,c[r][l]=d*g+f*u}for(let r=0;r<e;r++){const g=c[i][r],u=c[l][r];c[i][r]=f*g-d*u,c[l][r]=d*g+f*u}for(let r=0;r<e;r++){const g=a[r][i],u=a[r][l];a[r][i]=f*g-d*u,a[r][l]=d*g+f*u}}}return{values:c.map((o,s)=>o[s]),vectors:a}}const Ca=(t,e)=>t.map(c=>c[e]);function $o(t){const{values:e,vectors:c}=Ya(aa(Ae(t),t)),a=[0,1,2].sort((f,d)=>e[d]-e[f]),o=a.map(f=>Ca(c,f)),s=a.map(f=>Math.sqrt(Math.max(0,e[f]))),i=Va(ye(t,o[0])),l=ye(t,o[1]),p=Va(pe(l,$t(i,pt(i,l)))),x=go(i,p);return{U:Ae([i,p,x]),S:s,V:Ae([o[0],o[1],o[2]])}}function Xo(t){const e=Math.hypot(t[0],t[1],t[2]);if(e<1e-12)return uo();const c=$t(t,1/e),a=Math.cos(e),o=Math.sin(e),s=1-a;return[[a+c[0]*c[0]*s,c[0]*c[1]*s-c[2]*o,c[0]*c[2]*s+c[1]*o],[c[1]*c[0]*s+c[2]*o,a+c[1]*c[1]*s,c[1]*c[2]*s-c[0]*o],[c[2]*c[0]*s-c[1]*o,c[2]*c[1]*s+c[0]*o,a+c[2]*c[2]*s]]}function Zi(t){const e=t[0][0]+t[1][1]+t[2][2];let c;if(e>0){const o=Math.sqrt(e+1)*2;c=[(t[2][1]-t[1][2])/o,(t[0][2]-t[2][0])/o,(t[1][0]-t[0][1])/o,o/4]}else if(t[0][0]>t[1][1]&&t[0][0]>t[2][2]){const o=Math.sqrt(1+t[0][0]-t[1][1]-t[2][2])*2;c=[o/4,(t[0][1]+t[1][0])/o,(t[0][2]+t[2][0])/o,(t[2][1]-t[1][2])/o]}else if(t[1][1]>t[2][2]){const o=Math.sqrt(1+t[1][1]-t[0][0]-t[2][2])*2;c=[(t[0][1]+t[1][0])/o,o/4,(t[1][2]+t[2][1])/o,(t[0][2]-t[2][0])/o]}else{const o=Math.sqrt(1+t[2][2]-t[0][0]-t[1][1])*2;c=[(t[0][2]+t[2][0])/o,(t[1][2]+t[2][1])/o,o/4,(t[1][0]-t[0][1])/o]}const a=Math.hypot(...c);return c.map(o=>o/a*(c[3]<0?-1:1))}function Ji(t){const[e,c,a,o]=t;return[[1-2*(c*c+a*a),2*(e*c-a*o),2*(e*a+c*o)],[2*(e*c+a*o),1-2*(e*e+a*a),2*(c*a-e*o)],[2*(e*a-c*o),2*(c*a+e*o),1-2*(e*e+c*c)]]}function tl(t,e,c=_a.r){const a=(2*c+1)**2,o=new Float32Array(a),s=Array.from({length:6},()=>new Float32Array(a));let i=0,l=0;for(let d=-c;d<=c;d++)for(let r=-c;r<=c;r++,i++){const g=(fc(t,e[0]+r+1,e[1]+d)-fc(t,e[0]+r-1,e[1]+d))/2,u=(fc(t,e[0]+r,e[1]+d+1)-fc(t,e[0]+r,e[1]+d-1))/2;o[i]=fc(t,e[0]+r,e[1]+d),l+=o[i],s[0][i]=g*r,s[1][i]=u*r,s[2][i]=g*d,s[3][i]=u*d,s[4][i]=g,s[5][i]=u}l/=a;let p=0;for(let d=0;d<a;d++)o[d]-=l,p+=o[d]*o[d];if(p=Math.sqrt(p/a),p<.001)return null;const x=Array.from({length:6},(d,r)=>Array.from({length:6},(g,u)=>{let v=0;for(let b=0;b<a;b++)v+=s[r][b]*s[u][b];return v})),f=el(x);return f?{r:c,v:o,sd:s,Hi:f,sdv:p,A:[1,0,0,1]}:null}function el(t){const e=t.length,c=t.map((a,o)=>[...a,...Array.from({length:e},(s,i)=>o===i?1:0)]);for(let a=0;a<e;a++){let o=a;for(let s=a+1;s<e;s++)Math.abs(c[s][a])>Math.abs(c[o][a])&&(o=s);if(Math.abs(c[o][a])<1e-14)return null;[c[a],c[o]]=[c[o],c[a]];for(let s=0;s<e;s++)if(s!==a){const i=c[s][a]/c[a][a];for(let l=a;l<2*e;l++)c[s][l]-=i*c[a][l]}}return c.map((a,o)=>a.slice(e).map(s=>s/a[o]))}function cl(t,e,c){const{r:a,v:o,sd:s,Hi:i}=t,l=o.length,p=new Float32Array(l),x=new Float64Array(6),f=new Float64Array(6),d=e.data,r=e.w,g=e.w-1.001,u=e.h-1.001;let[v,b,S,T]=t.A,D=c[0],P=c[1],K=0;for(let M=0;M<_a.iters;M++){let y=0,z=0;for(let N=-a;N<=a;N++)for(let Q=-a;Q<=a;Q++,y++){let mt=D+v*Q+S*N,X=P+b*Q+T*N;mt=mt<0?0:mt>g?g:mt,X=X<0?0:X>u?u:X;const at=mt|0,Ce=X|0,Sc=mt-at,Qt=X-Ce,Zt=Ce*r+at;p[y]=(d[Zt]*(1-Sc)+d[Zt+1]*Sc)*(1-Qt)+(d[Zt+r]*(1-Sc)+d[Zt+r+1]*Sc)*Qt,z+=p[y]}z/=l;let h=0,w=0;for(let N=0;N<l;N++)p[N]-=z,h+=p[N]*p[N],w+=p[N]*o[N];const k=Math.sqrt(h/l);if(k<1e-4)return null;K=w/l/(k*t.sdv);const m=t.sdv/k;x.fill(0);for(let N=0;N<6;N++){const Q=s[N];let mt=0;for(let X=0;X<l;X++)mt+=Q[X]*(p[X]*m-o[X]);x[N]=mt}for(let N=0;N<6;N++){const Q=i[N];f[N]=Q[0]*x[0]+Q[1]*x[1]+Q[2]*x[2]+Q[3]*x[3]+Q[4]*x[4]+Q[5]*x[5]}const B=1+f[0],Y=f[1],lt=f[2],et=1+f[3],C=B*et-Y*lt;if(Math.abs(C)<1e-6)return null;const G=et/C,E=-Y/C,j=-lt/C,ct=B/C,wt=v*G+S*E,bt=b*G+T*E,I=v*j+S*ct,$=b*j+T*ct,J=G*f[4]+j*f[5],Mt=E*f[4]+ct*f[5];if(D-=wt*J+I*Mt,P-=bt*J+$*Mt,v=wt,b=bt,S=I,T=$,f[4]*f[4]+f[5]*f[5]<25e-6)break}const n=Math.abs(v*T-b*S);return!(K>=_a.ncc)||n<.4||n>2.5||Math.hypot(D-c[0],P-c[1])>_a.jump?null:{p:[D,P],A:[v,b,S,T]}}const _a=Object.freeze({r:6,iters:12,ncc:.85,jump:2});function bo(t,{skip:e=null,keep:c=140,onProgress:a=null,cols:o=16,rows:s=10,anchor:i=!1}={}){const l=t.map(()=>new Map);let p=0,x=[],f=null;for(let d=0;d<t.length;d++){const r=fo(t[d]);if(f){const g=jo(f,r,x.map(u=>u.p));x=x.map((u,v)=>{if(!g[v])return null;if(!u.tpl)return{...u,p:g[v]};const b=cl(u.tpl,t[d],g[v]);return b?(u.tpl.A=b.A,{...u,p:b.p}):null}).filter(Boolean)}if(x.length<c*.75){const g=t[d].w,u=t[d].h,v=e?.(d);for(const b of Uo(t[d],{cols:o,rows:s,skip:v})){if(!(!x.some(T=>Math.abs(T.p[0]-b[0])<8&&Math.abs(T.p[1]-b[1])<8)&&b[0]>4&&b[1]>4&&b[0]<g-5&&b[1]<u-5))continue;const S=i?tl(t[d],b):null;i&&!S||x.push({id:p++,p:b,tpl:S})}}for(const g of x)l[d].set(g.id,g.p);f=r,a?.((d+1)/t.length)}return l}const Fo=(t,e,c)=>[...t[e].keys()].filter(a=>t[c].has(a));function al(t,e,c,a,o,s,i){const l=Fo(t,e,c);if(l.length<20)return null;const p=l.map(b=>vc(t[e].get(b),a,o,s)),x=l.map(b=>t[c].get(b)),f=l.map(b=>t[e].get(b)),d=[];for(let b=0;b<400;b++){const S=Math.floor(i()*l.length),T=Math.floor(i()*l.length),D=Math.hypot(f[S][0]-f[T][0],f[S][1]-f[T][1]);D>o*.3&&d.push(Math.hypot(x[S][0]-x[T][0],x[S][1]-x[T][1])/D)}d.sort((b,S)=>b-S);let r=d.length>20?Math.max(.7,Math.min(1.4,d[d.length>>1])):1,g=x.map(b=>vc(b,a*r,o,s)),u=Fa(p,g,{thr:.02,rand:i});if(!u)return null;for(let b=0;b<5;b++){const S=Vo(u.inliers.map(T=>p[T]),u.inliers.map(T=>x[T]),u.q,a,o,s,o*2);if(Math.abs(S-r)<.001)break;r=S,g=x.map(T=>vc(T,a*r,o,s)),u=Fa(p,g,{thr:.02,rand:i})??u}const v=p.map((b,S)=>Xa($a(u.q,b),g[S])).sort((b,S)=>b-S);return{value:v[Math.floor(v.length*.8)],ids:l.length,zoom:r}}function Yo(t,e){const c=Array.from({length:9},()=>new Array(9).fill(0));for(let p=0;p<t.length;p++){const x=[];for(let f=0;f<3;f++)for(let d=0;d<3;d++)x.push(e[p][f]*t[p][d]);for(let f=0;f<9;f++)for(let d=0;d<9;d++)c[f][d]+=x[f]*x[d]}const{values:a,vectors:o}=Ya(c),s=Ca(o,a.indexOf(Math.min(...a))),{U:i,V:l}=$o([[s[0],s[1],s[2]],[s[3],s[4],s[5]],[s[6],s[7],s[8]]]);return aa(aa(i,[[1,0,0],[0,1,0],[0,0,0]]),Ae(l))}const ol=(t,e,c)=>{const a=ye(t,e),o=Math.hypot(a[0],a[1],a[2])||1;return Math.abs(pt(c,a))/o};function _o(t,e,c,a){const o=pe(t,c),s=pt(e,a),i=pt(e,o),l=pt(a,o),p=1-s*s;if(p<1e-9)return null;const x=(s*l-i)/p,f=(l-s*i)/p;return x<=0||f<=0?null:$t(_c(_c(t,$t(e,x)),_c(c,$t(a,f))),.5)}const Qa=(t,e)=>({o:t.C,d:Va(ye(Ae(t.R),e))});function Mo(t,e,c,a,o){const s=ye(t.R,pe(e,t.C));return s[2]>-1e-6?null:[a+c*s[0]/-s[2],o-c*s[1]/-s[2]]}function nl(t,e,c,a,o,s,i){const l=Fo(t,e,c),p=l.map(T=>vc(t[e].get(T),a,o,s)),x=l.map(T=>vc(t[c].get(T),a,o,s)),f=1.5/a;let d=[];for(let T=0;T<300;T++){const D=new Set;for(;D.size<8;)D.add(Math.floor(i()*l.length));const P=[...D],K=Yo(P.map(M=>p[M]),P.map(M=>x[M])),n=[];for(let M=0;M<l.length;M++)ol(K,p[M],x[M])<f&&n.push(M);n.length>d.length&&(d=n)}if(d.length<15)return null;const r=Yo(d.map(T=>p[T]),d.map(T=>x[T])),{U:g,V:u}=$o(r),v=[[0,-1,0],[1,0,0],[0,0,1]],b=Ca(g,2);let S=null;for(const T of[v,Ae(v)])for(const D of[1,-1]){let P=aa(aa(g,T),Ae(u));Qi(P)<0&&(P=P.map(h=>h.map(w=>-w)));const K=$t(b,D),n=$t(ye(Ae(P),K),-1),M={R:uo(),C:[0,0,0]},y={R:P,C:n},z=new Map;for(const h of d){const w=Qa(M,p[h]),k=Qa(y,x[h]),m=_o(w.o,w.d,k.o,k.d);m&&z.set(l[h],m)}(!S||z.size>S.points.size)&&(S={pose:y,points:z})}return S&&S.points.size>=15?S:null}function yo(t,e,c,a,o,s){let i={R:e.R.map(d=>[...d]),C:[...e.C]};const l=d=>{const r=[];for(const{X:g,px:u}of t){const v=Mo(d,g,c,a,o);r.push(v?v[0]-u[0]:50,v?v[1]-u[1]:50)}return r},p=(d,r)=>({R:aa(Xo([r[0],r[1],r[2]]),d.R),C:_c(d.C,[r[3]*s,r[4]*s,r[5]*s])});for(let d=0;d<12;d++){const r=l(i),g=r.map((T,D)=>D%2?null:Math.hypot(T,r[D+1])).flatMap(T=>T===null?[]:[T<=2?1:2/T,T<=2?1:2/T]),u=[];for(let T=0;T<6;T++){const D=[0,0,0,0,0,0];D[T]=1e-5;const P=l(p(i,D));u.push(P.map((K,n)=>(K-r[n])/1e-5))}const v=Array.from({length:6},()=>new Array(6).fill(0)),b=new Array(6).fill(0);for(let T=0;T<r.length;T++)for(let D=0;D<6;D++){b[D]+=u[D][T]*r[T]*g[T];for(let P=0;P<6;P++)v[D][P]+=u[D][T]*u[P][T]*g[T]}for(let T=0;T<6;T++)v[T][T]*=1.0001;const S=Qo(v,b.map(T=>-T));if(!S||(i=p(i,S),Math.hypot(...S)<1e-7))break}const x=l(i),f=[];for(let d=0;d<t.length;d++)Math.hypot(x[2*d],x[2*d+1])<2.5&&f.push(d);return{pose:i,inliers:f}}function Qo(t,e){const c=e.length,a=t.map((s,i)=>Float64Array.from([...s,e[i]]));for(let s=0;s<c;s++){let i=s;for(let x=s+1;x<c;x++)Math.abs(a[x][s])>Math.abs(a[i][s])&&(i=x);if(Math.abs(a[i][s])<1e-14)return null;[a[s],a[i]]=[a[i],a[s]];const l=a[s],p=l[s];for(let x=s+1;x<c;x++){const f=a[x],d=f[s]/p;if(d!==0)for(let r=s;r<=c;r++)f[r]-=d*l[r]}}const o=new Array(c);for(let s=c-1;s>=0;s--){const i=a[s];let l=i[c];for(let p=s+1;p<c;p++)l-=i[p]*o[p];o[s]=l/i[s]}return o}function sl(t,e,c,a=Ta(17),o=.75){const s=[...t.values()];if(s.length<30)return null;const i=s.map(r=>Math.hypot(...pe(r,c))).sort((r,g)=>r-g)[s.length>>1],l=i*.015;let p=null;for(let r=0;r<1e3;r++){const g=s[Math.floor(a()*s.length)],u=s[Math.floor(a()*s.length)],v=s[Math.floor(a()*s.length)];let b=go(pe(u,g),pe(v,g));const S=Math.hypot(...b);if(S<1e-9||(b=$t(b,1/S),pt(b,e)<0&&(b=$t(b,-1)),pt(b,e)<o))continue;const T=-pt(b,g);if(pt(b,c)+T<=l)continue;let D=0;for(const P of s)Math.abs(pt(b,P)+T)<l&&D++;(!p||D>p.count)&&(p={n:b,d:T,count:D})}if(!p||p.count<Math.max(20,s.length*.12))return null;let{n:x,d:f}=p,d=[];for(let r=0,g=l;r<4&&(d=s.filter(P=>Math.abs(pt(x,P)+f)<g),!(d.length<12));r++,g*=.6){const u=d.map(P=>1/Math.max(1e-6,pt(pe(P,c),pe(P,c)))),v=u.reduce((P,K)=>P+K,0),b=$t(d.reduce((P,K,n)=>_c(P,$t(K,u[n])),[0,0,0]),1/v),S=[[0,0,0],[0,0,0],[0,0,0]];d.forEach((P,K)=>{const n=pe(P,b);for(let M=0;M<3;M++)for(let y=0;y<3;y++)S[M][y]+=u[K]*n[M]*n[y]});const{values:T,vectors:D}=Ya(S);x=Ca(D,T.indexOf(Math.min(...T))),pt(x,e)<0&&(x=$t(x,-1)),f=-pt(x,b)}return d.length<Math.max(15,s.length*.08)||pt(x,e)<o?null:{n:x,d:f,count:d.length}}function ia(t,e,c,a,o,s,i,l=12,{focal:p=!1}={}){const x=a.filter(M=>t[M]),f=x.length;if(f<3)return o;const d=new Map(x.map((M,y)=>[M,y])),r=[...e.keys()].filter(M=>x.filter(y=>c[y].has(M)).length>=2),g=r.length;if(g<10)return o;const u=[];r.forEach((M,y)=>{for(const z of x)c[z].has(M)&&u.push({c:d.get(z),p:y,px:c[z].get(M)})});const v=x.map(M=>t[M].R.map(y=>[...y])),b=x.map(M=>[...t[M].C]),S=r.map(M=>[...e.get(M)]),T=(M,y,z,h)=>{let w=0;for(const k of u){const m=ye(M[k.c],pe(z[k.p],y[k.c]));if(m[2]>-1e-6){w+=100;continue}const B=s-h*m[0]/m[2]-k.px[0],Y=i+h*m[1]/m[2]-k.px[1],lt=Math.hypot(B,Y);w+=lt<=2?lt*lt:4*lt-4}return w};let D=.001,P=T(v,b,S,o);const K=6*(f-1)+(p?1:0),n=K-1;for(let M=0;M<l;M++){const y=Array.from({length:K},()=>new Array(K).fill(0)),z=new Array(K).fill(0),h=S.map(()=>[[0,0,0],[0,0,0],[0,0,0]]),w=S.map(()=>[0,0,0]),k=new Map,m=p?S.map(()=>[[0,0,0]]):null;for(const I of u){const $=ye(v[I.c],pe(S[I.p],b[I.c])),[J,Mt,N]=$;if(N>-1e-6)continue;const Q=s-o*J/N-I.px[0],mt=i+o*Mt/N-I.px[1],X=Math.hypot(Q,mt),at=X<=2?1:2/X,Ce=[-o/N,0,o*J/(N*N)],Sc=[0,o/N,-o*Mt/(N*N)],Qt=v[I.c],Zt=[ye(Ae(Qt),Ce),ye(Ae(Qt),Sc)],Jx=[[0,-N,Mt],[N,0,-J],[-Mt,J,0]],ji=St=>[...ye(Ae(Jx),St).map(sa=>-sa),...$t(ye(Ae(Qt),St),-1)],va=I.c?[ji(Ce),ji(Sc)]:null,No=[Q,mt],ja=[-J/N,Mt/N];for(let St=0;St<2;St++){for(let vt=0;vt<3;vt++){w[I.p][vt]+=at*Zt[St][vt]*No[St];for(let Jt=0;Jt<3;Jt++)h[I.p][vt][Jt]+=at*Zt[St][vt]*Zt[St][Jt]}if(p){z[n]+=at*ja[St]*No[St],y[n][n]+=at*ja[St]*ja[St];for(let vt=0;vt<3;vt++)m[I.p][0][vt]+=at*ja[St]*Zt[St][vt]}if(!va)continue;const sa=6*(I.c-1),Vi=I.c*g+I.p;let Io=k.get(Vi);Io||k.set(Vi,Io=Array.from({length:6},()=>[0,0,0]));for(let vt=0;vt<6;vt++){z[sa+vt]+=at*va[St][vt]*No[St];for(let Jt=0;Jt<6;Jt++)y[sa+vt][sa+Jt]+=at*va[St][vt]*va[St][Jt];for(let Jt=0;Jt<3;Jt++)Io[vt][Jt]+=at*va[St][vt]*Zt[St][Jt];if(p){const Jt=at*va[St][vt]*ja[St];y[sa+vt][n]+=Jt,y[n][sa+vt]+=Jt}}}}const B=h.map(I=>{const $=I.map((J,Mt)=>J.map((N,Q)=>N+(Mt===Q?D*(N+1e-9)+1e-9:0)));return il($)}),Y=y.map((I,$)=>I.map((J,Mt)=>J+($===Mt?D*(J+1e-9):0))),lt=z.map(I=>-I),et=new Map;for(const[I,$]of k){const J=I%g;et.has(J)||et.set(J,[]),et.get(J).push({o:6*(Math.floor(I/g)-1),B:$})}p&&m.forEach((I,$)=>{et.has($)||et.set($,[]),et.get($).push({o:n,B:I})});for(const[I,$]of et){const J=B[I],Mt=$.map(({o:N,B:Q})=>({o:N,M:Q.map(mt=>ye(Ae(J),mt))}));for(const N of Mt)for(let Q=0;Q<N.M.length;Q++)lt[N.o+Q]+=pt(N.M[Q],w[I]);for(const N of Mt)for(const Q of $)for(let mt=0;mt<N.M.length;mt++)for(let X=0;X<Q.B.length;X++)Y[N.o+mt][Q.o+X]-=pt(N.M[mt],Q.B[X])}const C=Qo(Y,lt);if(!C){D*=10;continue}const G=w.map(I=>$t(I,-1));for(const[I,$]of et)for(const{o:J,B:Mt}of $)for(let N=0;N<3;N++)for(let Q=0;Q<Mt.length;Q++)G[I][N]-=Mt[Q][N]*C[J+Q];const E=v.map((I,$)=>$?aa(Xo(C.slice(6*($-1),6*($-1)+3)),I):I),j=b.map((I,$)=>$?_c(I,C.slice(6*($-1)+3,6*$)):I),ct=S.map((I,$)=>_c(I,ye(B[$],G[$]))),wt=p?o+C[n]:o,bt=wt>0?T(E,j,ct,wt):1/0;bt<P?(P=bt,v.splice(0,f,...E),b.splice(0,f,...j),S.splice(0,g,...ct),o=wt,D=Math.max(1e-7,D/3)):D*=8}return x.forEach((M,y)=>{t[M]={...t[M],R:v[y],C:b[y]}}),r.forEach((M,y)=>e.set(M,S[y])),o}function il(t){const[[e,c,a],[o,s,i],[l,p,x]]=t,f=s*x-i*p,d=-(o*x-i*l),r=o*p-s*l,g=e*f+c*d+a*r;return Math.abs(g)<1e-18?[[0,0,0],[0,0,0],[0,0,0]]:[[f/g,-(c*x-a*p)/g,(c*i-a*s)/g],[d/g,(e*x-a*l)/g,-(e*i-a*o)/g],[r/g,-(e*p-c*l)/g,(e*s-c*o)/g]]}function Zo(t,e,{skip:c=null,rand:a=Ta(19),minParallax:o=2.2/e,obs:s=null,w:i=0,h:l=0}={}){const p=i||t[0].w,x=l||t[0].h,f=p/2,d=x/2,r=s??bo(t,{skip:c}),g=r.length;let u=null;for(const w of[0,Math.floor(g/4),Math.floor(g/2)]){let k=null;for(let m=w+2;m<Math.min(g,w+45);m++){const B=al(r,w,m,e,f,d,a);if(!B||B.ids<30)break;(!k||B.value>k.value)&&(k={b:m,value:B.value})}if(k&&k.value>o){u=[w,k.b];break}}if(!u)return{mode:"tripod",obs:r};const v=nl(r,u[0],u[1],e,f,d,a);if(!v)return{mode:"tripod",obs:r};const b=new Array(g).fill(null),S=v.points;b[u[0]]={R:uo(),C:[0,0,0]},b[u[1]]=v.pose;const T=Math.hypot(...v.pose.C),D=w=>{for(const[k,m]of r[w])if(!S.has(k))for(let B=0;B<g;B++){if(B===w||!b[B]||!r[B].has(k))continue;const Y=Qa(b[B],vc(r[B].get(k),e,f,d)),lt=Qa(b[w],vc(m,e,f,d));if(Math.acos(Math.min(1,pt(Y.d,lt.d)))<.02)continue;const et=_o(Y.o,Y.d,lt.o,lt.d);if(!et)continue;const C=Mo(b[B],et,e,f,d),G=Mo(b[w],et,e,f,d);if(C&&G&&Math.hypot(C[0]-r[B].get(k)[0],C[1]-r[B].get(k)[1])<2&&Math.hypot(G[0]-m[0],G[1]-m[1])<2){S.set(k,et);break}}},P=(w,k)=>{const m=[];for(const[Y,lt]of r[w])S.has(Y)&&m.push({X:S.get(Y),px:lt,id:Y});if(m.length<10)return!1;let B=yo(m,b[k],e,f,d,T);return B.inliers.length<m.length*.6&&B.inliers.length>=10&&(B=yo(B.inliers.map(Y=>m[Y]),B.pose,e,f,d,T)),B.inliers.length<10?!1:(b[w]=B.pose,!0)};let K=0;const n=()=>{if(++K<15)return;K=0;const w=b.map((m,B)=>m?B:-1).filter(m=>m>=0),k=Math.max(1,Math.ceil(w.length/30));ia(b,S,r,[u[0],...w.filter((m,B)=>m!==u[0]&&(B%k===0||B===w.length-1))],e,f,d,4)};D(u[1]);for(let w=u[0]+1;w<u[1];w++)P(w,b[w-1]?w-1:u[0])&&(D(w),n());for(let w=u[1]+1;w<g;w++)P(w,b[w-1]?w-1:u[1])&&(D(w),n());for(let w=u[0]-1;w>=0;w--)P(w,b[w+1]?w+1:u[0])&&(D(w),n());const M=b.filter(w=>!w).length;if(M>g*.2)return{mode:"tripod",obs:r,reason:"lost"};const y=b.map((w,k)=>w?k:-1).filter(w=>w>=0),z=Math.max(1,Math.ceil(y.length/60)),h=[u[0],...y.filter((w,k)=>w!==u[0]&&(k%z===0||k===y.length-1))];ia(b,S,r,h,e,f,d);for(const w of y)h.includes(w)||P(w,w);ia(b,S,r,y.length<=90?[u[0],...y.filter(w=>w!==u[0])]:h,e,f,d,6);for(let w=0;w<g;w++)if(!b[w]){const k=b.findIndex((m,B)=>m&&Math.abs(B-w)===Math.min(...b.map((Y,lt)=>Y?Math.abs(lt-w):1/0)));b[w]={...b[k],lost:!0}}return{mode:"free",poses:b,points:S,obs:r,pair:u,lost:M}}function ll(t,e,c){const a=[...t.values()],s=a.map(P=>pt(e,pe(P,c))).map((P,K)=>({h:P,i:K})).filter(P=>P.h<0).sort((P,K)=>P.h-K.h);if(s.length<20)return null;const i=s[s.length>>1].h*-1,l=Math.max(1e-6,i*.04),p=Math.max(12,s.length*.12);let x=null;for(let P=0;P<s.length;P++){let K=0;for(const n of s)Math.abs(n.h-s[P].h)<l&&K++;if(K>=p){x=s[P].h;break}}if(x===null)return null;const f=s.filter(P=>Math.abs(P.h-x)<l*1.5),d=f.map(P=>P.h).sort((P,K)=>P-K)[f.length>>1],r=s.filter(P=>Math.abs(P.h-d)<l*1.5).map(P=>a[P.i]),g=r.map(P=>1/Math.max(1e-6,pt(pe(P,c),pe(P,c)))),u=g.reduce((P,K)=>P+K,0),v=$t(r.reduce((P,K,n)=>_c(P,$t(K,g[n])),[0,0,0]),1/u),b=[[0,0,0],[0,0,0],[0,0,0]];r.forEach((P,K)=>{const n=pe(P,v);for(let M=0;M<3;M++)for(let y=0;y<3;y++)b[M][y]+=g[K]*n[M]*n[y]});const{values:S,vectors:T}=Ya(b);let D=Ca(T,S.indexOf(Math.min(...S)));return pt(D,e)<0&&(D=$t(D,-1)),(r.length<12||pt(D,e)<Math.cos(8*Math.PI/180))&&(D=e),{n:D,d:-pt(D,v),count:r.length}}const Jo=Object.freeze({ink:{width:1,tip:.12,press:.45,wobble:.06,alpha:1,retrace:!1,grain:0},pen:{width:.7,tip:.9,press:.04,wobble:.03,alpha:1,retrace:!1,grain:0},crayon:{width:1.1,tip:.7,press:.15,wobble:.14,alpha:.92,retrace:!0,grain:.55},chalk:{width:1.05,tip:.75,press:.12,wobble:.12,alpha:.88,retrace:!1,grain:.7},charcoal:{width:1.2,tip:.4,press:.3,wobble:.18,alpha:.9,retrace:!0,grain:.45},watercolor:{width:1.25,tip:.35,press:.35,wobble:.2,alpha:.55,retrace:!1,grain:0,wet:!0}});Object.freeze(["pencil","marker","brush",...Object.keys(Jo)]);const te=(t,e,c,a)=>Object.freeze({id:t,vi:e,en:c,...a}),tn=Object.freeze([te("watercolor-garden","Màu nước vườn","Watercolour garden",{about:["Màu nước loang trên giấy cotton, viền đậm nơi màu đọng","Translucent washes on cotton paper, darker pooled edges"],palette:["#f6efe0","#8fb39a","#e59b8b","#8fb5d4","#e8c170","#b07fa8"],ink:"#5b4a3f",brush:{style:"watercolor",width:.8,taper:.6,press:.5},outline:!0,texture:{type:"wash",amount:.7},paper:{color:"#f6efe0",texture:{type:"paper",amount:.6}},boil:{amount:1.2,fps:6},step:2,tags:["soft","editorial"]}),te("ink-wash","Thủy mặc","Ink wash",{about:["Mực tàu trên giấy dó, sắc độ xám, một điểm đỏ ấn","Brush ink on rice paper, grey tones, one red seal"],palette:["#f1ece0","#3c3c3c","#7d7d78","#c0392b","#dcd8cd","#5a6b5d"],ink:"#1d1d1b",brush:{style:"ink",width:1.1,taper:.85,press:.7},outline:!0,texture:{type:"wash",amount:.5},paper:{color:"#f1ece0",texture:{type:"paper",amount:.7}},boil:{amount:.8,fps:4},step:2,tags:["minimal","cinematic"]}),te("crayon-book","Sách sáp màu","Crayon book",{about:["Nét sáp màu thiếu nhi, tô gạch, giấy trắng ngà","Kids’ crayon lines and scribbled fills on warm paper"],palette:["#fbf6ea","#f2a93b","#4f9fd8","#e8504b","#cfe8ff","#6b4f8f"],ink:"#3a3226",brush:{style:"crayon",width:1,taper:.3,press:.3},outline:!0,texture:{type:"hatch",scale:.8,angle:-35,amount:.55},paper:{color:"#fbf6ea",texture:{type:"grain",amount:.5}},boil:{amount:2.4,fps:8},step:2,tags:["playful"]}),te("midcentury-flat","Phẳng thập niên 50","Midcentury flat",{about:["Mảng màu phẳng không viền, hạt in nhẹ, tông mù tạt – xanh két","Flat shapes without outlines, light print grain, mustard and teal"],palette:["#f3e7cf","#e2a33a","#2f7d79","#d9573b","#a9d6d0","#2c3e50"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:{type:"grain",amount:.35},paper:{color:"#f3e7cf",texture:{type:"grain",amount:.4}},boil:null,step:1,tags:["retro","clean"]}),te("rubber-hose","Hoạt hình ống cao su","Rubber-hose toon",{about:["Thập niên 30: đen trắng ngà, viền mực dày, chuyển động trên 2","1930s cartoon: cream greys, thick ink outlines, animated on twos"],palette:["#efe4cc","#e2d7bf","#a69c86","#5b5346","#fbf7ee","#2a251f"],ink:"#14110d",brush:{style:"ink",width:1.3,taper:.2,press:.2},outline:!0,texture:null,paper:{color:"#d8ccb2",texture:{type:"paper",amount:.8}},boil:{amount:1.6,fps:12},step:2,tags:["retro","playful"]}),te("riso-print","In riso","Riso print",{about:["Hai–ba màu mực in chồng, chấm tram, lệch bản nhẹ","Two or three overprinted inks, halftone, slight misregistration"],palette:["#f4eee2","#ff4f9a","#2a6fd6","#ffd23f","#ffc2dd","#1d3c78"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"riso",amount:.7},paper:{color:"#f4eee2",texture:{type:"grain",amount:.45}},boil:{amount:.6,fps:6},step:2,tags:["editorial","street"]}),te("papercut","Giấy cắt","Papercut",{about:["Lớp giấy cắt đỏ – kem, vân giấy, chuyển động stop-motion","Red and cream cut-paper layers, paper fibres, stop-motion timing"],palette:["#f5e9d4","#c8102e","#8b0a1f","#f0c05a","#ec9a78","#2b2b2b"],ink:null,brush:{style:"marker",width:1,taper:0,press:0},outline:!1,texture:{type:"paper",amount:.8},paper:{color:"#f5e9d4",texture:{type:"paper",amount:.9}},boil:{amount:.8,fps:4},step:3,tags:["editorial","playful"]}),te("whiteboard","Bảng trắng bút lông","Whiteboard marker",{about:["Bút lông đen – xanh – đỏ trên bảng trắng, tô gạch thưa","Black, blue and red markers on a whiteboard, loose hatching"],palette:["#fbfbf8","#1f5fbf","#d6332f","#2e9e5b","#f2b705","#555555"],ink:"#1b1b1b",brush:{style:"marker",width:.9,taper:.2,press:.1},outline:!0,texture:{type:"hatch",scale:1.2,angle:-45,amount:.35},paper:{color:"#fbfbf8",texture:{type:"grain",amount:.15}},boil:{amount:.8,fps:8},step:1,tags:["clean","corporate"]}),te("chalkboard","Bảng phấn","Chalkboard",{about:["Phấn trắng – vàng – hồng trên bảng xanh đen","White, yellow and pink chalk on a green-black board"],palette:["#24342c","#f4f1e8","#f6d65a","#f29bb6","#8fd3e8","#b6e388"],ink:"#f4f1e8",brush:{style:"chalk",width:1,taper:.3,press:.2},outline:!0,texture:{type:"stipple",scale:1,amount:.5},paper:{color:"#24342c",texture:{type:"grain",amount:.55}},boil:{amount:1.6,fps:8},step:2,tags:["retro","playful"]}),te("blueprint","Bản vẽ kỹ thuật","Blueprint",{about:["Nét trắng mảnh trên nền xanh lưới kỹ thuật","Thin white lines on blue grid paper"],palette:["#1d4f91","#e9f2ff","#9cc3ff","#ffd166","#6fb1ff","#c8dcff"],ink:"#e9f2ff",brush:{style:"pen",width:.6,taper:0,press:0},outline:!0,texture:{type:"hatch",scale:.7,angle:45,amount:.35},paper:{color:"#1d4f91",texture:{type:"grid",amount:.5}},boil:null,step:1,tags:["tech","minimal"]}),te("woodcut","Khắc gỗ","Woodcut",{about:["Mực đen dày, gạch khắc dày đặc, điểm đỏ","Heavy black ink, dense carved hatching, a red accent"],palette:["#efe6d2","#1a1714","#b8322a","#8a7a62","#e3d6b8","#5c4a3a"],ink:"#1a1714",brush:{style:"ink",width:1.4,taper:.6,press:.5},outline:!0,texture:{type:"crosshatch",scale:.8,angle:30,amount:.6},paper:{color:"#efe6d2",texture:{type:"paper",amount:.6}},boil:{amount:.6,fps:4},step:2,tags:["retro","editorial"]}),te("one-line","Một nét","One line",{about:["Một nét bút liền, không tô, vẽ dần","A single continuous pen line, no fills, drawn on"],palette:["#f7f4ee","#222222","#d64545","#3b6ea5","#999999","#555555"],ink:"#222222",brush:{style:"pen",width:.8,taper:.4,press:.1},outline:!0,texture:null,fillNone:!0,paper:{color:"#f7f4ee",texture:{type:"grain",amount:.2}},boil:null,step:1,tags:["minimal","clean"]}),te("isotype","Biểu tượng isotype","Isotype pictogram",{about:["Biểu tượng phẳng kiểu thống kê, 3 màu, gọn","Flat statistical pictograms, three colours, tidy"],palette:["#eceae4","#1d3557","#e63946","#457b9d","#a8dadc","#f1a208"],ink:null,brush:{style:"pen",width:1,taper:0,press:0},outline:!1,texture:null,paper:{color:"#eceae4",texture:null},boil:null,step:1,tags:["clean","corporate","minimal"]}),te("stained-glass","Kính màu","Stained glass",{about:["Viền chì đen dày, mảng màu ngọc rực, vân kính","Thick black leading, jewel colours, glass grain"],palette:["#121212","#1f6fb2","#c0392b","#f1c40f","#a3d9ff","#8e44ad"],ink:"#101010",brush:{style:"pen",width:1.8,taper:0,press:0},outline:!0,texture:{type:"grain",scale:1.6,amount:.5},paper:{color:"#151515",texture:{type:"grain",amount:.3}},boil:null,step:1,text:"#f6e7b4",tags:["bold","luxury"]}),te("pencil-sketch","Phác chì","Pencil sketch",{about:["Nét chì than mảnh, tô gạch đan nhạt, giấy vẽ","Graphite lines, light cross-hatching, sketch paper"],palette:["#f5f2ea","#8a8a86","#b9b7b0","#6e6a63","#c9a27e","#9fb0bf"],ink:"#3d3b38",brush:{style:"pencil",width:1.1,taper:.5,press:.4},outline:!0,texture:{type:"crosshatch",scale:1,angle:-40,amount:.45},paper:{color:"#f5f2ea",texture:{type:"paper",amount:.5}},boil:{amount:1.4,fps:8},step:2,tags:["soft","editorial"]}),te("pop-halftone","Pop chấm tram","Pop halftone",{about:["Viền đen đậm, chấm tram, vàng – đỏ – xanh rực","Bold black outlines, halftone dots, bright primaries"],palette:["#ffe14d","#ff3b3b","#1e90ff","#ff9f1c","#ffffff","#1a1a1a"],ink:"#111111",brush:{style:"marker",width:1.3,taper:0,press:0},outline:!0,texture:{type:"halftone",scale:1,angle:45,amount:.45},paper:{color:"#ffe14d",texture:{type:"halftone",scale:1.4,amount:.25,color:"#ffcc00"}},boil:null,step:1,tags:["bold","playful"]})]);Object.freeze(tn.map(t=>t.id));const Aa=(t,e,c,a)=>Object.freeze({id:t,vi:e,en:c,prompt:a}),rl=Object.freeze([Aa("anime-cel","Anime cel","Anime cel","Japanese anime, clean cel shading, crisp ink line art, flat colour with one shadow tone"),Aa("cartoon-2d","Hoạt hình 2D","2D cartoon","Western 2D cartoon, bold clean outlines, flat bright colours, simple shapes"),Aa("chibi","Chibi","Chibi","cute chibi proportions (big head, small body), soft cel shading, clean outlines"),Aa("comic","Truyện tranh","Comic book","comic book art, heavy ink outlines, halftone shading, strong contrast"),...tn.map(t=>Aa(t.id,t.vi,t.en,`${t.en}: ${t.about?.[1]||t.en}`))]);Object.freeze(rl.map(t=>t.id));const wo=(t,e,c,a,o,s)=>Object.freeze({id:t,label:e,min:c,max:a,vi:o,en:s}),xl=Object.freeze({kling:wo("kling","Kling 4.0",3,15,"Mặc định","Default"),seedance:wo("seedance","Seedance 2.5",4,30,"Chân thực nhất","Most realistic"),wan:wo("wan","Wan 3.0 Prime",2,15,"Bản nháp rẻ","Cheap draft")});Object.freeze(Object.keys(xl));const la="The person keeps exactly the same speech, lip movements, facial expressions, gestures, actions and timing as in the reference video.",ra=(t,e,c,a,o,s,i)=>Object.freeze({id:t,vi:e,en:c,image:a,hintVi:o,hintEn:s,build:i}),hl=Object.freeze([ra("scene","Đổi cảnh/nền","Change scene","optional","VD: quán cà phê ấm áp buổi tối","e.g. a cosy café at night",(t,e)=>`Edit the reference video: replace only the background and surroundings with ${e?`the place shown in the reference image${t?` — ${t}`:""}`:t||"a bright, modern interior"}. ${la} Keep the same person, face, hair and clothes, the same camera framing and camera motion. Match the light on the person to the new background. Photorealistic, no text.`),ra("camera","Đổi góc máy","Camera angle","optional","VD: cận mặt từ bên trái","e.g. a close-up from the left",(t,e)=>`Re-film the same moment from a different camera angle: ${t||"a closer shot from a slightly different angle"}. ${la} Same person, clothes, location and lighting${e?"; the reference image shows the look of the new angle":""}. Smooth camera, photorealistic, no text.`),ra("character","Thay nhân vật","Swap character","required","VD: giữ giọng nói, đổi trang phục công sở","e.g. keep the office outfit",t=>`Edit the reference video: replace the person with the character in the reference image — the same face, hair, body and outfit as in the image${t?` (${t})`:""}. ${la} Keep the same body positions, background, camera framing and camera motion. One person only, shown once. Photorealistic, no text.`),ra("relight","Đổi ánh sáng","Relight","optional","VD: nắng vàng hoàng hôn từ cửa sổ","e.g. golden sunset light from a window",(t,e)=>`Edit the reference video: change only the lighting to ${t||"warm golden-hour light from the side"}${e?", like the light in the reference image":""}. ${la} Keep everything else the same — person, clothes, background, camera framing and camera motion. Photorealistic, no text.`),ra("dof","Xoá phông","Blur background","optional","VD: phông xoá mạnh hơn","e.g. an even softer background",t=>`Edit the reference video: keep the person sharp and in focus and give the background a shallow depth of field — soft, creamy bokeh like a full-frame camera with an f/1.8 lens${t?`; ${t}`:""}. ${la} Keep the same person, background layout, camera framing and camera motion. Photorealistic, no text.`),ra("custom","Tự viết","Custom","optional","Mô tả thay đổi (tiếng Anh cho kết quả tốt nhất)","Describe the change",t=>`${t||"Edit the reference video."}${/lip|speech|timing/i.test(t)?"":` ${la}`}`)]);Object.freeze(hl.map(t=>t.id));const fl=Object.freeze({overcast:{azimuth:35,elevation:62,intensity:1.6,color:"#f1f4f8",ambient:"#c9d2dc",ambientIntensity:1.25,shadow:.45,softness:.85,contact:.75,env:.9,exposure:1},sun:{azimuth:40,elevation:48,intensity:3.4,color:"#fff3df",ambient:"#bcd2ec",ambientIntensity:.75,shadow:.7,softness:.25,contact:.8,env:.8,exposure:1},golden:{azimuth:70,elevation:16,intensity:3,color:"#ffc58a",ambient:"#8fa6c9",ambientIntensity:.7,shadow:.62,softness:.4,contact:.8,env:.7,exposure:1},night:{azimuth:20,elevation:55,intensity:1.4,color:"#ffd9a8",ambient:"#334866",ambientIntensity:.55,shadow:.5,softness:.55,contact:.85,env:.35,exposure:.85},studio:{azimuth:30,elevation:45,intensity:2.6,color:"#ffffff",ambient:"#ffffff",ambientIntensity:1,shadow:.35,softness:.6,contact:.6,env:1,exposure:1}});Object.freeze({preset:"overcast",...fl.overcast,blur:.5});const F=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,Ra=F(12,12,9),pl=[["noodles","Mì / phở","Noodles",["M3 11h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M9 21h6","M14 3l5 6M17 3l4 5"],"phở bún mì hủ_tiếu noodle noodles ramen soup canh","food"],["rice","Cơm","Rice bowl",["M3 12h18c0 4.5-4 8-9 8s-9-3.5-9-8Z","M5 12c0-3 3-5.5 7-5.5s7 2.5 7 5.5","M9 21h6"],"cơm gạo cơm_tấm rice meal bữa_ăn","food"],["coffee","Cà phê","Coffee",["M4 9h12v6a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5Z","M16 11h2a2.5 2.5 0 0 1 0 5h-2","M8 3c-1 1 0 2 0 3M12 3c-1 1 0 2 0 3"],"cà_phê cafe coffee espresso latte quán_cà_phê","food"],["tea","Trà","Tea",["M5 8h12v5a6 6 0 0 1-12 0Z","M3 21h18","M17 9h1.5a2 2 0 0 1 0 4H17"],"trà chè tea trà_chiều","food"],["bubble-tea","Trà sữa","Bubble tea",["M6 7h12l-1.5 14h-9Z","M5 7h14","M12 7l2-5h3","M9.5 17h.01M12 18h.01M14.5 17h.01"],"trà_sữa trân_châu bubble_tea milk_tea đồ_uống","food"],["cake","Bánh kem","Cake",["M4 12h16v8H4Z","M4 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 4 0","M12 12V8","M12 5.5c.8-.8.8-1.8 0-2.5-.8.7-.8 1.7 0 2.5Z"],"bánh_kem bánh_sinh_nhật sinh_nhật cake birthday tiệm_bánh","food"],["pizza","Pizza","Pizza",["M12 21 3 6c6-3 12-3 18 0Z","M4.5 8.5c5-2.2 10-2.2 15 0",F(10,10.5,1),F(14,13,1)],"pizza","food"],["burger","Burger","Burger",["M4 11a8 6 0 0 1 16 0Z","M3 14h18","M4 17h16a2 2 0 0 1-2 3H6a2 2 0 0 1-2-3Z"],"burger hamburger bánh_mì_kẹp đồ_ăn_nhanh fast_food","food"],["fries","Khoai tây chiên","Fries",["M6 10h12l-1.5 11h-9Z","M8 10 7 3M11 10V2M14 10l1-7M17 10l1.5-5"],"khoai_tây_chiên fries snack ăn_vặt","food"],["drumstick","Gà rán","Fried chicken",["M17 4a5 5 0 0 1 0 7l-3.5 3.5a3 3 0 0 1-4-4L13 7a5 5 0 0 1 4-3Z","M10.5 13.5l-5 5",F(4.5,19.5,1.6),F(6.5,20.8,1.2)],"gà gà_rán thịt_gà chicken fried_chicken","food"],["fish","Cá / hải sản","Fish",["M3 12c3-5 9-6 14 0-5 6-11 5-14 0Z","M17 12l4-3v6Z",F(8,11,.6)],"cá hải_sản fish seafood sushi","food"],["steak","Thịt bò","Steak",["M5 8c2-4 10-5 14-1s1 11-6 11-10-6-8-10Z",F(14,10,2),"M7 13c2 1 4 1 6-1M9 16c2 .5 4 0 5-1.5"],"thịt bò bít_tết steak beef thịt_nướng bbq","food"],["egg","Trứng","Egg",["M5 10c0-4 4-6 7-5s6-1 7 3-1 9-7 9-7-3-7-7Z",F(12,12,2.5)],"trứng trứng_ốp egg breakfast bữa_sáng","food"],["bread","Bánh mì","Bread",["M4 11a4 4 0 0 1 2-7h12a4 4 0 0 1 2 7v9H4Z","M9 8v3M13 8v3"],"bánh_mì bread bakery tiệm_bánh","food"],["apple","Trái cây","Fruit",["M12 7c-3-2-8-1-8 5s3 9 5 9c1 0 2-.6 3-.6s2 .6 3 .6c2 0 5-3 5-9s-5-7-8-5Z","M12 7c0-2 1-4 3-4"],"trái_cây hoa_quả táo apple fruit healthy lành_mạnh","food"],["carrot","Rau củ","Vegetables",["M14 7c-3 1-9 7-11 14 7-2 13-8 14-11a2.5 2.5 0 0 0-3-3Z","M15.5 7.5l3.5-4M16.5 8.5l4.5-1.5M15 6.5l.5-4.5","M8 13l2 1.5M6 16.5l2 1.5"],"rau rau_củ cà_rốt vegetable vegetables organic","food"],["chili","Cay","Spicy",["M18 5c-1 7-6 14-14 15 4-3 7-7 9-13","M13 7c1-2 3-3 5-2","M18 5c0-1 1-2 2-2"],"cay ớt spicy chili hot","food"],["wine","Rượu vang","Wine",["M7 3h10l-.5 5a4.5 4.5 0 0 1-9 0Z","M12 13v8M8 21h8"],"rượu rượu_vang vang wine bar nhà_hàng","food"],["beer","Bia","Beer",["M5 8h10v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1Z","M15 11h2a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-2","M5 8a2.5 2.5 0 0 1 3-3 3 3 0 0 1 5 0 2.5 2.5 0 0 1 2 3","M9 12v5M11.5 12v5"],"bia beer nhậu quán_nhậu","food"],["cocktail","Cocktail","Cocktail",["M4 4h16l-8 9Z","M12 13v7M8 20h8","M17 4l2-2"],"cocktail mocktail đồ_uống drink pha_chế","food"],["ice-cream","Kem","Ice cream",["M7 10a5 5 0 0 1 10 0Z","M7 10l5 12 5-12"],"kem ice_cream tráng_miệng dessert","food"],["donut","Bánh ngọt","Donut",[Ra,F(12,12,3),"M7 8h.01M16 7h.01M8 16h.01M17 15h.01"],"bánh_ngọt donut bánh_vòng snack","food"],["chef","Đầu bếp","Chef",["M7 14a4 4 0 0 1-1-7.8A5 5 0 0 1 12 3a5 5 0 0 1 6 3.2A4 4 0 0 1 17 14Z","M7 14v6h10v-6","M7 17h10"],"đầu_bếp bếp nấu_ăn chef cook công_thức recipe","food"],["cutlery","Nhà hàng","Restaurant",["M7 3v8M5 3v5a2 2 0 0 0 4 0V3","M7 11v10","M17 3c-2 2-2 6 0 8v10"],"nhà_hàng quán_ăn ăn ăn_uống restaurant dining thực_đơn menu","food"],["pot","Nồi","Pot",["M4 10h16v7a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3Z","M2 10h20","M9 7h6","M10 4c-.8.8 0 1.6 0 2.4M14 4c-.8.8 0 1.6 0 2.4"],"nồi lẩu nấu hầm hot_pot","food"],["pan","Chảo","Pan",[F(9,13,6),"M15 13h7"],"chảo xào chiên rán pan fry","food"],["store","Cửa hàng","Shop",["M3 9 5 3h14l2 6","M3 9a3 3 0 0 0 6 0 3 3 0 0 0 6 0 3 3 0 0 0 6 0","M5 12v9h14v-9","M10 21v-5h4v5"],"cửa_hàng shop store tiệm kinh_doanh bán_hàng","food"],["receipt","Hoá đơn","Receipt",["M6 2h12v20l-2-1.5-2 1.5-2-1.5-2 1.5-2-1.5-2 1.5Z","M9 7h6M9 11h6M9 15h3"],"hoá_đơn bill receipt thanh_toán đơn_hàng","food"],["scooter","Xe máy giao hàng","Scooter",[F(6,17,2.5),F(18,17,2.5),"M8.5 17h7","M15.5 17 13 9h-3","M13 9l3-4h3","M3 12h7"],"xe_máy shipper giao_đồ_ăn grab xe_ôm scooter motorbike","food"],["pulse","Nhịp tim","Heartbeat",["M2 12h4l2-5 4 10 2-5h8"],"nhịp_tim tim_mạch heartbeat pulse sức_khoẻ health","care"],["stethoscope","Khám bệnh","Doctor",["M6 3v6a4 4 0 0 0 8 0V3","M10 13v3a5 5 0 0 0 10 0v-2",F(20,12,2)],"bác_sĩ khám khám_bệnh phòng_khám doctor clinic y_tế","care"],["pill","Thuốc","Medicine",["M4.6 12.9 12.9 4.6a4.6 4.6 0 0 1 6.5 6.5l-8.3 8.3a4.6 4.6 0 0 1-6.5-6.5Z","M8.8 8.8l6.4 6.4"],"thuốc viên_uống thực_phẩm_chức_năng medicine pill vitamin","care"],["syringe","Tiêm","Injection",["M15 4l5 5-10 10-5-5Z","M18 2l4 4","M5 19l-2 2","M8 11l2 2M11 8l2 2"],"tiêm vắc_xin filler botox injection vaccine","care"],["medical","Y tế","Medical",["M9 3h6v6h6v6h-6v6H9v-6H3V9h6Z"],"y_tế bệnh_viện cấp_cứu medical hospital","care"],["tooth","Răng","Teeth",["M7 3c-3 0-4 3-3.5 6S5 15 6 19c.5 2 2 2 2.5 0l1-4c.4-1.5 2.6-1.5 3 0l1 4c.5 2 2 2 2.5 0 1-4 2-7 2.5-10S20 3 17 3c-2 0-3 1-5 1S9 3 7 3Z"],"răng nha_khoa niềng_răng tẩy_trắng dental teeth","care"],["brain","Trí não","Brain",["M12 5a3 3 0 0 0-5.5-1.5A3.5 3.5 0 0 0 4 9a3.5 3.5 0 0 0 1 6.5A3.5 3.5 0 0 0 9 20a3 3 0 0 0 3-1.5Z","M12 5a3 3 0 0 1 5.5-1.5A3.5 3.5 0 0 1 20 9a3.5 3.5 0 0 1-1 6.5A3.5 3.5 0 0 1 15 20a3 3 0 0 1-3-1.5Z","M12 5v13.5"],"não trí_não tư_duy tâm_lý trí_nhớ brain mind psychology","care"],["dna","Gen / DNA","DNA",["M7 2c0 7 10 7 10 14 0 3-1 5-1 6","M17 2c0 7-10 7-10 14 0 3 1 5 1 6","M9 6h6M8 11h8M8.5 18h7"],"dna gen di_truyền khoa_học tế_bào science","care"],["thermometer","Nhiệt độ","Temperature",["M10 14V5a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0Z","M12 14V9"],"sốt nhiệt_độ nhiệt_kế temperature fever","care"],["bandage","Băng dán","Bandage",["M4.5 14.5 14.5 4.5a3.5 3.5 0 0 1 5 5l-10 10a3.5 3.5 0 0 1-5-5Z","M10 10h.01M14 10h.01M10 14h.01M14 14h.01"],"vết_thương băng_dán sơ_cứu bandage","care"],["first-aid","Sơ cứu","First aid",["M3 7h18v13H3Z","M8 7V4h8v3","M12 10v7M8.5 13.5h7"],"sơ_cứu hộp_thuốc bảo_hiểm first_aid insurance","care"],["dumbbell","Tập gym","Workout",["M2 12h20","M5 8v8M8 6v12M16 6v12M19 8v8"],"gym tập tập_luyện tạ thể_hình workout fitness cơ_bắp","care"],["running","Chạy bộ","Running",[F(15,4,2),"M8 21l3-5 3 2v4","M11 16l1-6 3 2 3 1","M12 10l-4 1-2 3"],"chạy chạy_bộ cardio running marathon vận_động","care"],["yoga","Yoga / thiền","Yoga",[F(12,4.5,2),"M12 7.5V13","M12 9.5l-4 3.5 1.5 1.5M12 9.5l4 3.5-1.5 1.5","M5 18.5c2-2 4.5-2.5 7-2.5s5 .5 7 2.5c-2 1-4.5 1.5-7 1.5s-5-.5-7-1.5Z"],"yoga thiền meditation thư_giãn cân_bằng","care"],["bicycle","Đạp xe","Cycling",[F(5.5,16,3.5),F(18.5,16,3.5),"M5.5 16l4-7h6l3 7","M9.5 9 12 16H5.5","M14 6h2l-.5 3"],"xe_đạp đạp_xe cycling bike","care"],["stopwatch","Bấm giờ","Stopwatch",[F(12,14,7),"M12 14v-4","M10 3h4","M12 3v4","M18 7l1.5-1.5"],"bấm_giờ đồng_hồ_bấm_giờ phút giây timer stopwatch interval","care"],["scale","Cân nặng","Weight",["M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z","M8 10a4 4 0 0 1 8 0Z","M12 10l1.5-2.5"],"cân cân_nặng giảm_cân kg béo weight scale","care"],["drop","Nước","Water",["M12 3c3 4.5 6 8 6 11a6 6 0 0 1-12 0c0-3 3-6.5 6-11Z","M9.5 15a2.5 2.5 0 0 0 2.5 2.5"],"nước uống_nước cấp_nước cấp_ẩm water hydration giọt","care"],["lotion","Mỹ phẩm","Skincare",["M9 3h6v3H9Z","M8 6h8l1 3v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9Z","M10 13h4"],"mỹ_phẩm kem serum dưỡng_da skincare chăm_sóc_da sữa_rửa_mặt","care"],["lipstick","Son môi","Lipstick",["M9 11h6v10H9Z","M10 11V6l4-3v8","M9 15h6"],"son son_môi trang_điểm makeup lipstick","care"],["mirror","Gương","Mirror",[F(12,9,6),"M12 15v6M8 21h8"],"gương làm_đẹp beauty ngoại_hình","care"],["scissors","Cắt tóc","Haircut",[F(6,6,3),F(6,18,3),"M8.2 8.2 20 18M8.2 15.8 20 6"],"cắt cắt_tóc salon tóc barber haircut","care"],["comb","Chải tóc","Comb",["M3 9h18v4H3Z","M5 13v6M8 13v6M11 13v6M14 13v6M17 13v6"],"lược chải_tóc tóc hair","care"],["lotus","Spa","Spa",["M12 20c-5 0-9-3-9-7 3 0 6 1 9 4 3-3 6-4 9-4 0 4-4 7-9 7Z","M12 17c-2-3-2-7 0-11 2 4 2 8 0 11Z"],"spa massage thư_giãn liệu_trình wellness sen","care"],["moon","Giấc ngủ","Sleep",["M20 14a8 8 0 1 1-10-10 6.5 6.5 0 0 0 10 10Z","M16 3h3l-3 3h3"],"ngủ giấc_ngủ mất_ngủ ban_đêm sleep night","care"],["smile","Vui vẻ","Happy",[Ra,"M8.5 14a4 4 0 0 0 7 0","M9 9.5h.01M15 9.5h.01"],"vui hạnh_phúc hài_lòng cười happy smile","social"],["book","Sách","Book",["M4 4h11a3 3 0 0 1 3 3v14H7a3 3 0 0 1-3-3Z","M4 18a3 3 0 0 1 3-3h11"],"sách tài_liệu ebook book đọc_sách","learn"],["book-open","Bài học","Lesson",["M2 5h7a3 3 0 0 1 3 3v12a2.5 2.5 0 0 0-2.5-2.5H2Z","M22 5h-7a3 3 0 0 0-3 3v12a2.5 2.5 0 0 1 2.5-2.5H22Z"],"bài_học học đọc kiến_thức lesson learn study","learn"],["graduation","Tốt nghiệp","Graduation",["M2 9l10-5 10 5-10 5Z","M6 11v5c3 2.5 9 2.5 12 0v-5","M22 9v6"],"tốt_nghiệp khoá_học đại_học học_viên course graduation education giáo_dục","learn"],["pencil","Viết","Write",["M4 20l1-5L16 4l4 4L9 19Z","M14 6l4 4"],"viết bút ghi_chú bài_tập write note homework","learn"],["ruler","Đo lường","Ruler",["M3 16 16 3l5 5L8 21Z","M7 12l2 2M10 9l2 2M13 6l2 2"],"thước đo kích_thước ruler measure","learn"],["backpack","Học sinh","Student",["M6 8a6 6 0 0 1 12 0v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1Z","M9 4V3h6v1","M8 14h8v4H8Z"],"học_sinh sinh_viên đi_học balo student school","learn"],["school","Trường học","School",["M3 21V10l9-6 9 6v11","M3 21h18","M10 21v-5h4v5",F(12,11,1.8)],"trường trường_học trung_tâm school academy","learn"],["certificate","Chứng chỉ","Certificate",["M4 4h16v12H4Z","M8 8h8M8 11h5",F(16,17,2.5),"M14.5 19 14 22l2-1 2 1-.5-3"],"chứng_chỉ bằng_cấp chứng_nhận certificate diploma","learn"],["robot","AI / robot","AI robot",["M5 8h14v11H5Z","M12 8V5",F(12,3.5,1),"M9 13h.01M15 13h.01","M9.5 16.5h5","M2 12v3M22 12v3"],"ai trí_tuệ_nhân_tạo robot chatbot tự_động automation bot","learn"],["laptop","Máy tính","Laptop",["M5 5h14v10H5Z","M2 19h20l-2-4H4Z"],"laptop máy_tính làm_việc online computer","learn"],["monitor","Màn hình","Screen",["M3 4h18v12H3Z","M8 21h8M12 16v5"],"màn_hình desktop screen dashboard","learn"],["code","Lập trình","Code",["m8 7-5 5 5 5","m16 7 5 5-5 5","m14 4-4 16"],"code lập_trình developer website phần_mềm programming","learn"],["wifi","Internet","Wi-Fi",["M2 9a15 15 0 0 1 20 0","M5 12.5a10 10 0 0 1 14 0","M8.5 16a5 5 0 0 1 7 0","M12 19.5h.01"],"wifi internet mạng kết_nối online","learn"],["server","Dữ liệu","Server",["M4 4h16v6H4Z","M4 14h16v6H4Z","M8 7h.01M8 17h.01"],"máy_chủ server dữ_liệu lưu_trữ hosting database","learn"],["cursor","Click","Click",["M5 3l14 8-6 2-2 6Z","M13 13l5 5"],"click bấm nhấn_vào link chuột cursor","learn"],["gamepad","Game","Game",["M7 7h10a5 5 0 0 1 4.9 6l-.8 4a2.5 2.5 0 0 1-4.3 1.2L14 15h-4l-2.8 3.2A2.5 2.5 0 0 1 2.9 17l-.8-4A5 5 0 0 1 7 7Z","M8 10v4M6 12h4","M15 11h.01M17 13h.01"],"game chơi_game gaming trò_chơi esport","learn"],["headphones","Nghe","Listen",["M4 15v-3a8 8 0 0 1 16 0v3","M4 15h3v6H5a1 1 0 0 1-1-1Z","M20 15h-3v6h2a1 1 0 0 0 1-1Z"],"nghe tai_nghe podcast audio listen","learn"],["mic","Micro","Microphone",["M12 2a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V5a3 3 0 0 1 3-3Z","M5 11a7 7 0 0 0 14 0","M12 18v4"],"micro nói giọng_nói thu_âm voice speak livestream","learn"],["video-cam","Quay video","Recording",["M3 7h12v10H3Z","M15 10l6-3v10l-6-3"],"quay quay_video camera vlog recording","learn"],["link","Liên kết","Link",["M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1","M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"],"link liên_kết kết_nối đường_dẫn connect","learn"],["puzzle","Giải pháp","Puzzle",["M4 7h4a2 2 0 1 1 4 0h4v4a2 2 0 1 1 0 4v4H4v-4a2 2 0 1 0 0-4Z"],"giải_pháp mảnh_ghép tích_hợp puzzle solution integration","learn"],["search","Tìm kiếm","Search",[F(10.5,10.5,6.5),"m15.5 15.5 5 5"],"tìm tìm_kiếm search google nghiên_cứu research","learn"],["gear","Cài đặt","Settings",[F(12,12,3),F(12,12,7),"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1"],"cài_đặt thiết_lập quy_trình vận_hành settings process setup","learn"],["calculator","Tính toán","Calculator",["M5 3h14v18H5Z","M8 6h8v3H8Z","M8 13h.01M12 13h.01M16 13h.01M8 17h.01M12 17h.01M16 17h.01"],"tính tính_toán máy_tính_tiền kế_toán calculator accounting","learn"],["translate","Ngôn ngữ","Language",["M3 5h10M8 3v2","M5 5c1 4 4 7 7 8","M11 5c-1 4-4 7-7 8","M13 21l4-9 4 9","M14.5 18h5"],"ngôn_ngữ tiếng_anh dịch ngoại_ngữ language translate english","learn"],["download","Tải về","Download",["M12 3v12","m7 10 5 5 5-5","M4 21h16"],"tải tải_về download cài_app","learn"],["battery","Năng lượng","Battery",["M3 7h15v10H3Z","M21 10v4","M6 10v4M9 10v4"],"pin năng_lượng sạc battery energy","learn"],["door","Cửa","Door",["M6 3h12v18H6Z","M14 12h.01","M3 21h18"],"cửa cửa_ra_vào door entrance","place"],["bed","Phòng ngủ","Bedroom",["M3 18V6","M3 13h18v5","M21 18v-5a3 3 0 0 0-3-3h-8v3",F(6.5,10.5,1.5)],"phòng_ngủ giường khách_sạn homestay bedroom hotel","place"],["sofa","Phòng khách","Living room",["M5 11V8a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v3","M3 11a2 2 0 0 1 2 2v2h14v-2a2 2 0 1 1 4 0v5H1v-5a2 2 0 0 1 2-2Z","M5 20v1M19 20v1"],"phòng_khách sofa nội_thất living_room furniture","place"],["bath","Phòng tắm","Bathroom",["M3 12h18v3a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5Z","M6 12V5a2 2 0 0 1 4 0","M7 20l-1 2M17 20l1 2"],"phòng_tắm bồn_tắm wc toilet bathroom","place"],["area","Diện tích","Floor area",["M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5","M4 4l6 6M20 4l-6 6M20 20l-6-6M4 20l6-6"],"diện_tích m2 mét_vuông rộng area size","place"],["plane","Máy bay","Flight",["M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5Z"],"máy_bay bay chuyến_bay vé_máy_bay du_lịch flight travel","place"],["suitcase","Hành lý","Luggage",["M4 7h16v13H4Z","M9 7V4h6v3","M9 7v13M15 7v13"],"vali hành_lý đi_du_lịch luggage trip","place"],["ticket","Vé","Ticket",["M3 7h18v3a2 2 0 0 0 0 4v3H3v-3a2 2 0 0 0 0-4Z","M14 7v2M14 11v2M14 15v2"],"vé voucher sự_kiện ticket event","place"],["map","Bản đồ","Map",["M3 6l6-3 6 3 6-3v15l-6 3-6-3-6 3Z","M9 3v15M15 6v15"],"bản_đồ lộ_trình hành_trình map route","place"],["mountain","Núi","Mountain",["M2 20 9 8l4 6 3-4 6 10Z","M7.5 10.5 9 12l1.5-1.5"],"núi leo_núi trekking phượt mountain","place"],["umbrella","Biển","Beach",["M3 11a9 9 0 0 1 18 0Z","M12 11v10","M12 2v2"],"biển bãi_biển nghỉ_dưỡng resort beach ô_dù","place"],["palm","Nhiệt đới","Tropical",["M12 21c0-5 .5-9 1-12","M13 9c-2-3-6-4-9-2 3 0 5 1 6 3","M13 9c1-3 4-5 8-4-3 1-5 3-5 5","M13 9c-1-2-1-5 1-7 1 2 1 5-1 7","M7 21h12"],"dừa nhiệt_đới đảo kỳ_nghỉ tropical island vacation","place"],["sun","Nắng","Sunny",[F(12,12,4),"M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"],"nắng mặt_trời mùa_hè thời_tiết sunny summer weather","place"],["rain","Mưa","Rain",["M7 14a4 4 0 0 1 .5-8A6 6 0 0 1 18.5 8a3.5 3.5 0 0 1-.5 6Z","M8 17l-1 3M12 17l-1 3M16 17l-1 3"],"mưa mùa_mưa bão rain storm","place"],["pool","Hồ bơi","Pool",["M8 12V4M16 12V4M8 6h8M8 10h8","M2 15c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0","M2 19c2 1.5 4 1.5 6 0s4-1.5 6 0 4 1.5 6 0"],"hồ_bơi bể_bơi bơi pool swimming tiện_ích","place"],["tent","Cắm trại","Camping",["M12 3 2 21h20Z","M9 21l3-6 3 6"],"cắm_trại camping glamping dã_ngoại","place"],["tree","Cây xanh","Greenery",["M12 22v-6","M12 2l6 8h-3l4 6H5l4-6H6Z"],"cây cây_xanh công_viên thiên_nhiên tree park green","place"],["train","Tàu","Train",["M6 3h12a2 2 0 0 1 2 2v10a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V5a2 2 0 0 1 2-2Z","M4 10h16","M8 14h.01M16 14h.01","M8 18l-2 3M16 18l2 3"],"tàu tàu_hoả metro tàu_điện train","place"],["bus","Xe buýt","Bus",["M5 3h14a1 1 0 0 1 1 1v13H4V4a1 1 0 0 1 1-1Z","M4 10h16","M7 14h.01M17 14h.01","M6 17v3M18 17v3"],"xe_buýt xe_khách bus tour","place"],["car","Ô tô","Car",["M3 13l2-5a2 2 0 0 1 2-1h10a2 2 0 0 1 2 1l2 5v5H3Z","M3 13h18",F(7.5,16,1),F(16.5,16,1),"M5 18v2M19 18v2"],"ô_tô xe_hơi xe car vehicle lái_xe","place"],["fuel","Xăng","Fuel",["M4 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M3 21h12","M7 7h4v4H7Z","M14 9h2a2 2 0 0 1 2 2v6a1.5 1.5 0 0 0 3 0V8l-3-3"],"xăng nhiên_liệu đổ_xăng tiết_kiệm_xăng fuel gas","place"],["ev-charge","Xe điện","EV charging",["M5 21V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v16","M4 21h12","M10 7l-2 4h4l-2 4","M15 10h2a2 2 0 0 1 2 2v4a1.5 1.5 0 0 0 3 0V9"],"xe_điện sạc_xe trạm_sạc vinfast ev electric","place"],["road","Đường đi","Road",["M8 3 4 21M16 3l4 18","M12 4v2M12 10v3M12 17v3"],"con_đường đường_đi đường_phố đường_cao_tốc cao_tốc hành_trình road highway street","place"],["parking","Đỗ xe","Parking",["M4 4h16v16H4Z","M9 17V7h4a3 3 0 0 1 0 6H9"],"đỗ_xe bãi_xe hầm_xe parking","place"],["steering","Lái xe","Driving",[Ra,F(12,12,2),"M3.5 10h6.5M14 10h6.5M12 14v7"],"lái lái_xe vô_lăng học_lái driving","place"],["speedometer","Tốc độ","Speed",["M4 18a9 9 0 1 1 16 0","M12 14l4-5","M12 14h.01"],"tốc_độ km/h vận_tốc speed performance hiệu_suất","place"],["traffic-light","Giao thông","Traffic",["M8 2h8v20H8Z",F(12,6.5,1.6),F(12,12,1.6),F(12,17.5,1.6)],"giao_thông đèn_đỏ kẹt_xe traffic","place"],["ship","Tàu thuỷ","Ship",["M3 15h18l-3 5H6Z","M5 15V9h14v6","M9 9V5h6v4","M12 2v3"],"tàu_thuỷ du_thuyền cảng xuất_khẩu logistics ship cruise","place"],["megaphone","Thông báo","Announcement",["M3 10v4h4l9 5V5l-9 5Z","M7 14l1.5 6H11l-1-5","M19 9a4 4 0 0 1 0 6"],"thông_báo quảng_cáo marketing loa announce ads","social"],["bell","Chuông","Notification",["M6 16v-5a6 6 0 0 1 12 0v5l2 2H4Z","M10 21h4"],"chuông thông_báo nhắc subscribe đăng_ký_kênh notification","social"],["hashtag","Hashtag","Hashtag",["M5 9h14M5 15h14M10 3 8 21M16 3l-2 18"],"hashtag xu_hướng tag trending","social"],["at","Tài khoản","Mention",[F(12,12,4),"M16 8v5a2.5 2.5 0 0 0 5 0v-1a9 9 0 1 0-3.5 7.1"],"tài_khoản tag nhắc_tên username mention","social"],["user-plus","Theo dõi","Follow",[F(9,8,4),"M2 21a7 7 0 0 1 14 0","M19 8v6M16 11h6"],"follow theo_dõi kết_bạn follower người_theo_dõi","social"],["live","Livestream","Live",[F(12,12,2),"M7.8 7.8a6 6 0 0 0 0 8.4M16.2 7.8a6 6 0 0 1 0 8.4","M4.9 4.9a10 10 0 0 0 0 14.2M19.1 4.9a10 10 0 0 1 0 14.2"],"live livestream phát_sóng trực_tiếp broadcast","social"],["share","Chia sẻ","Share",[F(6,12,2.5),F(18,6,2.5),F(18,18,2.5),"M8.2 10.8l7.6-3.6M8.2 13.2l7.6 3.6"],"chia_sẻ share lan_toả viral","social"],["sad","Buồn","Sad",[Ra,"M8.5 16a4 4 0 0 1 7 0","M9 9.5h.01M15 9.5h.01"],"buồn thất_vọng chán sad upset","social"],["wow","Bất ngờ","Surprise",[Ra,F(12,15.5,1.8),"M9 9.5h.01M15 9.5h.01"],"bất_ngờ ngạc_nhiên wow sốc shock","social"],["crown","Đẳng cấp","Premium",["M3 8l4.5 4L12 5l4.5 7L21 8l-2 11H5Z","M5 19h14"],"vương_miện đẳng_cấp vip cao_cấp king queen","money"],["medal","Huy chương","Medal",[F(12,15,5),"M8.5 11 5 3h4l3 6 3-6h4l-3.5 8","M12 13v4"],"huy_chương giải thành_tích medal achievement","money"],["flag","Cột mốc","Milestone",["M5 21V4","M5 4h12l-2 4 2 4H5"],"cột_mốc mục_tiêu về_đích bắt_đầu milestone flag","money"],["handshake","Hợp tác","Partnership",["M2 11l4-4 4 2 3-2 4 1 5 4","M7 12l4 4a1.5 1.5 0 0 0 2-2","M10 14l2 2a1.5 1.5 0 0 0 2-2l-3-3","M13 13l1.5 1.5a1.5 1.5 0 0 0 2-2L13 9"],"hợp_tác đối_tác thoả_thuận deal partner partnership","money"],["briefcase","Công việc","Work",["M3 7h18v13H3Z","M8 7V4h8v3","M3 13h18"],"công_việc việc_làm tuyển_dụng doanh_nghiệp job business office","money"],["wallet","Ví tiền","Wallet",["M3 6a2 2 0 0 1 2-2h12v4","M3 6v12a2 2 0 0 0 2 2h16V8H5a2 2 0 0 1-2-2Z","M16 14h.01"],"ví ví_tiền chi_tiêu ví_điện_tử wallet spending","money"],["card","Thẻ","Card",["M2 5h20v14H2Z","M2 10h20","M6 15h4"],"thẻ thẻ_tín_dụng thanh_toán quẹt_thẻ card payment","money"],["bank","Ngân hàng","Bank",["M3 10 12 4l9 6","M4 10h16","M6 10v8M10 10v8M14 10v8M18 10v8","M3 21h18"],"ngân_hàng vay lãi_suất bank loan","money"],["piggy","Heo đất","Piggy bank",["M5 11a7 6 0 0 1 12-3h2l1 3h1v4h-2l-1 3h-3v2h-3v-2H9v2H6v-3a6 6 0 0 1-1-6Z","M14 9h.01","M9 7h4"],"heo_đất để_dành tích_luỹ piggy saving","money"],["document","Tài liệu","Document",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 13h7M9 17h5"],"tài_liệu hồ_sơ giấy_tờ báo_cáo document file","money"],["contract","Hợp đồng","Contract",["M6 2h8l5 5v15H6Z","M14 2v5h5","M9 17c1-2 2 1 3-1s2 1 3 0"],"hợp_đồng ký ký_kết pháp_lý contract sign legal","money"],["folder","Thư mục","Folder",["M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v11H3Z"],"thư_mục lưu_trữ folder","money"],["clipboard","Danh sách","Checklist",["M8 4H6v17h12V4h-2","M9 3h6v3H9Z","m9 13 2 2 4-4"],"checklist danh_sách việc_cần_làm todo kế_hoạch plan","money"],["pie","Tỷ trọng","Pie chart",["M21 12a9 9 0 1 1-9-9v9Z","M15 3a9 9 0 0 1 6 6h-6Z"],"tỷ_trọng thị_phần cơ_cấu pie market_share","money"],["funnel","Phễu","Funnel",["M3 4h18l-7 9v6l-4 2v-8Z"],"phễu lọc chuyển_đổi khách_hàng_tiềm_năng funnel filter conversion","money"],["magnet","Thu hút","Attract",["M5 4v8a7 7 0 0 0 14 0V4h-5v8a2 2 0 0 1-4 0V4Z","M5 8h5M14 8h5"],"thu_hút hút_khách nam_châm attract magnet lead","money"],["hourglass","Chờ đợi","Waiting",["M6 3h12M6 21h12","M7 3c0 5 10 5 10 9s-10 4-10 9","M17 3c0 5-10 5-10 9s10 4 10 9"],"chờ chờ_đợi hạn sắp_hết thời_hạn countdown deadline","money"],["infinity","Không giới hạn","Unlimited",["M12 12c-2-2.7-4-4-6-4a4 4 0 0 0 0 8c2 0 4-1.3 6-4Zm0 0c2 2.7 4 4 6 4a4 4 0 0 0 0-8c-2 0-4 1.3-6 4Z"],"không_giới_hạn mãi_mãi vô_hạn unlimited forever","money"],["refresh","Lặp lại","Repeat",["M21 12a9 9 0 0 1-15.5 6.3L3 16","M3 12a9 9 0 0 1 15.5-6.3L21 8","M3 21v-5h5M21 3v5h-5"],"lặp_lại đổi_trả hoàn_tiền cập_nhật refund repeat update","money"],["paw","Thú cưng","Pets",[F(7,9,1.8),F(17,9,1.8),F(10,5,1.6),F(14,5,1.6),"M12 12c-3 0-5 3-5 5.5 0 2 1.5 2.5 3 2 1-.3 1.5-.5 2-.5s1 .2 2 .5c1.5.5 3 0 3-2 0-2.5-2-5.5-5-5.5Z"],"thú_cưng chó mèo pet dog cat","social"]],Dt=(t,e,c)=>`M${t-c} ${e}a${c} ${c} 0 1 0 ${2*c} 0a${c} ${c} 0 1 0 ${-2*c} 0Z`,oa=Dt(12,12,9),dl={money:"Tiền",coins:"Tiết kiệm",percent:"Phần trăm",growth:"Tăng trưởng",decline:"Giảm",chart:"Biểu đồ",target:"Mục tiêu",clock:"Thời gian",calendar:"Lịch",user:"Cá nhân",users:"Đội nhóm",cart:"Giỏ hàng",bag:"Sản phẩm",gift:"Quà tặng",tag:"Giảm giá",rocket:"Ra mắt",bulb:"Ý tưởng",bolt:"Nhanh",star:"Ngôi sao",heart:"Trái tim",shield:"Uy tín",lock:"Riêng tư",key:"Bí quyết",check:"Hoàn thành",cross:"Sai",warning:"Lưu ý",question:"Câu hỏi",phone:"Điện thoại",chat:"Tin nhắn",mail:"Email",globe:"Toàn cầu",home:"Nhà",location:"Địa điểm",truck:"Giao hàng",fire:"Nổi bật",trophy:"Chiến thắng",sparkle:"Mới",chip:"Công nghệ",play:"Video",camera:"Ảnh",eye:"Lượt xem",like:"Thích",leaf:"Tự nhiên",music:"Âm nhạc"},gl={money:"money",coins:"money",percent:"money",growth:"money",decline:"money",chart:"money",target:"money",tag:"money",cart:"money",bag:"money",gift:"money",trophy:"money",user:"social",users:"social",heart:"social",like:"social",chat:"social",mail:"social",phone:"social",eye:"social",fire:"social",play:"social",camera:"social",music:"social",chip:"learn",bulb:"learn",rocket:"learn",question:"learn",globe:"learn",home:"place",location:"place",truck:"place",leaf:"place"},_=(t,e,c,a)=>[t,{name:dl[t],en:e,d:c,hints:a,group:gl[t]??"general"}],Za=Object.freeze(Object.fromEntries([_("money","Money",["M2.5 6.5h19v11h-19Z",Dt(12,12,2.6),"M6 12h.01M18 12h.01"],"tiền giá triệu tỷ nghìn vnd usd $ money price cash cost chi_phí thu_nhập lương giá_tiền"),_("coins","Savings",["M5 7a7 3 0 1 0 14 0a7 3 0 1 0 -14 0Z","M5 7v5c0 1.7 3.1 3 7 3s7-1.3 7-3V7","M5 12v5c0 1.7 3.1 3 7 3s7-1.3 7-3v-5"],"tiết_kiệm đầu_tư vốn ngân_sách save savings coin invest budget"),_("percent","Percent",["M19 5 5 19",Dt(6.5,6.5,2.5),Dt(17.5,17.5,2.5)],"% phần_trăm tỷ_lệ percent rate"),_("growth","Growth",["M3 17l6-6 4 4 8-8","M15 7h6v6"],"tăng tăng_trưởng doanh_thu lợi_nhuận lãi gấp_đôi gấp growth revenue profit increase scale x2 x3 x10"),_("decline","Decline",["M3 7l6 6 4-4 8 8","M15 17h6v-6"],"giảm thua_lỗ lỗ sụt tụt drop loss decline fall"),_("chart","Chart",["M4.5 20V11M10 20V5M15.5 20v-6M2.5 20h19"],"số_liệu báo_cáo thống_kê dữ_liệu kết_quả data report stats result analytics"),_("target","Target",[oa,Dt(12,12,4.5),Dt(12,12,.6)],"mục_tiêu chính_xác tập_trung target goal aim focus"),_("clock","Time",[oa,"M12 7.5V12l3 2"],"thời_gian phút giờ giây đồng_hồ time minute hour second deadline watch"),_("calendar","Calendar",["M4 5.5h16v15H4Z","M4 10h16M8 3v4M16 3v4"],"ngày lịch tuần tháng năm lịch_hẹn date day week month year schedule"),_("user","Person",[Dt(12,8,4),"M4.5 20.5a7.5 7.5 0 0 1 15 0"],"khách khách_hàng customer user person client founder"),_("users","Team",[Dt(9,8.5,3.5),"M2.5 20a6.5 6.5 0 0 1 13 0","M16 5.2a3.5 3.5 0 0 1 0 6.6","M18 14.3a6.5 6.5 0 0 1 3.5 5.7"],"đội đội_ngũ nhóm cộng_đồng nhân_viên team community people staff"),_("cart","Cart",["M3 4h2.2l2.3 11h10.8l2.2-8H6.3",Dt(10,19.5,1.5),Dt(17,19.5,1.5)],"mua đặt_hàng đơn_hàng giỏ_hàng mua_sắm buy order cart checkout"),_("bag","Product",["M5 8h14l-1 13H6Z","M9 8V6.5a3 3 0 0 1 6 0V8"],"sản_phẩm mặt_hàng túi product item bag"),_("gift","Gift",["M3.5 8.5h17v4h-17Z","M5 12.5v8h14v-8M12 8.5v12","M12 8.5C10.5 4.5 6 4.5 6.5 7c.3 1.5 3.5 1.5 5.5 1.5ZM12 8.5c1.5-4 6-4 5.5-1.5-.3 1.5-3.5 1.5-5.5 1.5Z"],"quà quà_tặng tặng miễn_phí ưu_đãi phần_thưởng free gift bonus"),_("tag","Sale",["M3 12.5V3.5h9l9 9-9 9Z",Dt(7.5,8,.9)],"giảm_giá khuyến_mãi sale discount deal voucher mã_giảm"),_("rocket","Launch",["M12 2.5c3.5 2.5 5 6.5 3.5 12h-7C7 9 8.5 5 12 2.5Z","M8.5 14.5 6 17l1 4 3-2.5M15.5 14.5 18 17l-1 4-3-2.5",Dt(12,9,1.6)],"ra_mắt khởi_nghiệp bứt_phá phóng launch startup boost"),_("bulb","Idea",["M9 18h6M10 21h4","M12 3a6 6 0 0 0-3.8 10.6c.6.5.8 1.3.8 2.4h6c0-1.1.2-1.9.8-2.4A6 6 0 0 0 12 3Z"],"ý_tưởng mẹo bí_kíp sáng_tạo idea tip hack creative insight"),_("bolt","Fast",["M13 2 4.5 13.5H11L10 22l8.5-11.5H12Z"],"nhanh ngay lập_tức năng_lượng tốc_độ fast instant energy power quick speed"),_("star","Star",["m12 3 2.8 5.8 6.2.9-4.5 4.4 1.1 6.2L12 17.4l-5.6 2.9 1.1-6.2L3 9.7l6.2-.9Z"],"đánh_giá chất_lượng tốt_nhất xuất_sắc cao_cấp star review rating best quality premium"),_("heart","Love",["M12 20.5S4 15.9 4 10a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 5.9-8 10.5-8 10.5Z"],"yêu thích tim sức_khoẻ sức_khỏe chăm_sóc love like health care"),_("shield","Trust",["M12 2.5 4 5.5v6c0 5 3.4 8.7 8 10 4.6-1.3 8-5 8-10v-6Z","m8.5 12 2.5 2.5 4.5-5"],"an_toàn bảo_mật bảo_hành uy_tín chính_hãng secure safe trust guarantee warranty"),_("lock","Private",["M5 10.5h14v10H5Z","M8 10.5V7a4 4 0 0 1 8 0v3.5"],"riêng_tư mật_khẩu khoá private lock password privacy"),_("key","Key",[Dt(7.5,15.5,4),"M10.5 12.5 20 3M16.5 6.5 19 9M14 9l2 2"],"chìa_khoá chìa_khóa bí_quyết bí_mật key secret unlock"),_("check","Done",[oa,"m8 12.5 2.8 2.8L16.5 9.5"],"hoàn_thành hiệu_quả chính_xác xong đúng đạt done ok correct works"),_("cross","Wrong",[oa,"m9 9 6 6M15 9l-6 6"],"sai lỗi đừng không_nên tránh sai_lầm mistake wrong error avoid"),_("warning","Warning",["M12 3.5 2.5 20h19Z","M12 10v4.5M12 17.5h.01"],"lưu_ý cảnh_báo chú_ý nguy_hiểm rủi_ro warning risk careful"),_("question","Question",[oa,"M9.5 9.2a2.6 2.6 0 0 1 5 .8c0 1.8-2.5 2.2-2.5 4","M12 17h.01"],"câu_hỏi tại_sao vì_sao thế_nào làm_sao question why how"),_("phone","Phone",["M8.5 2.5h7A1.5 1.5 0 0 1 17 4v16a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 7 20V4a1.5 1.5 0 0 1 1.5-1.5Z","M11 18.5h2"],"điện_thoại ứng_dụng app gọi mobile phone call smartphone"),_("chat","Message",["M4 4.5h16V16H10l-5 4v-4H4Z","M8 10.2h.01M12 10.2h.01M16 10.2h.01"],"tin_nhắn nhắn_tin inbox bình_luận chat message comment dm"),_("mail","Email",["M3 5.5h18v13H3Z","m3 6.5 9 6.5 9-6.5"],"email thư mail newsletter"),_("globe","Global",[oa,"M3 12h18","M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3Z"],"toàn_cầu quốc_tế thế_giới online website web global world international"),_("home","Home",["m3 11 9-8 9 8","M5 9.5V21h14V9.5","M10 21v-6h4v6"],"nhà ngôi_nhà gia_đình home house family"),_("location","Location",["M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z",Dt(12,10,2.5)],"địa_chỉ cửa_hàng chi_nhánh vị_trí bản_đồ location address store map"),_("truck","Delivery",["M2.5 6h11v10h-11Z","M13.5 9.5h4l3 3.5v3h-7",Dt(6.8,18,1.8),Dt(17.3,18,1.8)],"giao_hàng vận_chuyển ship delivery shipping freeship"),_("fire","Hot",["M12 21.5c4 0 7-2.8 7-6.8 0-3.6-2.4-5.8-4-8.7-.7 1.8-1.7 2.8-2.9 3C12.2 6.4 11 4.2 9 2.5c.2 3.8-4 6-4 12.2 0 4 3 6.8 7 6.8Z"],"hot bán_chạy xu_hướng viral trend cháy_hàng"),_("trophy","Winner",["M8 3.5h8v6a4 4 0 0 1-8 0Z","M8 5H4.5v1.5A3.5 3.5 0 0 0 8 10M16 5h3.5v1.5A3.5 3.5 0 0 1 16 10","M12 13.5v4M9 21h6M10 17.5h4V21h-4Z"],"chiến_thắng số_1 top giải_thưởng vô_địch winner trophy award champion"),_("sparkle","New",["m12 2.5 2.2 6.3L20.5 11l-6.3 2.2L12 19.5l-2.2-6.3L3.5 11l6.3-2.2Z","m19 16 .8 2.2L22 19l-2.2.8L19 22l-.8-2.2L16 19l2.2-.8Z"],"mới đặc_biệt thông_minh phép_màu ai new special magic smart"),_("chip","Tech",["M7 7h10v10H7Z","M10 10h4v4h-4Z","M9 3v4M15 3v4M9 17v4M15 17v4M3 9h4M3 15h4M17 9h4M17 15h4"],"công_nghệ phần_mềm máy_tính tech technology software computer"),_("play","Video",[oa,"m10 8.5 5.5 3.5-5.5 3.5Z"],"video clip kênh youtube tiktok play watch"),_("camera","Photo",["M3 7.5h4l1.5-2.5h7L17 7.5h4v12H3Z",Dt(12,13.3,3.5)],"ảnh hình_ảnh chụp máy_ảnh photo camera picture"),_("eye","View",["M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12Z",Dt(12,12,3)],"lượt_xem nhìn view views see"),_("like","Like",["M7 10.5v10H3.5v-10Z","M7 10.5 11 3c1.7 0 2.8 1.3 2.5 3l-.7 3.5H19a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.8 21H7"],"đồng_ý tuyệt_vời like thumbs good great"),_("leaf","Natural",["M5 19c0-8 5-14 15-14 0 10-6 15-14 15","M5 19c3-4 6-7 10-9"],"tự_nhiên thiên_nhiên hữu_cơ organic eco natural green"),_("music","Music",["M9 18V5l11-2v13",Dt(6,18,3),Dt(17,16,3)],"âm_nhạc bài_hát âm_thanh nhạc music song sound audio"),...pl.map(([t,e,c,a,o,s])=>[t,{name:e,en:c,d:a,hints:o,group:s}])].sort((t,e)=>t[0].localeCompare(e[0])))),ul=Object.keys(Za),bl=t=>String(t).normalize("NFC").toLowerCase();ul.flatMap(t=>Za[t].hints.split(" ").map(e=>[bl(e).replace(/_/g," "),t])),new Set("và của là có không được cho một những các này đó để trong với khi thì mà như cũng đã sẽ rất hơn nhiều tôi bạn mình anh chị em ở từ ra vào lên xuống nên nếu vì nhưng hay còn đang lại cái con người gì sao thế vậy rồi nè nha ạ à ơi ai đâu nào bị bởi tại theo về qua sau trước the a an and or of to in on is are was were for with that this it as at by be i you we they he she my your our not but so if do does did have has had will can just very more".split(" "));const en=Object.freeze([["cube","Cube","Hộp 3D xoay","3D cube turn",1,["3d","cube","rotate"]],["inside-cube","InsideCube","Trong lòng hộp","Inside the cube",1,["3d","cube","room"]],["cross-warp","CrossWarp","Kéo giãn chéo","Cross warp",.8,["warp","zoom"]],["cross-zoom","CrossZoom","Zoom nhoè chéo","Cross zoom blur",.8,["zoom","blur","impact"]],["doorway","Doorway","Cửa đôi mở","Doorway",1,["3d","door","open"]],["dreamy","Dreamy","Mộng mơ gợn sóng","Dreamy wave",1,["dream","wave","soft"]],["dreamy-zoom","DreamyZoom","Zoom mộng mơ","Dreamy zoom",1,["dream","zoom","flash"]],["ripple","Ripple","Gợn sóng lan","Spreading ripple",1,["water","wave"]],["water-drop","WaterDrop","Giọt nước","Water drop",1.2,["water","drop","ripple"]],["shockwave","Shockwave","Sóng xung kích kính vỡ","Glass shockwave",1.2,["glass","shatter","impact"]],["kaleidoscope","Kaleidoscope","Kính vạn hoa","Kaleidoscope",1,["kaleidoscope","spin","psychedelic"]],["morph","Morph","Biến hình","Morph",1,["morph","liquid"]],["mosaic","Mosaic","Ghép mảnh xoay","Mosaic pan",1.2,["tiles","pan"]],["hexagonalize","Hexagonalize","Lục giác hoá","Hexagonalize",1,["hexagon","pixel","tech"]],["honeycomb","Honeycomb","Tổ ong","Honeycomb",1.2,["hexagon","tiles","tech"]],["puzzle","Puzzle","Ghép hình rơi","Puzzle pieces",1.4,["puzzle","pieces","fall"]],["shatter","Shatter","Vỡ kính","Shatter",1.2,["glass","break","impact"]],["tile-blast","TileBlast","Ô vuông bung ra","Tile blast",1.2,["tiles","explode","3d"]],["tunnel","Tunnel","Đường hầm","Tunnel",1.2,["tunnel","3d","fly"]],["vortex","Vortex","Lốc xoáy mảnh","Vortex",1.4,["tornado","pieces","wind"]],["warp-speed","WarpSpeed","Tốc độ ánh sáng","Warp speed",1.2,["space","speed","stars"]],["gravity-lens","GravityLens","Thấu kính hấp dẫn","Gravity lens",1.2,["space","black hole","warp"]],["fisheye","Fisheye","Mắt cá phồng","Fisheye bulge",1,["lens","bulge"]],["film-burn","FilmBurn","Cháy phim loé","Film burn flare",1.2,["film","retro","light"]],["film-strip","FilmStrip","Cuộn phim trượt","Film strip slip",1.2,["film","retro","projector"]],["glitch-memories","GlitchMemories","Glitch ký ức","Glitch memories",.8,["glitch","digital"]],["datamosh","StripDatamoshGlitch","Datamosh xé dải","Datamosh strips",1,["glitch","datamosh","digital"]],["vhs-tracking","VhsTracking","Nhiễu băng VHS","VHS tracking",1,["vhs","retro","noise"]],["tv-turn-off","TvTurnOff","Tắt TV cũ","Old TV off",1,["tv","retro"]],["ink-bleed","InkBleed","Mực loang nước","Ink bleed",1.4,["ink","organic","art"]],["watercolor","WatercolorDissolve","Màu nước","Watercolour",1.4,["paint","art","soft"]],["smoke","SmokeDissolve","Khói tràn","Smoke dissolve",1.4,["smoke","organic"]],["paper-tear","PaperTear","Xé giấy đôi","Paper tear",1.2,["paper","tear","collage"]],["crumple","Crumple","Vò giấy","Crumple",1.2,["paper","3d"]],["sphere","Sphere","Cuộn thành cầu","Sphere roll",1.2,["3d","ball"]],["book-flip","BookFlip","Lật trang sách","Book page flip",1.2,["book","page","3d"]],["split-flap","SplitFlap","Bảng lật sân bay","Split-flap board",1.4,["board","flip","retro"]],["disintegrate","Disintegrate","Tan thành bụi","Disintegrate",1.4,["dust","particles"]],["vaporize","Vaporize","Bốc hơi","Vaporize",1.4,["smoke","particles"]],["light-rays","LightRays","Tia sáng toả","Light rays",1.2,["light","glow"]],["prisms","Prisms","Lăng trụ xoay","Prism billboard",1.2,["3d","billboard"]],["reeded-glass","ReededGlass","Kính gân","Reeded glass",1,["glass","refraction"]],["swim","Swim","Hoá cá bơi","Swim away",1.4,["fun","organic"]],["heat-haze","HeatHaze","Hơi nóng","Heat haze",1,["heat","distortion"]]].map(([t,e,c,a,o,s])=>Object.freeze({id:t,file:e,name:c,nameEn:a,duration:o,tags:Object.freeze(s)})));Object.freeze(en.map(t=>t.id));const Ml=t=>`gl-${t}`;Object.freeze(en.map((t,e)=>Object.freeze({id:Ml(t.id),version:1,name:t.name,category:"Shader GPU",duration:t.duration,tags:["gpu","shader",...t.tags],sortOrder:5e3+e*10,gl:{id:t.id}}))),Object.freeze([{id:"whip",n:1,vi:"Quất",en:"Whip",pts:[[0,0],[.25,.08],[.4,.35],[.5,1],[.6,.35],[.75,.08],[1,0]],fx:{blurH:.8,rgbShift:.3}},{id:"whip-out",n:2,vi:"Quất ra",en:"Whip out",pts:[[0,0],[.3,.25],[.45,.7],[.5,1],[.56,.3],[.65,0],[1,0]],fx:{blurH:.9,shake:.3}},{id:"whip-in",n:3,vi:"Quất vào",en:"Whip in",pts:[[0,0],[.35,0],[.44,.3],[.5,1],[.55,.7],[.7,.25],[1,0]],fx:{blurH:.9,zoomBlur:.3}},{id:"slow-fast-slow",n:4,vi:"Chậm – nhanh – chậm",en:"Slow – fast – slow",pts:[[0,0],[.15,-.6],[.32,-.6],[.5,1],[.68,-.6],[.85,-.6],[1,0]],fx:{blurH:.7,flash:.35}},{id:"punch",n:5,vi:"Đấm",en:"Punch",pts:[[0,0],[.4,0],[.46,1],[.54,1],[.6,0],[1,0]],fx:{zoomBlur:.8,flash:.6,shake:.5}},{id:"double-hit",n:6,vi:"Hai nhịp",en:"Double hit",pts:[[0,0],[.18,.55],[.3,.05],[.42,.2],[.5,1],[.6,.2],[.75,0],[1,0]],fx:{blurH:.6,rgbShift:.5,shake:.4}},{id:"bounce",n:7,vi:"Nảy",en:"Bounce",pts:[[0,0],[.3,.15],[.5,1],[.62,-1],[.8,-.6],[1,0]],fx:{blurV:.7,zoomBlur:.3}},{id:"linear-burst",n:8,vi:"Bùng thẳng",en:"Linear burst",pts:[[0,0],[.5,1],[1,0]],fx:{blurH:.6,zoomBlur:.4}},{id:"plateau",n:9,vi:"Giữ tốc",en:"Plateau",pts:[[0,0],[.2,.85],[.5,1],[.8,.85],[1,0]],fx:{blurH:.5,rgbShift:.25}},{id:"stutter",n:10,vi:"Bậc thang",en:"Stutter",pts:[[0,0],[.2,0],[.23,.35],[.33,.35],[.36,.7],[.45,.7],[.48,1],[.52,1],[.55,.5],[.66,.5],[.69,0],[1,0]],fx:{rgbShift:.6,shake:.6}},{id:"drift",n:11,vi:"Trôi rồi vọt",en:"Drift & rush",pts:[[0,0],[.2,-.8],[.38,-.8],[.5,1],[.7,.3],[1,0]],fx:{blurH:.7,blurV:.3}},{id:"snap",n:12,vi:"Bật",en:"Snap",pts:[[0,0],[.25,-1],[.44,-1],[.5,1],[.56,0],[1,0]],fx:{zoomBlur:.6,flash:.5,rgbShift:.3}}]).map(t=>t.id);const cn=Object.freeze([.2126,.7152,.0722]),yl=t=>[1,3,5].map(e=>parseInt(t.slice(e,e+2),16));function Pa(t){const[e,c,a]=cn;return[[e+(1-e)*t,c-c*t,a-a*t],[e-e*t,c+(1-c)*t,a-a*t],[e-e*t,c-c*t,a+(1-a)*t]]}function wl(t){const e=t*Math.PI/180,c=Math.cos(e),a=Math.sin(e);return[[.213+c*.787-a*.213,.715-c*.715-a*.715,.072-c*.072+a*.928],[.213-c*.213+a*.143,.715+c*.285+a*.14,.072-c*.072-a*.283],[.213-c*.213-a*.787,.715-c*.715+a*.715,.072+c*.928+a*.072]]}const an=(t,e,c)=>[[t,0,0],[0,e,0],[0,0,c]],ml=Object.freeze({"wash-red":"#ff2a1f","wash-magenta":"#e81ccf","wash-yellow":"#ffd21a","wash-lime":"#a3ff00"});function kl(t,e,c=1.2){const a=yl(t);return[0,1,2].map(o=>cn.map((s,i)=>(o===i?1-e:0)+e*c*a[o]/255*s))}const Qc=t=>[t,t,t];Object.freeze({hue:t=>({m:wl(t*180)}),vivid:t=>({m:Pa(1+.9*t),c:Qc([["s",.15*t]])}),warm:t=>({m:an(1+.08*t,1+.01*t,1-.12*t),c:[[["add",10*t]],[["add",2*t]],[["add",-6*t]]]}),cool:t=>({m:an(1-.08*t,1+.01*t,1+.1*t),c:[[["add",-6*t]],[["add",t]],[["add",10*t]]]}),"teal-orange":t=>({m:Pa(1+.15*t),c:[[["s",.5*t]],[["s",.12*t]],[["s",-.45*t]]]}),fade:t=>({m:Pa(1-.35*t),c:Qc([["lift",36*t,255-22*t]])}),contrast:t=>({c:Qc([["s",.7*t]])}),bleach:t=>({m:Pa(1-.55*t),c:Qc([["s",.55*t]])}),posterize:t=>({c:Qc([["post",Math.round(11-9*t)]])}),threshold:t=>({m:Pa(0),c:Qc([["add",255*(.5-t)],["post",1]])}),exposure:t=>({c:Qc([["lift",0,255*2**(2*t)]])}),...Object.fromEntries(Object.entries(ml).map(([t,e])=>[t,c=>({m:kl(e,c),c:Qc([["s",.3*c]])})]))});const Sl=Object.freeze(["split","film","circle","rect","star","heart"]);Object.freeze([...Sl,"text"]),[...Object.keys(Jo)];const vl=Object.freeze({sway:{vi:"Đung đưa",en:"Sway",amount:6,period:3.2,unit:"deg",pivot:"bottom"},swing:{vi:"Lắc con lắc",en:"Swing",amount:9,period:2.4,unit:"deg",pivot:"top"},breathe:{vi:"Thở",en:"Breathe",amount:.025,period:3.6,unit:"ratio",pivot:"bottom"},bob:{vi:"Nhấp nhô",en:"Bob",amount:10,period:2,unit:"box",pivot:"center"},wave:{vi:"Vẫy tay",en:"Wave",amount:22,period:1.1,unit:"deg",pivot:"top"},nod:{vi:"Gật đầu",en:"Nod",amount:4,period:2.6,unit:"deg",pivot:"bottom"},blink:{vi:"Chớp mắt",en:"Blink",amount:.92,period:3.8,unit:"ratio",pivot:"center"},rise:{vi:"Bốc lên (hơi, khói)",en:"Rise (steam, smoke)",amount:150,period:2.6,unit:"box",pivot:"center"},wiggle:{vi:"Rung nhẹ",en:"Wiggle",amount:3,period:.5,unit:"box",pivot:"center"},flicker:{vi:"Nhấp nháy",en:"Flicker",amount:.35,period:.25,unit:"ratio",pivot:"center"},spin:{vi:"Quay tròn",en:"Spin",amount:1,period:6,unit:"turns",pivot:"center"},drift:{vi:"Trôi qua lại",en:"Drift",amount:30,period:8,unit:"box",pivot:"center"}});Object.freeze(Object.keys(vl)),[["red",0],["yellow",60],["green",120],["cyan",180],["blue",240],["magenta",300]].map(t=>t[0]);const Tl=Object.freeze([{id:"cinematic",name:"Điện ảnh",en:"Cinematic",p:{contrast:1.4,sat:1.05,split:{shadow:[-.07,.01,.08],highlight:[.07,.03,-.05]},hues:[{h:25,w:30,sat:1.18},{h:0,w:18,sat:1.3,lum:-.03},{h:200,w:40,sat:.8}],black:.015}},{id:"teal-orange",name:"Teal & Orange",en:"Teal & Orange",p:{contrast:1.25,sat:1.2,split:{shadow:[-.12,.03,.12],highlight:[.12,.04,-.1]},hues:[{h:30,w:35,sat:1.3},{h:120,w:45,sat:.6,shift:60}]}},{id:"warm-film",name:"Phim ấm",en:"Warm film",p:{wb:[1.14,1.02,.8],contrast:1.15,sat:.95,split:{shadow:[.04,.01,-.04],highlight:[.06,.03,-.05]},black:.04,white:.97}},{id:"cool-noir",name:"Lạnh trinh thám",en:"Cool noir",p:{wb:[.82,.97,1.18],contrast:1.35,sat:.45,split:{shadow:[-.04,.01,.08],highlight:[-.02,0,.03]},black:.015}},{id:"print-film",name:"Phim chiếu rạp",en:"Print film",p:{contrast:1.3,sat:1,split:{shadow:[-.05,.02,.05],highlight:[.05,.02,-.04]},hues:[{h:120,w:50,sat:.7},{h:25,w:30,sat:1.15}],black:.03,white:.95}},{id:"bleach-bypass",name:"Bleach bypass",en:"Bleach bypass",p:{sat:.3,contrast:1.6,black:.02,white:.98}},{id:"matte-fade",name:"Matte nhạt",en:"Faded matte",p:{contrast:.85,sat:.7,black:.14,white:.9,split:{shadow:[0,.03,.05],highlight:[.02,.02,0]}}},{id:"vintage-70s",name:"Cổ điển 70s",en:"Vintage 70s",p:{wb:[1.12,1.04,.74],sat:.75,contrast:1.08,split:{shadow:[.02,.06,-.02],highlight:[.07,.04,-.06]},black:.1,white:.92}},{id:"golden-hour",name:"Giờ vàng",en:"Golden hour",p:{wb:[1.16,1.02,.78],contrast:1.1,sat:1.15,hues:[{h:35,w:40,sat:1.3}],split:{shadow:[.02,0,-.02],highlight:[.06,.03,-.05]},white:.98}},{id:"moonlight",name:"Ánh trăng",en:"Moonlight",p:{wb:[.72,.9,1.25],sat:.4,contrast:1.2,split:{shadow:[-.04,0,.1]},white:.9}},{id:"vivid",name:"Quảng cáo rực rỡ",en:"Vivid commercial",p:{contrast:1.25,sat:1.6,hues:[{h:25,w:25,sat:.9}],black:0,white:1}},{id:"pastel",name:"Pastel mềm",en:"Soft pastel",p:{contrast:.78,sat:.7,black:.12,white:1,split:{shadow:[.06,.02,.06],highlight:[.05,.02,.04]}}},{id:"neon",name:"Neon đêm",en:"Neon night",p:{contrast:1.3,sat:1.5,split:{shadow:[-.04,.02,.14],highlight:[.14,-.04,.1]},hues:[{h:300,w:40,sat:1.4},{h:190,w:40,sat:1.4}]}},{id:"desert",name:"Sa mạc",en:"Desert",p:{wb:[1.14,1,.76],contrast:1.25,sat:.95,hues:[{h:35,w:45,sat:1.3},{h:210,w:40,sat:.5}],black:.03}},{id:"forest",name:"Rừng xanh",en:"Forest green",p:{wb:[.92,1.08,.94],contrast:1.15,sat:1,hues:[{h:110,w:45,sat:1.35,shift:-18},{h:25,w:30,sat:1.05}],split:{shadow:[-.03,.06,.03]}}},{id:"bw-classic",name:"Đen trắng cổ điển",en:"Classic B&W",p:{sat:0,contrast:1.15,black:.02,white:.98}},{id:"bw-contrast",name:"Đen trắng tương phản",en:"High-contrast B&W",p:{sat:0,contrast:1.8}},{id:"sepia",name:"Nâu sepia",en:"Sepia",p:{sat:0,contrast:1.08,tint:[1.15,.97,.72],black:.05,white:.94}}]);new Map(Tl.map(t=>[t.id,t]));const Zc=t=>String(Math.round(t*10)/10),ot=(t,e)=>`${Zc(t)} ${Zc(e)}`,we=t=>t*Math.PI/180,A=(t,e,c)=>`M${ot(t-c,e)}A${Zc(c)} ${Zc(c)} 0 1 0 ${ot(t+c,e)}A${Zc(c)} ${Zc(c)} 0 1 0 ${ot(t-c,e)}Z`,Rt=(t,e,c,a,o)=>{o=Math.min(o,c/2,a/2);const s=`A${Zc(o)} ${Zc(o)} 0 0 1 `;return`M${ot(t+o,e)}L${ot(t+c-o,e)}${s}${ot(t+c,e+o)}L${ot(t+c,e+a-o)}${s}${ot(t+c-o,e+a)}L${ot(t+o,e+a)}${s}${ot(t,e+a-o)}L${ot(t,e+o)}${s}${ot(t+o,e)}Z`},Tt=(...t)=>"M"+t.map(([e,c])=>ot(e,c)).join("L")+"Z",nt=(...t)=>"M"+t.map(([e,c])=>ot(e,c)).join("L"),mo=(t,e,c,a,o=-90)=>Tt(...Array.from({length:a},(s,i)=>[t+c*Math.cos(we(o+i*360/a)),e+c*Math.sin(we(o+i*360/a))])),De=(t,e,c,a,o,s=-90)=>Tt(...Array.from({length:o*2},(i,l)=>{const p=we(s+l*180/o),x=l%2?a:c;return[t+x*Math.cos(p),e+x*Math.sin(p)]})),pc=(t,e,c,a=.16)=>{const o=c*a;return`M${ot(t,e-c)}Q${ot(t+o,e-o)} ${ot(t+c,e)}Q${ot(t+o,e+o)} ${ot(t,e+c)}Q${ot(t-o,e+o)} ${ot(t-c,e)}Q${ot(t-o,e-o)} ${ot(t,e-c)}Z`},on=(t,e,c,a=190,o=34)=>{const s=we(c+180-o),i=we(c+180+o);return`M${ot(t+a*Math.cos(s),e+a*Math.sin(s))}L${ot(t,e)}L${ot(t+a*Math.cos(i),e+a*Math.sin(i))}`},Ee=(t,e,c,a,o)=>Tt(...[[-c/2,-a/2],[c/2,-a/2],[c/2,a/2],[-c/2,a/2]].map(([s,i])=>[t+s*Math.cos(we(o))-i*Math.sin(we(o)),e+s*Math.sin(we(o))+i*Math.cos(we(o))])),xa=(t,e,c,a)=>mo(t,e,c,3,a),ko=(t,e,c,a)=>t.replace(/(-?\d*\.?\d+)[ ,]+(-?\d*\.?\d+)/g,(o,s,i)=>ot(+s*e+c,+i*e+a)),nn="M500 880C140 600 100 330 280 220C400 150 480 220 500 300C520 220 600 150 720 220C900 330 860 600 500 880Z",Jc=(t,e,c)=>ko(nn,c,t-500*c,e-540*c),sn="M500 90C640 90 740 190 740 340L740 500C740 600 800 650 860 700L140 700C200 650 260 600 260 500L260 340C260 190 360 90 500 90Z",ln="M400 780C420 860 580 860 600 780Z",Cl=(t,e,c,a,o,s)=>{const i=[],l=(p,x,f,d)=>{const r=Math.hypot(f-p,d-x),g=(f-p)/r,u=(d-x)/r;for(let v=0;v<r-1;v+=o+s){const b=Math.min(r,v+o);i.push(`M${ot(p+g*v,x+u*v)}L${ot(p+g*b,x+u*b)}`)}};return l(t,e,c,e),l(c,e,c,a),l(c,a,t,a),l(t,a,t,e),i.join("")},H=(t,e,c={})=>({d:t,f:e,...c}),L=(t,e,c,a={})=>({d:t,s:e,w:c,...a}),W=(t,e,c,a,o={})=>({d:t,f:e,s:c,w:a,...o}),R=(t,e,c,a,o,s,i,l)=>({id:t,cat:e,name:c,kw:a,primary:o,secondary:s,p:i,...l?{anim:l}:{}}),rt=(t,e=30,c={})=>L(t,"a",e,{h:"marker",...c}),Al={in:"draw",out:"fade",loop:"none"},ee=(t,e,c,a)=>R(t,"doodle",e,`${c} vẽ tay hand drawn doodle`,"#e2382f","#1c1c22",a,Al),q="#1c1c22",Rl=(t,e,c,a,o,s)=>Array.from({length:c},(i,l)=>{const p=l*360/c,x=l%2?o:a;return`M${ot(t,e)}L${ot(t+x*Math.cos(we(p-s)),e+x*Math.sin(we(p-s)))}L${ot(t+x*Math.cos(we(p+s)),e+x*Math.sin(we(p+s)))}Z`}).join(""),ta=()=>W(A(500,500,430),"a","b",30),rn="M290 600C380 780 620 780 710 600",ha=(t,e,c,a=64)=>[L(t,"b",a+46),L(on(...e,c),"b",a+46),L(t,"a",a),L(on(...e,c),"a",a)],xn=[A(300,420,190),A(500,330,210),A(720,420,200),A(540,520,200),A(340,530,150)].join(""),So="M500 120C260 120 90 260 90 430C90 560 170 660 290 710C290 790 250 850 180 900C300 890 410 840 470 760C480 760 490 760 500 760C740 760 910 620 910 430C910 260 740 120 500 120Z",vo="M180 140L820 140Q900 140 900 220L900 560Q900 640 820 640L440 640L260 840L280 640L180 640Q100 640 100 560L100 220Q100 140 180 140Z",fa=t=>({a:[Ee(180,200,90,40,30),xa(700,140,60,10),A(870,420,28),Ee(300,760,80,34,-40)].join(""),b:[Ee(520,180,70,34,-20),A(120,520,30),xa(820,760,56,70),Ee(640,880,84,32,18)].join(""),y:[A(380,320,30),Ee(900,160,80,34,50),xa(150,780,58,-20),Ee(560,620,74,30,-60)].join(""),r:[xa(400,600,62,30),Ee(780,300,80,34,-30),A(240,420,26),Ee(470,880,70,30,40)].join(""),g:[Ee(260,100,80,34,-10),A(640,400,30),xa(920,620,56,-40),Ee(120,640,70,30,60)].join(""),u:[xa(560,100,56,-70),Ee(720,560,80,32,20),A(380,860,28),Ee(880,900,60,28,-20)].join("")})[t],hn=[R("arrow-bold","arrow","Mũi tên dày","arrow right chỉ hướng bold","#ffd23f",q,[W(Tt([100,380],[560,380],[560,190],[920,500],[560,810],[560,620],[100,620]),"a","b",36)]),R("arrow-curve","arrow","Mũi tên cong","arrow curve chỉ vào","#ff4b55","#ffffff",ha("M150 830C130 480 360 280 800 300",[800,300],3)),R("arrow-down","arrow","Mũi tên xuống","arrow down bấm vào dưới","#ffd23f",q,[W(Tt([380,100],[620,100],[620,480],[820,480],[500,900],[180,480],[380,480]),"a","b",36)]),R("arrow-chevrons","arrow","Chevron xuống","chevron down swipe vuốt","#ffffff",q,[L(nt([200,60],[500,300],[800,60]),"a",90),L(nt([200,360],[500,600],[800,360]),"a",90,{o:.65}),L(nt([200,660],[500,900],[800,660]),"a",90,{o:.35})]),R("arrow-diagonal","arrow","Mũi tên chéo","arrow diagonal up tăng trưởng","#31c76a","#ffffff",ha(nt([160,840],[840,160]),[840,160],-45)),R("arrow-loop","arrow","Mũi tên vòng","arrow loop hand drawn vẽ tay","#ffd23f",q,ha("M120 840C280 880 440 780 440 620C440 480 310 440 280 540C250 640 380 720 520 620C660 520 720 400 830 250",[830,250],-54,56)),R("arrow-zigzag","arrow","Mũi tên zigzag","arrow zigzag răng cưa","#3aa8ff","#ffffff",ha(nt([110,820],[270,420],[430,740],[600,340],[860,260]),[860,260],-17,56)),R("arrow-uturn","arrow","Mũi tên quay đầu","arrow u turn quay lại","#ff4b55","#ffffff",ha("M220 880L220 440C220 270 340 190 500 190C660 190 780 270 780 440L780 700",[780,700],90)),ee("doodle-circle","Vòng khoanh vẽ tay","khoanh tròn circle highlight",[rt("M330 230C480 140 760 170 850 380C930 570 790 800 540 840C300 880 120 720 140 480C155 320 300 210 470 190C560 180 640 200 700 230")]),ee("doodle-oval","Khoanh dẹt vẽ tay","khoanh oval ellipse chữ",[rt("M250 340C420 270 760 290 880 420C980 530 830 680 520 700C250 715 70 620 110 480C140 380 300 330 480 320C590 315 680 330 760 360")]),ee("doodle-underline","Gạch chân vẽ tay","gạch chân underline nhấn",[rt("M90 560C260 530 470 545 650 535C760 528 850 520 920 530",34)]),ee("doodle-double-underline","Gạch chân đôi vẽ tay","gạch chân đôi double underline",[rt("M90 520C300 495 620 500 910 515",30),rt("M150 600C360 580 640 585 860 598",26)]),ee("doodle-wavy","Gạch sóng vẽ tay","gạch sóng wavy squiggle",[rt("M80 520C140 460 200 460 250 520C300 580 360 580 410 520C460 460 520 460 570 520C620 580 680 580 730 520C780 460 840 460 920 520",30)]),ee("doodle-arrow","Mũi tên vẽ tay","mũi tên chỉ arrow pointer",[rt("M150 820C180 600 360 380 760 260",30),rt("M600 230L770 255L690 410",30)]),ee("doodle-loop-arrow","Mũi tên xoắn vẽ tay","mũi tên xoắn loop arrow",[rt("M120 820C300 860 470 760 450 600C430 470 300 470 300 560C300 660 470 690 600 560C700 460 740 360 820 250",28),rt("M700 250L825 245L800 370",28)]),ee("doodle-cross","Gạch chéo vẽ tay","gạch bỏ cross out sai",[rt("M170 230C380 420 600 610 850 790",34),rt("M820 210C620 400 400 610 180 800",34)]),ee("doodle-check","Dấu tích vẽ tay","dấu tích check đúng",[rt("M170 520C260 600 340 680 410 780C520 560 660 360 860 190",38)]),ee("doodle-star","Ngôi sao vẽ tay","ngôi sao star nổi bật",[rt("M500 130L590 400L870 410L640 570L730 850L500 680L270 850L360 570L130 410L410 400L505 140",26)]),ee("doodle-sparks","Tia nhấn vẽ tay","tia nhấn emphasis spark",[rt("M500 360L500 140",30),rt("M330 420L190 270",30),rt("M670 420L810 270",30)]),ee("doodle-hatch","Gạch bóng vẽ tay","gạch bóng hatching shading",[rt("M160 700L330 300",20),rt("M260 740L450 300",20),rt("M370 770L570 310",20),rt("M480 790L690 320",20),rt("M600 800L800 340",20)]),ee("doodle-dots","Chấm nguệch ngoạc","chấm scribble dots",[rt("M210 520C170 470 230 420 270 460C310 500 250 560 215 525",26),rt("M480 500C440 450 500 400 540 440C580 480 520 540 485 505",26),rt("M750 520C710 470 770 420 810 460C850 500 790 560 755 525",26)]),ee("doodle-bracket","Ngoặc vẽ tay","ngoặc bracket nhóm",[rt("M330 140C220 150 210 260 220 380C230 460 200 500 150 505C200 512 230 550 220 630C210 760 230 860 340 870",28),rt("M670 140C780 150 790 260 780 380C770 460 800 500 850 505C800 512 770 550 780 630C790 760 770 860 660 870",28)]),ee("doodle-box","Khung vẽ tay","khung box hộp",[rt("M140 210C380 190 640 195 880 215C870 420 870 620 885 800C640 815 380 812 120 795C130 600 128 400 150 190",28)]),ee("doodle-heart","Tim vẽ tay","tim heart thích",[rt("M500 840C200 620 120 400 260 260C380 150 480 230 500 330C520 230 620 150 740 260C880 400 800 620 500 840",28)]),R("arrow-refresh","arrow","Mũi tên làm mới","refresh reload lặp lại","#31c76a","#ffffff",ha("M712 247A330 330 0 1 1 288 247",[288,247],-40)),R("badge-star","badge","Huy hiệu sao","badge star ngôi sao best","#ffd23f",q,[W(A(500,500,420),"a","b",34),L(A(500,500,350),"b",14,{o:.5}),H(De(500,500,250,105,5),"w")]),R("badge-burst","badge","Nổ sao","burst starburst sale nổ","#ff4b55",q,[W(De(500,500,470,390,18),"a","b",30),L(A(500,500,300),"w",16,{o:.8})]),R("badge-ribbon","badge","Ruy băng","ribbon banner dải băng","#ff4b55","#a31f2b",[H(Tt([40,380],[220,380],[220,620],[40,620],[120,500]),"b"),H(Tt([960,380],[780,380],[780,620],[960,620],[880,500]),"b"),W(Tt([160,300],[840,300],[840,700],[160,700]),"a","k",30),L(nt([260,440],[740,440]),"w",34,{o:.9}),L(nt([320,560],[680,560]),"w",34,{o:.9})]),R("badge-pill","badge","Nhãn viên thuốc","label pill nhãn tag","#3aa8ff",q,[W(Rt(80,340,840,320,160),"a","b",32),H(A(250,500,70),"w"),L(nt([390,500],[760,500]),"w",50)]),R("badge-shield","badge","Khiên bảo vệ","shield bảo hành guarantee","#3aa8ff",q,[W("M500 90L860 210L860 520C860 720 700 860 500 930C300 860 140 720 140 520L140 210Z","a","b",34),L(nt([320,500],[450,630],[690,380]),"w",70)]),R("badge-medal","badge","Huy chương","medal huy chương giải thưởng","#ffd23f",q,[W(Tt([260,60],[430,60],[620,520],[450,520]),"b","k",14),W(Tt([740,60],[570,60],[380,520],[550,520]),"r","k",14),W(A(500,670,260),"a","b",34),H(De(500,670,150,65,5),"w")]),R("badge-hexagon","badge","Lục giác","hexagon badge huy hiệu","#a56bff",q,[W(mo(500,500,440,6),"a","b",34),L(mo(500,500,340,6),"w",16,{o:.8}),H(De(500,500,150,64,5),"w")]),R("badge-tag","badge","Nhãn mũi tên","label tag nhãn mới new","#31c76a",q,[W(Tt([100,300],[760,300],[900,500],[760,700],[100,700]),"a","b",34),H(A(250,500,60),"w"),L(nt([380,500],[700,500]),"w",50)]),R("icon-check","icon","Tích tròn","check đúng ok done","#31c76a",q,[W(A(500,500,420),"a","b",34),L(nt([270,520],[440,690],[740,330]),"w",100)]),R("icon-cross","icon","X tròn","cross sai wrong close","#ff4b55",q,[W(A(500,500,420),"a","b",34),L("M330 330L670 670M670 330L330 670","w",100)]),R("icon-bulb","icon","Bóng đèn","lightbulb ý tưởng idea tip","#ffd23f",q,[W("M500 100C320 100 220 230 220 380C220 500 300 560 340 640L340 700L660 700L660 640C700 560 780 500 780 380C780 230 680 100 500 100Z","a","b",34),L("M360 790L640 790M410 870L590 870","b",54),L("M420 560L420 420L500 500L580 420L580 560","w",34,{o:.8})]),R("icon-pin","icon","Ghim vị trí","pin location địa điểm map","#ff4b55",q,[W("M500 90C300 90 200 240 200 400C200 600 420 800 500 920C580 800 800 600 800 400C800 240 700 90 500 90Z","a","b",34),H(A(500,400,115),"w")]),R("icon-clock","icon","Đồng hồ giờ","clock time giờ thời gian","#3aa8ff",q,[W(A(500,500,420),"w","b",40),L("M500 500L500 250M500 500L690 590","a",58),H(A(500,500,40),"b"),L("M500 120L500 160M500 840L500 880M120 500L160 500M840 500L880 500","b",30)]),R("icon-bolt","icon","Tia chớp","bolt lightning nhanh flash","#ffd23f",q,[W(Tt([590,60],[220,560],[470,560],[400,940],[790,400],[530,400]),"a","b",36)]),R("icon-flame","icon","Ngọn lửa","fire flame hot lửa","#ff7a1a",q,[W("M500 60C560 220 760 320 760 580C760 780 650 920 500 920C350 920 240 780 240 600C240 480 300 400 360 340C370 420 420 460 450 440C400 320 430 180 500 60Z","a","b",34),H("M500 520C560 600 620 660 620 740C620 820 570 880 500 880C430 880 380 820 380 740C380 660 450 600 500 520Z","y")]),R("icon-crown","icon","Vương miện","crown vip king","#ffd23f",q,[W(Tt([120,760],[80,300],[330,520],[500,200],[670,520],[920,300],[880,760]),"a","b",34),H(A(80,290,50)+A(500,190,50)+A(920,290,50),"a"),L(nt([200,660],[800,660]),"b",30,{o:.6})]),R("icon-search","icon","Kính lúp","magnifier search tìm kiếm zoom","#3aa8ff",q,[L(nt([620,620],[880,880]),"b",150),L(nt([620,620],[880,880]),"a",100),W(A(420,420,270),"w","b",70)]),R("icon-gift","icon","Hộp quà","gift quà tặng present","#ff4b55",q,[W(Rt(150,430,700,470,30),"a","b",30),W(Rt(100,310,800,150,30),"a","b",30),H(Rt(440,310,120,590,10),"w"),W("M500 310C380 130 210 190 300 310Z","w","b",24),W("M500 310C620 130 790 190 700 310Z","w","b",24)]),R("icon-trophy","icon","Cúp","trophy winner cúp vô địch","#ffd23f",q,[L("M290 190C110 190 110 420 310 440M710 190C890 190 890 420 690 440","b",50),W("M280 100L720 100L700 400C690 540 600 600 500 600C400 600 310 540 300 400Z","a","b",34),W("M440 600L560 600L580 780L420 780Z","a","b",30),W(Rt(300,780,400,110,30),"a","b",30)]),R("icon-exclaim","icon","Dấu chấm than","exclamation chú ý attention","#ff4b55",q,[W(Rt(370,90,260,540,130),"a","b",34),W(A(500,790,100),"a","b",34)]),R("icon-question","icon","Dấu hỏi","question hỏi thắc mắc","#3aa8ff",q,[L("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","b",170),L("M290 330C290 190 420 120 520 120C650 120 730 210 710 330C690 460 520 470 510 620","a",110),W(A(510,840,80),"a","b",30)]),R("icon-target","icon","Mục tiêu","target bullseye đích","#ff4b55",q,[W(A(500,500,430),"w","b",34),H(A(500,500,320),"a"),H(A(500,500,210),"w"),H(A(500,500,100),"a"),L(A(500,500,100),"b",20)]),R("face-smile","emotion","Cười tươi","smile happy vui emoji","#ffcf3a","#3a2a10",[ta(),H(A(360,410,52)+A(640,410,52),"b"),L(rn,"b",56)]),R("face-laugh","emotion","Cười lớn","laugh haha cười","#ffcf3a","#3a2a10",[ta(),L("M270 450Q360 340 450 450M550 450Q640 340 730 450","b",52),H("M250 590L750 590C750 780 640 850 500 850C360 850 250 780 250 590Z","b"),H("M380 790C430 720 570 720 620 790C590 830 410 830 380 790Z","r")]),R("face-wink","emotion","Nháy mắt","wink nháy tinh nghịch","#ffcf3a","#3a2a10",[ta(),H(A(360,410,52),"b"),L("M560 440Q640 360 720 440","b",52),L(rn,"b",56),H(A(250,570,38)+A(750,570,38),"r",{o:.35})]),R("face-sad","emotion","Buồn","sad cry khóc buồn","#ffcf3a","#3a2a10",[ta(),H(A(360,440,50)+A(640,440,50),"b"),L("M270 360L430 320M730 360L570 320","b",40),L("M310 740C400 620 600 620 690 740","b",56),H("M290 540C250 620 240 670 290 690C340 670 330 620 290 540Z","u")]),R("face-angry","emotion","Giận dữ","angry mad giận","#ff6b4d","#3a1208",[ta(),L("M250 330L450 430M750 330L550 430","b",62),H(A(380,510,42)+A(620,510,42),"b"),L("M320 750Q500 600 680 750","b",56)]),R("face-surprised","emotion","Ngạc nhiên","surprised wow ngạc nhiên","#ffcf3a","#3a2a10",[ta(),W(A(360,410,82)+A(640,410,82),"w","b",26),H(A(360,410,34)+A(640,410,34),"b"),L("M260 260Q360 200 450 260M550 260Q640 200 740 260","b",40),H("M425 700A75 100 0 1 0 575 700A75 100 0 1 0 425 700Z","b")]),R("face-cool","emotion","Ngầu","cool sunglasses kính râm ngầu","#ffcf3a","#3a2a10",[ta(),H(Rt(150,340,320,190,80)+Rt(530,340,320,190,80),"b"),L(nt([470,400],[530,400]),"b",40),L(nt([220,410],[320,410]),"w",26,{o:.5}),L("M310 650C400 770 600 770 690 650","b",52)]),R("face-love","emotion","Mắt trái tim","love heart eyes yêu thích","#ffcf3a","#3a2a10",[ta(),H(Jc(360,420,.23)+Jc(640,420,.23),"r"),L("M290 630C380 800 620 800 710 630","b",52)]),R("bubble-round","bubble","Bóng thoại tròn","speech bubble hội thoại nói","#ffffff",q,[W(So,"a","b",34)]),R("bubble-rect","bubble","Bóng thoại vuông","speech box bubble chat","#ffffff",q,[W(vo,"a","b",34)]),R("bubble-cloud","bubble","Bóng suy nghĩ","thought cloud nghĩ mây","#ffffff",q,[L(xn,"b",70),H(xn,"a"),W(A(250,810,66),"a","b",30),W(A(130,915,40),"a","b",26)]),R("bubble-shout","bubble","Bóng hét","shout burst hét la","#ffd23f",q,[W(Tt(...Array.from({length:28},(t,e)=>{const c=we(-90+e*360/28),a=e%2?290:470;return[500+a*Math.cos(c),480+a*Math.sin(c)]})),"a","b",30)]),R("bubble-typing","bubble","Đang nhập","typing dots ba chấm","#ffffff",q,[W(Tt([200,620],[170,800],[350,660]),"a","b",30),W(Rt(100,260,800,400,200),"a","b",34),H(A(340,460,48)+A(500,460,48)+A(660,460,48),"b")]),R("bubble-chat","bubble","Bình luận màu","comment chat message tin nhắn","#3aa8ff",q,[W(vo,"a","b",34),L(nt([240,300],[760,300]),"w",48),L(nt([240,430],[600,430]),"w",48,{o:.8})]),R("bubble-exclaim","bubble","Bóng chú ý","notice attention lưu ý","#ff4b55",q,[W(So,"a","b",34),L(nt([500,270],[500,470]),"w",92),H(A(500,600,52),"w")]),R("bubble-heart","bubble","Bóng yêu thích","love bubble tim","#ffffff",q,[W(So,"a","b",34),H(Jc(500,430,.42),"r")]),R("social-like","social","Thích","like thumbs up ngón cái thích","#3aa8ff",q,[W(Tt([90,440],[290,440],[290,900],[90,900]),"b","k",30),W("M340 460L520 100C600 100 640 160 620 260L600 380L840 380C920 380 960 450 930 520L860 800C840 870 800 900 740 900L340 900Z","a","b",34)]),R("social-heart","social","Tim","heart love yêu thích tim","#ff4b55",q,[W(nn,"a","b",34),L("M250 330C250 280 290 250 340 250","w",36,{o:.7})]),R("social-comment","social","Bình luận","comment bình luận chat","#3aa8ff",q,[W(vo,"a","b",34),H(A(330,390,52)+A(500,390,52)+A(670,390,52),"w")]),R("social-share","social","Chia sẻ","share chia sẻ forward","#31c76a",q,[W("M520 150L920 450L520 750L520 590C300 590 160 680 100 860C130 560 300 380 520 350Z","a","b",34)]),R("social-bell","social","Chuông","bell notification thông báo","#ffd23f",q,[W(sn,"a","b",34),W(ln,"a","b",30)]),R("social-subscribe","social","Nút đăng ký","subscribe follow đăng ký theo dõi","#ff4b55",q,[W(Rt(60,330,880,340,170),"a","b",34),H(ko(sn,.38,230-500*.38,500-470*.38),"w"),H(ko(ln,.38,230-500*.38,500-470*.38),"w"),L(nt([420,450],[820,450]),"w",50),L(nt([420,560],[700,560]),"w",50,{o:.65})]),R("social-save","social","Lưu","save bookmark lưu","#ffd23f",q,[W("M240 100L760 100L760 900L500 720L240 900Z","a","b",34)]),R("social-play","social","Nút phát","play video phát","#ff4b55",q,[W(A(500,500,430),"a","b",34),H(Tt([410,310],[410,690],[740,500]),"w")]),R("social-follow","social","Theo dõi","follow add friend kết bạn","#3aa8ff",q,[W(A(390,300,170),"a","b",30),W("M80 900C80 660 230 570 390 570C550 570 700 660 700 900Z","a","b",30),L("M830 300L830 560M700 430L960 430","b",100),L("M830 300L830 560M700 430L960 430","w",58)]),R("social-views","social","Lượt xem","views eye mắt xem","#3aa8ff",q,[W("M50 500C220 250 780 250 950 500C780 750 220 750 50 500Z","w","b",34),W(A(500,500,170),"a","b",24),H(A(500,500,70),"b"),H(A(540,460,26),"w")]),R("price-tag","price","Thẻ giá","price tag giá nhãn","#ffd23f",q,[W("M110 110L520 110L910 500L500 910L110 520Z","a","b",34),W(A(270,270,62),"w","b",26)]),R("price-percent","price","Huy hiệu %","percent discount giảm giá","#ff4b55",q,[W(A(500,500,430),"a","b",34),L(A(340,340,78),"w",44),L(A(660,660,78),"w",44),L(nt([720,280],[280,720]),"w",56)]),R("price-sale","price","Nổ sale %","sale burst khuyến mãi","#ff4b55",q,[W(De(500,500,480,400,20),"a","b",30),L(A(380,380,60),"w",38),L(A(620,620,60),"w",38),L(nt([670,320],[330,680]),"w",50)]),R("price-coin","price","Đồng xu","coin dollar tiền xu","#ffd23f",q,[W(A(500,500,430),"a","b",34),L(A(500,500,340),"b",16,{o:.5}),L("M630 360C610 290 400 280 390 385C380 490 620 510 610 625C600 730 390 730 370 635","w",64),L(nt([500,230],[500,770]),"w",42)]),R("price-cart","price","Giỏ hàng","cart shop mua hàng","#31c76a",q,[L("M70 140L220 140L330 620L820 620","b",70),W(Tt([270,260],[930,260],[830,580],[360,580]),"a","b",34),W(A(420,790,70),"w","b",30),W(A(740,790,70),"w","b",30)]),R("price-coupon","price","Phiếu giảm giá","coupon voucher mã giảm","#a56bff",q,[W("M70 250L930 250L930 410A100 100 0 0 0 930 590L930 750L70 750L70 590A100 100 0 0 0 70 410Z","a","b",34),L("M650 310L650 360M650 420L650 470M650 530L650 580M650 640L650 690","w",28),L(nt([180,420],[520,420]),"w",50),L(nt([180,540],[440,540]),"w",50,{o:.7})]),R("price-truck","price","Giao hàng","truck delivery freeship vận chuyển","#3aa8ff",q,[W(Tt([60,260],[600,260],[600,720],[60,720]),"a","b",34),W(Tt([600,380],[780,380],[930,540],[930,720],[600,720]),"a","b",34),H(Tt([670,440],[760,440],[850,540],[670,540]),"w"),W(A(250,740,95),"w","b",34),W(A(750,740,95),"w","b",34)]),R("price-star","price","Sao giá","star price best seller bán chạy","#ffd23f",q,[W(De(500,510,480,215,5),"a","b",34),L(De(500,510,330,150,5),"w",16,{o:.6})]),R("frame-corners","frame","Khung ngắm","viewfinder corners góc","#ffffff",q,[L("M120 340L120 120L340 120M660 120L880 120L880 340M880 660L880 880L660 880M340 880L120 880L120 660","a",70)]),R("frame-polaroid","frame","Khung polaroid","polaroid photo ảnh","#ffffff",q,[W("M110 90L890 90L890 910L110 910ZM190 170L810 170L810 700L190 700Z","a","b",30,{eo:!0})]),R("frame-border","frame","Viền bo góc","border rounded viền","#ffd23f",q,[H(Rt(60,60,880,880,120)+Rt(150,150,700,700,60),"a",{eo:!0}),L(Rt(150,150,700,700,60),"b",14)]),R("frame-film","frame","Khung phim","film cinema phim","#ffd23f",q,[H(`M60 160L940 160L940 840L60 840ZM160 300L840 300L840 700L160 700Z${Array.from({length:8},(t,e)=>Rt(100+e*105,200,55,60,10)+Rt(100+e*105,740,55,60,10)).join("")}`,"b",{eo:!0}),L("M60 160L940 160L940 840L60 840Z","a",16)]),R("frame-ticket","frame","Khung vé","ticket vé coupon","#ff4b55",q,[W("M70 160L930 160L930 400A100 100 0 0 0 930 600L930 840L70 840L70 600A100 100 0 0 0 70 400ZM170 260L830 260L830 740L170 740Z","a","b",30,{eo:!0})]),R("frame-circle","frame","Khung tròn","circle ring vòng tròn","#ffffff",q,[W(A(500,500,440)+A(500,500,340),"a","b",20,{eo:!0})]),R("frame-tv","frame","Khung TV","tv television màn hình","#3aa8ff",q,[L(nt([330,60],[500,210],[670,60]),"b",44),W(Rt(70,220,860,680,130)+Rt(160,310,680,500,70),"a","b",30,{eo:!0})]),R("frame-dashed","frame","Khung nét đứt","dashed viền đứt","#ffffff",q,[L(Cl(100,100,900,900,70,50),"a",36)]),R("fx-sparkle","sparkle","Lấp lánh","sparkle twinkle lấp lánh","#fff3a8","#ffffff",[H(A(500,500,260),"a",{o:.4,bl:70}),H(pc(500,500,470,.1),"a"),H(pc(500,500,200,.14),"b")]),R("fx-sparkles","sparkle","Cụm lấp lánh","sparkles cluster nhiều sao","#ffe066","#ffffff",[H(A(400,560,300),"a",{o:.25,bl:80}),H(pc(400,560,340,.12),"a"),H(pc(750,260,190,.14),"a"),H(pc(770,800,120,.16),"b"),H(pc(400,560,120,.16),"b")]),R("fx-shine","sparkle","Tia lấp loáng","shine flare tia sáng","#ffe066","#ffffff",[H(A(500,500,230),"a",{o:.35,bl:70}),H(De(500,500,470,60,8,-90),"a"),H(De(500,500,330,50,8,-67.5),"b",{o:.9}),H(A(500,500,90),"b")]),R("fx-light-leak","sparkle","Rò sáng","light leak ánh sáng loá","#ffb347","#ff5da2",[H(A(330,340,260),"a",{o:.6,bl:100}),H(A(680,640,240),"b",{o:.55,bl:100}),H(A(520,520,150),"w",{o:.45,bl:80})]),R("fx-rays","sparkle","Tia nắng","rays sunburst chói","#ffe066","#ffffff",[H(Rl(500,500,16,480,360,6),"a",{o:.9}),H(A(500,500,130),"a",{o:.5,bl:40}),H(A(500,500,80),"b")]),R("fx-confetti","sparkle","Pháo giấy","confetti party mừng","#ff4b55","#3aa8ff",[H(fa("a"),"a"),H(fa("b"),"b"),H(fa("y"),"y"),H(fa("r"),"r"),H(fa("g"),"g"),H(fa("u"),"u")]),R("fx-glow-ring","sparkle","Vòng sáng","glow ring halo","#7cf0ff","#ffffff",[L(A(500,500,330),"a",90,{o:.55,bl:40}),L(A(500,500,330),"b",20)]),R("fx-lens-flare","sparkle","Chói ống kính","lens flare anamorphic","#ffd08a","#ffffff",[L(nt([40,300],[620,300]),"b",16,{o:.7,bl:6}),H(A(300,300,150),"b",{o:.85,bl:50}),H(A(300,300,70),"b"),H(A(540,540,60),"a",{o:.6,bl:8}),H(A(680,680,110),"a",{o:.4,bl:12}),H(A(820,820,40),"a",{o:.8,bl:4})]),R("fx-twinkle","sparkle","Sao nhấp nháy","twinkle stars sao nhỏ","#ffe066","#ffffff",[H(pc(250,300,150,.16)+pc(560,620,120,.16),"a"),H(pc(700,220,200,.14)+pc(300,800,100,.18),"b"),H(pc(820,760,170,.14),"a")]),R("fx-heart-burst","sparkle","Tim bay","hearts float like tim bay","#ff4b55","#ff9cc2",[H(Jc(500,600,.55),"a"),H(Jc(250,370,.28),"b",{o:.9}),H(Jc(760,300,.36),"a",{o:.8}),H(Jc(830,660,.2),"w"),H(Jc(170,720,.2),"a",{o:.7})]),R("status-stars","status","5 sao","rating stars đánh giá 5 sao","#ffd23f",q,[W(Array.from({length:5},(t,e)=>De(140+e*180,500,92,40,5)).join(""),"a","b",12)]),R("status-stars-4","status","4 sao","rating four stars 4 sao","#ffd23f",q,[W(Array.from({length:4},(t,e)=>De(140+e*180,500,92,40,5)).join(""),"a","b",12),W(De(860,500,92,40,5),"b","b",12,{o:.3})]),R("status-progress","status","Thanh tiến trình","progress bar loading thanh","#31c76a",q,[W(Rt(60,400,880,200,100),"w","b",24),H(Rt(84,424,540,152,76),"a")]),R("status-ring","status","Vòng tiến trình","progress ring vòng phần trăm","#31c76a",q,[L(A(500,500,410),"b",100,{o:.3}),L("M500 90A410 410 0 1 1 90 500","a",100)]),R("status-check","status","Dấu tích lớn","checkmark tick đúng","#31c76a",q,[L(nt([140,540],[400,800],[880,200]),"b",200),L(nt([140,540],[400,800],[880,200]),"a",130)]),R("status-cross","status","Dấu X lớn","cross x sai","#ff4b55",q,[L("M200 200L800 800M800 200L200 800","b",200),L("M200 200L800 800M800 200L200 800","a",130)]),R("status-checkbox","status","Ô tích","checkbox ô chọn","#31c76a",q,[W(Rt(110,110,780,780,170),"w","b",34),L(nt([270,520],[440,690],[740,320]),"a",110)]),R("status-crossbox","status","Ô gạch X","crossbox ô sai","#ff4b55",q,[W(Rt(110,110,780,780,170),"w","b",34),L("M310 310L690 690M690 310L310 690","a",110)]),R("status-warning","status","Cảnh báo","warning cảnh báo lưu ý","#ffd23f",q,[W(Tt([500,100],[930,850],[70,850]),"a","b",40),L(nt([500,370],[500,600]),"b",84),H(A(500,730,46),"b")]),R("status-dots","status","Ba chấm tải","loading dots đang tải","#ffffff",q,[H(A(200,500,80),"a"),H(A(500,500,80),"a",{o:.6}),H(A(800,500,80),"a",{o:.3})])];new Map(hn.map(t=>[t.id,t])),hn.map(t=>t.id);const Pl=Object.freeze({emitter:"point",ex:.5,ey:.5,esize:.2,text:"CLIPOOX",rate:80,burst:0,prerun:0,life:2,speed:220,direction:-90,spread:60,gravity:0,wind:0,drag:.4,turbulence:.2,shape:"glow",size:8,sizeEnd:.3,color:"#fff3c4",colorEnd:"#ff7a1a",opacity:1,blend:"add",seed:1}),zl={particles:"Custom particles — a free particle system: choose the emitter (point, box, disc, line, ring or text), rate, burst, life, speed, direction, gravity, wind, drag, turbulence, shape and colours","pt-dust":"Floating glow dust particles — soft glowing motes drift and swirl over the whole frame (dust, bokeh, ambience)","pt-sparks":"Spark fountain particles — hot sparks shoot up from the bottom and fall back under gravity (sparks, fire, welding)","pt-firework":"Fireworks burst particles — one burst of sparks explodes outward, slows and falls (fireworks, celebration, new year)","pt-snow":"Snowfall particles — snowflakes fall softly over the whole frame with a light wind (snow, winter, christmas)","pt-rain":"Rain particles — fast rain streaks fall at a slight angle over the whole frame (rain, storm, weather)","pt-smoke":"Rising smoke particles — soft smoke puffs rise from the bottom, grow and fade (smoke, steam, fog, mist)","pt-magic":"Magic swirl dust particles — star sparkles circle a ring and twirl (magic, fairy dust, sparkle, glitter)","pt-text":"Particle text — glowing particles form the words (text = the words; logo text, title made of particles)","pt-hearts":"Floating hearts particles — hearts rise from the bottom and sway (love, like, valentine, wedding)","pt-fireflies":"Fireflies particles — small glowing lights wander slowly in the dark (fireflies, night, glow)","pt-confetti":"Confetti particles — paper confetti bursts in and tumbles down (confetti, party, celebration, winner)"},qe=(t,e,c,a)=>Object.freeze({id:t,name:e,category:"Hạt",duration:c,params:Object.freeze({...Pl,...a}),code:`function render(ctx,t,env){
2
2
  // `+zl[t]+` (settings: particles {rate, gravity, shape, color…}).
3
3
  M.particles(ctx,t,env,env.params)
4
4
  }`}),To=Object.freeze([qe("particles","Hạt tuỳ chỉnh",5,{}),qe("pt-dust","Bụi sáng lơ lửng",8,{emitter:"box",esize:1.1,rate:45,prerun:6,life:6,speed:14,spread:360,drag:.2,turbulence:.6,shape:"glow",size:8,sizeEnd:1,color:"#fff6dc",colorEnd:"#ffd08a",opacity:.85}),qe("pt-sparks","Tia lửa phun",4,{ex:.5,ey:.9,rate:160,life:1.4,speed:900,direction:-90,spread:38,gravity:1100,drag:.3,turbulence:0,shape:"spark",size:4,sizeEnd:.4,color:"#fff1b8",colorEnd:"#ff4a12"}),qe("pt-firework","Pháo hoa",3,{ey:.4,rate:0,burst:320,life:2.8,speed:560,spread:360,gravity:150,drag:1.5,turbulence:.1,shape:"spark",size:5,sizeEnd:.5,color:"#fff6e0",colorEnd:"#ff3df0",seed:5}),qe("pt-snow","Tuyết rơi",10,{emitter:"line",ey:-.05,esize:1.3,rate:70,prerun:11,life:11,speed:80,direction:90,spread:25,wind:12,drag:.1,turbulence:.35,shape:"snow",size:10,sizeEnd:1,color:"#ffffff",colorEnd:"#dceaff",opacity:.9,blend:"normal"}),qe("pt-rain","Mưa",6,{emitter:"line",ey:-.08,esize:1.4,rate:320,prerun:1,life:.9,speed:1700,direction:100,spread:3,drag:0,turbulence:0,shape:"streak",size:2,sizeEnd:1,color:"#cfe0ff",colorEnd:"#9fb8dd",opacity:.55,blend:"normal"}),qe("pt-smoke","Khói bốc",8,{emitter:"disc",ey:.95,esize:.35,rate:18,prerun:5,life:6,speed:120,direction:-90,spread:40,wind:22,drag:.25,turbulence:.9,shape:"smoke",size:36,sizeEnd:4,color:"#cfcfcf",colorEnd:"#5d6168",opacity:.28,blend:"normal"}),qe("pt-magic","Bụi phép xoáy",6,{emitter:"ring",esize:.42,rate:180,prerun:2,life:2.2,speed:40,direction:-90,spread:360,drag:.6,turbulence:1.1,shape:"star",size:12,sizeEnd:.2,color:"#e9d4ff",colorEnd:"#33e0ff"}),qe("pt-text","Chữ hạt sáng",5,{emitter:"text",text:"CLIPOOX",esize:.7,rate:600,prerun:1.6,life:1.6,speed:8,spread:360,drag:1,turbulence:.15,shape:"glow",size:6,sizeEnd:.5,color:"#ffffff",colorEnd:"#7fe3ff"}),qe("pt-hearts","Tim bay",6,{emitter:"line",ey:1.05,esize:.9,rate:10,prerun:3,life:5,speed:160,direction:-90,spread:20,drag:.2,turbulence:.45,shape:"heart",size:26,sizeEnd:1.3,color:"#ff5a8a",colorEnd:"#ff9ac0",blend:"normal"}),qe("pt-fireflies","Đom đóm",10,{emitter:"box",esize:1,rate:12,prerun:7,life:7,speed:20,spread:360,drag:.5,turbulence:1.4,shape:"glow",size:12,sizeEnd:.8,color:"#f4ff8a",colorEnd:"#9dff5c",opacity:1}),qe("pt-confetti","Pháo giấy",4,{ey:-.05,rate:90,burst:120,life:3.5,speed:420,direction:90,spread:120,gravity:520,drag:1.2,turbulence:.6,shape:"square",size:12,sizeEnd:1,color:"#ffd400",colorEnd:"#ff3d7f",blend:"normal",seed:3})]);Object.freeze(To.map(t=>t.id));const Bl=Object.freeze([{key:"bevn",family:"Clipoox Be Vietnam Pro",weight:"800",style:"normal",file:"BeVietnamPro-800.woff2"},{key:"bevn",family:"Clipoox Be Vietnam Pro",weight:"900",style:"normal",file:"BeVietnamPro-900.woff2"},{key:"mont",family:"Clipoox Montserrat",weight:"900",style:"normal",file:"Montserrat-900.woff2"},{key:"mont",family:"Clipoox Montserrat",weight:"100 700",style:"normal",file:"Montserrat-var.woff2"},{key:"anton",family:"Clipoox Anton",weight:"400",style:"normal",file:"Anton-400.woff2"},{key:"oswald",family:"Clipoox Oswald",weight:"700",style:"normal",file:"Oswald-700.woff2"},{key:"play",family:"Clipoox Playfair Display",weight:"800",style:"italic",file:"PlayfairDisplay-800-italic.woff2"},{key:"brico",family:"Clipoox Bricolage Grotesque",weight:"200 800",style:"normal",file:"BricolageGrotesque-var.woff2"},{key:"bungee",family:"Clipoox Bungee",weight:"400",style:"normal",file:"Bungee-400.woff2"}].map(t=>Object.freeze(t)));Object.freeze(Object.fromEntries(Object.entries({bevn:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',mont:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',anton:'Impact, "Arial Narrow", sans-serif',oswald:'"Arial Narrow", system-ui, sans-serif',play:'Georgia, "Times New Roman", serif',brico:'system-ui, "Segoe UI", Roboto, Arial, sans-serif',bungee:'Impact, "Arial Black", sans-serif'}).map(([t,e])=>[t,`"${Bl.find(c=>c.key===t).family}", ${e}`])));const V=Object.freeze([{id:"bold",name:"Bold",tag:"Chữ đậm kiểu Hormozi, nhảy từng từ",accent:"#ffe600"},{id:"clean",name:"Clean",tag:"Tối giản kiểu Apple, nét mảnh",accent:"#ffffff"},{id:"neon",name:"Neon",tag:"Phát sáng, nhấp nháy bật đèn",accent:"#00f0ff"},{id:"podcast",name:"Podcast",tag:"Thanh tên, thẻ trích dẫn, tag khách mời",accent:"#ffb020"},{id:"sale",name:"Sale",tag:"Giá, đếm ngược, huy hiệu giảm giá",accent:"#ff2d2d"},{id:"business",name:"Business",tag:"Doanh nghiệp: KPI, biểu đồ, quy trình, bảng giá",accent:"#2f7bff"},{id:"launch",name:"Launch",tag:"Ra mắt sản phẩm / app: nền kem, chữ gọn, một màu nhấn",accent:"#ff6a2b"},{id:"glow",name:"Glow Story",tag:"Kể chuyện 3D phát sáng trên nền tối: tài chính, creator, cảm xúc",accent:"#22e06b"},{id:"noir",name:"Gold Noir",tag:"Bóng người viền vàng neon, phụ đề chữ đặc: video kinh doanh, bài học",accent:"#ffc400"},{id:"pop",name:"Pop Editorial",tag:"Chữ đen trên giấy, từ khoá đỏ bật ra, hình minh hoạ cho từng ý",accent:"#e8202a"},{id:"illus",name:"Minh hoạ",tag:"Icon phát sáng cho mọi chủ đề: ẩm thực, sức khoẻ, giáo dục, nhà, xe, du lịch…",accent:"#ffd23f"},{id:"studio",name:"Studio Showcase",tag:"Giới thiệu sản phẩm: giao diện timeline 3D, kéo thả, AI, xuất video",accent:"#b4e36a"},{id:"creator",name:"Creator Pro",tag:"Edit kiểu creator cao cấp: chữ sau người, xu 3D, tiền rơi, tia điện, chữ neon",accent:"#ff2b2b"},{id:"mono",name:"Mono Grid",tag:"Đơn sắc trên giấy kẻ chấm: mảng đen, khung chọn, một điểm màu nhấn",accent:"#2fbfa0"},{id:"ai",name:"AI & Tech",tag:"AI và công nghệ: mạng nơ-ron, chat AI, chip phát sáng, dòng dữ liệu, agent",accent:"#7c5cff"},{id:"fin",name:"Fintech",tag:"Tài chính số: biểu đồ nến, giá cổ phiếu, ví, thẻ, lãi kép — xanh tăng, đỏ giảm",accent:"#21c87a"},{id:"explain",name:"Explainer UI",tag:"Minh hoạ lời nói: thẻ giao diện cho từng câu — bình luận, hồ sơ, đồng hồ, thông báo, đóng dấu, công tắc, nút CTA",accent:"#ff3d8b"},{id:"info",name:"Infographic 3D",tag:"Thẻ biểu đồ trắng xoay 3D: vòng carousel, xoè thẻ, bảng nghiêng, vòng %, cột, sóng, radar",accent:"#8b2fc9"},{id:"cyber",name:"Cyber Reveal",tag:"Logo reveal gaming / công nghệ: thẻ neon xoay vòng, chip bảng mạch, chữ cắt lát glitch, hạt vuông, HUD",accent:"#19e3c3"},{id:"kinetic",name:"Kinetic Words",tag:"Chữ động trên talking head: chữ trắng nhỏ + từ đỏ khổng lồ, chữ cong vòm, sóng, nhòe, ghép điểm ảnh, ruy băng",accent:"#e8141c"},{id:"bridge",name:"Bridges",tag:"Chỗ nối cảnh: cửa sổ phóng xuyên, khối chéo, mống mắt, chớp sáng, vệt lia, mực loang, glitch",accent:"#ff5a36"},{id:"tvc",name:"Brand TVC",tag:"TVC doanh nghiệp theo màu thương hiệu: mở thương hiệu, vấn đề → giải pháp, ưu đãi, đánh giá, liên hệ, logo",accent:"#2f6bff"},{id:"home",name:"Home",tag:"Bất động sản: thẻ căn hộ, mặt bằng, ghim bản đồ, giá/m², chìa khoá, tiện ích, trả góp",accent:"#c9a45c"},{id:"health",name:"Health",tag:"Y tế, sức khoẻ: nhịp tim, viên thuốc, thẻ bác sĩ, đặt lịch khám, chỉ số, checklist khám",accent:"#13b5a6"},{id:"fit",name:"Fit & Sport",tag:"Gym, thể thao: đếm rep, đồng hồ hiệp, vòng macro, kỷ lục, đếm bước, lịch tập",accent:"#ff4b1f"},{id:"travel",name:"Travel",tag:"Du lịch, khách sạn: thẻ lên máy bay, tuyến bay, lịch trình, thẻ phòng, thời tiết, dấu hộ chiếu",accent:"#ff7a45"},{id:"menu",name:"Food Menu",tag:"Ẩm thực: bảng menu, công thức, món bốc khói, phiếu order, độ cay, giao món",accent:"#e8492d"},{id:"auto",name:"Auto",tag:"Ô tô, xe máy: đồng hồ tốc độ, thông số, pin xe điện, đặt lái thử, xe lộ dần",accent:"#e10600"},{id:"cine",name:"Cinematic Symbols",tag:"Phim 2D biểu tượng: nhà dưới trời sao, con mắt, thanh kiếm, vương miện, tim, trăng, chìa khoá — quầng sáng, hạt phim, sao nối cảnh",accent:"#ff3b54"},{id:"pulse",name:"Pulse Geometry",tag:"Motion hình học trừu tượng: chấm sáng, thanh neon, vòng mục tiêu, lục giác, vệt sáng — hình lấp khung nối cảnh",accent:"#ff2a3d"},{id:"story",name:"Story Journey",tag:"Kể chuyện hai tông: một vật dẫn (máy bay giấy, bóng, tim, tin nhắn) bay qua phố, tháp, vũ trụ, đường hầm, đồi nhà — cảnh nối cảnh theo vật",accent:"#ff3b5c"},{id:"lumen",name:"Living Glow",tag:"Ánh sáng sống: vòng neon, quả cầu óng ánh, sinh vật phát sáng có xúc tu, quạt mở, quả cầu hologram, đường hầm vòng màu, chữ neon — chớp màu pastel nối cảnh",accent:"#8b5cff"},{id:"rebound",name:"Neon Rebound",tag:"Bóng sáng nảy qua các khung neon nét mảnh: gạch, dốc, răng cưa, trụ, ống, phố, khung lồng khung — camera đi theo quả bóng",accent:"#36d6e7"},{id:"join",name:"Join Lab",tag:"Chuyển cảnh mới cho mọi thể loại: lật khối 3D, gập giấy, cuộn trang, xé giấy, chất lỏng, gợn sóng, hạt tan rồi tụ, chia khung, biến hình, tường chữ, phóng xuyên vật — che vết cắt ở giữa",accent:"#ff5a36"},{id:"fluid",name:"Liquid Flow",tag:"Chất lỏng mềm mại: khối gradient biến hình, giọt rơi, sóng tràn, đèn dung nham, mực loang trong nước, bong bóng, chữ tan chảy — cảnh nối cảnh bằng chất lỏng tràn đầy khung",accent:"#ff6fb5"},{id:"promo",name:"Product Reveal",tag:"Ra mắt sản phẩm / app / AI: logo loé sáng, thẻ kính gradient, thanh gõ lệnh phát sáng, đám biểu tượng kính 3D, mũi tên phóng lên, chân trời vòm tím — vật thể biến hình nối cảnh",accent:"#8a5cff"},{id:"morph",name:"Shape Shifter",tag:"Một yếu tố nối cảnh biến hình khác nhau qua từng cảnh: chấm sáng, sợi chỉ, vòng mũi tên, hình thoi, sao, viên thuốc, dải, thẻ, hàng chấm, cột sáng, mặt trời, giọt, logo — tông hổ phách ấm",accent:"#ff8a1f"},{id:"glass",name:"Kính Fintech",tag:"Tài chính trên kính tối: thẻ kính mờ có vệt sáng lướt, quả cầu trợ lý phát sáng, số dư đếm nhanh, cột xu, biểu đồ bậc thang, đường về đích, nến, vòng phần trăm, biểu tượng và giá — chữ trắng nhỏ + từ khoá xanh điện lớn",accent:"#3a63ff"},{id:"clipooxmotion",name:"Clipoox",tag:"Bộ motion riêng của Clipoox: logo ngọn lửa thật, xanh chanh + đen; cảnh ra mắt nền sáng, cảnh studio nền tối phát sáng, cảnh khuyến mãi (chữ gradient, quay số, đếm số, pill kính, mưa xu, thẻ số dư, HUD) và cảnh số liệu tăng trưởng (khung viền nhãn, đồng hồ vạch, đường tăng trưởng, lưới chấm); có nhóm cảnh dựng riêng cho khổ dọc 9:16 (clipoox-v-*); cảnh phim ra mắt (ô lệnh AI gõ chữ, tiêu đề glitch, dòng trạng thái ánh lướt, cửa sổ bung pháo giấy, bể bóng, mặt pixel, lõi ngọn lửa, hologram, khối thẻ, logo tia sáng)",accent:"#8afb00"},{id:"prodreview",name:"Review sản phẩm",tag:"Review / routine sản phẩm khổ dọc: chú thích BƯỚC 1 / hướng dẫn chữ trắng mờ dần vào, logo chìm, mở logo, packshot pastel, nhãn chỉ sản phẩm, lợi ích, chấm điểm, thẻ mua ngay",accent:"#e2557f"},{id:"course",name:"Course Kit",tag:"Video khoá học / hướng dẫn / hỏi đáp: thanh điều hướng câu hỏi Q1…Q15, ô các bước, thẻ công cụ (biểu tượng + địa chỉ web), thẻ chương, thẻ ý chính, thanh tiến độ, khung cửa sổ quanh video quay màn hình, mũi tên chỉ vùng, khung người nói (PiP), nhãn chủ đề, đường hành trình, ảnh bật ra, bìa sách, khung mô hình xếp tầng, bố cục hai thẻ, dấu thương hiệu góc, bảng so sánh viết tay, tài liệu tô đỏ, bản đồ ghim — kính xanh đậm, kính đen viền neon đỏ hoặc nền trắng sáng biên tập",accent:"#3d7bff"},{id:"aiworkflow",name:"Quy trình AI & HUD game",tag:"Phim ra mắt kiểu 'AI dựng game': thẻ tiêu đề đua xe (dải cờ ca-rô, chớp màu), ô lệnh gắn ảnh + thẻ thương hiệu, quét bản phác thảo, tiêu đề trạng thái + checklist, chọn phong cách 2×2, danh sách bước chữ lớn, khung 3D + thẻ lệnh; HUD game đua xe (vòng, đồng hồ tốc độ, bản đồ nhỏ, ô vật phẩm, thanh tăng tốc), menu tạm dừng, chọn xe / nhân vật, phụ đề kết — có bản dọc 9:16 (aiw-v-*)",accent:"#8afb00"},{id:"techlaunch",name:"Ra mắt công nghệ",tag:"Phim ra mắt app / model AI / thiết bị kiểu biên tập công nghệ sáng: giấy trắng hồng + quầng hồng / chanh, hồng sen + đen, chữ vuông công nghệ, mũi tên >> << đóng khung tiêu đề; chồng chữ + ảnh rải, tên trong khung + nhãn, dựng chữ từng nhịp, nhân vật + bầy thẻ bay, bảng tính năng có khung video, số rải + bậc thang thẻ, khung phát video, khung đầu / giữa / cuối, 4K tách đôi + lưới mặt, thẻ kết — có bản dọc 9:16 (tl-v-*), đổi màu được (bản Clipoox: theme dark + accent chanh)",accent:"#ff1f8e"},{id:"framed",name:"Creator khung",tag:"Talking head creator / khoá học trên nền than chì lưới ô vuông: người nói trong khung bo góc có góc ngoặc vàng, chữ hoa đậm trắng + một màu nhấn, nhãn nhỏ giãn chữ, đường kẻ mảnh; khung người nói, A với B, tiêu đề xếp tầng + con trỏ, đồng hồ đếm giờ → chữ, chip đếm theo ngón tay, thẻ giấy câu hỏi + trả lời, kêu gọi bình luận A hay B, thẻ chương, định nghĩa, tóm tắt checklist, tên giảng viên — có bản dọc 9:16 (fr-v-*), đổi màu nhấn được",accent:"#ffc21a"},{id:"uibeats",name:"Nhịp giao diện",tag:"Nhịp giao diện cho video ra mắt SaaS / app: nút Thích, chip ✓, sao chép link, dán link, chữ hiện từ mờ, thẻ bản nháp",accent:"#f5a524"},{id:"clipooxstudio",name:"Clipoox Studio",tag:'Kiểu "motion viết bằng code" cho phim ra mắt / SaaS / giải thích: giấy kem có quầng đào + chanh và hình học bay, tiêu đề có một chữ nghiêng có chân + đường cong bezier kèm tay nắm, nút chanh; cảnh tối trên lưới chấm (ô lệnh AI, đang tạo, quạt thẻ 3D, code + đồ thị tốc độ, timeline tìm lỗi + vá, thẻ xuất video); bút vẽ path → logo, nhiều con trỏ cộng tác, ba điện thoại, CTA → logo; trang hồ sơ + con dấu, bản đồ lộ trình vẽ tay, bảng khởi hành lật chữ, tiêu đề thẻ nghiêng, chữ glitch; chữ nhấn + vòng đếm trên người nói — tự xếp cho 16:9 và 9:16, đổi màu nhấn + theme sáng / tối',accent:"#8afb00"},{id:"matrix",name:"Ma trận số",tag:"Thế giới số kiểu Ma trận: mưa mã xanh lục, lao xuyên đường hầm dữ liệu, chữ giải mã từ ký tự loạn, màn hình CRT có dòng quét và chữ gõ",accent:"#22ff66"},{id:"lightfx",name:"Dải sáng điện ảnh",tag:"Clip giới thiệu kiểu điện ảnh ánh tím: bó dải sáng bay xoắn trong không gian rồi lao theo xe, tên người hiện bằng tia lửa chạy, cờ lụa in logo bay trong gió",accent:"#b44dff"},{id:"sportcine",name:"Thể thao điện ảnh & Creator",tag:"Quảng cáo thể thao điện ảnh + reel hướng dẫn của creator: lưới chấm halftone chớp, ô phân tích có toạ độ nối bằng cung mảnh, con trỏ có thẻ tên, nhãn thẻ media (pill kính / chip chanh), pill kêu gọi bình luận từ khoá có tim đỏ",accent:"#c8f53c"},{id:"faceholo",name:"HUD hologram bám mặt",tag:"HUD hologram trong suốt để ghim lên khuôn mặt (bám theo chuyển động đầu): bảng cuộc gọi, bàn phím quay số, cột chữ cuộn, lưới quét và khoá mục tiêu trên mặt, bong bóng chat 3D, vòng dữ liệu, trình phát nhạc, nhịp tim, thẻ hồ sơ, chồng thông báo, radar bản đồ, dịch song ngữ, thời tiết",accent:"#7fd8ff"},{id:"history",name:"Chuyện có thật",tag:"Video kể chuyện có thật kiểu phim cổ: nắng cửa sổ trên tường, năm in lớn, tiêu đề chữ nghiêng phát sáng, băng dán đỏ, thẻ viền chỉ khâu chữ màu, chữ bay trong chiều sâu, chữ khối đỏ sau vật, lớp phim cũ, thanh tìm kiếm cuối video",accent:"#e3242b"}].map(t=>Object.freeze(t))),Wl=Object.freeze(["idea","money","time","growth","target","heart","trophy","rocket","lock","megaphone","gift","globe","chat","mail","user","team","star","fire","check","cross","warning","search","gear","calendar","phone","cart","shield","key","briefcase","camera","music","home","chart","cool","shock","laugh","cry","love","angry","think"]);""+JSON.stringify(Object.fromEntries(Object.entries(Za).map(([t,e])=>[t,e.d])));const fn=V.find(t=>t.id==="business"),Ge=(t,e,c,a,o)=>({id:t,name:e,category:fn.name,pack:"business",duration:c,params:{...a,accent:fn.accent,style:"business"},code:o}),na=`const num=s=>{const st=M.stat(s),last=String(s).trim().split(' ').pop()||'',m=last.match(/[.,]([0-9]+)/),d=m?Math.min(2,m[1].length):0,pl=last.charAt(0)==='+';return{label:st.label,v:st.v,d,pre:pl?'+':'',u:st.u.replace('+','')}}
5
5
  const show=(n,k)=>{const v=n.v*k;return n.pre+(n.d?v.toFixed(n.d).replace('.',','):M.fmt(v))+n.u}
6
6
  `,Tc=`const card=(x,y,w,h,r,a)=>{ctx.save();ctx.fillStyle=M.rgba(sk.panel,a);ctx.shadowColor='rgba(0,0,0,.35)';ctx.shadowBlur=S.u*.04;M.rr(ctx,x,y,w,h,r);ctx.fill();ctx.restore()}
7
- `,ye=`const head=(y,size)=>{if(!p.text)return;const f=M.fit(ctx,String(p.text),q=>sk.font(q,'h'),size,S.w,1,.45);ctx.save();ctx.globalAlpha=k.v*M.ease.outCubic(M.range(t,.05,.5));ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle=sk.fill;ctx.fillText(f.lines[0],S.cx,y+(1-M.ease.outCubic(M.range(t,.05,.5)))*S.u*.03);ctx.restore()}
7
+ `,me=`const head=(y,size)=>{if(!p.text)return;const f=M.fit(ctx,String(p.text),q=>sk.font(q,'h'),size,S.w,1,.45);ctx.save();ctx.globalAlpha=k.v*M.ease.outCubic(M.range(t,.05,.5));ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle=sk.fill;ctx.fillText(f.lines[0],S.cx,y+(1-M.ease.outCubic(M.range(t,.05,.5)))*S.u*.03);ctx.restore()}
8
8
  `,Hl=[Ge("biz-kpi-cards","Thẻ KPI tự đếm",5,{text:"Kết quả năm 2025",items:"Doanh thu 2,5tỷ|Khách hàng 12000|Tăng trưởng +38%|Đánh giá 4,9★",position:"center"},`function render(ctx,t,env){
9
9
  // Up to 4 cards (2×2) fly in one by one; each number counts up from 0, the accent bar grows on the left.
10
10
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
11
- `+na+Tc+ye+` const list=M.items(p,4).map(num),n=Math.max(1,list.length),cols=n===1?1:2,rows=Math.ceil(n/cols)
11
+ `+na+Tc+me+` const list=M.items(p,4).map(num),n=Math.max(1,list.length),cols=n===1?1:2,rows=Math.ceil(n/cols)
12
12
  const gap=S.u*.03,cw=Math.min((S.w-gap*(cols-1))/cols,S.u*(S.port?.44:.5)),ch=cw*(S.port?.62:.5),th=p.text?S.u*.1:0
13
13
  const W=cw*cols+gap*(cols-1),H=ch*rows+gap*(rows-1)+th,x0=S.cx-W/2,y0=S.y-H/2
14
14
  head(y0+th*.4,S.u*.06)
@@ -24,7 +24,7 @@
24
24
  }`),Ge("biz-bar-chart","Biểu đồ cột tăng trưởng",5,{text:"Doanh thu (tỷ đồng)",items:"2021 1,2|2022 1,8|2023 2,6|2024 4,1",position:"center"},`function render(ctx,t,env){
25
25
  // Axis, then bars rise one by one (outBack) while their values count; the last bar takes the accent.
26
26
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
27
- `+na+Tc+ye+` const list=M.items(p).map(num),n=Math.max(1,list.length),mx=Math.max(1e-6,...list.map(s=>Math.abs(s.v)))
27
+ `+na+Tc+me+` const list=M.items(p).map(num),n=Math.max(1,list.length),mx=Math.max(1e-6,...list.map(s=>Math.abs(s.v)))
28
28
  const W=Math.min(S.w,S.u*(S.port?1:1.25)),H=W*(S.port?.95:.62),x0=S.cx-W/2,y0=S.y-H/2,pad=W*.07,th=p.text?H*.16:H*.05
29
29
  ctx.save();ctx.globalAlpha=k.v;card(x0,y0,W,H,W*.04,.8);ctx.restore()
30
30
  head(y0+th*.6,H*.075)
@@ -40,7 +40,7 @@
40
40
  }`),Ge("biz-line-chart","Đường xu hướng",5,{text:"Người dùng hoạt động",items:"T1 1200|T4 2100|T7 1900|T10 3400|T12 5200",position:"center"},`function render(ctx,t,env){
41
41
  // The line draws left to right with a soft area under it; a dot rides the tip with the counting value.
42
42
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
43
- `+na+Tc+ye+` const list=M.items(p).map(num),n=list.length,mx=Math.max(1e-6,...list.map(s=>s.v)),mn=Math.min(0,...list.map(s=>s.v))
43
+ `+na+Tc+me+` const list=M.items(p).map(num),n=list.length,mx=Math.max(1e-6,...list.map(s=>s.v)),mn=Math.min(0,...list.map(s=>s.v))
44
44
  const W=Math.min(S.w,S.u*(S.port?1:1.25)),H=W*(S.port?.9:.6),x0=S.cx-W/2,y0=S.y-H/2,pad=W*.08,th=p.text?H*.17:H*.05
45
45
  ctx.save();ctx.globalAlpha=k.v;card(x0,y0,W,H,W*.04,.8);ctx.restore()
46
46
  head(y0+th*.6,H*.08)
@@ -61,7 +61,7 @@
61
61
  }`),Ge("biz-donut","Biểu đồ tròn tỷ trọng",5,{text:"Doanh thu theo kênh",items:"Online 55%|Cửa hàng 30%|Đại lý 15%",position:"center"},`function render(ctx,t,env){
62
62
  // Arcs draw clockwise one after another in shades of the accent; the legend counts its percentages.
63
63
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
64
- `+na+Tc+ye+` const list=M.items(p).map(num),sum=Math.max(1e-6,list.reduce((a,s)=>a+Math.max(0,s.v),0)),n=Math.max(1,list.length)
64
+ `+na+Tc+me+` const list=M.items(p).map(num),sum=Math.max(1e-6,list.reduce((a,s)=>a+Math.max(0,s.v),0)),n=Math.max(1,list.length)
65
65
  const W=Math.min(S.w,S.u*(S.port?1:1.3)),H=W*(S.port?1.25:.58),x0=S.cx-W/2,y0=S.y-H/2,th=p.text?H*.14:H*.04
66
66
  ctx.save();ctx.globalAlpha=k.v;card(x0,y0,W,H,W*.04,.8);ctx.restore()
67
67
  head(y0+th*.6,H*.07)
@@ -83,7 +83,7 @@
83
83
  }`),Ge("biz-process","Quy trình các bước",6,{text:"Quy trình làm việc",items:"Tư vấn|Thiết kế|Triển khai|Bàn giao",position:"center"},`function render(ctx,t,env){
84
84
  // Numbered circles linked by a line that draws itself; each step lights up in turn (accent fill + label).
85
85
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
86
- `+ye+` const list=M.items(p),n=Math.max(1,list.length),vert=S.port,step=Math.max(.35,Math.min(1.1,(D-1.6)/n))
86
+ `+me+` const list=M.items(p),n=Math.max(1,list.length),vert=S.port,step=Math.max(.35,Math.min(1.1,(D-1.6)/n))
87
87
  const span=vert?Math.min(S.bot-S.top,S.u*1.5)*.72:S.w*.86,r=Math.min(S.u*.06,span/n*.22),th=p.text?S.u*.13:0
88
88
  const pos=i=>{const f=n>1?i/(n-1):.5;return vert?[S.x0+S.w*.16,S.y-span/2+th/2+span*f]:[S.cx-span/2+span*f,S.y+th/2]}
89
89
  head(vert?S.y-span/2-th*.4:S.y-r*2.6,S.u*.065)
@@ -102,7 +102,7 @@
102
102
  }`),Ge("biz-timeline","Cột mốc phát triển",7,{text:"Hành trình của chúng tôi",items:"2015 Thành lập|2018 Chi nhánh thứ 2|2021 1 triệu khách hàng|2024 Vươn ra quốc tế",position:"center"},`function render(ctx,t,env){
103
103
  // A line draws through the milestones; each one pops a dot, its year (accent) and its caption.
104
104
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
105
- `+ye+` const list=M.items(p).map(s=>{const w=String(s).split(' ');return{y:w[0]||'',c:w.slice(1).join(' ')}}),n=Math.max(1,list.length),vert=S.port
105
+ `+me+` const list=M.items(p).map(s=>{const w=String(s).split(' ');return{y:w[0]||'',c:w.slice(1).join(' ')}}),n=Math.max(1,list.length),vert=S.port
106
106
  const step=Math.max(.4,Math.min(1.3,(D-1.6)/n)),span=vert?Math.min(S.bot-S.top,S.u*1.55)*.74:S.w*.9,th=p.text?S.u*.13:0
107
107
  const pos=i=>{const f=n>1?i/(n-1):.5;return vert?[S.x0+S.w*.12,S.y-span/2+th/2+span*f]:[S.cx-span/2+span*f,S.y+th*.3]}
108
108
  head(vert?S.y-span/2-th*.45:S.y-S.u*.24,S.u*.065)
@@ -122,7 +122,7 @@
122
122
  }`),Ge("biz-pricing","Bảng giá gói",6,{text:"Chọn gói phù hợp",sub:"Phổ biến nhất",items:"Cơ bản: 199k|Chuyên nghiệp: 499k|Doanh nghiệp: Liên hệ",position:"center"},`function render(ctx,t,env){
123
123
  // Up to 3 plan cards (items "Plan: price", or the last word is the price) rise in; the middle one is taller, outlined in the accent, with a badge (sub) and a light sweep.
124
124
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
125
- `+ye+` const list=M.items(p,3).map(s=>{const c=String(s).indexOf(':');if(c>=0)return{name:String(s).slice(0,c).trim(),price:String(s).slice(c+1).trim()};const w=String(s).split(' ');return{name:w.slice(0,-1).join(' ')||w[0]||'',price:w.length>1?w[w.length-1]:''}}),n=Math.max(1,list.length),hot=Math.floor((n-1)/2),vert=S.port
125
+ `+me+` const list=M.items(p,3).map(s=>{const c=String(s).indexOf(':');if(c>=0)return{name:String(s).slice(0,c).trim(),price:String(s).slice(c+1).trim()};const w=String(s).split(' ');return{name:w.slice(0,-1).join(' ')||w[0]||'',price:w.length>1?w[w.length-1]:''}}),n=Math.max(1,list.length),hot=Math.floor((n-1)/2),vert=S.port
126
126
  const gap=S.u*.03,th=p.text?S.u*.17:S.u*.05,cw=vert?Math.min(S.w,S.u*.8):Math.min((S.w-gap*(n-1))/n,S.u*.42),ch=vert?Math.min(S.u*.24,(S.bot-S.top-th)/n-gap):cw*1.15
127
127
  const W=vert?cw:cw*n+gap*(n-1),H=vert?ch*n+gap*(n-1):ch,x0=S.cx-W/2,y0=S.y-H/2+th/2
128
128
  head(y0-th*.62,S.u*.06)
@@ -200,7 +200,7 @@
200
200
  }`),Ge("biz-compare","So sánh với đối thủ",6,{text:"Vì sao chọn chúng tôi?",sub:"Chúng tôi",other:"Nơi khác",items:"Giao hàng trong 2 giờ|Bảo hành 24 tháng|Hỗ trợ 24/7|Đổi trả miễn phí",position:"center"},`function render(ctx,t,env){
201
201
  // A two-column table: each row slides in, our column gets an accent tick, the other a grey cross.
202
202
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
203
- `+Tc+ye+` const list=M.items(p),n=Math.max(1,list.length),W=Math.min(S.w,S.u*(S.port?1:1.2)),rh=S.u*(S.port?.115:.1),th=p.text?rh*1.2:0,hh=rh*.9,H=th+hh+rh*n+rh*.4,x0=S.cx-W/2,y0=S.y-H/2
203
+ `+Tc+me+` const list=M.items(p),n=Math.max(1,list.length),W=Math.min(S.w,S.u*(S.port?1:1.2)),rh=S.u*(S.port?.115:.1),th=p.text?rh*1.2:0,hh=rh*.9,H=th+hh+rh*n+rh*.4,x0=S.cx-W/2,y0=S.y-H/2
204
204
  const c1=x0+W*.66,c2=x0+W*.86,step=Math.max(.3,Math.min(.6,(D-2)/n))
205
205
  ctx.save();ctx.globalAlpha=k.v;card(x0,y0,W,H,S.u*.03,.84);ctx.restore()
206
206
  head(y0+th*.6,rh*.5)
@@ -219,7 +219,7 @@
219
219
  }`)],pn=V.find(t=>t.id==="business"),Et=(t,e,c,a,o)=>({id:t,name:e,category:pn.name,pack:"business",duration:c,params:{...a,accent:pn.accent,style:"business"},code:o}),qt=`const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.4)
220
220
  `,Ll=[Et("biz-funnel","Phễu chuyển đổi",5,{text:"Phễu bán hàng",items:"Tiếp cận 12000|Quan tâm 4800|Dùng thử 1500|Mua hàng 620",position:"center"},`function render(ctx,t,env){
221
221
  // Funnel layers open from the centre one by one; each counts its number, the step-to-step rate sits on the right.
222
- `+qt+na+ye+` const list=M.items(p).map(num),n=Math.max(1,list.length),th=p.text?S.u*.12:0
222
+ `+qt+na+me+` const list=M.items(p).map(num),n=Math.max(1,list.length),th=p.text?S.u*.12:0
223
223
  const W=Math.min(S.w*.8,S.u*(S.port?.85:1)),lh=Math.min(S.u*(S.port?.16:.12),(S.bot-S.top-th)/n*.9),H=lh*n,cx=S.cx,y0=S.y-(H+th)/2+th
224
224
  head(y0-th*.55,S.u*.06)
225
225
  ctx.save()
@@ -278,7 +278,7 @@
278
278
  box(rx,ry,rw,String(p.text||''),true,M.ease.outBack(M.range(t,.05,.5)))
279
279
  }`),Et("biz-swot","Ma trận SWOT",6,{text:"Phân tích SWOT",items:"Thương hiệu mạnh|Chi phí vận hành cao|Thị trường tỉnh lẻ|Đối thủ giá rẻ",position:"center"},`function render(ctx,t,env){
280
280
  // Four cells flip in (S, W, O, T) with a big watermark letter and their item text; S uses the accent.
281
- `+qt+ye+` const list=M.items(p,4),gap=S.u*.025,th=p.text?S.u*.12:0,cw=Math.min((S.w-gap)/2,S.u*(S.port?.44:.42)),ch=cw*(S.port?.85:.55),W=cw*2+gap,H=ch*2+gap,x0=S.cx-W/2,y0=S.y-(H+th)/2+th
281
+ `+qt+me+` const list=M.items(p,4),gap=S.u*.025,th=p.text?S.u*.12:0,cw=Math.min((S.w-gap)/2,S.u*(S.port?.44:.42)),ch=cw*(S.port?.85:.55),W=cw*2+gap,H=ch*2+gap,x0=S.cx-W/2,y0=S.y-(H+th)/2+th
282
282
  head(y0-th*.55,S.u*.06)
283
283
  const cols=[sk.acc,'#ff5a5f','#2fd27a','#ffb020'],L=['S','W','O','T']
284
284
  for(let i=0;i<4;i++){const x=x0+(i%2)*(cw+gap),y=y0+Math.floor(i/2)*(ch+gap),t0=.35+i*.25,e=M.ease.outBack(M.range(t,t0,t0+.6))
@@ -290,7 +290,7 @@
290
290
  ctx.restore()}
291
291
  }`),Et("biz-ranking","Bảng xếp hạng",5.5,{text:"Top chi nhánh tháng 9",items:"Quận 1 980|Thủ Đức 860|Quận 7 720|Bình Thạnh 610|Gò Vấp 450",position:"center"},`function render(ctx,t,env){
292
292
  // Rows sorted by value slide in; gold / silver / bronze rank badges, bars grow and values count.
293
- `+qt+na+Tc+ye+` const list=M.items(p).map(num).sort((a,b)=>b.v-a.v),n=Math.max(1,list.length),mx=Math.max(1e-6,...list.map(s=>s.v)),th=p.text?S.u*.12:S.u*.03
293
+ `+qt+na+Tc+me+` const list=M.items(p).map(num).sort((a,b)=>b.v-a.v),n=Math.max(1,list.length),mx=Math.max(1e-6,...list.map(s=>s.v)),th=p.text?S.u*.12:S.u*.03
294
294
  const W=Math.min(S.w,S.u*(S.port?1:1.2)),rh=Math.min(S.u*.11,(S.bot-S.top-th)/n*.85),H=th+rh*n+rh*.3,x0=S.cx-W/2,y0=S.y-H/2
295
295
  ctx.save();ctx.globalAlpha=k.v;card(x0,y0,W,H,S.u*.03,.84);ctx.restore()
296
296
  head(y0+th*.55,S.u*.055)
@@ -337,7 +337,7 @@
337
337
  ctx.restore()
338
338
  }`),Et("biz-team","Đội ngũ",5.5,{text:"Đội ngũ của chúng tôi",items:"Minh Anh · CEO|Quốc Huy · CTO|Thu Trang · CMO|Đức Long · CFO",position:"center"},`function render(ctx,t,env){
339
339
  // Avatar circles with initials pop in a grid; an accent ring draws around each, name and role appear below.
340
- `+qt+ye+` const list=M.items(p).map(s=>{const a=String(s).split('·');return{name:(a[0]||'').trim(),role:a.slice(1).join('·').trim()}}),n=Math.max(1,list.length)
340
+ `+qt+me+` const list=M.items(p).map(s=>{const a=String(s).split('·');return{name:(a[0]||'').trim(),role:a.slice(1).join('·').trim()}}),n=Math.max(1,list.length)
341
341
  const cols=S.port?Math.min(2,n):Math.min(5,n),rows=Math.ceil(n/cols),cw=S.w/cols,r=Math.min(cw*.28,S.u*(S.port?.11:.085)),rh=r*3.5,th=p.text?S.u*.13:0,H=rh*rows+th,y0=S.y-H/2+th
342
342
  head(y0-th*.55,S.u*.06)
343
343
  list.forEach((m,i)=>{const row=Math.floor(i/cols),inRow=Math.min(cols,n-row*cols),c=i%cols,x=S.cx+(c-(inRow-1)/2)*cw,y=y0+row*rh+r*1.1,t0=.4+i*.18,e=M.ease.outBack(M.range(t,t0,t0+.5))
@@ -352,7 +352,7 @@
352
352
  ctx.restore()})
353
353
  }`),Et("biz-gantt","Lộ trình theo quý",6,{text:"Lộ trình 2026",items:"Nghiên cứu 1-2|Phát triển 2-3|Ra mắt 3|Mở rộng 3-4",position:"center"},`function render(ctx,t,env){
354
354
  // A Q1–Q4 Gantt: each task bar (last word "a-b" = quarters) grows in turn; a "now" line sweeps to mid-Q3.
355
- `+qt+Tc+ye+` const list=M.items(p).map(s=>{const w=String(s).split(' '),q=(w.length>1?w.pop():'1').split('-').map(Number),a=Math.max(1,Math.min(4,q[0]||1)),b=Math.max(a,Math.min(4,q[1]||a));return{name:w.join(' ')||String(s),a,b}}),n=Math.max(1,list.length)
355
+ `+qt+Tc+me+` const list=M.items(p).map(s=>{const w=String(s).split(' '),q=(w.length>1?w.pop():'1').split('-').map(Number),a=Math.max(1,Math.min(4,q[0]||1)),b=Math.max(a,Math.min(4,q[1]||a));return{name:w.join(' ')||String(s),a,b}}),n=Math.max(1,list.length)
356
356
  const W=Math.min(S.w,S.u*(S.port?1:1.3)),th=p.text?S.u*.12:S.u*.03,rh=Math.min(S.u*.1,(S.bot-S.top-th)/(n+1)*.85),H=th+rh*(n+1)+rh*.3,x0=S.cx-W/2,y0=S.y-H/2,lw=W*(S.port?.32:.26),gx=x0+lw,gw=W-lw-W*.04,qw=gw/4
357
357
  ctx.save();ctx.globalAlpha=k.v;card(x0,y0,W,H,S.u*.03,.85);ctx.restore()
358
358
  head(y0+th*.55,S.u*.055)
@@ -477,7 +477,7 @@
477
477
  ctx.restore()
478
478
  }`),Et("biz-heatmap","Lịch hoạt động",5,{text:"Đơn hàng mỗi ngày",sub:"+312 đơn tuần này",position:"center"},`function render(ctx,t,env){
479
479
  // A week × day activity grid (rising trend) fills column by column in shades of the accent; a legend and the sub sit below.
480
- `+qt+Tc+ye+` const cols=S.port?12:22,rowsN=7,W=Math.min(S.w,S.u*(S.port?.95:1.3)),cs=W/(cols+2),th=p.text?S.u*.11:S.u*.03,H=th+cs*rowsN+cs*3,x0=S.cx-W/2,y0=S.y-H/2,gx=x0+cs,gy=y0+th+cs*.5
480
+ `+qt+Tc+me+` const cols=S.port?12:22,rowsN=7,W=Math.min(S.w,S.u*(S.port?.95:1.3)),cs=W/(cols+2),th=p.text?S.u*.11:S.u*.03,H=th+cs*rowsN+cs*3,x0=S.cx-W/2,y0=S.y-H/2,gx=x0+cs,gy=y0+th+cs*.5
481
481
  ctx.save();ctx.globalAlpha=k.v;card(x0,y0,W,H,S.u*.03,.85);ctx.restore()
482
482
  head(y0+th*.55,S.u*.05)
483
483
  ctx.save()
@@ -1428,7 +1428,7 @@
1428
1428
  const by=ey-h/2;ctx.save();ctx.globalAlpha*=e;ctx.translate((1-e)*(left?-1:1)*u*.03,0)
1429
1429
  M.glass(ctx,bx,by,w,h,h*.3,{rim:.6});M.glyph(ctx,p.glyph,bx+h*.6,ey,h*.55,{color:sk.acc,draw:M.range(t,.6,1.1)})
1430
1430
  ctx.textAlign='left';M.ink(ctx,sk,f.lines[0]||'',bx+h*1.1,ey,f.size);ctx.restore()
1431
- }`)],yn=V.find(t=>t.id==="creator"),te=(t,e,c,a,o)=>({id:t,name:e,category:yn.name,pack:"creator",duration:c,params:{accent:yn.accent,...a,style:"creator"},code:o}),Nl=[te("creator-icon-row","Hàng icon nền tảng",4.5,{items:"play|loop|note",sub:"*,0,1,2",position:"lower"},`function render(ctx,t,env){
1431
+ }`)],yn=V.find(t=>t.id==="creator"),ce=(t,e,c,a,o)=>({id:t,name:e,category:yn.name,pack:"creator",duration:c,params:{accent:yn.accent,...a,style:"creator"},code:o}),Nl=[ce("creator-icon-row","Hàng icon nền tảng",4.5,{items:"play|loop|note",sub:"*,0,1,2",position:"lower"},`function render(ctx,t,env){
1432
1432
  // Icon row under a caption: three platform-style app icons (generic glyphs: play tile, loop, note — or any glyph
1433
1433
  // name) pop in one by one, then the ACTIVE one (sub = a list of beats, * = all lit, 0/1/2 = that icon) grows and
1434
1434
  // glows while the others dim, and the row slides so the active icon is centred; the beats share the clip evenly.
@@ -1453,7 +1453,7 @@
1453
1453
  const on=M.lerp(lit(i,prev),lit(i,cur),mixK),x=W/2+(i-(n-1)/2)*gap-ox,sc=a*(.82+.3*on),al=Math.min(1,a*1.4)*(.28+.72*on)
1454
1454
  ctx.save();ctx.globalAlpha*=al;if(on<.5)ctx.filter='grayscale(1)';draw(name,x,Y+(1-Math.min(1,a))*s*.4,s*sc,on);ctx.restore()})
1455
1455
  ctx.restore()
1456
- }`),te("creator-phone-duo","Hai điện thoại + tay vuốt",4.5,{text:"10 ĐẾN 12 / GIỜ MỖI NGÀY",sub:"4 KHÁCH / CÙNG LÚC",hole:0,number:1,position:"center"},`function render(ctx,t,env){
1456
+ }`),ce("creator-phone-duo","Hai điện thoại + tay vuốt",4.5,{text:"10 ĐẾN 12 / GIỜ MỖI NGÀY",sub:"4 KHÁCH / CÙNG LÚC",hole:0,number:1,position:"center"},`function render(ctx,t,env){
1457
1457
  // Two phones side by side with a bold caption inside each (a " / " splits a red line from a white one); a white hand
1458
1458
  // swipes from the first phone to the second, which then lights up. number 1 = dark red backdrop (a cut-away), 0 =
1459
1459
  // phones float over the real picture; hole 1 = the screens are see-through so footage placed under them plays inside.
@@ -1486,7 +1486,7 @@
1486
1486
  if(sw>0&&sw<1){ctx.globalAlpha*=.6;for(let j=1;j<4;j++){ctx.fillStyle='rgba(255,255,255,'+(.3/j)+')';ctx.fillRect(-hs*(.6+j*.35),-hs*.1,hs*.25,hs*.06)}}
1487
1487
  ctx.restore()}
1488
1488
  ctx.restore()
1489
- }`),te("creator-watch-chart","Biểu đồ thời gian xem",4,{text:"Thời gian xem",sub:"00:60",number:.55,position:"lower"},`function render(ctx,t,env){
1489
+ }`),ce("creator-watch-chart","Biểu đồ thời gian xem",4,{text:"Thời gian xem",sub:"00:60",number:.55,position:"lower"},`function render(ctx,t,env){
1490
1490
  // A small dark glass "watch time" card: label (text) top-left, faint grid, a grey reference line, then a RED line
1491
1491
  // draws on — flat at first, then it plunges at "number" (0..1 of the width) like viewers leaving; a glowing dot rides
1492
1492
  // its tip; 00:00 and sub (the end time) under the axis.
@@ -1503,7 +1503,7 @@
1503
1503
  const N=Math.max(2,Math.round(80*dr));for(let i=0;i<=N;i++){const q=dr*i/N;i?ctx.lineTo(gx+gw*q,f(q)):ctx.moveTo(gx,f(0))}ctx.stroke();ctx.shadowBlur=0
1504
1504
  const hx=gx+gw*dr,hy=f(dr);ctx.fillStyle='#ffffff';ctx.beginPath();ctx.arc(hx,hy,w*.016,0,M.TAU);ctx.fill();ctx.strokeStyle=sk.acc;ctx.lineWidth=w*.007;ctx.stroke()}
1505
1505
  ctx.restore()
1506
- }`),te("creator-scrub-bar","Thanh tua video",3,{from:.12,number:.64,text:"",position:"lower"},`function render(ctx,t,env){
1506
+ }`),ce("creator-scrub-bar","Thanh tua video",3,{from:.12,number:.64,text:"",position:"lower"},`function render(ctx,t,env){
1507
1507
  // A video scrub / progress bar: a thin track wipes in, the red fill grows behind a white dot with a red ring that
1508
1508
  // slides from "from" to "number" (0..1) and stops with a soft pulse; text = an optional time label over the dot.
1509
1509
  const {width:W,height:H,duration:D,params:p}=env,port=H>W*1.1,u=Math.min(W,H),sk=M.skin(env,p),k=M.io(t,D,.3,.3)
@@ -1517,7 +1517,7 @@
1517
1517
  ctx.fillStyle='#ffffff';ctx.beginPath();ctx.arc(dx,Y,r,0,M.TAU);ctx.fill();ctx.strokeStyle=sk.acc;ctx.lineWidth=th*.7;ctx.stroke()
1518
1518
  const s=String(p.text||'');if(s){ctx.font=sk.font(u*.035,'s');ctx.textAlign='center';ctx.textBaseline='bottom';ctx.fillStyle='#ffffff';ctx.shadowColor='rgba(0,0,0,.6)';ctx.shadowBlur=u*.01;ctx.fillText(s,dx,Y-r*2)}}
1519
1519
  ctx.restore()
1520
- }`),te("creator-dot-list","Danh sách chấm màu",4.5,{items:"Thông tin|Hướng dẫn|Bán hàng",number:1,glyph:"user",accent2:"#c77dff",position:"lower"},`function render(ctx,t,env){
1520
+ }`),ce("creator-dot-list","Danh sách chấm màu",4.5,{items:"Thông tin|Hướng dẫn|Bán hàng",number:1,glyph:"user",accent2:"#c77dff",position:"lower"},`function render(ctx,t,env){
1521
1521
  // A list beside / under the speaker: an optional round avatar bubble (number 1, a glyph inside a glowing ring) on the
1522
1522
  // left, then lines (items, up to 5) arrive one by one, spread over the first 60 % of the clip — a coloured dot pops (accent2) and the words
1523
1523
  // slide in from a blur; earlier lines stay lit. Lower-middle, centred as one block.
@@ -1538,7 +1538,7 @@
1538
1538
  const f=M.fit(ctx,s.toUpperCase(),z=>sk.font(z,'s'),size,tw,1);ctx.save();ctx.font=f.font;ctx.globalAlpha*=e;if(a<1)ctx.filter='blur('+((1-e)*size*.25).toFixed(1)+'px)'
1539
1539
  ctx.shadowColor='rgba(0,0,0,.55)';ctx.shadowBlur=size*.25;ctx.fillStyle='#ffffff';ctx.fillText(f.lines[0]||'',tx+(1-e)*size*.8,y);ctx.restore()})
1540
1540
  ctx.restore()
1541
- }`),te("creator-offer-card","Thẻ khoá học giảm giá",5,{text:"Gói khoá học A",items:"Lộ trình 8 tuần|Bài tập thực chiến|Nhóm hỗ trợ riêng",number:1946500,unit:"VNĐ",sub:"SALE −15%",glyph:"graduation",position:"lower"},`function render(ctx,t,env){
1541
+ }`),ce("creator-offer-card","Thẻ khoá học giảm giá",5,{text:"Gói khoá học A",items:"Lộ trình 8 tuần|Bài tập thực chiến|Nhóm hỗ trợ riêng",number:1946500,unit:"VNĐ",sub:"SALE −15%",glyph:"graduation",position:"lower"},`function render(ctx,t,env){
1542
1542
  // Product / course card drop-in: a dark glass card falls in with an overshoot — a picture panel (glyph on a warm
1543
1543
  // gradient, an OFFER ribbon), the title (text), bullets (items), then the price pill counts DOWN from the old price to the
1544
1544
  // sale price (number, unit) — the old price is "from", or worked out from a percent in the sale tag (sub, "−15%") —
@@ -1562,7 +1562,7 @@
1562
1562
  ctx.font=sk.font(w*.065,'h');ctx.shadowColor='rgba(0,0,0,.7)';ctx.shadowBlur=w*.02;ctx.fillStyle='#ffffff';ctx.fillText(String(p.sub),w*.12,0)
1563
1563
  if(f0>0){ctx.font=sk.font(w*.048,'s');ctx.fillStyle='rgba(255,255,255,.7)';const o=M.fmt(f0),ow=ctx.measureText(o).width,ox=-w*.24;ctx.fillText(o,ox,0);ctx.strokeStyle=sk.acc;ctx.lineWidth=w*.008;ctx.beginPath();ctx.moveTo(ox-ow/2,0);ctx.lineTo(ox+ow/2,0);ctx.stroke()}
1564
1564
  ctx.restore()}
1565
- }`),te("creator-notify-stack","Thông báo xếp chồng",4.5,{items:"Bạn có thông báo mới|Đơn hàng mới: +1.250.000đ|Thanh toán thành công: +990.000đ",every:.8,position:"lower"},`function render(ctx,t,env){
1565
+ }`),ce("creator-notify-stack","Thông báo xếp chồng",4.5,{items:"Bạn có thông báo mới|Đơn hàng mới: +1.250.000đ|Thanh toán thành công: +990.000đ",every:.8,position:"lower"},`function render(ctx,t,env){
1566
1566
  // Phone notification banners slide down one by one (every s) and STACK: the newest sits in front, the older ones tuck
1567
1567
  // behind it smaller and dimmer. Each item "Title: message" (or just a message under a generic title); the app tile
1568
1568
  // picks a glyph from the words (money → wallet, message → chat, else bell). No real bank / app names.
@@ -1584,7 +1584,7 @@
1584
1584
  const f2=M.fit(ctx,msg,z=>sk.font(z,'s'),h*.23,mw,1);ctx.font=f2.font;ctx.fillStyle='rgba(255,255,255,.78)';ctx.fillText(f2.lines[0]||'',cx,yy+h*.17)
1585
1585
  ctx.restore()}
1586
1586
  ctx.restore()
1587
- }`),te("creator-message-chip","Tin nhắn / thông báo mạng xã hội",3.5,{text:"Minh Anh",sub:"Cho mình xin lộ trình với!",number:0,glyph:"heart",position:"lower"},`function render(ctx,t,env){
1587
+ }`),ce("creator-message-chip","Tin nhắn / thông báo mạng xã hội",3.5,{text:"Minh Anh",sub:"Cho mình xin lộ trình với!",number:0,glyph:"heart",position:"lower"},`function render(ctx,t,env){
1588
1588
  // A small social chip: number 0 = a DM bar — avatar initials (text = the name), the message (sub) types itself and
1589
1589
  // the round send button is tapped (a ring pulses); number 1 = a social notification — an app tile with a glyph
1590
1590
  // (heart by default), the name in bold and the action (sub). Slides up from a blur; lower-middle.
@@ -1606,7 +1606,7 @@
1606
1606
  const tx=ax+ts/2+h*.28,mw=w-(tx-x)-h*.4;ctx.textAlign='left';const f1=M.fit(ctx,name,z=>sk.font(z,'s'),h*.27,mw,1);ctx.font=f1.font;ctx.fillStyle='#ffffff';ctx.fillText(f1.lines[0]||'',tx,Y-h*.15)
1607
1607
  const f2=M.fit(ctx,msg,z=>sk.font(z,'s'),h*.22,mw,1);ctx.font=f2.font;ctx.fillStyle='rgba(255,255,255,.7)';ctx.fillText(f2.lines[0]||'',tx,Y+h*.17)}
1608
1608
  ctx.restore()
1609
- }`),te("creator-thumb-wall","Tường thumbnail + lượt xem",4.5,{items:"5 LỖI EDIT|HOOK 3 GIÂY|KHÔNG B-ROLL?|CẮT NHỊP NHANH|LÝ DO GÌ?|EDIT NHƯ PRO",number:987e3,accent2:"#ff7a3d"},`function render(ctx,t,env){
1609
+ }`),ce("creator-thumb-wall","Tường thumbnail + lượt xem",4.5,{items:"5 LỖI EDIT|HOOK 3 GIÂY|KHÔNG B-ROLL?|CẮT NHỊP NHANH|LÝ DO GÌ?|EDIT NHƯ PRO",number:987e3,accent2:"#ff7a3d"},`function render(ctx,t,env){
1610
1610
  // Full-frame thumbnail wall: a grid of black-and-white video thumbnails (abstract — titles from items, light shapes,
1611
1611
  // no faces) zooms out from the centre tile, which stays in COLOUR with a white rim, an eye glyph and a view counter
1612
1612
  // that counts up to "number" (from "from", else from about 2.3 % below: 964K → 987K). A cut-away for reach / views / "so many videos" beats.
@@ -1629,7 +1629,7 @@
1629
1629
  ctx.fillStyle='rgba(0,0,0,'+(.25*M.range(t,.6,1.4)).toFixed(3)+')';ctx.fillRect(-W,-H,W*2,H*2)
1630
1630
  const hs=1+.05*Math.sin(M.range(t,.9,1.3)*Math.PI);ctx.scale(hs,hs);tile(0,0,0,0,true)
1631
1631
  ctx.restore()
1632
- }`),te("creator-wave-mismatch","Sóng âm không khớp",3.5,{text:"CREATOR",sub:"MUSIC",number:0,position:"lower"},`function render(ctx,t,env){
1632
+ }`),ce("creator-wave-mismatch","Sóng âm không khớp",3.5,{text:"CREATOR",sub:"MUSIC",number:0,position:"lower"},`function render(ctx,t,env){
1633
1633
  // Audio "mismatch" chips: number 0 = two waveform chips side by side — the voice (text label, blue) and the music
1634
1634
  // (sub label, green) whose peaks do not line up, a red ≠ pulses between them; number 1 = one green waveform chip
1635
1635
  // (text label in it) that drains to grey while a red X draws over it ("không khớp").
@@ -1649,7 +1649,7 @@
1649
1649
  const ne=M.ease.outBack(M.range(t,.7,1)),pu=1+.08*Math.sin(t*8);if(ne>0){ctx.save();ctx.translate(W/2,Y);ctx.scale(ne*pu,ne*pu);ctx.strokeStyle=sk.acc;ctx.lineWidth=ch*.09;ctx.lineCap='round';ctx.shadowColor=sk.acc;ctx.shadowBlur=ch*.25;const s=g*.28
1650
1650
  ctx.beginPath();ctx.moveTo(-s,-s*.35);ctx.lineTo(s,-s*.35);ctx.moveTo(-s,s*.35);ctx.lineTo(s,s*.35);ctx.moveTo(s*.45,-s*.85);ctx.lineTo(-s*.45,s*.85);ctx.stroke();ctx.restore()}}
1651
1651
  ctx.restore()
1652
- }`),te("creator-layout-box","Khung bố cục sai",3,{text:"Bố cục sai",color:"#2fbf5a",position:"lower"},`function render(ctx,t,env){
1652
+ }`),ce("creator-layout-box","Khung bố cục sai",3,{text:"Bố cục sai",color:"#2fbf5a",position:"lower"},`function render(ctx,t,env){
1653
1653
  // A translucent green layout guide box (color) drawn over the chest area to show a wrong layout: it opens from the
1654
1654
  // centre, thirds lines and corner handles appear, it breathes once; the label (text) sits at its top in heavy red
1655
1655
  // caps with a dark shadow and a small warning glyph.
@@ -1664,7 +1664,7 @@
1664
1664
  const f=M.fit(ctx,s,z=>sk.font(z,'n'),u*(port?.15:.12),w*.86,1);ctx.font=f.font;const tw=ctx.measureText(f.lines[0]||'').width;M.glyph(ctx,'warning',-tw/2-f.size*.55,0,f.size*.7,{color:'#ffd23f',width:2.4})
1665
1665
  ctx.lineJoin='round';ctx.lineWidth=f.size*.16;ctx.strokeStyle='#160000';ctx.strokeText(f.lines[0]||'',0,0);ctx.fillStyle=sk.acc;ctx.fillText(f.lines[0]||'',0,0);ctx.restore()}
1666
1666
  ctx.restore()
1667
- }`),te("creator-glass-shatter","Vỡ kính chồng thẻ",3.5,{items:"BẢN NHÁP|BẢN 2|BẢN CUỐI",number:1.1,position:"lower"},`function render(ctx,t,env){
1667
+ }`),ce("creator-glass-shatter","Vỡ kính chồng thẻ",3.5,{items:"BẢN NHÁP|BẢN 2|BẢN CUỐI",number:1.1,position:"lower"},`function render(ctx,t,env){
1668
1668
  // A fanned stack of three video cards (items = their titles) — at "number" s a red flash hits, cracks radiate from an
1669
1669
  // impact point across every card, the colour drains to grey, then the shards slip and fall away. For "it breaks /
1670
1670
  // it fails / bị hỏng" beats.
@@ -1685,7 +1685,7 @@
1685
1685
  ctx.restore()
1686
1686
  ctx.strokeStyle='rgba(255,255,255,.55)';ctx.lineWidth=Math.max(1,cw*.012);M.rr(ctx,x,y,cw,ch,cw*.08);ctx.stroke();ctx.restore()})
1687
1687
  ctx.restore()
1688
- }`),te("creator-reaction-pop","Biểu cảm bật lên",3.5,{items:"devil|like|fire",position:"lower"},`function render(ctx,t,env){
1688
+ }`),ce("creator-reaction-pop","Biểu cảm bật lên",3.5,{items:"devil|like|fire",position:"lower"},`function render(ctx,t,env){
1689
1689
  // Reaction badges pop around the chest one after another (items: devil, like, fire, heart, wow) with a springy
1690
1690
  // bounce while a cursor clicks each one (a ring ripples); they float gently, then shrink away. Red devil face, blue
1691
1691
  // thumbs-up disc, pink flame disc — generic reaction glyphs, no app branding.
@@ -1710,7 +1710,7 @@
1710
1710
  const ci=cur<0?list.length-1:cur,prev=Math.max(0,ci-1),[ax,ay]=spots[prev%4],[bx,by]=spots[ci%4],m=M.ease.inOutCubic(M.range(t,at(ci)-.4,at(ci)-.05)),cx=W/2+M.lerp(ax,bx,cur<0?1:m)*sp+r*.35,cy=Y+M.lerp(ay,by,cur<0?1:m)*r*1.6+r*.35
1711
1711
  const ca=M.range(t,0,.15)*(1-M.range(t,at(list.length-1)+.6,at(list.length-1)+.9));if(ca>0){ctx.globalAlpha*=ca;M.cursor(ctx,cx,cy,r*.55,0,'#ffffff')}
1712
1712
  ctx.restore()
1713
- }`),te("creator-pill-caption","Nhãn kính + icon",3.5,{text:"Edit",sub:"hiệu quả",glyph:"target",accent2:"#2ec8ff",position:"lower"},`function render(ctx,t,env){
1713
+ }`),ce("creator-pill-caption","Nhãn kính + icon",3.5,{text:"Edit",sub:"hiệu quả",glyph:"target",accent2:"#2ec8ff",position:"lower"},`function render(ctx,t,env){
1714
1714
  // A dark glass pill caption: the key word (text, italic heavy, accent2 cyan) with a glyph beside it (target by
1715
1715
  // default) over a white second line (sub). It fades in out of a blur, a white glow flashes across once, then holds.
1716
1716
  const {width:W,height:H,duration:D,params:p}=env,port=H>W*1.1,u=Math.min(W,H),sk=M.skin(env,p),k=M.io(t,D,.2,.3),A=/^#[0-9a-f]{6}$/i.test(p.accent2)?p.accent2:'#2ec8ff'
@@ -1725,7 +1725,7 @@
1725
1725
  if(p.glyph)M.glyph(ctx,String(p.glyph),tx+ctx.measureText(s1).width+z*.62,ty,z*.95,{color:A,width:2.8})
1726
1726
  ctx.shadowBlur=0;if(s2){ctx.font=sk.font(z*.86,'s');ctx.textAlign='center';ctx.fillStyle='#ffffff';ctx.shadowColor='rgba(0,0,0,.5)';ctx.shadowBlur=z*.15;ctx.fillText(s2,W/2,y+ph*.72)}
1727
1727
  ctx.restore()
1728
- }`),te("creator-chapter-bar","Chuyển chương thanh timeline",3.5,{text:"PHẦN 2",sub:"Lỗi hay gặp",items:"Cắt thô còn sai|Âm thanh không khớp",number:.3},`function render(ctx,t,env){
1728
+ }`),ce("creator-chapter-bar","Chuyển chương thanh timeline",3.5,{text:"PHẦN 2",sub:"Lỗi hay gặp",items:"Cắt thô còn sai|Âm thanh không khớp",number:.3},`function render(ctx,t,env){
1729
1729
  // Full-frame chapter interstitial: from a white flash into a dark red screen — a red timeline line with its progress
1730
1730
  // and a white playhead that slides on, a small video card above it, comment markers popping on the line with short
1731
1731
  // comment cards (items) beside the card, the chapter label (text small, sub big) on top; the whole set eases back
@@ -1751,7 +1751,7 @@
1751
1751
  ctx.restore()}
1752
1752
  const wf=Math.max(1-M.range(t,0,.22),M.range(t,D-.18,D));if(wf>0){ctx.fillStyle='rgba(255,255,255,'+(wf*.92).toFixed(3)+')';ctx.fillRect(0,0,W,H)}
1753
1753
  ctx.restore()
1754
- }`),te("creator-quote-end","Thẻ kết trích dẫn",5,{text:"EDIT",sub:"HIỆU QUẢ",items:"Không chỉ làm video đẹp,|mà làm người xem hiểu ngay|từ lần xem đầu tiên.",glyph:"target",number:1},`function render(ctx,t,env){
1754
+ }`),ce("creator-quote-end","Thẻ kết trích dẫn",5,{text:"EDIT",sub:"HIỆU QUẢ",items:"Không chỉ làm video đẹp,|mà làm người xem hiểu ngay|từ lần xem đầu tiên.",glyph:"target",number:1},`function render(ctx,t,env){
1755
1755
  // Full-frame quote end card: a dark red glow, the title in heavy italic caps — text in the accent with a glyph
1756
1756
  // (target) beside it, sub in white under it, a red rule — then the quote lines (items, in quotes) fade up one by one;
1757
1757
  // number 1 = the whole card wipes to white over the last 0.7 s (the video's last frame).
@@ -1766,7 +1766,7 @@
1766
1766
  const f=M.fit(ctx,txt,z=>sk.font(z,'s'),qs,mw,2);ctx.save();ctx.globalAlpha*=a;ctx.font=f.font;ctx.fillStyle='rgba(255,255,255,.88)';f.lines.forEach((ln,j)=>ctx.fillText(ln,x0,y0+ts*2.15+i*qs*1.9+j*f.lh+(1-a)*qs*.5));ctx.restore()})
1767
1767
  if(wipe){const w=M.ease.inOutCubic(M.range(t,D-.7,D));if(w>0){ctx.fillStyle='rgba(255,255,255,'+w.toFixed(3)+')';ctx.fillRect(0,0,W,H)}}
1768
1768
  ctx.restore()
1769
- }`)],Il=["talking-head","course","explainer"],ee=(t,e=["bold"],c="high",a=[])=>Object.freeze({videoType:[...Il,...a],role:t,style:e,energy:c,orientation:["any"]}),Ul={"creator-icon-row":ee(["social","list","explain"]),"creator-phone-duo":ee(["compare","explain"],["bold","tech"]),"creator-watch-chart":ee(["stat","explain"],["tech"]),"creator-scrub-bar":ee(["stat","overlay"],["tech","minimal"],"medium"),"creator-dot-list":ee(["list","step"],["clean"],"medium"),"creator-offer-card":ee(["cta","stat"],["bold","tech"],"high",["affiliate"]),"creator-notify-stack":ee(["social","proof"],["tech"],"high",["affiliate"]),"creator-message-chip":ee(["social","cta"],["tech","clean"],"medium",["affiliate","podcast"]),"creator-thumb-wall":ee(["social","proof","stat"]),"creator-wave-mismatch":ee(["compare","explain"],["tech"]),"creator-layout-box":ee(["compare","explain"],["tech","minimal"],"medium"),"creator-glass-shatter":ee(["explain","transition"]),"creator-reaction-pop":ee(["social","sticker","overlay"],["playful","bold"]),"creator-pill-caption":ee(["caption","title"],["tech","clean"],"medium"),"creator-chapter-bar":ee(["chapter","transition","title"]),"creator-quote-end":ee(["quote","outro","cta"])},Kl=Nl.map(t=>({...t,tags:Ul[t.id]})),wn=V.find(t=>t.id==="creator"),dc=(t,e,c,a,o)=>({id:t,name:e,category:wn.name,pack:"creator",duration:c,params:{accent:wn.accent,...a,style:"creator"},code:o}),jl=[dc("creator-behind-title","Chữ lớn sau người",3.5,{text:"Không nghi ngờ",sub:"2025",from:2023,position:"top"},`function render(ctx,t,env){
1769
+ }`)],Il=["talking-head","course","explainer"],ae=(t,e=["bold"],c="high",a=[])=>Object.freeze({videoType:[...Il,...a],role:t,style:e,energy:c,orientation:["any"]}),Ul={"creator-icon-row":ae(["social","list","explain"]),"creator-phone-duo":ae(["compare","explain"],["bold","tech"]),"creator-watch-chart":ae(["stat","explain"],["tech"]),"creator-scrub-bar":ae(["stat","overlay"],["tech","minimal"],"medium"),"creator-dot-list":ae(["list","step"],["clean"],"medium"),"creator-offer-card":ae(["cta","stat"],["bold","tech"],"high",["affiliate"]),"creator-notify-stack":ae(["social","proof"],["tech"],"high",["affiliate"]),"creator-message-chip":ae(["social","cta"],["tech","clean"],"medium",["affiliate","podcast"]),"creator-thumb-wall":ae(["social","proof","stat"]),"creator-wave-mismatch":ae(["compare","explain"],["tech"]),"creator-layout-box":ae(["compare","explain"],["tech","minimal"],"medium"),"creator-glass-shatter":ae(["explain","transition"]),"creator-reaction-pop":ae(["social","sticker","overlay"],["playful","bold"]),"creator-pill-caption":ae(["caption","title"],["tech","clean"],"medium"),"creator-chapter-bar":ae(["chapter","transition","title"]),"creator-quote-end":ae(["quote","outro","cta"])},Kl=Nl.map(t=>({...t,tags:Ul[t.id]})),wn=V.find(t=>t.id==="creator"),dc=(t,e,c,a,o)=>({id:t,name:e,category:wn.name,pack:"creator",duration:c,params:{accent:wn.accent,...a,style:"creator"},code:o}),jl=[dc("creator-behind-title","Chữ lớn sau người",3.5,{text:"Không nghi ngờ",sub:"2025",from:2023,position:"top"},`function render(ctx,t,env){
1770
1770
  // A heavy two-tier title meant to sit BEHIND the speaker (placeBehindPerson): the word slams in red with a glow,
1771
1771
  // then the big line (sub) — when it is a number it rolls up from "from" like an odometer, digit by digit.
1772
1772
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.2,.3),u=S.u
@@ -2281,7 +2281,7 @@
2281
2281
  if(horiz){rx+=cw;rw-=cw}else{ry+=chh;rh-=chh}})
2282
2282
  const tf=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.045,S.w*.9,1);if(p.text){ctx.font=tf.font;ctx.textAlign='left';ctx.textBaseline='middle';M.ink(ctx,sk,tf.lines[0]||'',x,y-u*.06,tf.size)}
2283
2283
  ctx.restore()
2284
- }`)],vn=V.find(t=>t.id==="explain"),ce=(t,e,c,a,o)=>({id:t,name:e,category:vn.name,pack:"explain",duration:c,params:{accent:vn.accent,position:"top",...a,style:"explain"},code:o}),we="const BX=(env,p)=>{const W=env.width,H=env.height,port=H>W*1.1,u=Math.min(W,H),pos=p.position||'top';if(pos==='center')return{x:W*(port?.07:.2),y:H*(port?.2:.1),w:W*(port?.86:.6),h:H*(port?.6:.8),u,port,W,H};if(port)return{x:W*.06,y:H*.06,w:W*.88,h:H*.42,u,port,W,H};return{x:W*.5,y:H*.08,w:W*.44,h:H*.84,u,port,W,H}};const CARD=(c,x,y,w,h,r,acc,a=1)=>{c.save();c.shadowColor=M.rgba(acc,.4*a);c.shadowBlur=r*2;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix(acc,'#16040f',.8));g.addColorStop(1,M.mix(acc,'#0a0207',.9));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowBlur=0;c.strokeStyle=M.rgba(acc,.6);c.lineWidth=Math.max(1,r*.07);c.stroke();c.restore()};const PILL=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const HEAD=(c,sk,s,x,y,z,acc)=>{c.font=sk.font(z,'s','800');c.fillStyle=acc;c.textAlign='left';c.textBaseline='middle';c.beginPath();c.arc(x+z*.25,y,z*.2,0,M.TAU);c.fill();c.fillText(String(s).toUpperCase(),x+z*.8,y)};const HOT=(c,s,x,y,z,acc)=>{c.save();const g=c.createLinearGradient(0,y-z/2,0,y+z/2);g.addColorStop(0,M.mix(acc,'#ffffff',.45));g.addColorStop(1,acc);c.shadowColor=acc;c.shadowBlur=z*.35;c.fillStyle=g;c.fillText(s,x,y);c.shadowBlur=0;c.fillText(s,x,y);c.restore()};",Fl=[ce("exp-backdrop","Nền giải thích tím",6,{position:"center"},`function render(ctx,t,env){
2284
+ }`)],vn=V.find(t=>t.id==="explain"),oe=(t,e,c,a,o)=>({id:t,name:e,category:vn.name,pack:"explain",duration:c,params:{accent:vn.accent,position:"top",...a,style:"explain"},code:o}),ke="const BX=(env,p)=>{const W=env.width,H=env.height,port=H>W*1.1,u=Math.min(W,H),pos=p.position||'top';if(pos==='center')return{x:W*(port?.07:.2),y:H*(port?.2:.1),w:W*(port?.86:.6),h:H*(port?.6:.8),u,port,W,H};if(port)return{x:W*.06,y:H*.06,w:W*.88,h:H*.42,u,port,W,H};return{x:W*.5,y:H*.08,w:W*.44,h:H*.84,u,port,W,H}};const CARD=(c,x,y,w,h,r,acc,a=1)=>{c.save();c.shadowColor=M.rgba(acc,.4*a);c.shadowBlur=r*2;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix(acc,'#16040f',.8));g.addColorStop(1,M.mix(acc,'#0a0207',.9));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowBlur=0;c.strokeStyle=M.rgba(acc,.6);c.lineWidth=Math.max(1,r*.07);c.stroke();c.restore()};const PILL=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const HEAD=(c,sk,s,x,y,z,acc)=>{c.font=sk.font(z,'s','800');c.fillStyle=acc;c.textAlign='left';c.textBaseline='middle';c.beginPath();c.arc(x+z*.25,y,z*.2,0,M.TAU);c.fill();c.fillText(String(s).toUpperCase(),x+z*.8,y)};const HOT=(c,s,x,y,z,acc)=>{c.save();const g=c.createLinearGradient(0,y-z/2,0,y+z/2);g.addColorStop(0,M.mix(acc,'#ffffff',.45));g.addColorStop(1,acc);c.shadowColor=acc;c.shadowBlur=z*.35;c.fillStyle=g;c.fillText(s,x,y);c.shadowBlur=0;c.fillText(s,x,y);c.restore()};",Fl=[oe("exp-backdrop","Nền giải thích tím",6,{position:"center"},`function render(ctx,t,env){
2285
2285
  // Full-frame plum backdrop: a glow from the top, a slow grid, floating dust and a vignette — under cut-away cards.
2286
2286
  const {width:W,height:H,params:p}=env,sk=M.skin(env,p),u=Math.min(W,H),acc=sk.acc
2287
2287
  const g=ctx.createLinearGradient(0,0,0,H);g.addColorStop(0,M.mix(acc,'#12030e',.72));g.addColorStop(.55,M.mix(acc,'#0b0209',.88));g.addColorStop(1,'#070106');ctx.fillStyle=g;ctx.fillRect(0,0,W,H)
@@ -2289,7 +2289,7 @@
2289
2289
  const s=u*.09,off=(t*u*.01)%s;ctx.strokeStyle=M.rgba(acc,.07);ctx.lineWidth=1;ctx.beginPath();for(let x=-s+off;x<W+s;x+=s){ctx.moveTo(x,0);ctx.lineTo(x,H)}for(let y=-s+off;y<H+s;y+=s){ctx.moveTo(0,y);ctx.lineTo(W,y)}ctx.stroke()
2290
2290
  const R=M.rand(9);for(let i=0;i<40;i++){const x=R()*W,y=(R()*H-t*u*.02*(.5+R()))%H,yy=y<0?y+H:y;ctx.fillStyle=M.rgba(acc,.12+.2*R());ctx.beginPath();ctx.arc(x,yy,u*.002*(1+R()*2),0,M.TAU);ctx.fill()}
2291
2291
  const v=ctx.createRadialGradient(W/2,H/2,Math.min(W,H)*.3,W/2,H/2,Math.max(W,H)*.75);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,.55)');ctx.fillStyle=v;ctx.fillRect(0,0,W,H)
2292
- }`),ce("exp-room-panel","Tấm nền nhường chỗ",4,{},`function render(ctx,t,env){
2292
+ }`),oe("exp-room-panel","Tấm nền nhường chỗ",4,{},`function render(ctx,t,env){
2293
2293
  // The band a card sits on once the speaker stepped aside (makeRoom): 9:16 = the top half, fading out over the face
2294
2294
  // line; 16:9 = the right column, fading out towards the speaker. Plum like the cards, a slow grid, a soft top glow.
2295
2295
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.35,.35),u=Math.min(W,H),port=H>W*1.1,acc=sk.acc
@@ -2299,8 +2299,8 @@
2299
2299
  const r=ctx.createRadialGradient(port?W/2:W*.75,0,0,port?W/2:W*.75,0,u*.8);r.addColorStop(0,M.rgba(acc,.22));r.addColorStop(1,M.rgba(acc,0));ctx.fillStyle=r;if(port)ctx.fillRect(0,0,W,H*.5);else ctx.fillRect(W*.5,0,W*.5,H)
2300
2300
  const s=u*.09,off=(t*u*.01)%s;ctx.save();ctx.beginPath();if(port)ctx.rect(0,0,W,H*.46);else ctx.rect(W*.5,0,W*.5,H);ctx.clip();ctx.strokeStyle=M.rgba(acc,.07);ctx.lineWidth=1;ctx.beginPath();for(let x=-s+off;x<W+s;x+=s){ctx.moveTo(x,0);ctx.lineTo(x,H)}for(let y=-s+off;y<H+s;y+=s){ctx.moveTo(0,y);ctx.lineTo(W,y)}ctx.stroke();ctx.restore()
2301
2301
  ctx.restore()
2302
- }`),ce("exp-kicker-title","Tiêu đề hai tầng nóng",3,{text:"Núp bóng",sub:"Người mua",number:0},`function render(ctx,t,env){
2303
- ${we}
2302
+ }`),oe("exp-kicker-title","Tiêu đề hai tầng nóng",3,{text:"Núp bóng",sub:"Người mua",number:0},`function render(ctx,t,env){
2303
+ ${ke}
2304
2304
  // Two-tier hook title: a small white line (text) drops in, the big hot word (sub) slams with a shake; number > 1
2305
2305
  // adds a tilted "×N" badge.
2306
2306
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.2,.3),B=BX(env,p),u=B.u,acc=sk.acc,cx=B.x+B.w/2
@@ -2311,8 +2311,8 @@
2311
2311
  ctx.save();ctx.translate(cx+sh,yy);ctx.scale(sc,sc);ctx.globalAlpha*=Math.min(1,q*2);ctx.font=sf.font;sf.lines.forEach((l,i)=>HOT(ctx,l,0,i*sf.size*1.02,sf.size,acc));ctx.restore()
2312
2312
  const n=Math.round(+p.number||0);if(n>1){const b=M.ease.outBack(M.range(t,.6,.9)),bw=u*.12;ctx.save();ctx.translate(cx+Math.min(B.w*.42,ctx.measureText(sf.lines[0]||'').width*.5+bw*.4),yy+sf.size*.55);ctx.rotate(-.1);ctx.scale(b,b);ctx.fillStyle=acc;M.rr(ctx,-bw/2,-bw*.35,bw,bw*.7,bw*.15);ctx.fill();ctx.fillStyle=M.readable(acc);ctx.font=sk.font(bw*.42,'n');ctx.fillText('×'+n,0,0);ctx.restore()}}
2313
2313
  ctx.restore()
2314
- }`),ce("exp-comment-thread","Luồng bình luận",5,{text:"Khoá học mới đã mở đăng ký",items:"Khách ẩn danh: Gần AI lên đây hả?|Người dùng mạng: Tao ghét, tao KHÔNG MUA",sub:"KHÔNG MUA"},`function render(ctx,t,env){
2315
- ${we}
2314
+ }`),oe("exp-comment-thread","Luồng bình luận",5,{text:"Khoá học mới đã mở đăng ký",items:"Khách ẩn danh: Gần AI lên đây hả?|Người dùng mạng: Tao ghét, tao KHÔNG MUA",sub:"KHÔNG MUA"},`function render(ctx,t,env){
2315
+ ${ke}
2316
2316
  // A social post card (caption = text) whose comments (items "Name: comment") pop in one by one; the phrase in sub is
2317
2317
  // boxed in the accent inside the last comment it appears in.
2318
2318
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,4),hl=String(p.sub||'')
@@ -2330,8 +2330,8 @@
2330
2330
  ctx.fillStyle='#16181c';ctx.fillText(pre,px,ty);ctx.fillStyle=acc;ctx.fillRect(px+pw-u*.004,ty-mf.size*.6,(hw+u*.008)*q,mf.size*1.2);ctx.fillStyle=q>.5?'#ffffff':'#16181c';ctx.fillText(hl,px+pw,ty);ctx.fillStyle='#16181c';ctx.fillText(post,px+pw+hw,ty)}
2331
2331
  ctx.restore()})
2332
2332
  ctx.restore()
2333
- }`),ce("exp-profile-card","Hồ sơ khách hàng",5,{text:"Người dùng mạng",sub:"Bình luận dưới bài quảng cáo",items:"Chướng mắt|Ghét|Chửi",number:0,unit:"đơn hàng"},`function render(ctx,t,env){
2334
- ${we}
2333
+ }`),oe("exp-profile-card","Hồ sơ khách hàng",5,{text:"Người dùng mạng",sub:"Bình luận dưới bài quảng cáo",items:"Chướng mắt|Ghét|Chửi",number:0,unit:"đơn hàng"},`function render(ctx,t,env){
2334
+ ${ke}
2335
2335
  // A CRM profile: avatar + name (text) + where they came from (sub); attitude pills (items) light up one after
2336
2336
  // another; the purchase history counts to number + unit ("0 đơn hàng" reads as an empty table).
2337
2337
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,4)
@@ -2347,8 +2347,8 @@
2347
2347
  const q=M.ease.outCubic(M.range(t,1.8,2.6)),n=+p.number||0,lab=M.fmt(n*q)+' '+String(p.unit||''),cy=Math.min(y+h-u*.06,hy+u*.15);ctx.globalAlpha*=M.range(t,1.6,2);ctx.font=sk.font(u*.045,'h');const tw=ctx.measureText(lab).width+u*.06
2348
2348
  ctx.strokeStyle=M.rgba(acc,.7);ctx.lineWidth=Math.max(1,u*.002);M.rr(ctx,x+w/2-tw/2,cy-u*.04,tw,u*.08,u*.012);ctx.stroke();ctx.fillStyle='#ffffff';ctx.textAlign='center';ctx.fillText(lab,x+w/2,cy)}
2349
2349
  ctx.restore()
2350
- }`),ce("exp-mood-gauge","Đồng hồ cảm xúc",4.5,{text:"Mức bực bội của khứa",items:"Chướng mắt|Lằng nhằng|Chửi|Phát tiết"},`function render(ctx,t,env){
2351
- ${we}
2350
+ }`),oe("exp-mood-gauge","Đồng hồ cảm xúc",4.5,{text:"Mức bực bội của khứa",items:"Chướng mắt|Lằng nhằng|Chửi|Phát tiết"},`function render(ctx,t,env){
2351
+ ${ke}
2352
2352
  // A stopwatch gauge whose red needle climbs while a ladder of levels (items, low → high) lights up from the bottom;
2353
2353
  // the current level is big and hot; title (text) above the ladder.
2354
2354
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,5),n=Math.max(1,its.length)
@@ -2362,8 +2362,8 @@
2362
2362
  its.forEach((s,i)=>{const y=by-step*(i+.5),on=i===act,past=i<act,a=M.range(t,.2+i*.08,.5+i*.08);ctx.save();ctx.globalAlpha*=a*(on?1:past?.85:.25);const f=M.fit(ctx,String(s).toUpperCase(),z=>sk.font(z,'h'),on?step*.95:step*.55,lw*.95,1);ctx.font=f.font;ctx.textAlign='left';ctx.textBaseline='middle'
2363
2363
  if(on)HOT(ctx,f.lines[0]||'',lx,y,f.size,acc);else{ctx.fillStyle='#ffffff';ctx.fillText(f.lines[0]||'',lx,y)}ctx.restore()})
2364
2364
  ctx.restore()
2365
- }`),ce("exp-notifications","Màn hình khoá thông báo",5,{text:"23:47",sub:"Thứ Năm",items:"Nhắc nợ: Hạn trả góp hôm nay|Chủ nhà: Nhắc tiền phòng|Tin nhắn: 99+ tin chưa đọc|Sếp: Lên phòng gặp anh"},`function render(ctx,t,env){
2366
- ${we}
2365
+ }`),oe("exp-notifications","Màn hình khoá thông báo",5,{text:"23:47",sub:"Thứ Năm",items:"Nhắc nợ: Hạn trả góp hôm nay|Chủ nhà: Nhắc tiền phòng|Tin nhắn: 99+ tin chưa đọc|Sếp: Lên phòng gặp anh"},`function render(ctx,t,env){
2366
+ ${ke}
2367
2367
  // A phone lock screen: the clock (text) and day (sub), then notifications (items "App: message") drop in and stack,
2368
2368
  // the phone jolts a little on each one.
2369
2369
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,5)
@@ -2377,8 +2377,8 @@
2377
2377
  ctx.save();ctx.globalAlpha*=Math.min(1,a);ctx.translate(0,(1-a)*-nh*.8);ctx.fillStyle='rgba(255,255,255,.16)';M.rr(ctx,nx,ny,nw,nh,nh*.25);ctx.fill();ctx.fillStyle=i%2?acc:'#ffc93c';M.rr(ctx,nx+nh*.15,ny+nh*.2,nh*.6,nh*.6,nh*.14);ctx.fill()
2378
2378
  ctx.textAlign='left';ctx.fillStyle='#ffffff';ctx.font=sk.font(nh*.26,'s','800');ctx.fillText(app,nx+nh*.95,ny+nh*.33);const mf=M.fit(ctx,msg,z=>sk.font(z,'s','500'),nh*.26,nw-nh*1.1,1);ctx.font=mf.font;ctx.fillStyle='rgba(255,255,255,.85)';ctx.fillText(mf.lines[0]||'',nx+nh*.95,ny+nh*.68);ctx.restore()})
2379
2379
  ctx.restore();ctx.restore()
2380
- }`),ce("exp-expert-stamp","Ý kiến bị đóng dấu",4.5,{text:"Ý kiến chuyên gia",sub:"Vô dụng",items:"Về chiến lược tổng thể|Về trải nghiệm khách hàng|Về định vị thương hiệu"},`function render(ctx,t,env){
2381
- ${we}
2380
+ }`),oe("exp-expert-stamp","Ý kiến bị đóng dấu",4.5,{text:"Ý kiến chuyên gia",sub:"Vô dụng",items:"Về chiến lược tổng thể|Về trải nghiệm khách hàng|Về định vị thương hiệu"},`function render(ctx,t,env){
2381
+ ${ke}
2382
2382
  // A long expert note (title = text, numbered sections = items with skeleton lines) — then a rubber stamp (sub)
2383
2383
  // slams across it and the card shakes.
2384
2384
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,4)
@@ -2391,8 +2391,8 @@
2391
2391
  if(st>0){const sf=M.fit(ctx,String(p.sub||'').toUpperCase(),z=>sk.font(z,'h'),u*.1,w*.75,1),sc=1+1.4*(1-M.ease.outCubic(st));ctx.font=sf.font;const tw=ctx.measureText(sf.lines[0]||'').width+u*.06,th=sf.size*1.3
2392
2392
  ctx.save();ctx.translate(x+w/2,y+h*.58);ctx.rotate(-.12);ctx.scale(sc,sc);ctx.globalAlpha*=Math.min(1,st*1.5);ctx.fillStyle=M.rgba(M.mix(acc,'#16040f',.7),.9);M.rr(ctx,-tw/2,-th/2,tw,th,u*.012);ctx.fill();ctx.strokeStyle=acc;ctx.lineWidth=u*.008;ctx.stroke();ctx.textAlign='center';HOT(ctx,sf.lines[0]||'',0,0,sf.size,acc);ctx.restore()}
2393
2393
  ctx.restore()
2394
- }`),ce("exp-checklist-x","Danh sách gạch bỏ",4,{text:"Soát góp ý",items:"Chuyên môn|Tư cách",number:0},`function render(ctx,t,env){
2395
- ${we}
2394
+ }`),oe("exp-checklist-x","Danh sách gạch bỏ",4,{text:"Soát góp ý",items:"Chuyên môn|Tư cách",number:0},`function render(ctx,t,env){
2395
+ ${ke}
2396
2396
  // A checklist (header = text, rows = items): each row gets its mark in turn — number 0 = a red X and the label struck
2397
2397
  // through (fails), 1 = an accent tick (passes).
2398
2398
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,5),pass=+p.number===1
@@ -2404,8 +2404,8 @@
2404
2404
  ctx.strokeStyle=m>0?col:'rgba(255,255,255,.35)';ctx.lineWidth=Math.max(1.5,rh*.03);M.rr(ctx,bx,ry-box/2,box,box,box*.18);ctx.stroke()
2405
2405
  if(m>0){ctx.save();ctx.translate(bx+box/2,ry);ctx.scale(m,m);ctx.strokeStyle=col;ctx.lineWidth=box*.14;ctx.lineCap='round';ctx.beginPath();if(pass){ctx.moveTo(-box*.25,0);ctx.lineTo(-box*.05,box*.2);ctx.lineTo(box*.28,-box*.22)}else{ctx.moveTo(-box*.22,-box*.22);ctx.lineTo(box*.22,box*.22);ctx.moveTo(box*.22,-box*.22);ctx.lineTo(-box*.22,box*.22)}ctx.stroke();ctx.restore()}})
2406
2406
  ctx.restore()
2407
- }`),ce("exp-toggle-on","Bật công tắc",4,{text:"Bán khoá học tự động",sub:"Bán tự động"},`function render(ctx,t,env){
2408
- ${we}
2407
+ }`),oe("exp-toggle-on","Bật công tắc",4,{text:"Bán khoá học tự động",sub:"Bán tự động"},`function render(ctx,t,env){
2408
+ ${ke}
2409
2409
  // A settings row (label = text) whose switch is tapped on — the track floods with the accent and glows — then a big
2410
2410
  // hot button (sub) pops out under it.
2411
2411
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,x=B.x,w=B.w,pad=w*.06,rh=u*.11,y=B.y+B.h*.3-rh/2,inn=M.ease.outCubic(M.range(t,0,.4))
@@ -2417,8 +2417,8 @@
2417
2417
  const b=M.ease.outBack(M.range(t,1.5,1.9));if(b>0&&p.sub){const bf=M.fit(ctx,String(p.sub||'').toUpperCase(),z=>sk.font(z,'h'),u*.065,w*.8,1);ctx.font=bf.font;const bw=ctx.measureText(bf.lines[0]||'').width+u*.1,bh=bf.size*1.6,by=y+rh+u*.05+bh/2
2418
2418
  ctx.save();ctx.translate(x+w/2,by);ctx.scale(b,b);ctx.shadowColor=acc;ctx.shadowBlur=bh*(.5+.2*Math.sin(t*5));const g=ctx.createLinearGradient(0,-bh/2,0,bh/2);g.addColorStop(0,M.mix(acc,'#ffffff',.25));g.addColorStop(1,acc);PILL(ctx,-bw/2,-bh/2,bw,bh,g);ctx.shadowBlur=0;ctx.fillStyle=M.readable(acc);ctx.textAlign='center';ctx.fillText(bf.lines[0]||'',0,0);ctx.restore()}
2419
2419
  ctx.restore()
2420
- }`),ce("exp-id-badge","Thẻ tên nhân sự",5,{text:"Toxic Bouncer 1.0",sub:"Đội phòng chống tiêu cực",items:"Bình luận|Tin nhắn|Video|Livestream"},`function render(ctx,t,env){
2421
- ${we}
2420
+ }`),oe("exp-id-badge","Thẻ tên nhân sự",5,{text:"Toxic Bouncer 1.0",sub:"Đội phòng chống tiêu cực",items:"Bình luận|Tin nhắn|Video|Livestream"},`function render(ctx,t,env){
2421
+ ${ke}
2422
2422
  // A staff ID badge drops on its lanyard and swings to rest: a round portrait, the role in big hot type (text), the
2423
2423
  // team line (sub) and duty chips (items) along the bottom.
2424
2424
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,4)
@@ -2431,8 +2431,8 @@
2431
2431
  let yy=py+pr*1.55+tf.lines.length*tf.size*1.02;const sf=M.fit(ctx,String(p.sub||'').toUpperCase(),z=>sk.font(z,'s','800'),bw*.05,bw*.88,1);ctx.font=sf.font;ctx.fillStyle='#ffffff';ctx.fillText(sf.lines[0]||'',0,yy);yy+=sf.size*1.4
2432
2432
  const ic=['bell','mic','play','heart'],cw=bw*.88/Math.max(1,its.length),cs=Math.min(cw*.55,(bw*.03+bh-yy)*.5);its.forEach((s,i)=>{const a=M.ease.outBack(M.range(t,.9+i*.15,1.2+i*.15));if(a<=0||cs<bw*.04)return;const ix=-bw*.44+cw*(i+.5);ctx.save();ctx.translate(ix,yy+cs*.5);ctx.scale(a,a);ctx.fillStyle='rgba(255,255,255,.95)';M.rr(ctx,-cs/2,-cs/2,cs,cs,cs*.22);ctx.fill();ctx.fillStyle=acc;M.icon(ctx,ic[i%4],0,0,cs*.24);ctx.fillStyle='#ffffff';ctx.font=sk.font(cs*.26,'s','700');ctx.fillText(s,0,cs*.8);ctx.restore()})
2433
2433
  ctx.restore()
2434
- }`),ce("exp-triple-meters","Ba đồng hồ MAX",4.5,{text:"Kha AI",sub:"2027",items:"Xịn|Tự động|Sướng"},`function render(ctx,t,env){
2435
- ${we}
2434
+ }`),oe("exp-triple-meters","Ba đồng hồ MAX",4.5,{text:"Kha AI",sub:"2027",items:"Xịn|Tự động|Sướng"},`function render(ctx,t,env){
2435
+ ${ke}
2436
2436
  // A title (text + big hot sub) over three meter tiles (items): each needle sweeps to MAX in turn, the arc floods
2437
2437
  // with the accent and its MAX pill lights.
2438
2438
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,4),n=Math.max(1,its.length)
@@ -2447,8 +2447,8 @@
2447
2447
  const lf=M.fit(ctx,String(s).toUpperCase(),z=>sk.font(z,'h'),tw*.17,tw*.86,1);ctx.font=lf.font;ctx.fillStyle='#ffffff';ctx.fillText(lf.lines[0]||'',0,th*.2)
2448
2448
  const pw=tw*.42,ph=tw*.13;PILL(ctx,-pw/2,th*.34-ph/2,pw,ph,full?acc:'rgba(255,255,255,.1)');ctx.fillStyle=full?M.readable(acc):'rgba(255,255,255,.4)';ctx.font=sk.font(ph*.6,'s','900');ctx.fillText('MAX',0,th*.34);ctx.restore()})
2449
2449
  ctx.restore()
2450
- }`),ce("exp-price-up","Giá sắp tăng",4,{text:"Giá khoá học sẽ",sub:"Tăng 50%",items:"Đồng nghiệp nâng cấp trước|Miễn phí nâng cấp"},`function render(ctx,t,env){
2451
- ${we}
2450
+ }`),oe("exp-price-up","Giá sắp tăng",4,{text:"Giá khoá học sẽ",sub:"Tăng 50%",items:"Đồng nghiệp nâng cấp trước|Miễn phí nâng cấp"},`function render(ctx,t,env){
2451
+ ${ke}
2452
2452
  // A warning card: a rising arrow, the lead (text) and the big hot change (sub — its number counts up); an optional
2453
2453
  // second card (items: line, big line) slides in below.
2454
2454
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,2),x=B.x,w=B.w,pad=w*.06
@@ -2462,8 +2462,8 @@
2462
2462
  const pw=u*.16,ph=u*.035;PILL(ctx,x+w/2-pw/2,y2+u*.035-ph/2,pw,ph,'#3b5bff');ctx.fillStyle='#ffffff';ctx.font=sk.font(ph*.55,'s','900');ctx.fillText('PRO',x+w/2,y2+u*.035)
2463
2463
  const f1=M.fit(ctx,String(its[0]),z=>sk.font(z,'s','700'),u*.026,w-pad*2,1);ctx.font=f1.font;ctx.fillStyle='#ffffff';ctx.fillText(f1.lines[0]||'',x+w/2,y2+u*.08);if(its[1]){const f2=M.fit(ctx,String(its[1]).toUpperCase(),z=>sk.font(z,'h'),u*.045,w-pad*2,1);ctx.font=f2.font;HOT(ctx,f2.lines[0]||'',x+w/2,y2+u*.125,f2.size,acc)}ctx.restore()}}
2464
2464
  ctx.restore()
2465
- }`),ce("exp-cta-button","Nút kêu gọi hành động",4,{text:"Nâng cấp PRO ngay",sub:"khoahoc.vn/nang-cap"},`function render(ctx,t,env){
2466
- ${we}
2465
+ }`),oe("exp-cta-button","Nút kêu gọi hành động",4,{text:"Nâng cấp PRO ngay",sub:"khoahoc.vn/nang-cap"},`function render(ctx,t,env){
2466
+ ${ke}
2467
2467
  // The closing CTA: a big glowing pill (text) pops, rings pulse out of it, a cursor taps it (it presses in); the
2468
2468
  // link (sub) and a bobbing arrow sit under it.
2469
2469
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,cx=B.x+B.w/2,cy=B.y+B.h*.45
@@ -2476,8 +2476,8 @@
2476
2476
  const lf=M.fit(ctx,String(p.sub||''),z=>sk.font(z,'s','600'),u*.026,B.w*.9,1);ctx.globalAlpha=(1-k.o)*M.range(t,.5,.9);ctx.font=lf.font;ctx.fillStyle='#ffffff';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(lf.lines[0]||'',cx,cy+bh*.95)
2477
2477
  const ay=cy+bh*1.35+Math.sin(t*5)*u*.008,as=u*.02;ctx.strokeStyle='#ffffff';ctx.lineWidth=u*.004;ctx.lineCap='round';ctx.beginPath();ctx.moveTo(cx,ay-as);ctx.lineTo(cx,ay+as);ctx.moveTo(cx-as*.6,ay+as*.4);ctx.lineTo(cx,ay+as);ctx.lineTo(cx+as*.6,ay+as*.4);ctx.stroke()
2478
2478
  ctx.restore()
2479
- }`),ce("exp-fame-meter","Thanh độ nổi tiếng",4.5,{text:"Nổi tiếng",items:"Người biết anh em 90|Kẻ vào chửi 70"},`function render(ctx,t,env){
2480
- ${we}
2479
+ }`),oe("exp-fame-meter","Thanh độ nổi tiếng",4.5,{text:"Nổi tiếng",items:"Người biết anh em 90|Kẻ vào chửi 70"},`function render(ctx,t,env){
2480
+ ${ke}
2481
2481
  // A "fame" card (stars + title = text): each row (items "label value") fills a lane of little faces up to value % —
2482
2482
  // the more people know you, the more show up.
2483
2483
  const {duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),B=BX(env,p),u=B.u,acc=sk.acc,its=M.items(p,4).map(M.stat),x=B.x,w=B.w,pad=w*.05
@@ -2487,8 +2487,8 @@
2487
2487
  const bx=x+pad+lw+w*.03,bw=x+w-pad-bx,bh=rh*.5,cnt=Math.max(4,Math.floor(bw/(bh*.62))),on=Math.round(cnt*M.clamp(s.v/100)*q);ctx.fillStyle='rgba(255,255,255,.07)';PILL(ctx,bx,ry-bh/2,bw,bh,'rgba(255,255,255,.07)')
2488
2488
  for(let j=0;j<on;j++){const fx=bx+bh*.35+j*(bw-bh*.7)/(cnt-1),c=j%3===0?acc:j%3===1?'#ffc93c':'#ffffff';ctx.fillStyle=c;ctx.beginPath();ctx.arc(fx,ry,bh*.28,0,M.TAU);ctx.fill();ctx.fillStyle='rgba(0,0,0,.55)';ctx.beginPath();ctx.arc(fx-bh*.09,ry-bh*.04,bh*.04,0,M.TAU);ctx.arc(fx+bh*.09,ry-bh*.04,bh*.04,0,M.TAU);ctx.fill()}})
2489
2489
  ctx.restore()
2490
- }`),ce("exp-question-banner","Băng câu hỏi tương tác",4,{text:"Website anh em gắn chatbot AI chưa?",sub:"Comment «RỒI» hoặc «CHƯA» nha"},`function render(ctx,t,env){
2491
- ${we}
2490
+ }`),oe("exp-question-banner","Băng câu hỏi tương tác",4,{text:"Website anh em gắn chatbot AI chưa?",sub:"Comment «RỒI» hoặc «CHƯA» nha"},`function render(ctx,t,env){
2491
+ ${ke}
2492
2492
  // An engagement banner slides down at the very top: the question (text) in bold white, the ask (sub) under it and a
2493
2493
  // bouncing accent badge at the right — the cue to comment.
2494
2494
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),k=M.io(t,D,.3,.3),u=Math.min(W,H),port=H>W*1.1,bw=W*(port?.9:.6),x=(W-bw)/2,pad=bw*.04
@@ -3765,15 +3765,15 @@
3765
3765
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,L=Math.hypot(W,H)/2,n=9,ph=t/D*3
3766
3766
  ctx.save();for(let i=n;i>=0;i--){const z=((i+ph)%n)/n,r=L*Math.pow(z,1.8)*(.2+1.6*c);ctx.fillStyle=i%2?M.rgba(DARK,c):M.rgba(acc,c);ctx.beginPath();ctx.arc(W/2,H/2,r,0,M.TAU);ctx.fill()}
3767
3767
  if(c>.8){ctx.fillStyle=M.rgba(DARK,(c-.8)/.2);ctx.fillRect(0,0,W,H)}ctx.restore()
3768
- }`)],Wn=V.find(t=>t.id==="tvc"),ae=(t,e,c,a,o)=>({id:t,name:e,category:Wn.name,pack:"tvc",duration:c,params:{accent:Wn.accent,position:"center",...a,style:"tvc"},code:o}),fe="const INK='#15161c',SUB='#5d6070';const CARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(20,22,40,.18)';c.shadowBlur=r*2.2;c.shadowOffsetY=r*.6;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const CHIP=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const PILL=(c,s,cx,cy,z)=>{const w=c.measureText(s).width+z*1.4,h=z*1.7;c.save();c.shadowColor='rgba(20,22,40,.16)';c.shadowBlur=z*.8;c.shadowOffsetY=z*.15;c.fillStyle='#ffffff';M.rr(c,cx-w/2,cy-h/2,w,h,h/2);c.fill();c.restore()};const MARK=(c,sk,s,x,y,r,acc)=>{c.save();const g=c.createLinearGradient(x-r,y-r,x+r,y+r);g.addColorStop(0,M.mix(acc,'#ffffff',.2));g.addColorStop(1,M.mix(acc,'#000000',.25));c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.fillStyle=M.readable(acc);c.font=sk.font(r*.9,'h');c.textAlign='center';c.textBaseline='middle';c.fillText(String(s||'?').trim().split(/ +/).slice(0,2).map(w=>w[0]||'').join('').toUpperCase(),x,y+r*.05);c.restore()};",Jl=[ae("tvc-backdrop","Nền thương hiệu",6,{number:0},`function render(ctx,t,env){
3768
+ }`)],Wn=V.find(t=>t.id==="tvc"),ne=(t,e,c,a,o)=>({id:t,name:e,category:Wn.name,pack:"tvc",duration:c,params:{accent:Wn.accent,position:"center",...a,style:"tvc"},code:o}),de="const INK='#15161c',SUB='#5d6070';const CARD=(c,x,y,w,h,r)=>{c.save();c.shadowColor='rgba(20,22,40,.18)';c.shadowBlur=r*2.2;c.shadowOffsetY=r*.6;c.fillStyle='#ffffff';M.rr(c,x,y,w,h,r);c.fill();c.restore()};const CHIP=(c,x,y,w,h,fill)=>{c.fillStyle=fill;M.rr(c,x,y,w,h,h/2);c.fill()};const PILL=(c,s,cx,cy,z)=>{const w=c.measureText(s).width+z*1.4,h=z*1.7;c.save();c.shadowColor='rgba(20,22,40,.16)';c.shadowBlur=z*.8;c.shadowOffsetY=z*.15;c.fillStyle='#ffffff';M.rr(c,cx-w/2,cy-h/2,w,h,h/2);c.fill();c.restore()};const MARK=(c,sk,s,x,y,r,acc)=>{c.save();const g=c.createLinearGradient(x-r,y-r,x+r,y+r);g.addColorStop(0,M.mix(acc,'#ffffff',.2));g.addColorStop(1,M.mix(acc,'#000000',.25));c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.fillStyle=M.readable(acc);c.font=sk.font(r*.9,'h');c.textAlign='center';c.textBaseline='middle';c.fillText(String(s||'?').trim().split(/ +/).slice(0,2).map(w=>w[0]||'').join('').toUpperCase(),x,y+r*.05);c.restore()};",Jl=[ne("tvc-backdrop","Nền thương hiệu",6,{number:0},`function render(ctx,t,env){
3769
3769
  // Full-frame brand backdrop: a soft light gradient tinted by the brand colour with a slow light sweep (numberValue 1 =
3770
3770
  // the dark premium variant); every TVC card sits on it.
3771
3771
  const {width:W,height:H,params:p}=env,sk=M.skin(env,p),acc=sk.acc,dark=+p.number===1,u=Math.min(W,H)
3772
3772
  const g=ctx.createLinearGradient(0,0,W,H);g.addColorStop(0,dark?M.mix(acc,'#07080c',.82):M.mix(acc,'#ffffff',.92));g.addColorStop(1,dark?'#050608':M.mix(acc,'#eef0f6',.8));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)
3773
3773
  const x=W*(.2+.6*((t*.12)%1)),r=ctx.createRadialGradient(x,H*.3,0,x,H*.3,u*.9);r.addColorStop(0,dark?M.rgba(acc,.22):'rgba(255,255,255,.7)');r.addColorStop(1,'rgba(255,255,255,0)');ctx.fillStyle=r;ctx.fillRect(0,0,W,H)
3774
3774
  ctx.fillStyle=M.rgba(acc,dark?.5:.85);ctx.fillRect(0,H-u*.012,W,u*.012)
3775
- }`),ae("tvc-brand-open","Mở thương hiệu",4,{text:"CLIPOOX",sub:"Dựng video chuyên nghiệp bằng AI"},`function render(ctx,t,env){
3776
- ${fe}
3775
+ }`),ne("tvc-brand-open","Mở thương hiệu",4,{text:"CLIPOOX",sub:"Dựng video chuyên nghiệp bằng AI"},`function render(ctx,t,env){
3776
+ ${de}
3777
3777
  // Brand open: an accent bar wipes in, the brand name (text) reveals behind it with a light sweep across the letters,
3778
3778
  // the tagline (sub) fades up under it.
3779
3779
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.05,.4),u=S.u,acc=sk.acc
@@ -3785,8 +3785,8 @@
3785
3785
  ctx.save();ctx.beginPath();ctx.rect(bx,S.y-z*.6,bw*rev,z*1.2);ctx.clip();ctx.fillStyle=INK;ctx.fillText(word,S.cx,S.y);const sx=bx+bw*((t*.6)%1.4-.2);const g=ctx.createLinearGradient(sx-z,0,sx+z,0);g.addColorStop(0,'rgba(255,255,255,0)');g.addColorStop(.5,'rgba(255,255,255,.65)');g.addColorStop(1,'rgba(255,255,255,0)');ctx.fillStyle=g;ctx.globalCompositeOperation='source-atop';ctx.fillRect(bx,S.y-z*.6,bw,z*1.2);ctx.restore()
3786
3786
  ctx.font=sf.font;ctx.fillStyle=SUB;ctx.globalAlpha*=M.ease.outCubic(M.range(t,.8,1.3));sf.lines.forEach((l,i)=>ctx.fillText(l,S.cx,S.y+z*.85+i*sf.size*1.25))
3787
3787
  ctx.restore()
3788
- }`),ae("tvc-problem","Nỗi đau khách hàng",3.5,{text:"Dựng video mất cả tuần?",sub:"Tốn tiền thuê, chờ đợi, sửa mãi"},`function render(ctx,t,env){
3789
- ${fe}
3788
+ }`),ne("tvc-problem","Nỗi đau khách hàng",3.5,{text:"Dựng video mất cả tuần?",sub:"Tốn tiền thuê, chờ đợi, sửa mãi"},`function render(ctx,t,env){
3789
+ ${de}
3790
3790
  // The pain: a card with a red cross badge shakes in, the problem (text) bold, the details (sub) under it.
3791
3791
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u
3792
3792
  const w=Math.min(S.w*.92,u*.9),h=u*.34,x=S.cx-w/2,y=S.y-h/2,a=M.ease.outBack(M.range(t,0,.45)),sh=t<.9?Math.sin(t*50)*u*.006*(1-M.range(t,.45,.9)):0
@@ -3795,8 +3795,8 @@
3795
3795
  const tx=bx+r*1.6,tw=x+w-tx-w*.05;ctx.textAlign='left';ctx.textBaseline='middle';const tf=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.055,tw,2);ctx.font=tf.font;ctx.fillStyle=INK;tf.lines.forEach((l,i)=>ctx.fillText(l,tx,S.y-h*.14+i*tf.size*1.1-(tf.lines.length-1)*tf.size*.3))
3796
3796
  const sf=M.fit(ctx,String(p.sub||''),z=>sk.font(z,'s','500'),u*.032,tw,1);ctx.font=sf.font;ctx.fillStyle=SUB;ctx.fillText(sf.lines[0]||'',tx,S.y+h*.26)
3797
3797
  ctx.restore()
3798
- }`),ae("tvc-solution","Giải pháp xuất hiện",4,{text:"Clipoox Canvas",sub:"AI dựng video trong vài phút"},`function render(ctx,t,env){
3799
- ${fe}
3798
+ }`),ne("tvc-solution","Giải pháp xuất hiện",4,{text:"Clipoox Canvas",sub:"AI dựng video trong vài phút"},`function render(ctx,t,env){
3799
+ ${de}
3800
3800
  // The answer: an accent burst of rays and a ring, the solution / product name (text) pops in the middle with a soft
3801
3801
  // glow, the benefit (sub) in an accent pill under it.
3802
3802
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc
@@ -3808,8 +3808,8 @@
3808
3808
  ctx.save();ctx.translate(S.cx,S.y);ctx.scale(a,a);ctx.font=tf.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillStyle=INK;ctx.shadowColor=M.rgba(acc,.35);ctx.shadowBlur=u*.04;tf.lines.forEach((l,i)=>ctx.fillText(l,0,(i-(tf.lines.length-1)/2)*tf.size*1.05));ctx.restore()
3809
3809
  const c=M.ease.outCubic(M.range(t,.7,1.1));if(c>0&&p.sub){const sf=M.fit(ctx,String(p.sub),z=>sk.font(z,'s','700'),u*.035,S.w*.85,1);ctx.font=sf.font;const pw=ctx.measureText(sf.lines[0]||'').width+u*.06,ph=sf.size*1.9,py=S.y+tf.size*tf.lines.length*.62+u*.05;ctx.globalAlpha*=c;CHIP(ctx,S.cx-pw/2,py,pw,ph,acc);ctx.fillStyle=M.readable(acc);ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(sf.lines[0]||'',S.cx,py+ph/2)}
3810
3810
  ctx.restore()
3811
- }`),ae("tvc-feature-trio","Ba tính năng nổi bật",5,{text:"Vì sao chọn chúng tôi",items:"Nhanh gấp 10 lần|Không cần kỹ năng|Giá chỉ từ 99k"},`function render(ctx,t,env){
3812
- ${fe}
3811
+ }`),ne("tvc-feature-trio","Ba tính năng nổi bật",5,{text:"Vì sao chọn chúng tôi",items:"Nhanh gấp 10 lần|Không cần kỹ năng|Giá chỉ từ 99k"},`function render(ctx,t,env){
3812
+ ${de}
3813
3813
  // Three feature cards (items, up to 4) pop in left → right (a column in portrait), each with an accent icon disc and
3814
3814
  // its line; the heading (text) above.
3815
3815
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,its=M.items(p,4),n=Math.max(1,its.length),port=S.port
@@ -3820,8 +3820,8 @@
3820
3820
  ctx.save();ctx.translate(cx,cy);ctx.scale(a,a);ctx.translate(-cx,-cy);CARD(ctx,x,y,cw,ch,u*.02);const r=port?ch*.3:ch*.17,ix=port?x+r*1.6:cx,iy=port?cy:y+ch*.32;ctx.fillStyle=M.rgba(acc,.15);ctx.beginPath();ctx.arc(ix,iy,r,0,M.TAU);ctx.fill();ctx.fillStyle=acc;M.icon(ctx,ic[i%4],ix,iy,r*.5)
3821
3821
  const lf=M.fit(ctx,String(s),z=>sk.font(z,'s','700'),u*.032,port?cw-r*3.6:cw*.86,2);ctx.font=lf.font;ctx.fillStyle=INK;ctx.textAlign=port?'left':'center';lf.lines.forEach((l,j)=>ctx.fillText(l,port?x+r*3.1:cx,(port?cy:y+ch*.7)+(j-(lf.lines.length-1)/2)*lf.size*1.15));ctx.restore()})
3822
3822
  ctx.restore()
3823
- }`),ae("tvc-big-stat","Con số ấn tượng",4,{text:"khách hàng tin dùng",number:12e3,sub:"+"},`function render(ctx,t,env){
3824
- ${fe}
3823
+ }`),ne("tvc-big-stat","Con số ấn tượng",4,{text:"khách hàng tin dùng",number:12e3,sub:"+"},`function render(ctx,t,env){
3824
+ ${de}
3825
3825
  // A big number (number, sub = a short prefix / suffix such as + or %) counts up inside an accent ring that sweeps
3826
3826
  // round; the label (text) under it.
3827
3827
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,R=u*.2,q=M.ease.outExpo(M.range(t,.2,1.8)),n=+p.number||0,suf=String(p.sub||'')
@@ -3829,8 +3829,8 @@
3829
3829
  const lab=M.fmt(n*q)+suf,f=M.fit(ctx,M.fmt(n)+suf,z=>sk.font(z,'n'),R*.55,R*1.7,1);ctx.font=f.font;ctx.fillStyle=INK;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(lab,S.cx,S.y)
3830
3830
  const lf=M.fit(ctx,String(p.text||''),z=>sk.font(z,'s','600'),u*.04,R*2.7,1);ctx.font=lf.font;ctx.fillStyle=SUB;ctx.globalAlpha*=M.range(t,.6,1);ctx.fillText(lf.lines[0]||'',S.cx,S.y+R*1.3)
3831
3831
  ctx.restore()
3832
- }`),ae("tvc-trust-badges","Huy hiệu tin cậy",4,{items:"Chính hãng 100%|Bảo hành 2 năm|Giao hàng 2 giờ|Đổi trả 30 ngày"},`function render(ctx,t,env){
3833
- ${fe}
3832
+ }`),ne("tvc-trust-badges","Huy hiệu tin cậy",4,{items:"Chính hãng 100%|Bảo hành 2 năm|Giao hàng 2 giờ|Đổi trả 30 ngày"},`function render(ctx,t,env){
3833
+ ${de}
3834
3834
  // A row (grid in portrait) of round trust badges (items) stamping in one by one: accent rim, a tick and the line.
3835
3835
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,its=M.items(p,4),n=Math.max(1,its.length),port=S.port,cols=port?2:n,rows=Math.ceil(n/cols)
3836
3836
  const cell=Math.min(S.w/cols,u*.38),r=cell*.32
@@ -3839,8 +3839,8 @@
3839
3839
  ctx.save();ctx.translate(cx,cy);ctx.scale(a,a);ctx.rotate((1-a)*.5);ctx.shadowColor='rgba(20,22,40,.18)';ctx.shadowBlur=r*.4;ctx.fillStyle='#ffffff';ctx.beginPath();ctx.arc(0,0,r,0,M.TAU);ctx.fill();ctx.shadowBlur=0;ctx.strokeStyle=acc;ctx.lineWidth=r*.07;ctx.beginPath();ctx.arc(0,0,r*.9,0,M.TAU);ctx.stroke()
3840
3840
  ctx.fillStyle=acc;M.icon(ctx,'check',0,-r*.32,r*.2);const lf=M.fit(ctx,String(s),z=>sk.font(z,'s','800'),r*.2,r*1.5,2);ctx.font=lf.font;ctx.fillStyle=INK;ctx.textAlign='center';ctx.textBaseline='middle';lf.lines.forEach((l,j)=>ctx.fillText(l,0,r*.12+j*lf.size*1.1));ctx.restore()})
3841
3841
  ctx.restore()
3842
- }`),ae("tvc-testimonial","Khách hàng nói gì",5,{text:"Từ khi dùng, mình làm video nhanh gấp 5 lần, khách tăng rõ rệt.",sub:"Chị Lan · Chủ shop thời trang",number:5},`function render(ctx,t,env){
3843
- ${fe}
3842
+ }`),ne("tvc-testimonial","Khách hàng nói gì",5,{text:"Từ khi dùng, mình làm video nhanh gấp 5 lần, khách tăng rõ rệt.",sub:"Chị Lan · Chủ shop thời trang",number:5},`function render(ctx,t,env){
3843
+ ${de}
3844
3844
  // A testimonial card: stars (number, 0–5) fill in, the quote (text) fades in line by line, the customer (sub) with an
3845
3845
  // initials disc at the bottom.
3846
3846
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc
@@ -3850,8 +3850,8 @@
3850
3850
  ctx.font=tf.font;ctx.fillStyle=INK;ctx.textAlign='left';ctx.textBaseline='top';tf.lines.forEach((l,i)=>{ctx.save();ctx.globalAlpha*=M.range(t,.5+i*.25,.9+i*.25);ctx.fillText(l,x+pad,y+pad+u*.06+i*tf.size*1.3);ctx.restore()})
3851
3851
  const by=y+h-pad-u*.03;MARK(ctx,sk,p.sub,x+pad+u*.03,by,u*.03,acc);ctx.font=sk.font(u*.03,'s','700');ctx.fillStyle=SUB;ctx.textBaseline='middle';ctx.globalAlpha*=M.range(t,1.2,1.6);ctx.fillText(String(p.sub||''),x+pad+u*.08,by)
3852
3852
  ctx.restore()
3853
- }`),ae("tvc-offer","Thẻ ưu đãi",4,{text:"Ưu đãi khai trương",number:499e3,sub:"Giá gốc 990.000đ",items:"Chỉ 3 ngày"},`function render(ctx,t,env){
3854
- ${fe}
3853
+ }`),ne("tvc-offer","Thẻ ưu đãi",4,{text:"Ưu đãi khai trương",number:499e3,sub:"Giá gốc 990.000đ",items:"Chỉ 3 ngày"},`function render(ctx,t,env){
3854
+ ${de}
3855
3855
  // The offer: a card with an accent ribbon (text), the new price (number, đ) counting down from the old one with a
3856
3856
  // bounce, the old price (sub) struck through, a time-limit chip (items[0]) pulsing.
3857
3857
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,its=M.items(p,1)
@@ -3862,8 +3862,8 @@
3862
3862
  const sf=M.fit(ctx,String(p.sub||''),z=>sk.font(z,'s','500'),u*.032,w*.8,1);ctx.font=sf.font;ctx.fillStyle=SUB;const st=ctx.measureText(sf.lines[0]||'').width;ctx.fillText(sf.lines[0]||'',S.cx,y+h*.68);ctx.strokeStyle='#ff4d5e';ctx.lineWidth=u*.004;ctx.beginPath();ctx.moveTo(S.cx-st/2,y+h*.68);ctx.lineTo(S.cx-st/2+st*M.range(t,.8,1.1),y+h*.68);ctx.stroke()
3863
3863
  if(its[0]){const pulse=1+.05*Math.sin(t*6),cf=M.fit(ctx,String(its[0]),z=>sk.font(z,'s','800'),u*.028,w*.6,1);ctx.font=cf.font;const cw=ctx.measureText(cf.lines[0]||'').width+u*.05,chh=cf.size*1.8;ctx.save();ctx.translate(S.cx,y+h*.86);ctx.scale(pulse,pulse);CHIP(ctx,-cw/2,-chh/2,cw,chh,M.rgba(acc,.15));ctx.fillStyle=acc;ctx.fillText(cf.lines[0]||'',0,0);ctx.restore()}
3864
3864
  ctx.restore()
3865
- }`),ae("tvc-countdown-offer","Đếm ngược ưu đãi",5,{text:"Ưu đãi kết thúc sau",number:48},`function render(ctx,t,env){
3866
- ${fe}
3865
+ }`),ne("tvc-countdown-offer","Đếm ngược ưu đãi",5,{text:"Ưu đãi kết thúc sau",number:48},`function render(ctx,t,env){
3866
+ ${de}
3867
3867
  // A countdown: day / hour / minute / second boxes (number = hours left) tick down live with a flip on the seconds;
3868
3868
  // the heading (text) above in the brand colour.
3869
3869
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,total=Math.max(0,(+p.number||0)*3600-Math.floor(t))
@@ -3871,8 +3871,8 @@
3871
3871
  ctx.save();ctx.globalAlpha=(1-k.o)*a;ctx.textAlign='center';ctx.textBaseline='middle';const hf=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.05,S.w*.9,1);ctx.font=hf.font;PILL(ctx,hf.lines[0]||'',S.cx,S.y-bw*.95,hf.size);ctx.fillStyle=acc;ctx.fillText(hf.lines[0]||'',S.cx,S.y-bw*.95)
3872
3872
  parts.forEach(([v,l],i)=>{const x=x0+i*(bw+gap),y=S.y-bw*.45,fr=i===3?1-(t%1):0;CARD(ctx,x,y,bw,bw*.9,bw*.12);ctx.save();ctx.translate(x+bw/2,y+bw*.38);ctx.scale(1,1-.6*Math.max(0,fr-.85)/.15);ctx.font=sk.font(bw*.42,'n');ctx.fillStyle=INK;ctx.fillText(String(v).padStart(2,'0'),0,0);ctx.restore();ctx.font=sk.font(bw*.13,'s','700');ctx.fillStyle=SUB;ctx.fillText(l,x+bw/2,y+bw*.75)})
3873
3873
  ctx.restore()
3874
- }`),ae("tvc-cta-contact","Thẻ liên hệ cuối",5,{text:"Dùng thử miễn phí",items:"canvas.clipoox.com|Hotline 1900 0000|Quận 1, TP. HCM"},`function render(ctx,t,env){
3875
- ${fe}
3874
+ }`),ne("tvc-cta-contact","Thẻ liên hệ cuối",5,{text:"Dùng thử miễn phí",items:"canvas.clipoox.com|Hotline 1900 0000|Quận 1, TP. HCM"},`function render(ctx,t,env){
3875
+ ${de}
3876
3876
  // The end card: a big accent CTA button (text) pops with a soft pulse, the contact lines (items: website, phone,
3877
3877
  // address…) slide in under it each with an icon.
3878
3878
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,its=M.items(p,4)
@@ -3882,8 +3882,8 @@
3882
3882
  const ic=['play','bell','heart','star'];its.forEach((s,i)=>{const q=M.ease.outCubic(M.range(t,.5+i*.2,.9+i*.2));if(q<=0)return;const y=by+bh*.9+i*u*.07,lf=M.fit(ctx,String(s),z=>sk.font(z,'s','600'),u*.034,S.w*.8,1);ctx.font=lf.font;const lw=ctx.measureText(lf.lines[0]||'').width,lx=S.cx-lw/2+u*.025
3883
3883
  ctx.save();ctx.globalAlpha*=q;ctx.translate((1-q)*u*.05,0);ctx.fillStyle=acc;M.icon(ctx,ic[i%4],lx-u*.04,y,u*.014);ctx.fillStyle=INK;ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillText(lf.lines[0]||'',lx,y);ctx.restore()})
3884
3884
  ctx.restore()
3885
- }`),ae("tvc-logo-sting","Logo thương hiệu",3.5,{text:"Clipoox",sub:"Video đẹp hơn mỗi ngày"},`function render(ctx,t,env){
3886
- ${fe}
3885
+ }`),ne("tvc-logo-sting","Logo thương hiệu",3.5,{text:"Clipoox",sub:"Video đẹp hơn mỗi ngày"},`function render(ctx,t,env){
3886
+ ${de}
3887
3887
  // The logo sting: two accent rings burst, the brand mark (initials of text in a gradient disc) lands with a bounce,
3888
3888
  // the brand name (text) and tagline (sub) slide out beside it (under it in portrait). Put the real logo image over
3889
3889
  // the disc when the brand kit has one.
@@ -3898,8 +3898,8 @@
3898
3898
  const a=M.ease.outBack(M.range(t,0,.45));ctx.save();ctx.translate(mx,my);ctx.scale(a,a);ctx.shadowColor='rgba(20,22,40,.25)';ctx.shadowBlur=r*.5;MARK(ctx,sk,p.text,0,0,r,acc);ctx.restore()
3899
3899
  ctx.globalAlpha*=b;ctx.textBaseline='middle';ctx.textAlign=port?'center':'left';ctx.font=nf.font;ctx.fillStyle=INK;ctx.fillText(nf.lines[0]||'',tx+(port?0:(1-b)*-u*.04),ty);ctx.font=sf.font;ctx.fillStyle=SUB;ctx.fillText(sf.lines[0]||'',tx,ty+nf.size*.8)
3900
3900
  ctx.restore()
3901
- }`),ae("tvc-location","Địa điểm cửa hàng",4.5,{text:"Ghé cửa hàng gần bạn",sub:"123 Lê Lợi, Quận 1, TP. HCM"},`function render(ctx,t,env){
3902
- ${fe}
3901
+ }`),ne("tvc-location","Địa điểm cửa hàng",4.5,{text:"Ghé cửa hàng gần bạn",sub:"123 Lê Lợi, Quận 1, TP. HCM"},`function render(ctx,t,env){
3902
+ ${de}
3903
3903
  // A map card: streets draw on a light map, an accent pin drops and bounces with a pulse ring, the heading (text) and
3904
3904
  // the address (sub) under it.
3905
3905
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc
@@ -3912,8 +3912,8 @@
3912
3912
  if(t>.6){ctx.fillStyle=acc;ctx.beginPath();ctx.arc(px,pp-pr*1.2,pr,Math.PI*.85,Math.PI*.15);ctx.lineTo(px,pp);ctx.closePath();ctx.fill();ctx.fillStyle='#ffffff';ctx.beginPath();ctx.arc(px,pp-pr*1.25,pr*.38,0,M.TAU);ctx.fill()}
3913
3913
  ctx.textAlign='center';ctx.textBaseline='middle';const tf=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.05,w*.9,1),sf=M.fit(ctx,String(p.sub||''),z=>sk.font(z,'s','500'),u*.032,w*.9,1);ctx.font=tf.font;ctx.fillStyle=INK;ctx.fillText(tf.lines[0]||'',S.cx,y+h+u*.07);ctx.font=sf.font;ctx.fillStyle=SUB;ctx.fillText(sf.lines[0]||'',S.cx,y+h+u*.13)
3914
3914
  ctx.restore()
3915
- }`),ae("tvc-slogan","Slogan từng chữ",4,{text:"Đẹp hơn. Nhanh hơn. Rẻ hơn."},`function render(ctx,t,env){
3916
- ${fe}
3915
+ }`),ne("tvc-slogan","Slogan từng chữ",4,{text:"Đẹp hơn. Nhanh hơn. Rẻ hơn."},`function render(ctx,t,env){
3916
+ ${de}
3917
3917
  // The slogan (text) lands word by word (sentences break the lines), the last word in the brand colour, a short accent
3918
3918
  // underline draws under the final line.
3919
3919
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.05,.35),u=S.u,acc=sk.acc
@@ -3923,8 +3923,8 @@
3923
3923
  lines.forEach((l,i)=>{const ws=l.split(/ +/),lw=ctx.measureText(l).width;let x=S.cx-lw/2;ws.forEach(w=>{const q=M.ease.outBack(M.range(t,.1+idx*.18,.4+idx*.18)),ww=ctx.measureText(w+' ').width;if(q>0){ctx.save();ctx.globalAlpha*=Math.min(1,q*2);ctx.translate(x,y0+i*f.size*1.15+(1-q)*f.size*.4);ctx.fillStyle=idx===total-1?acc:INK;ctx.fillText(w,0,0);ctx.restore()}x+=ww;idx++})})
3924
3924
  const ul=M.ease.outCubic(M.range(t,.2+total*.18,.6+total*.18));if(ul>0){const ly=y0+(lines.length-1)*f.size*1.15+f.size*.62,lw=ctx.measureText(lines.at(-1)||'').width*.4;ctx.strokeStyle=acc;ctx.lineWidth=u*.008;ctx.lineCap='round';ctx.beginPath();ctx.moveTo(S.cx-lw/2,ly);ctx.lineTo(S.cx-lw/2+lw*ul,ly);ctx.stroke()}
3925
3925
  ctx.restore()
3926
- }`),ae("tvc-before-after","Trước và sau",4.5,{items:"Trước|Sau",text:"Kết quả sau 7 ngày"},`function render(ctx,t,env){
3927
- ${fe}
3926
+ }`),ne("tvc-before-after","Trước và sau",4.5,{items:"Trước|Sau",text:"Kết quả sau 7 ngày"},`function render(ctx,t,env){
3927
+ ${de}
3928
3928
  // Before / after: a card split by a divider that slides across — the left half grey and flat (items[0]), the right
3929
3929
  // half in the brand colour with sparkle (items[1]); the result line (text) under it.
3930
3930
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,its=M.items(p,2)
@@ -3935,8 +3935,8 @@
3935
3935
  ctx.font=sk.font(u*.035,'s','800');ctx.textBaseline='middle';ctx.textAlign='left';ctx.fillStyle=SUB;ctx.fillText(String(its[0]||''),x+u*.03,y+u*.045);ctx.textAlign='right';ctx.fillStyle=M.readable(acc);ctx.fillText(String(its[1]||''),x+w-u*.03,y+u*.045)
3936
3936
  const tf=M.fit(ctx,String(p.text||''),z=>sk.font(z,'h'),u*.048,w*.9,1);ctx.font=tf.font;ctx.textAlign='center';ctx.fillStyle=INK;ctx.fillText(tf.lines[0]||'',S.cx,y+h+u*.065)
3937
3937
  ctx.restore()
3938
- }`),ae("tvc-partners","Đối tác tin dùng",4.5,{text:"Được tin dùng bởi",items:"Công ty A|Tập đoàn B|Chuỗi C|Thương hiệu D|Studio E"},`function render(ctx,t,env){
3939
- ${fe}
3938
+ }`),ne("tvc-partners","Đối tác tin dùng",4.5,{text:"Được tin dùng bởi",items:"Công ty A|Tập đoàn B|Chuỗi C|Thương hiệu D|Studio E"},`function render(ctx,t,env){
3939
+ ${de}
3940
3940
  // "Trusted by": the heading (text) then partner name tiles (items) — drawn as clean wordmark tiles, no real logos —
3941
3941
  // flowing in on a slow marquee.
3942
3942
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.3,.35),u=S.u,acc=sk.acc,its=M.items(p,5)
@@ -5631,7 +5631,7 @@
5631
5631
  ctx.globalAlpha=(1-k.o)*q;ctx.font=f.font;ctx.textAlign='center';ctx.textBaseline='middle';ctx.lineWidth=u*.012;ctx.strokeStyle='rgba(0,0,0,.55)';ctx.strokeText(f.lines[0],S.cx,y);ctx.fillStyle='#ffffff';ctx.fillText(f.lines[0],S.cx,y)
5632
5632
  ctx.fillStyle=acc;ctx.fillRect(S.cx-u*.06,y+f.lh*.62,u*.12*q,u*.008)}
5633
5633
  ctx.restore()
5634
- }`,rr=[["home","Căn hộ mẫu","home-apartment","Bàn giao nhà","home-keys|home-house|home-apartment","home"],["health","Khám tổng quát","health-stethoscope","Chăm sóc sức khoẻ","health-pills|health-thermometer|health-firstaid","heart"],["fit","Tập mỗi ngày","fit-dumbbell","Đồ tập thiết yếu","fit-shoe|fit-bottle|fit-gloves","dumbbell"],["travel","Đi Hội An","travel-lantern","Sẵn sàng lên đường","travel-passport|travel-camera|travel-suitcase","plane"],["menu","Phở bò gia truyền","menu-pho","Combo sáng","menu-banhmi|menu-milktea|menu-coffee","coffee"],["auto","Xe điện mới","auto-ev","Trải nghiệm lái thử","auto-keyfob|auto-charger|auto-wheel","car"]].flatMap(([t,e,c,a,o,s])=>[$n(t+"-photo-pop","Sticker ảnh thật",t,4,{text:e,photo:c,glyph:s,sub:""},ir),$n(t+"-photo-trio","Bộ 3 sticker ảnh",t,4.5,{text:a,items:o,glyph:s},lr)]),Xn=V.find(t=>t.id==="cine"),oe=(t,e,c,a,o)=>({id:t,name:e,category:Xn.name,pack:"cine",duration:c,params:{accent:Xn.accent,position:"center",...a,style:"cine"},code:o}),Ao="const HX=(c,d)=>/^#[0-9a-f]{6}$/i.test(c)?c:d,WH='#ffffff',BK='#000000',TAU=Math.PI*2,E=M.ease,MX=M.mix,RA=M.rgba,RG=M.range;const GL=(c,x,y,r,l,a)=>{if(!(a>0&&r>0))return;a=Math.min(1,a);c.save();c.globalCompositeOperation='screen';const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,RA(l,a));g.addColorStop(.3,RA(l,a*.4));g.addColorStop(1,RA(l,0));c.fillStyle=g;c.fillRect(x-r,y-r,r*2,r*2);c.restore()};const SP=(c,x,y,s,w,r)=>{c.save();c.translate(x,y);c.rotate(r);c.beginPath();c.moveTo(s,0);for(let i=0;i<4;i++){c.bezierCurveTo(s*w,s*w,s*w,s*w,0,s);c.rotate(Math.PI/2)}c.closePath();c.restore()};const STAR=(c,x,y,s,l,a,r=0)=>{if(!(a>0&&s>0))return;a=Math.min(1,a);GL(c,x,y,s*2.4,l,.6*a);c.save();c.globalAlpha=a;const f=c.createLinearGradient(x-s*3,0,x+s*3,0);f.addColorStop(0,'rgba(255,255,255,0)');f.addColorStop(.5,'rgba(255,255,255,.75)');f.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=f;c.fillRect(x-s*3,y-s*.025,s*6,s*.05);c.shadowColor=l;c.shadowBlur=s*.9;c.fillStyle=MX(l,WH,.7);SP(c,x,y,s,.06,r);c.fill();c.shadowBlur=0;c.fillStyle=WH;SP(c,x,y,s*.5,.05,r);c.fill();c.restore()};",gc=Ao+"const BEGIN=(c,t,e,B,N,F,A)=>{const W=e.width,H=e.height,D=e.duration,p=e.params||{},port=H>W*1.1,u=Math.min(W,H),k=E.outCubic(RG(t,0,.45)),o={e,t,W,H,D,p,port,u,k,bg:HX(p.bg,B),nx:HX(p.next,N),fg:HX(p.fg,F),ac:HX(p.glow,A),cx:W/2,cy:H*(port?.44:.46),q:RG(t,D-.45,D),end:t<=0||t>=D};c.fillStyle=t>=D?o.nx:o.bg;c.fillRect(0,0,W,H);if(o.end)return o;c.save();c.globalAlpha=k;const g=c.createRadialGradient(o.cx,o.cy,0,o.cx,o.cy,Math.hypot(W,H)*.62);g.addColorStop(0,MX(o.bg,o.fg,.12));g.addColorStop(.45,o.bg);g.addColorStop(1,MX(o.bg,BK,.55));c.fillStyle=g;c.fillRect(0,0,W,H);c.restore();GL(c,o.cx,o.cy,u*.95,o.fg,.2*k);GL(c,o.cx,o.cy,u*.8,WH,.3*Math.sin(Math.PI*RG(t,0,.7)));return o};const END=(c,o,x,y)=>{const {W,H,u,t,k,p,D,q}=o;let r=M.rand(17);c.save();c.fillStyle=MX(o.fg,WH,.5);for(let i=0;i<26;i++){const X=r()*W+Math.sin(t*.6+i)*u*.02,Y=((r()*H-t*u*(.015+.04*r()))%H+H)%H,z=u*(.0015+.004*r()),w=k*(.35+.65*Math.abs(Math.sin(t*1.3+i)));c.globalAlpha=w*.7;c.beginPath();c.arc(X,Y,z,0,TAU);c.fill()}r=M.rand(Math.floor(t*24)*131+7);const n=W*H/1600;c.globalAlpha=k;for(let i=0;i<n;i++){c.fillStyle=i%2?'rgba(255,255,255,.07)':'rgba(0,0,0,.11)';c.fillRect(r()*W,r()*H,1.6,1.6)}c.restore();const tx=String(p.text||''),sb=String(p.sub||''),a=E.outCubic(RG(t,.55,1.15))*(1-RG(t,D-.8,D-.45));if(a>0&&(tx||sb)){const S=M.safe(o.e,'lower'),sk=M.skin(o.e,p),s=u*(o.port?.062:.056);let Y=(o.port?H*.76:H*.84)+(1-a)*s*.3;c.save();c.globalAlpha=a;c.textAlign='center';c.textBaseline='middle';c.shadowColor=RA(o.fg,.8);c.shadowBlur=s*.6;c.fillStyle='#fff6ec';if(tx){const f=M.fit(c,tx,z=>sk.font(z,'h'),s,S.w*.86,2);c.font=f.font;Y-=(f.lines.length-1)*f.lh/2;f.lines.forEach(l=>{c.fillText(l,S.cx,Y);Y+=f.lh});Y+=f.size*.95-f.lh}if(sb){M.ls(c,s*.12);const g=M.fit(c,sb.toUpperCase(),z=>sk.font(z,'s'),s*.36,S.w*.8,1);c.font=g.font;c.globalAlpha=a*.8;c.fillText(g.lines[0]||'',S.cx,Y)}c.restore()}if(q<=0)return;if(q>=.86){c.fillStyle=o.nx;c.fillRect(0,0,W,H);return}const R=Math.hypot(Math.max(x,W-x),Math.max(y,H-y)),b=E.outBack(RG(q,0,.3)),g=RG(q,.24,.86),s=M.lerp(u*.1*b,R*1.08,g*g*g),j=g*.6;const w=M.lerp(.07,1,Math.pow(g,1.6));GL(c,x,y,s*2.5+u*.15,WH,.7*b);c.save();c.shadowColor=WH;c.shadowBlur=Math.min(u*.12,s*.6+u*.02);c.fillStyle=MX(WH,o.nx,.15);SP(c,x,y,s*1.05+u*.012,w,j);c.fill();c.shadowBlur=0;c.fillStyle=MX(WH,o.nx,RG(q,.2,.45));SP(c,x,y,s,w,j);c.fill();c.restore();if(g<.6)STAR(c,x,y,s*.55+u*.02,WH,1-g/.6,j)};",to=gc+"const STARS=(c,o,n,m)=>{const r=M.rand(5);c.save();c.fillStyle=WH;for(let i=0;i<n;i++){const x=r()*o.W,y=r()*m,s=o.u*(.0012+.0028*r());c.globalAlpha=o.k*(.25+.75*Math.abs(Math.sin(o.t*1.6+i*2.4)));c.beginPath();c.arc(x,y,s,0,TAU);c.fill()}c.restore()};",xr=[oe("cine-night-house","Ngôi nhà dưới trời sao",3.5,{bg:"#0b1633",next:"#c8102e",fg:"#ffd27a",glow:"#36e0c8",text:"",sub:""},`function render(c,t,env){
5634
+ }`,rr=[["home","Căn hộ mẫu","home-apartment","Bàn giao nhà","home-keys|home-house|home-apartment","home"],["health","Khám tổng quát","health-stethoscope","Chăm sóc sức khoẻ","health-pills|health-thermometer|health-firstaid","heart"],["fit","Tập mỗi ngày","fit-dumbbell","Đồ tập thiết yếu","fit-shoe|fit-bottle|fit-gloves","dumbbell"],["travel","Đi Hội An","travel-lantern","Sẵn sàng lên đường","travel-passport|travel-camera|travel-suitcase","plane"],["menu","Phở bò gia truyền","menu-pho","Combo sáng","menu-banhmi|menu-milktea|menu-coffee","coffee"],["auto","Xe điện mới","auto-ev","Trải nghiệm lái thử","auto-keyfob|auto-charger|auto-wheel","car"]].flatMap(([t,e,c,a,o,s])=>[$n(t+"-photo-pop","Sticker ảnh thật",t,4,{text:e,photo:c,glyph:s,sub:""},ir),$n(t+"-photo-trio","Bộ 3 sticker ảnh",t,4.5,{text:a,items:o,glyph:s},lr)]),Xn=V.find(t=>t.id==="cine"),se=(t,e,c,a,o)=>({id:t,name:e,category:Xn.name,pack:"cine",duration:c,params:{accent:Xn.accent,position:"center",...a,style:"cine"},code:o}),Ao="const HX=(c,d)=>/^#[0-9a-f]{6}$/i.test(c)?c:d,WH='#ffffff',BK='#000000',TAU=Math.PI*2,E=M.ease,MX=M.mix,RA=M.rgba,RG=M.range;const GL=(c,x,y,r,l,a)=>{if(!(a>0&&r>0))return;a=Math.min(1,a);c.save();c.globalCompositeOperation='screen';const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,RA(l,a));g.addColorStop(.3,RA(l,a*.4));g.addColorStop(1,RA(l,0));c.fillStyle=g;c.fillRect(x-r,y-r,r*2,r*2);c.restore()};const SP=(c,x,y,s,w,r)=>{c.save();c.translate(x,y);c.rotate(r);c.beginPath();c.moveTo(s,0);for(let i=0;i<4;i++){c.bezierCurveTo(s*w,s*w,s*w,s*w,0,s);c.rotate(Math.PI/2)}c.closePath();c.restore()};const STAR=(c,x,y,s,l,a,r=0)=>{if(!(a>0&&s>0))return;a=Math.min(1,a);GL(c,x,y,s*2.4,l,.6*a);c.save();c.globalAlpha=a;const f=c.createLinearGradient(x-s*3,0,x+s*3,0);f.addColorStop(0,'rgba(255,255,255,0)');f.addColorStop(.5,'rgba(255,255,255,.75)');f.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=f;c.fillRect(x-s*3,y-s*.025,s*6,s*.05);c.shadowColor=l;c.shadowBlur=s*.9;c.fillStyle=MX(l,WH,.7);SP(c,x,y,s,.06,r);c.fill();c.shadowBlur=0;c.fillStyle=WH;SP(c,x,y,s*.5,.05,r);c.fill();c.restore()};",gc=Ao+"const BEGIN=(c,t,e,B,N,F,A)=>{const W=e.width,H=e.height,D=e.duration,p=e.params||{},port=H>W*1.1,u=Math.min(W,H),k=E.outCubic(RG(t,0,.45)),o={e,t,W,H,D,p,port,u,k,bg:HX(p.bg,B),nx:HX(p.next,N),fg:HX(p.fg,F),ac:HX(p.glow,A),cx:W/2,cy:H*(port?.44:.46),q:RG(t,D-.45,D),end:t<=0||t>=D};c.fillStyle=t>=D?o.nx:o.bg;c.fillRect(0,0,W,H);if(o.end)return o;c.save();c.globalAlpha=k;const g=c.createRadialGradient(o.cx,o.cy,0,o.cx,o.cy,Math.hypot(W,H)*.62);g.addColorStop(0,MX(o.bg,o.fg,.12));g.addColorStop(.45,o.bg);g.addColorStop(1,MX(o.bg,BK,.55));c.fillStyle=g;c.fillRect(0,0,W,H);c.restore();GL(c,o.cx,o.cy,u*.95,o.fg,.2*k);GL(c,o.cx,o.cy,u*.8,WH,.3*Math.sin(Math.PI*RG(t,0,.7)));return o};const END=(c,o,x,y)=>{const {W,H,u,t,k,p,D,q}=o;let r=M.rand(17);c.save();c.fillStyle=MX(o.fg,WH,.5);for(let i=0;i<26;i++){const X=r()*W+Math.sin(t*.6+i)*u*.02,Y=((r()*H-t*u*(.015+.04*r()))%H+H)%H,z=u*(.0015+.004*r()),w=k*(.35+.65*Math.abs(Math.sin(t*1.3+i)));c.globalAlpha=w*.7;c.beginPath();c.arc(X,Y,z,0,TAU);c.fill()}r=M.rand(Math.floor(t*24)*131+7);const n=W*H/1600;c.globalAlpha=k;for(let i=0;i<n;i++){c.fillStyle=i%2?'rgba(255,255,255,.07)':'rgba(0,0,0,.11)';c.fillRect(r()*W,r()*H,1.6,1.6)}c.restore();const tx=String(p.text||''),sb=String(p.sub||''),a=E.outCubic(RG(t,.55,1.15))*(1-RG(t,D-.8,D-.45));if(a>0&&(tx||sb)){const S=M.safe(o.e,'lower'),sk=M.skin(o.e,p),s=u*(o.port?.062:.056);let Y=(o.port?H*.76:H*.84)+(1-a)*s*.3;c.save();c.globalAlpha=a;c.textAlign='center';c.textBaseline='middle';c.shadowColor=RA(o.fg,.8);c.shadowBlur=s*.6;c.fillStyle='#fff6ec';if(tx){const f=M.fit(c,tx,z=>sk.font(z,'h'),s,S.w*.86,2);c.font=f.font;Y-=(f.lines.length-1)*f.lh/2;f.lines.forEach(l=>{c.fillText(l,S.cx,Y);Y+=f.lh});Y+=f.size*.95-f.lh}if(sb){M.ls(c,s*.12);const g=M.fit(c,sb.toUpperCase(),z=>sk.font(z,'s'),s*.36,S.w*.8,1);c.font=g.font;c.globalAlpha=a*.8;c.fillText(g.lines[0]||'',S.cx,Y)}c.restore()}if(q<=0)return;if(q>=.86){c.fillStyle=o.nx;c.fillRect(0,0,W,H);return}const R=Math.hypot(Math.max(x,W-x),Math.max(y,H-y)),b=E.outBack(RG(q,0,.3)),g=RG(q,.24,.86),s=M.lerp(u*.1*b,R*1.08,g*g*g),j=g*.6;const w=M.lerp(.07,1,Math.pow(g,1.6));GL(c,x,y,s*2.5+u*.15,WH,.7*b);c.save();c.shadowColor=WH;c.shadowBlur=Math.min(u*.12,s*.6+u*.02);c.fillStyle=MX(WH,o.nx,.15);SP(c,x,y,s*1.05+u*.012,w,j);c.fill();c.shadowBlur=0;c.fillStyle=MX(WH,o.nx,RG(q,.2,.45));SP(c,x,y,s,w,j);c.fill();c.restore();if(g<.6)STAR(c,x,y,s*.55+u*.02,WH,1-g/.6,j)};",to=gc+"const STARS=(c,o,n,m)=>{const r=M.rand(5);c.save();c.fillStyle=WH;for(let i=0;i<n;i++){const x=r()*o.W,y=r()*m,s=o.u*(.0012+.0028*r());c.globalAlpha=o.k*(.25+.75*Math.abs(Math.sin(o.t*1.6+i*2.4)));c.beginPath();c.arc(x,y,s,0,TAU);c.fill()}c.restore()};",xr=[se("cine-night-house","Ngôi nhà dưới trời sao",3.5,{bg:"#0b1633",next:"#c8102e",fg:"#ffd27a",glow:"#36e0c8",text:"",sub:""},`function render(c,t,env){
5635
5635
  ${to}
5636
5636
  // Night house: a small house with one warm lit window sits on a glowing teal horizon under twinkling stars, a 4-point star sparkles above it and bursts into the next colour. Fields: bg (flat first frame), next (flat last frame), fg (window light), accent (horizon glow), text, sub.
5637
5637
  const o=BEGIN(c,t,env,'#0b1633','#c8102e','#ffd27a','#36e0c8');if(o.end)return
@@ -5664,7 +5664,7 @@
5664
5664
  STAR(c,sx,sy,u*.045*tw*k,MX(fg,WH,.4),k,t*.15)
5665
5665
  STAR(c,cx-u*.27,hy-u*.31,u*.016*(.6+.4*Math.sin(t*4+2)),WH,k*.8,0)
5666
5666
  END(c,o,sx,sy)
5667
- }`),oe("cine-eye","Con mắt đỏ",3.5,{bg:"#c8102e",next:"#1b1550",fg:"#ffffff",glow:"#5c0010",text:"",sub:""},`function render(c,t,env){
5667
+ }`),se("cine-eye","Con mắt đỏ",3.5,{bg:"#c8102e",next:"#1b1550",fg:"#ffffff",glow:"#5c0010",text:"",sub:""},`function render(c,t,env){
5668
5668
  ${gc}
5669
5669
  // Red eye: on flat red a white 4-point star grows and opens into an almond eye (iris, star highlight) that glances around and sheds a blood-red tear; the highlight bursts into next. Fields: bg, next, fg (eye white), accent (tear / iris), text, sub.
5670
5670
  const o=BEGIN(c,t,env,'#c8102e','#1b1550',WH,'#5c0010');if(o.end)return
@@ -5697,7 +5697,7 @@
5697
5697
  c.beginPath();c.moveTo(0,-ds*1.7);c.bezierCurveTo(ds*.6,-ds*.7,ds,0,ds,ds*.2);c.arc(0,ds*.2,ds,0,Math.PI);c.bezierCurveTo(-ds,0,-ds*.6,-ds*.7,0,-ds*1.7);c.fill()
5698
5698
  c.shadowBlur=0;c.fillStyle='rgba(255,255,255,.7)';c.beginPath();c.ellipse(-ds*.35,-ds*.05,ds*.16,ds*.3,-.3,0,TAU);c.fill();c.restore()}
5699
5699
  END(c,o,hx,hy)
5700
- }`),oe("cine-sword","Thanh kiếm phát sáng",3.5,{bg:"#1b1550",next:"#0d2a1f",fg:"#d6e4ff",glow:"#8f7dff",text:"",sub:""},`function render(c,t,env){
5700
+ }`),se("cine-sword","Thanh kiếm phát sáng",3.5,{bg:"#1b1550",next:"#0d2a1f",fg:"#d6e4ff",glow:"#8f7dff",text:"",sub:""},`function render(c,t,env){
5701
5701
  ${gc}
5702
5702
  // Glowing sword: light rays fan down from above while a radiant sword descends point first and hovers, a glint runs down the blade and sparkles on the tip, which bursts into the next colour. Fields: bg, next, fg (blade light), accent (hilt and rays), text, sub.
5703
5703
  const o=BEGIN(c,t,env,'#1b1550','#0d2a1f','#d6e4ff','#8f7dff');if(o.end)return
@@ -5726,7 +5726,7 @@
5726
5726
  const ts=RG(t,2.0,2.2),fl=Math.exp(-Math.pow((t-2.3)/.14,2))
5727
5727
  STAR(c,cx,ty,u*(.028+.05*fl)*ts*(.85+.15*Math.sin(t*7)),fg,A,t*.3)
5728
5728
  END(c,o,cx,ty)
5729
- }`),oe("cine-crown-rain","Mưa vương miện",3.5,{bg:"#0d2a1f",next:"#3a0a1e",fg:"#ff7a62",glow:"#ffd27a",text:"",sub:""},`function render(c,t,env){
5729
+ }`),se("cine-crown-rain","Mưa vương miện",3.5,{bg:"#0d2a1f",next:"#3a0a1e",fg:"#ff7a62",glow:"#ffd27a",text:"",sub:""},`function render(c,t,env){
5730
5730
  ${gc}
5731
5731
  // Crown rain: on dark green a gold-coral crown drops in and settles, then crowns rain down at every depth and keep multiplying in a coral glow; the sparkle on the crown's top jewel bursts into the next colour. Fields: bg, next, fg (coral glow), accent (gold), text, sub.
5732
5732
  const o=BEGIN(c,t,env,'#0d2a1f','#3a0a1e','#ff7a62','#ffd27a');if(o.end)return
@@ -5752,7 +5752,7 @@
5752
5752
  const jx=cx,jy=my-ms*.63
5753
5753
  STAR(c,jx,jy,u*.035*(.75+.25*Math.sin(t*6)),WH,k*RG(t,.85,1.15),t*.2)
5754
5754
  END(c,o,jx,jy)
5755
- }`),oe("cine-heart","Trái tim đập",3,{bg:"#3a0a1e",next:"#0a1630",fg:"#ff3d63",glow:"#ffb0c4",text:"",sub:""},`function render(c,t,env){
5755
+ }`),se("cine-heart","Trái tim đập",3,{bg:"#3a0a1e",next:"#0a1630",fg:"#ff3d63",glow:"#ffb0c4",text:"",sub:""},`function render(c,t,env){
5756
5756
  ${gc}
5757
5757
  // Beating heart: a glossy red heart beats lub-dub in a pink glow, every beat sends a ring of light outward; a sparkle on its shoulder bursts into the next colour. Fields: bg, next, fg (heart), accent (glow and rings), text, sub.
5758
5758
  const o=BEGIN(c,t,env,'#3a0a1e','#0a1630','#ff3d63','#ffb0c4');if(o.end)return
@@ -5772,7 +5772,7 @@
5772
5772
  const sx=cx+hs*.62,sy=cy-hs*.74
5773
5773
  STAR(c,sx,sy,u*.03*(.75+.45*b),WH,k*RG(t,.4,.8),t*.3)
5774
5774
  END(c,o,sx,sy)
5775
- }`),oe("cine-moon","Trăng khuyết và mây",3.5,{bg:"#0a1630",next:"#2a1606",fg:"#fff1c9",glow:"#7e95ff",text:"",sub:""},`function render(c,t,env){
5775
+ }`),se("cine-moon","Trăng khuyết và mây",3.5,{bg:"#0a1630",next:"#2a1606",fg:"#fff1c9",glow:"#7e95ff",text:"",sub:""},`function render(c,t,env){
5776
5776
  ${to}
5777
5777
  // Crescent moon: a glowing crescent rocks gently in a starry night while soft lit clouds drift across it; a sparkle at its upper tip bursts into the next colour. Fields: bg, next, fg (moonlight), accent (cloud rim), text, sub.
5778
5778
  const o=BEGIN(c,t,env,'#0a1630','#2a1606','#fff1c9','#7e95ff');if(o.end)return
@@ -5793,7 +5793,7 @@
5793
5793
  const sx=mx-r*.12,sy=my-r*1.05
5794
5794
  STAR(c,sx,sy,u*.032*(.75+.25*Math.sin(t*5)),fg,k*RG(t,.5,.9),t*.2)
5795
5795
  END(c,o,sx,sy)
5796
- }`),oe("cine-key","Chìa khoá và ổ khoá",3.5,{bg:"#2a1606",next:"#10243a",fg:"#ffc46b",glow:"#fff3d6",text:"",sub:""},`function render(c,t,env){
5796
+ }`),se("cine-key","Chìa khoá và ổ khoá",3.5,{bg:"#2a1606",next:"#10243a",fg:"#ffc46b",glow:"#fff3d6",text:"",sub:""},`function render(c,t,env){
5797
5797
  ${gc}
5798
5798
  // Key and keyhole: a golden key slides down into a keyhole lit from behind and turns; light floods out through the keyhole in rays and the keyhole flare bursts into the next colour. Fields: bg, next, fg (gold), accent (light core), text, sub.
5799
5799
  const o=BEGIN(c,t,env,'#2a1606','#10243a','#ffc46b','#fff3d6');if(o.end)return
@@ -5821,7 +5821,7 @@
5821
5821
  const cf=Math.exp(-Math.pow((t-1.9)/.12,2))
5822
5822
  STAR(c,cx,kh+u*.03,u*(.03+.06*cf)*RG(t,1.6,1.9)*(.85+.15*Math.sin(t*7)),ac,k,t*.2)
5823
5823
  END(c,o,cx,kh+u*.03)
5824
- }`),oe("cine-hourglass","Đồng hồ cát",3.5,{bg:"#10243a",next:"#2b0d3d",fg:"#ffcf8a",glow:"#9fd8ff",text:"",sub:""},`function render(c,t,env){
5824
+ }`),se("cine-hourglass","Đồng hồ cát",3.5,{bg:"#10243a",next:"#2b0d3d",fg:"#ffcf8a",glow:"#9fd8ff",text:"",sub:""},`function render(c,t,env){
5825
5825
  ${gc}
5826
5826
  // Hourglass: a glass hourglass in a bronze frame, golden sand pours through the neck in a glowing stream and piles up below; the sparkle at the neck bursts into the next colour. Fields: bg, next, fg (sand light), accent (glass), text, sub.
5827
5827
  const o=BEGIN(c,t,env,'#10243a','#2b0d3d','#ffcf8a','#9fd8ff');if(o.end)return
@@ -5849,7 +5849,7 @@
5849
5849
  c.restore()
5850
5850
  STAR(c,cx,cy,u*.03*(.7+.3*Math.sin(t*5)),WH,k*RG(t,.5,.9),t*.3)
5851
5851
  END(c,o,cx,cy)
5852
- }`),oe("cine-rocket","Tên lửa phóng",3,{bg:"#2b0d3d",next:"#04202a",fg:"#ffb35a",glow:"#ff5fa2",text:"",sub:""},`function render(c,t,env){
5852
+ }`),se("cine-rocket","Tên lửa phóng",3,{bg:"#2b0d3d",next:"#04202a",fg:"#ffb35a",glow:"#ff5fa2",text:"",sub:""},`function render(c,t,env){
5853
5853
  ${gc}
5854
5854
  // Rocket launch: a white rocket climbs through a plum night on a flickering flame, leaving a billowing lit smoke trail while stars streak past; the sparkle on its nose bursts into the next colour. Fields: bg, next, fg (flame), accent (fins and smoke), text, sub.
5855
5855
  const o=BEGIN(c,t,env,'#2b0d3d','#04202a','#ffb35a','#ff5fa2');if(o.end)return
@@ -5878,7 +5878,7 @@
5878
5878
  const nx=cx+sh,ny=ry-rl*.6
5879
5879
  STAR(c,nx,ny,u*.03*(.8+.2*Math.sin(t*7)),WH,k*RG(t,D-1.3,D-.8),t*.3)
5880
5880
  END(c,o,nx,ny)
5881
- }`),oe("cine-lighthouse","Hải đăng quét sáng",3.5,{bg:"#04202a",next:"#1a0a05",fg:"#fff0b0",glow:"#2fd3c5",text:"",sub:""},`function render(c,t,env){
5881
+ }`),se("cine-lighthouse","Hải đăng quét sáng",3.5,{bg:"#04202a",next:"#1a0a05",fg:"#fff0b0",glow:"#2fd3c5",text:"",sub:""},`function render(c,t,env){
5882
5882
  ${to}
5883
5883
  // Lighthouse at sea: a lighthouse on a rock sweeps twin beams over a teal night sea, waves glint, the lamp flares when it faces you and bursts into next. Fields: bg, next, fg (beam light), accent (sea glow), text, sub.
5884
5884
  const o=BEGIN(c,t,env,'#04202a','#1a0a05','#fff0b0','#2fd3c5');if(o.end)return
@@ -5905,7 +5905,7 @@
5905
5905
  GL(c,lx,ly,u*(.15+.6*fr),fg,(.5+.5*fr)*k)
5906
5906
  STAR(c,lx,ly,u*(.02+.07*fr),fg,k,0)
5907
5907
  END(c,o,lx,ly)
5908
- }`),oe("cine-flame","Ngọn nến lung linh",3,{bg:"#1a0a05",next:"#0c2414",fg:"#ffb347",glow:"#ff5a1f",text:"",sub:""},`function render(c,t,env){
5908
+ }`),se("cine-flame","Ngọn nến lung linh",3,{bg:"#1a0a05",next:"#0c2414",fg:"#ffb347",glow:"#ff5a1f",text:"",sub:""},`function render(c,t,env){
5909
5909
  ${gc}
5910
5910
  // Candle flame: a cream candle in the dark, its flame flickers and sways inside a warm halo while tiny embers rise; the flame tip bursts into the next colour. Fields: bg, next, fg (flame), accent (outer flame / halo), text, sub.
5911
5911
  const o=BEGIN(c,t,env,'#1a0a05','#0c2414','#ffb347','#ff5a1f');if(o.end)return
@@ -5927,7 +5927,7 @@
5927
5927
  c.restore()
5928
5928
  const R=M.rand(9);c.save();c.fillStyle=MX(fg,WH,.3);for(let i=0;i<14;i++){const sp=.5+R(),ph=R(),q=(t*.35*sp+ph)%1,x=cx+sx+(R()-.5)*u*.06+Math.sin(t*2+i)*u*.02*q,y=fy-fh-q*u*.45;c.globalAlpha=k*(1-q)*.9;c.beginPath();c.arc(x,y,u*.0035*(1-q*.5),0,TAU);c.fill()}c.restore()
5929
5929
  END(c,o,cx+sx,fy-fh)
5930
- }`),oe("cine-tree","Cây lớn lên",3.5,{bg:"#0c2414",next:"#0a0a28",fg:"#8cff7a",glow:"#ffe08a",text:"",sub:""},`function render(c,t,env){
5930
+ }`),se("cine-tree","Cây lớn lên",3.5,{bg:"#0c2414",next:"#0a0a28",fg:"#8cff7a",glow:"#ffe08a",text:"",sub:""},`function render(c,t,env){
5931
5931
  ${gc}
5932
5932
  // Growing tree: a tree grows from a glowing mound, branches split and glowing leaf clusters pop out and sway while motes drift like fireflies; a sparkle above the crown bursts into the next colour. Fields: bg, next, fg (leaf glow), accent (sparkle), text, sub.
5933
5933
  const o=BEGIN(c,t,env,'#0c2414','#0a0a28','#8cff7a','#ffe08a');if(o.end)return
@@ -5949,7 +5949,7 @@
5949
5949
  const sx=cx+u*.05,sy=gy-u*.7
5950
5950
  STAR(c,sx,sy,u*.035*(.75+.25*Math.sin(t*5)),ac,k*RG(t,1.6,2.1),t*.25)
5951
5951
  END(c,o,sx,sy)
5952
- }`),oe("cine-planet","Hành tinh có vành",3.5,{bg:"#0a0a28",next:"#2a0c10",fg:"#ffb27a",glow:"#8fd3ff",text:"",sub:""},`function render(c,t,env){
5952
+ }`),se("cine-planet","Hành tinh có vành",3.5,{bg:"#0a0a28",next:"#2a0c10",fg:"#ffb27a",glow:"#8fd3ff",text:"",sub:""},`function render(c,t,env){
5953
5953
  ${to}
5954
5954
  // Ringed planet: a banded planet with a tilted glowing ring floats in deep space while a small moon orbits behind and in front of it and stars twinkle; a sparkle on the ring bursts into the next colour. Fields: bg, next, fg (planet), accent (ring and moon), text, sub.
5955
5955
  const o=BEGIN(c,t,env,'#0a0a28','#2a0c10','#ffb27a','#8fd3ff');if(o.end)return
@@ -5974,7 +5974,7 @@
5974
5974
  const sx=cx+r*1.58,sy=py-r*.46
5975
5975
  STAR(c,sx,sy,u*.03*(.75+.25*Math.sin(t*5)),WH,k*RG(t,.6,1),t*.25)
5976
5976
  END(c,o,sx,sy)
5977
- }`),oe("cine-door","Cánh cửa mở ra ánh sáng",3.5,{bg:"#2a0c10",next:"#0b1633",fg:"#ffe2a8",glow:"#ff7a59",text:"",sub:""},`function render(c,t,env){
5977
+ }`),se("cine-door","Cánh cửa mở ra ánh sáng",3.5,{bg:"#2a0c10",next:"#0b1633",fg:"#ffe2a8",glow:"#ff7a59",text:"",sub:""},`function render(c,t,env){
5978
5978
  ${gc}
5979
5979
  // Opening door: a door in a dark wall swings open and warm light spills out across the floor in a widening wedge with glittering dust; the light in the doorway bursts into the next colour. Fields: bg, next, fg (light), accent (door), text, sub.
5980
5980
  const o=BEGIN(c,t,env,'#2a0c10','#0b1633','#ffe2a8','#ff7a59');if(o.end)return
@@ -6001,7 +6001,7 @@
6001
6001
  const sx=x0+dw*.66,sy=cy
6002
6002
  STAR(c,sx,sy,u*.035*(.8+.2*Math.sin(t*6)),WH,k*RG(t,1.6,2),t*.25)
6003
6003
  END(c,o,sx,sy)
6004
- }`),oe("cine-caption","Phụ đề điện ảnh",4,{text:"Mọi câu chuyện bắt đầu từ một tia sáng",sub:"Chương một",fg:"#ffd9a0",color:"#fff6ec",position:"lower"},`function render(c,t,env){
6004
+ }`),se("cine-caption","Phụ đề điện ảnh",4,{text:"Mọi câu chuyện bắt đầu từ một tia sáng",sub:"Chương một",fg:"#ffd9a0",color:"#fff6ec",position:"lower"},`function render(c,t,env){
6005
6005
  ${Ao}
6006
6006
  // Elegant caption (transparent overlay for any scene): a serif line (text) settles in from wide tracking, a thin glowing rule with a tiny star draws under it, the small caps sub follows, a light sweep runs across the words, then all fades. Fields: text, sub, fg (glow), color (text), position.
6007
6007
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),u=S.u,fg=HX(p.fg,'#ffd9a0'),col=HX(p.color,'#fff6ec'),a=E.outCubic(RG(t,0,.9)),A=a*(1-E.inCubic(RG(t,D-.55,D)))
@@ -6018,7 +6018,7 @@
6018
6018
  STAR(c,S.cx,y,u*.014*RG(t,.9,1.2),fg,A,0)}
6019
6019
  if(sb){M.ls(c,sz*.16);const g2=M.fit(c,sb.toUpperCase(),s=>sk.font(s,'s'),sz*.34,S.w*.85,1);c.font=g2.font;c.globalAlpha=A*E.outCubic(RG(t,.7,1.3))*.85;c.fillStyle=col;c.fillText(g2.lines[0]||'',S.cx,y+sz*.6)}
6020
6020
  c.restore()
6021
- }`),oe("cine-spark","Lấp lánh sao bốn cánh",2.5,{fg:"#ffe9b0",size:1,x:.5,position:"center"},`function render(c,t,env){
6021
+ }`),se("cine-spark","Lấp lánh sao bốn cánh",2.5,{fg:"#ffe9b0",size:1,x:.5,position:"center"},`function render(c,t,env){
6022
6022
  ${Ao}
6023
6023
  // Star sparkle (transparent decoration): a 4-point star pops in, twinkles and turns with a soft bloom, a thin anamorphic flare and two tiny satellite sparkles, then fades. Fields: fg (star colour), size, x (0..1 across the frame), position (top / center / lower).
6024
6024
  const {width:W,duration:D,params:p}=env,S=M.safe(env,p.position),u=S.u,fg=HX(p.fg,'#ffe9b0'),sz=Math.max(.3,Math.min(3,+p.size||1)),x=W*M.clamp(+p.x||.5,.05,.95),y=S.y
@@ -6417,7 +6417,7 @@
6417
6417
  const dx=S.cx-w/2-u*.05,ph=(t*1.6)%1,r=u*.008*(1+.5*Math.exp(-ph*5))
6418
6418
  ctx.save();ctx.globalAlpha=k.v*(1-ph);NEON(ctx,fg,u*.002,()=>{ctx.beginPath();ctx.arc(dx,S.y,r+u*.016*M.ease.outCubic(ph),0,M.TAU)},.7);ctx.restore()
6419
6419
  DOT(ctx,dx,S.y,r,fg,k.v)
6420
- }`)],Yn=V.find(t=>t.id==="story"),me=(t,e,c,a,o)=>({id:t,name:e,category:Yn.name,pack:"story",duration:c,params:{accent:Yn.accent,position:"center",...a,style:"story"},code:o}),Re="const CO='#ff3b5c',CR='#efe9d6',CH='#1b1b1d',BK='#0d0d0f',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),RC=(c,...a)=>c.fillRect(...a),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},MIN=Math.min,ABS=Math.abs,HY=Math.hypot;const LUM=x=>{const h=M.hex(x);return h[0]*.3+h[1]*.59+h[2]*.11},FR=(a,b)=>{const n=SN(a*12.99+b*78.23)*43758.5;return n-Math.floor(n)},PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d;const DOT=(c,x,y,r)=>{BP(c);c.arc(x,y,MAX(0,r),0,TAU);c.fill()},PL=(c,...p)=>{BP(c);for(let i=0;i<p.length;i+=2)c.lineTo(p[i],p[i+1]);c.fill()},RF=(c,x,y,w,h,r)=>{M.rr(c,x,y,w,h,r);c.fill()},G=(g,s)=>{s.forEach(o=>g.addColorStop(o[0],o[1]));return g};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,CH),nx=PC(p.next,CO),lt=LUM(bg)>170,ac=PC(p.fg,PC(p.accent,CO)),hi=ED(p.heroIn,'l'),ho=ED(p.heroOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[k=='l'?W*f:k=='r'?-W*f:0,k=='t'?H*f:k=='b'?-H*f:0],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]);const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,hk:p.hero,K:{bg,nx,ac,fg:ABS(LUM(ac)-LUM(bg))<40?(lt?CH:CR):ac,cr:lt?CH:CR,dk:lt?CH:LUM(bg)<60?'#060607':BK},e:pi?1:E.outCubic(RG(t,0,.4)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02;const GLOW=(c,x,y,r,col,a)=>{if(a>0&&r>0){FS(c,G(c.createRadialGradient(x,y,0,x,y,r),[[0,RA(col,MIN(1,a))],[1,RA(col,0)]]));RC(c,x-r,y-r,r*2,r*2)}};const BGL=(c,B,s,x)=>{SV(c);GA(c,B.e);FS(c,G(x?c.createRadialGradient(x[0],x[1],0,x[0],x[1],x[2]):c.createLinearGradient(0,0,0,B.H),s));RC(c,0,0,B.W,B.H);FS(c,G(c.createRadialGradient(B.cx,B.cy,B.u*.35,B.cx,B.cy,HY(B.W,B.H)*.62),[[0,RA(BK,0)],[1,RA(BK,.45)]]));RC(c,0,0,B.W,B.H);RS(c)};const CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GLOW(c,x,y,R*1.3+B.u*.06,B.K.ac,.55*(1-k));FS(c,B.K.nx);DOT(c,x,y,R)}};const END=(c,B)=>{const {W,H,u,t,q}=B,a=B.e*(1-q);if(a>0){let s=String(B.p.text||'').trim();const k=a*(1-RG(q,0,.35)),r=M.rand(Math.floor(t*24)*7+3);SV(c);GA(c,a);for(let i=0;i<W*H/1600;i++){FS(c,i%2?RA(CR,.06):RA(BK,.1));RC(c,r()*W,r()*H,1.5,1.5)}if(s&&k>0){s=s[0].toUpperCase()+s.slice(1).toLowerCase();const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.042,S.w*.8,2),n=f.lines.length,h=n*f.lh+f.size;GA(c,k*.4);FS(c,BK);c.shadowColor=BK;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,k);c.font=f.font;c.textAlign='center';c.textBaseline='middle';FS(c,CR);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh))}RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,H)}if(B.pz)RS(c)};const EP=(B,k)=>{const o=B.u*.16;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},TT=B=>{const m=MAX(.3,B.D-.75);return[.3+m*.34,B.D-.45-m*.3]};const HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HP=(B,tt,sx,sy,hd)=>{const O=B.of(tt),I=B.pi&&HO(B,{l:'r',r:'l',t:'b',b:'t'}[B.hi]),A=I?[I[0]-O[0],I[1]-O[1]]:EP(B,B.hi),Z=B.po?(a=>[a[0]-O[0],a[1]-O[1]])(HO(B,B.ho)):EP(B,B.ho),T=TT(B),X=B.po?B.D-PN:B.D-.45;let x=sx+SN(tt*1.3)*B.u*.02,y=sy+SN(tt*2.4)*B.u*.014,s=1,k=0;if(tt<T[0]){k=E.outCubic(RG(tt,B.pi?PN:.3,T[0]));x=L(A[0],x,k);y=L(A[1],y,k);if(B.hi=='c')s=k}else if(tt>T[1]){k=(B.po?E.inOutCubic:E.inCubic)(RG(tt,T[1],X));x=L(x,Z[0],k);y=L(y,Z[1],k);if(B.ho=='c')s=1-k}y-=SN(k*PI)*B.u*.07;if(hd)s*=MIN(1,1-RG(tt,T[0]-.2,T[0])+RG(tt,T[1],T[1]+.2));return{x,y,s:tt<.3&&!B.pi?0:MAX(0,s)}};const HEART=(c,x,y,s)=>{BP(c);c.moveTo(x,y+s*.9);c.bezierCurveTo(x-s*1.25,y+s*.05,x-s*.95,y-s*.95,x,y-s*.42);c.bezierCurveTo(x+s*.95,y-s*.95,x+s*1.25,y+s*.05,x,y+s*.9)};const HERO=(c,B,h,z,kd)=>{const s=z*h.s,K=B.K,k=kd||B.hk,t=B.t,a=h.a||0;if(!(s>.5))return;SV(c);c.translate(h.x,h.y);FS(c,K.cr);if(k=='heart'){c.rotate(SN(t*3)*.12);GLOW(c,0,0,s*2,K.ac,.4);FS(c,K.ac);HEART(c,0,0,s*.8);c.fill();c.strokeStyle=CR;c.lineWidth=s*.13;c.stroke()}else if(k=='ball'){c.rotate(t*2);DOT(c,0,0,s*.75);FS(c,MX(K.cr,BK,.2));PL(c,0,0,s*.75,0,s*.25,s*.7);PL(c,0,0,-s*.45,-s*.6,-s*.74,0);FS(c,MX(K.cr,BK,.1));PL(c,0,0,-s*.3,s*.7,-s*.72,s*.2)}else if(k=='bubble'){c.rotate(SN(t*2)*.08);RF(c,-s,-s*.62,s*2,s*1.15,s*.45);PL(c,-s*.5,s*.4,-s*.85,s*.85,0,s*.48);FS(c,K.fg);for(let i=-1;i<2;i++)DOT(c,i*s*.42,-s*.05,s*.12)}else if(k=='star'){c.rotate(t*1.5);GLOW(c,0,0,s*2.2,K.fg,.45);FS(c,K.cr);BP(c);for(let i=0;i<8;i++){const r=i%2?s*.32:s;c.lineTo(CS(i*PI/4)*r,SN(i*PI/4)*r)}c.fill()}else{c.rotate(a);if(CS(a)<0)c.scale(1,-1);FS(c,MX(K.cr,CH,.32));PL(c,s,0,-s*.45,0,-s*.66,s*.48);FS(c,K.cr);PL(c,s,0,-s*.85,-s*.62,-s*.45,0)}RS(c)};const FLY=(c,B,F,z)=>{const t=B.t,h=F(t),a=F(t-.04),b=F(t+.04),A=EP(B,B.hi),Z=EP(B,B.ho);if(!(h.s>0))return;if(B.pz){RS(c);SV(c);const o=B.of(t);c.translate(o[0],o[1])}h.a=Math.atan2(b.y-a.y+(Z[1]-A[1])*.004,b.x-a.x+(Z[0]-A[0])*.004+.001);SV(c);c.strokeStyle=B.K.fg;c.lineCap='round';for(let i=1;i<14;i++){const p=F(t-i*.03),o=F(t-i*.03+.03),k=1-i/14;if(!(p.s>0))break;GA(c,k*.8*h.s);c.lineWidth=B.u*.004*k+.5;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);HERO(c,B,h,z);if(B.pz){RS(c);B.cl()}};",da="const PARTS=(c,B,sd,n,x,y,w,h,col,sz,a)=>{const R=M.rand(sd);SV(c);FS(c,col);for(let i=0;i<n;i++){const f=(R()+B.t*(.1+R()*.2))%1;GA(c,a*B.e*SN(f*PI));DOT(c,x+R()*w+SN(B.t*1.4+i)*B.u*.012,y+h*(1-f),B.u*sz*(.4+R()*.8))}RS(c)};",eo="const STARS=(c,B,n,m)=>{const r=M.rand(9);SV(c);FS(c,B.K.cr);for(let i=0;i<n;i++){GA(c,B.e*(.25+.75*ABS(SN(B.t*1.7+i*2.3))));DOT(c,r()*B.W,r()*m,B.u*(.001+.003*r()))}RS(c)};const PLANET=(c,B,x,top,R,col)=>{const y=top+R,K=B.K;FS(c,G(c.createRadialGradient(x,y,R*.96,x,y,R*1.1),[[0,RA(K.ac,.6)],[1,RA(K.ac,0)]]));DOT(c,x,y,R*1.1);FS(c,G(c.createLinearGradient(0,top,0,top+B.u*.5),[[0,MX(col,K.ac,.3)],[.25,col]]));DOT(c,x,y,R);c.strokeStyle=RA(MX(K.ac,CR,.4),.8);c.lineWidth=B.u*.004;BP(c);c.arc(x,y,R,PI*1.1,PI*1.9);c.stroke()};",Pe="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B",fr=[me("story-phone-message","Tin nhắn điện thoại",3.2,{bg:"#1b1b1d",next:"#0d0d0f",fg:"#ff3b5c",hero:"bubble",heroIn:"b",heroOut:"r",msg:"mình vẫn là bạn chứ?",text:""},`function render(c,t,env){
6420
+ }`)],Yn=V.find(t=>t.id==="story"),Se=(t,e,c,a,o)=>({id:t,name:e,category:Yn.name,pack:"story",duration:c,params:{accent:Yn.accent,position:"center",...a,style:"story"},code:o}),Re="const CO='#ff3b5c',CR='#efe9d6',CH='#1b1b1d',BK='#0d0d0f',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),RC=(c,...a)=>c.fillRect(...a),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},MIN=Math.min,ABS=Math.abs,HY=Math.hypot;const LUM=x=>{const h=M.hex(x);return h[0]*.3+h[1]*.59+h[2]*.11},FR=(a,b)=>{const n=SN(a*12.99+b*78.23)*43758.5;return n-Math.floor(n)},PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d;const DOT=(c,x,y,r)=>{BP(c);c.arc(x,y,MAX(0,r),0,TAU);c.fill()},PL=(c,...p)=>{BP(c);for(let i=0;i<p.length;i+=2)c.lineTo(p[i],p[i+1]);c.fill()},RF=(c,x,y,w,h,r)=>{M.rr(c,x,y,w,h,r);c.fill()},G=(g,s)=>{s.forEach(o=>g.addColorStop(o[0],o[1]));return g};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,CH),nx=PC(p.next,CO),lt=LUM(bg)>170,ac=PC(p.fg,PC(p.accent,CO)),hi=ED(p.heroIn,'l'),ho=ED(p.heroOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[k=='l'?W*f:k=='r'?-W*f:0,k=='t'?H*f:k=='b'?-H*f:0],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]);const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,hk:p.hero,K:{bg,nx,ac,fg:ABS(LUM(ac)-LUM(bg))<40?(lt?CH:CR):ac,cr:lt?CH:CR,dk:lt?CH:LUM(bg)<60?'#060607':BK},e:pi?1:E.outCubic(RG(t,0,.4)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02;const GLOW=(c,x,y,r,col,a)=>{if(a>0&&r>0){FS(c,G(c.createRadialGradient(x,y,0,x,y,r),[[0,RA(col,MIN(1,a))],[1,RA(col,0)]]));RC(c,x-r,y-r,r*2,r*2)}};const BGL=(c,B,s,x)=>{SV(c);GA(c,B.e);FS(c,G(x?c.createRadialGradient(x[0],x[1],0,x[0],x[1],x[2]):c.createLinearGradient(0,0,0,B.H),s));RC(c,0,0,B.W,B.H);FS(c,G(c.createRadialGradient(B.cx,B.cy,B.u*.35,B.cx,B.cy,HY(B.W,B.H)*.62),[[0,RA(BK,0)],[1,RA(BK,.45)]]));RC(c,0,0,B.W,B.H);RS(c)};const CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GLOW(c,x,y,R*1.3+B.u*.06,B.K.ac,.55*(1-k));FS(c,B.K.nx);DOT(c,x,y,R)}};const END=(c,B)=>{const {W,H,u,t,q}=B,a=B.e*(1-q);if(a>0){let s=String(B.p.text||'').trim();const k=a*(1-RG(q,0,.35)),r=M.rand(Math.floor(t*24)*7+3);SV(c);GA(c,a);for(let i=0;i<W*H/1600;i++){FS(c,i%2?RA(CR,.06):RA(BK,.1));RC(c,r()*W,r()*H,1.5,1.5)}if(s&&k>0){s=s[0].toUpperCase()+s.slice(1).toLowerCase();const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.042,S.w*.8,2),n=f.lines.length,h=n*f.lh+f.size;GA(c,k*.4);FS(c,BK);c.shadowColor=BK;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,k);c.font=f.font;c.textAlign='center';c.textBaseline='middle';FS(c,CR);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh))}RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,H)}if(B.pz)RS(c)};const EP=(B,k)=>{const o=B.u*.16;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},TT=B=>{const m=MAX(.3,B.D-.75);return[.3+m*.34,B.D-.45-m*.3]};const HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HP=(B,tt,sx,sy,hd)=>{const O=B.of(tt),I=B.pi&&HO(B,{l:'r',r:'l',t:'b',b:'t'}[B.hi]),A=I?[I[0]-O[0],I[1]-O[1]]:EP(B,B.hi),Z=B.po?(a=>[a[0]-O[0],a[1]-O[1]])(HO(B,B.ho)):EP(B,B.ho),T=TT(B),X=B.po?B.D-PN:B.D-.45;let x=sx+SN(tt*1.3)*B.u*.02,y=sy+SN(tt*2.4)*B.u*.014,s=1,k=0;if(tt<T[0]){k=E.outCubic(RG(tt,B.pi?PN:.3,T[0]));x=L(A[0],x,k);y=L(A[1],y,k);if(B.hi=='c')s=k}else if(tt>T[1]){k=(B.po?E.inOutCubic:E.inCubic)(RG(tt,T[1],X));x=L(x,Z[0],k);y=L(y,Z[1],k);if(B.ho=='c')s=1-k}y-=SN(k*PI)*B.u*.07;if(hd)s*=MIN(1,1-RG(tt,T[0]-.2,T[0])+RG(tt,T[1],T[1]+.2));return{x,y,s:tt<.3&&!B.pi?0:MAX(0,s)}};const HEART=(c,x,y,s)=>{BP(c);c.moveTo(x,y+s*.9);c.bezierCurveTo(x-s*1.25,y+s*.05,x-s*.95,y-s*.95,x,y-s*.42);c.bezierCurveTo(x+s*.95,y-s*.95,x+s*1.25,y+s*.05,x,y+s*.9)};const HERO=(c,B,h,z,kd)=>{const s=z*h.s,K=B.K,k=kd||B.hk,t=B.t,a=h.a||0;if(!(s>.5))return;SV(c);c.translate(h.x,h.y);FS(c,K.cr);if(k=='heart'){c.rotate(SN(t*3)*.12);GLOW(c,0,0,s*2,K.ac,.4);FS(c,K.ac);HEART(c,0,0,s*.8);c.fill();c.strokeStyle=CR;c.lineWidth=s*.13;c.stroke()}else if(k=='ball'){c.rotate(t*2);DOT(c,0,0,s*.75);FS(c,MX(K.cr,BK,.2));PL(c,0,0,s*.75,0,s*.25,s*.7);PL(c,0,0,-s*.45,-s*.6,-s*.74,0);FS(c,MX(K.cr,BK,.1));PL(c,0,0,-s*.3,s*.7,-s*.72,s*.2)}else if(k=='bubble'){c.rotate(SN(t*2)*.08);RF(c,-s,-s*.62,s*2,s*1.15,s*.45);PL(c,-s*.5,s*.4,-s*.85,s*.85,0,s*.48);FS(c,K.fg);for(let i=-1;i<2;i++)DOT(c,i*s*.42,-s*.05,s*.12)}else if(k=='star'){c.rotate(t*1.5);GLOW(c,0,0,s*2.2,K.fg,.45);FS(c,K.cr);BP(c);for(let i=0;i<8;i++){const r=i%2?s*.32:s;c.lineTo(CS(i*PI/4)*r,SN(i*PI/4)*r)}c.fill()}else{c.rotate(a);if(CS(a)<0)c.scale(1,-1);FS(c,MX(K.cr,CH,.32));PL(c,s,0,-s*.45,0,-s*.66,s*.48);FS(c,K.cr);PL(c,s,0,-s*.85,-s*.62,-s*.45,0)}RS(c)};const FLY=(c,B,F,z)=>{const t=B.t,h=F(t),a=F(t-.04),b=F(t+.04),A=EP(B,B.hi),Z=EP(B,B.ho);if(!(h.s>0))return;if(B.pz){RS(c);SV(c);const o=B.of(t);c.translate(o[0],o[1])}h.a=Math.atan2(b.y-a.y+(Z[1]-A[1])*.004,b.x-a.x+(Z[0]-A[0])*.004+.001);SV(c);c.strokeStyle=B.K.fg;c.lineCap='round';for(let i=1;i<14;i++){const p=F(t-i*.03),o=F(t-i*.03+.03),k=1-i/14;if(!(p.s>0))break;GA(c,k*.8*h.s);c.lineWidth=B.u*.004*k+.5;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);HERO(c,B,h,z);if(B.pz){RS(c);B.cl()}};",da="const PARTS=(c,B,sd,n,x,y,w,h,col,sz,a)=>{const R=M.rand(sd);SV(c);FS(c,col);for(let i=0;i<n;i++){const f=(R()+B.t*(.1+R()*.2))%1;GA(c,a*B.e*SN(f*PI));DOT(c,x+R()*w+SN(B.t*1.4+i)*B.u*.012,y+h*(1-f),B.u*sz*(.4+R()*.8))}RS(c)};",eo="const STARS=(c,B,n,m)=>{const r=M.rand(9);SV(c);FS(c,B.K.cr);for(let i=0;i<n;i++){GA(c,B.e*(.25+.75*ABS(SN(B.t*1.7+i*2.3))));DOT(c,r()*B.W,r()*m,B.u*(.001+.003*r()))}RS(c)};const PLANET=(c,B,x,top,R,col)=>{const y=top+R,K=B.K;FS(c,G(c.createRadialGradient(x,y,R*.96,x,y,R*1.1),[[0,RA(K.ac,.6)],[1,RA(K.ac,0)]]));DOT(c,x,y,R*1.1);FS(c,G(c.createLinearGradient(0,top,0,top+B.u*.5),[[0,MX(col,K.ac,.3)],[.25,col]]));DOT(c,x,y,R);c.strokeStyle=RA(MX(K.ac,CR,.4),.8);c.lineWidth=B.u*.004;BP(c);c.arc(x,y,R,PI*1.1,PI*1.9);c.stroke()};",Pe="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B",fr=[Se("story-phone-message","Tin nhắn điện thoại",3.2,{bg:"#1b1b1d",next:"#0d0d0f",fg:"#ff3b5c",hero:"bubble",heroIn:"b",heroOut:"r",msg:"mình vẫn là bạn chứ?",text:""},`function render(c,t,env){
6421
6421
  ${Re}
6422
6422
  // Phone message: a hand holds a phone, typing dots then a chat bubble (msg) pops on screen as the hero flies in; it leaves as the hero and the screen zooms to next (fields: msg, text, bg, next, fg, hero, heroIn, heroOut).
6423
6423
  ${Pe},T=TT(B),ph=MIN(H*.58,u*.84),pw=ph*.5,py=cy+(1-E.outCubic(RG(t,0,.55)))*H*.75+u*.03,zm=1+.05*t/D,sx=-pw*.44,sy=-ph*.46,sw=pw*.88,sh=ph*.92,by=sy+sh*.42
@@ -6438,7 +6438,7 @@
6438
6438
  FLY(c,B,tt=>HP(B,tt,cx,py+by*zm,1),u*.055)
6439
6439
  if(q>0){GLOW(c,cx,cy,u*.9,K.ac,.6*(1-q));FS(c,K.nx);RF(c,L(cx+sx*zm,-4,q),L(py+sy*zm,-4,q),L(sw*zm,W+8,q),L(sh*zm,H+8,q),L(pw*.1,0,q))}
6440
6440
  END(c,B)
6441
- }`),me("story-city-flythrough","Bay xuyên thành phố",3.2,{bg:"#0d0d0f",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6441
+ }`),Se("story-city-flythrough","Bay xuyên thành phố",3.2,{bg:"#0d0d0f",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6442
6442
  ${Re}${da}
6443
6443
  // City flythrough: the camera flies down a dark skyscraper canyon toward a coral street light, lit buildings rush past in parallax, the hero plane leads, then the light floods to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6444
6444
  ${Pe},vy=H*(B.port?.42:.45),zc=t*1.6,f0=u*.55,sky=MX(K.bg,K.ac,.62)
@@ -6454,7 +6454,7 @@
6454
6454
  FLY(c,B,tt=>HP(B,tt,cx+u*.05,vy+u*.17),u*.06)
6455
6455
  CC(c,B,cx,vy,q,u*.06)
6456
6456
  END(c,B)
6457
- }`),me("story-tower-dissolve","Tháp tan thành bụi",3.4,{bg:"#ff3b5c",next:"#efe9d6",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"t",text:""},`function render(c,t,env){
6457
+ }`),Se("story-tower-dissolve","Tháp tan thành bụi",3.4,{bg:"#ff3b5c",next:"#efe9d6",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"t",text:""},`function render(c,t,env){
6458
6458
  ${Re}${da}
6459
6459
  // Tower dissolve: coral sky, big pale sun behind a black spire tower that disintegrates from the tip into rising particles as the hero passes, then the sun grows to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6460
6460
  ${Pe},gy=H*(B.port?.8:.84),sy=H*(B.port?.4:.42)-u*.05*t/D,sr=u*(B.port?.3:.25),th=gy-H*(B.port?.15:.1),tx=cx+u*.06,ty=gy+(1-E.outCubic(RG(t,0,.55)))*u*.5
@@ -6471,7 +6471,7 @@
6471
6471
  FLY(c,B,tt=>HP(B,tt,cx-sr*1.05,sy-sr*.7),u*.055)
6472
6472
  CC(c,B,cx,sy,q,sr)
6473
6473
  END(c,B)
6474
- }`),me("story-satellite-orbit","Vệ tinh quỹ đạo",3.4,{bg:"#0d0d0f",next:"#1b1b1d",fg:"#ff3b5c",hero:"plane",heroIn:"b",heroOut:"r",text:""},`function render(c,t,env){
6474
+ }`),Se("story-satellite-orbit","Vệ tinh quỹ đạo",3.4,{bg:"#0d0d0f",next:"#1b1b1d",fg:"#ff3b5c",hero:"plane",heroIn:"b",heroOut:"r",text:""},`function render(c,t,env){
6475
6475
  ${Re}${eo}
6476
6476
  // Satellite orbit: over a planet curve with a coral rim, a satellite with solar panels and a tiny heart turns in a coral ring that draws itself, the hero passes, the ring fills to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6477
6477
  ${Pe},sy=H*(B.port?.42:.44),rr=u*.27,sp=E.outBack(RG(t,.05,.6)),dr=E.inOutCubic(RG(t,.25,D-.5)),bw=u*.075,pw=u*.13,pd=u*.055,ox=bw*.5+pw*.15,a0=-PI/2+t*.3,ae=a0+TAU*dr
@@ -6489,7 +6489,7 @@
6489
6489
  FLY(c,B,tt=>HP(B,tt,cx+u*.2,sy+rr*.9),u*.055)
6490
6490
  CC(c,B,cx,sy,q,rr)
6491
6491
  END(c,B)
6492
- }`),me("story-warp-tunnel","Đường hầm ánh sáng",2.6,{bg:"#1b1b1d",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"c",text:""},`function render(c,t,env){
6492
+ }`),Se("story-warp-tunnel","Đường hầm ánh sáng",2.6,{bg:"#1b1b1d",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"c",text:""},`function render(c,t,env){
6493
6493
  ${Re}${da}
6494
6494
  // Warp tunnel: coral light streaks rush out of a glowing centre and accelerate, the hero flies in, then the streaks thicken and merge into next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6495
6495
  ${Pe},bo=E.inCubic(RG(t,.2,D)),R=M.rand(21),rm=HY(W,H)*.6
@@ -6502,7 +6502,7 @@
6502
6502
  FLY(c,B,tt=>HP(B,tt,cx-u*.04,cy+u*.12),u*.06)
6503
6503
  CC(c,B,cx,cy,q,u*.06)
6504
6504
  END(c,B)
6505
- }`),me("story-light-column","Cột sáng giữa đêm",3.2,{bg:"#0d0d0f",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"c",heroOut:"r",text:""},`function render(c,t,env){
6505
+ }`),Se("story-light-column","Cột sáng giữa đêm",3.2,{bg:"#0d0d0f",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"c",heroOut:"r",text:""},`function render(c,t,env){
6506
6506
  ${Re}${da}
6507
6507
  // Light column: a coral beam switches on over a lone astronaut / robot silhouette, small paper planes circle it, dust rises, the hero passes, then the column widens to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6508
6508
  ${Pe},fy=H*(B.port?.74:.8),bw=u*(B.port?.32:.26),on=E.outCubic(RG(t,0,.5)),h=u*(B.port?.42:.36),bc=MX(K.ac,CR,K.ac==K.bg?.5:.2)
@@ -6522,7 +6522,7 @@
6522
6522
  FLY(c,B,tt=>HP(B,tt,cx+u*.26,fy-h*1.15),u*.055)
6523
6523
  if(q>0){const w=L(bw*.3,W*1.04,q);GLOW(c,cx,cy,MAX(W,H),K.ac,.4*(1-q));FS(c,K.nx);RC(c,cx-w/2,0,w,H)}
6524
6524
  END(c,B)
6525
- }`),me("story-pillar-pass","Luồn qua hàng cột",2.8,{bg:"#ff3b5c",next:"#0d0d0f",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6525
+ }`),Se("story-pillar-pass","Luồn qua hàng cột",2.8,{bg:"#ff3b5c",next:"#0d0d0f",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6526
6526
  ${Re}
6527
6527
  // Pillar pass: a coral field with black pillars on two parallax layers sliding past, small planes thread the gaps with the hero, then the pillars widen and merge into next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6528
6528
  ${Pe},dir=B.ho=='l'?-1:1,sl=E.outCubic(RG(t,0,.6))
@@ -6535,7 +6535,7 @@
6535
6535
  lay(u*.34,.9,u*.12,K.dk,3,1)
6536
6536
  FLY(c,B,tt=>HP(B,tt,cx,cy-u*.04),u*.06)
6537
6537
  END(c,B)
6538
- }`),me("story-hill-houses","Đồi và những mái nhà",3.2,{bg:"#1b1b1d",next:"#0d0d0f",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6538
+ }`),Se("story-hill-houses","Đồi và những mái nhà",3.2,{bg:"#1b1b1d",next:"#0d0d0f",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6539
6539
  ${Re}${eo}
6540
6540
  // Hill houses: rolling dark hills in parallax under a coral horizon and a pale moon, small cream houses with lit windows, the hero flies over, then the near hill rises to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6541
6541
  ${Pe},dir=B.ho=='l'?-1:1,hz=H*(B.port?.58:.56)
@@ -6550,7 +6550,7 @@
6550
6550
  FLY(c,B,tt=>HP(B,tt,cx,hz-u*.12),u*.055)
6551
6551
  hill(2,L(hz+H*.24,-u*.4,q),u*.07,.4,MX(K.dk,K.nx,q),u*.036,e*(1-q))
6552
6552
  END(c,B)
6553
- }`),me("story-paper-crumple","Vò giấy mở tim",3.6,{bg:"#0d0d0f",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6553
+ }`),Se("story-paper-crumple","Vò giấy mở tim",3.6,{bg:"#0d0d0f",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6554
6554
  ${Re}${eo}
6555
6555
  // Paper crumple: the hero becomes a cream sheet over a planet horizon, crumples into a faceted paper ball, then unfolds into flying facets revealing a beating coral heart that grows to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6556
6556
  ${Pe},T=TT(B),ap=E.outBack(RG(t,T[0]-.25,T[0]+.15)),k=E.inOutCubic(RG(t,D*.36,D*.55)),uf=E.outCubic(RG(t,D*.6,D*.6+.6)),hs=u*.15,n=16,hp=E.outBack(RG(t,D*.6,D*.6+.45)),A=[]
@@ -6567,7 +6567,7 @@
6567
6567
  FLY(c,B,tt=>HP(B,tt,cx,cy,1),u*.055)
6568
6568
  if(q>0){FS(c,K.nx);HEART(c,cx,cy,L(u*.1,RM(B,cx,cy)*2.4,q));c.fill()}
6569
6569
  END(c,B)
6570
- }`),me("story-face-reaction","Gương mặt cảm xúc",3,{bg:"#ff3b5c",next:"#1b1b1d",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"t",text:""},`function render(c,t,env){
6570
+ }`),Se("story-face-reaction","Gương mặt cảm xúc",3,{bg:"#ff3b5c",next:"#1b1b1d",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"t",text:""},`function render(c,t,env){
6571
6571
  ${Re}
6572
6572
  // Face reaction: a coral frame pops in with a cartoon face — blinking round eyes, sad brows, wobbly mouth, a rolling tear — holding a glowing phone; the frame zooms to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6573
6573
  ${Pe},fw=u*(B.port?.72:.56),fh=fw*(B.port?1.2:1),zm=MAX(0,E.outBack(RG(t,0,.55)))*(1+.04*t/D),r=fw*.26,hy=-fh*.08,bl=1-.9*MAX(0,1-ABS(t-D*.42)/.09),lx=SN(t*.8)*r*.05,ly=r*.05*E.inOutCubic(RG(t,.4,1)),tf=RG(t,D*.3,D*.78),ts=r*.075*MIN(1,tf*4),ty=hy+r*.15+E.inQuad(tf)*r*.62
@@ -6585,7 +6585,7 @@
6585
6585
  FLY(c,B,tt=>HP(B,tt,cx+fw*.32,cy-fh*.5-u*.08),u*.055)
6586
6586
  if(q>0){FS(c,K.nx);RF(c,L(cx-fw*zm/2,-4,q),L(cy-fh*zm/2,-4,q),L(fw*zm,W+8,q),L(fh*zm,H+8,q),L(fw*.06,0,q))}
6587
6587
  END(c,B)
6588
- }`),me("story-spotlight-v","Đèn sân khấu chữ V",2.8,{bg:"#0d0d0f",next:"#efe9d6",fg:"#ff3b5c",hero:"plane",heroIn:"t",heroOut:"r",text:""},`function render(c,t,env){
6588
+ }`),Se("story-spotlight-v","Đèn sân khấu chữ V",2.8,{bg:"#0d0d0f",next:"#efe9d6",fg:"#ff3b5c",hero:"plane",heroIn:"t",heroOut:"r",text:""},`function render(c,t,env){
6589
6589
  ${Re}${da}
6590
6590
  // V spotlight: two corner stage lights swing their beams into a V meeting on a floor spot, dust in the light, the hero hovers in the spotlight, then the spot floods to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6591
6591
  ${Pe},fy=H*(B.port?.7:.76),sw=E.outBack(RG(t,.05,.8)),rx=u*.17,bc=MX(K.ac,CR,K.ac==K.bg?.5:.25),F=tt=>HP(B,tt,cx,fy-u*.2),h=F(t)
@@ -6601,7 +6601,7 @@
6601
6601
  FLY(c,B,F,u*.07)
6602
6602
  CC(c,B,cx,fy,q,rx*.6)
6603
6603
  END(c,B)
6604
- }`),me("story-planet-horizon","Chân trời hành tinh",3,{bg:"#0d0d0f",next:"#1b1b1d",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6604
+ }`),Se("story-planet-horizon","Chân trời hành tinh",3,{bg:"#0d0d0f",next:"#1b1b1d",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6605
6605
  ${Re}${eo}
6606
6606
  // Planet horizon: the camera tilts down as a huge dark planet rises with a coral sunrise behind its rim, stars and a crescent moon, the hero flies over, the planet rises to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6607
6607
  ${Pe},R=MAX(W,H)*1.15,S=Math.sqrt(R*R-W*W/4)*.97,top0=L(H*1.02,H*(B.port?.66:.62),E.outCubic(RG(t,0,1.4)))-u*.04*t/D,mx=W*.24,my=H*.2,mr=u*.035
@@ -6612,7 +6612,7 @@
6612
6612
  PLANET(c,B,cx,L(top0,S-R,q),R,MX(K.dk,K.nx,q))
6613
6613
  FLY(c,B,tt=>HP(B,tt,cx+u*.06,top0-u*.15),u*.055)
6614
6614
  END(c,B)
6615
- }`),me("story-heart-burst","Trái tim bùng nở",2.6,{bg:"#1b1b1d",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6615
+ }`),Se("story-heart-burst","Trái tim bùng nở",2.6,{bg:"#1b1b1d",next:"#ff3b5c",fg:"#ff3b5c",hero:"plane",heroIn:"l",heroOut:"r",text:""},`function render(c,t,env){
6616
6616
  ${Re}${da}
6617
6617
  // Heart burst: a coral heart pops and beats, rays turn behind it, shock rings and small hearts burst outward, the hero passes, then the heart grows to next (fields: text, bg, next, fg, hero, heroIn, heroOut).
6618
6618
  ${Pe},hp=MAX(0,E.outBack(RG(t,.08,.6))),bt=t>.6?Math.exp(-(((t-.6)*1.6)%1)*5):0,s=u*.12*hp*(1+.08*bt),hy=cy-u*.02,rm=HY(W,H)
@@ -6625,7 +6625,7 @@
6625
6625
  FLY(c,B,tt=>HP(B,tt,cx+u*.24,hy-u*.24),u*.055)
6626
6626
  if(q>0){FS(c,K.nx);HEART(c,cx,hy,L(s,RM(B,cx,hy)*2.4,q));c.fill()}
6627
6627
  END(c,B)
6628
- }`),me("story-caption","Chữ kể chuyện",3,{text:"Are we still friends?",fg:"#ff3b5c",position:"lower"},`function render(ctx,t,env){
6628
+ }`),Se("story-caption","Chữ kể chuyện",3,{text:"Are we still friends?",fg:"#ff3b5c",position:"lower"},`function render(ctx,t,env){
6629
6629
  // Overlay caption: a short line (text) in cream sentence case rises in word by word over any scene with a soft shadow while a coral underline draws beneath it; transparent elsewhere, no fill (fields: text, fg, position).
6630
6630
  const c=ctx,{duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.35),u=S.u,fg=/^#[0-9a-f]{6}$/i.test(String(p.fg))?p.fg:'#ff3b5c',E=M.ease.outCubic
6631
6631
  let s=String(p.text||'').trim();if(!s||!(k.v>0))return;s=s[0].toUpperCase()+s.slice(1).toLowerCase()
@@ -6634,8 +6634,8 @@
6634
6634
  let wi=0,mw=0;f.lines.forEach((l,i)=>{const lw=c.measureText(l).width;mw=Math.max(mw,lw);let x=S.cx-lw/2;l.split(' ').forEach(w=>{const a=E(M.range(t,.05+wi*.07,.4+wi*.07));wi++;c.globalAlpha=a*out;c.fillText(w,x,y0+i*f.lh+(1-a)*f.size*.35);x+=c.measureText(w+' ').width})})
6635
6635
  const dr=M.ease.outExpo(M.range(t,.3,1.1)),ly=y0+(n-1)*f.lh+f.size*.78;c.shadowBlur=0;c.shadowOffsetY=0;c.globalAlpha=out;c.strokeStyle=fg;c.lineCap='round';c.lineWidth=Math.max(2,f.size*.07);if(dr>0){c.beginPath();c.moveTo(S.cx-mw/2,ly);c.lineTo(S.cx-mw/2+mw*dr,ly);c.stroke()}
6636
6636
  c.restore()
6637
- }`)],_n=V.find(t=>t.id==="lumen"),ne=(t,e,c,a,o)=>({id:t,name:e,category:_n.name,pack:"lumen",duration:c,params:{accent:_n.accent,position:"center",...a,style:"lumen"},code:o}),se="const NV='#05041a',PK='#ff4fa3',AM='#ffb648',VI='#7a4dff',LV='#c49bff',YL='#fff09a',RD='#ff3a5c',IR=[AM,PK,VI,'#2a1680'],VS=[LV,'#9a7bff',VI,'#1d0f5c'];const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,NV),nx:PC(p.next,NV),fg:PC(p.fg,VI),f2:PC(p.fg2,PK)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.44,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;GL(c,x,y,r*6,col,a);c.save();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.6);c.shadowColor=col;c.shadowBlur=r*3;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const SPH=(c,x,y,r,ry=1,cs=IR,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.beginPath();c.moveTo(x-r,y);c.arc(x,y,r,Math.PI,0);c.ellipse(x,y,r,Math.max(.01,r*ry),0,0,Math.PI);c.closePath();const b=c.createLinearGradient(0,y-r,0,y+r*ry);b.addColorStop(0,cs[0]);b.addColorStop(.38,cs[1]);b.addColorStop(.66,cs[2]);b.addColorStop(1,cs[3]);c.fillStyle=b;c.shadowColor=cs[1];c.shadowBlur=r*.6;c.fill();c.shadowBlur=0;const s=c.createRadialGradient(x-r*.3,y-r*.55,0,x-r*.3,y-r*.55,r);s.addColorStop(0,'rgba(255,255,255,.85)');s.addColorStop(.28,'rgba(255,236,246,.24)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.strokeStyle='rgba(236,220,255,.55)';c.lineWidth=Math.max(1,r*.035);c.stroke();c.restore()};const CC=(c,B,x,y,k,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k,cl=col||B.K.fg;GL(c,x,y,R+B.u*.3,cl,1-k);const g=c.createRadialGradient(x,y,R*.55,x,y,R+1);g.addColorStop(0,B.K.nx);g.addColorStop(.8,B.K.nx);g.addColorStop(1,M.mix(B.K.nx,cl,.6*(1-k)));c.fillStyle=g;c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();NEON(c,cl,B.u*.006,()=>{c.beginPath();c.arc(x,y,R,0,M.TAU)},0,1-M.range(k,.6,.95))};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const FL=(t,ts,cs)=>{let i=0;ts.forEach(a=>{if(t>=a)i++});return cs[Math.min(i,cs.length-1)]};const POLY=(c,x,y,r,n,rot)=>{c.beginPath();for(let i=0;i<n;i++){const a=rot+i*M.TAU/n;c[i?'lineTo':'moveTo'](x+Math.cos(a)*r,y+Math.sin(a)*r)}c.closePath()};const MOTE=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,s=R(),y=((R()*B.H-t*B.u*(.03+.06*s))%B.H+B.H)%B.H;DOT(c,x,y,B.u*(.0016+.002*s),[PK,LV,AM][i%3],a*(.35+.5*M.noise(i,t*1.5)))}};",Qn="const DRING=(c,x,y,R,n,d,h,a=1,rot=0)=>{if(!(R>0)||!(a>0))return;c.save();c.globalCompositeOperation='lighter';c.globalAlpha=.16*Math.min(1,a);c.strokeStyle=M.mix(AM,VI,h);c.lineWidth=d*7;c.beginPath();c.arc(x,y,R,0,M.TAU);c.stroke();for(let i=0;i<n;i++){const an=rot+i*M.TAU/n,f=(Math.cos(an-rot*.4)+1)/2,col=M.mix(M.mix('#ffc83a',RD,f),f>.5?VI:'#5b6cff',h),px=x+Math.cos(an)*R,py=y+Math.sin(an)*R;c.globalAlpha=.45*Math.min(1,a);c.fillStyle=col;c.beginPath();c.arc(px,py,d*2.4,0,M.TAU);c.fill();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.2);c.beginPath();c.arc(px,py,d*1.15,0,M.TAU);c.fill()}c.restore()};",Ro="const CRT=(c,x,y,s,t,a=1,g=1)=>{if(!(s>0)||!(a>0))return;GL(c,x,y-s*.35,s*3.4,PK,.6*a);for(let i=0;i<7;i++){const f=i/6-.5,x0=x+f*s*1.45,L=s*(1.35+.7*M.noise(i*1.7,.3))*g,ph=t*2.2+i*.9,col=i%2?LV:PK;if(!(L>1))continue;const gr=c.createLinearGradient(0,y,0,y+L);gr.addColorStop(0,M.rgba(col,1));gr.addColorStop(1,M.rgba(VI,0));NEON(c,col,s*.028,()=>{c.beginPath();c.moveTo(x0,y);for(let j=1;j<=8;j++){const k=j/8;c.lineTo(x0+Math.sin(ph-k*2.6)*s*.16*k+f*s*.35*k,y+L*k)}},gr,a*.95)}const sw=Math.sin(t*1.7)*s*.22,Q=[[x+s*.82,y-s*.18],[x+s*1.75,y+s*.45],[x+s*1.25,y-s*1.1],[x+s*2.25,y-s*.75+sw]],pt=k=>{const m=1-k;return[0,1].map(d=>m*m*m*Q[0][d]+3*m*m*k*Q[1][d]+3*m*k*k*Q[2][d]+k*k*k*Q[3][d])},gt=M.clamp(g*1.1-.1);if(gt>0){NEON(c,RD,s*.045,()=>{c.beginPath();for(let i=0;i<=24;i++){const p=pt(i/24*gt);c[i?'lineTo':'moveTo'](p[0],p[1])}},0,a);const p=pt(gt);DOT(c,p[0],p[1],s*.075,AM,a)}SPH(c,x,y,s*(1+.03*Math.sin(t*3.1)),.26+.03*Math.sin(t*3.1+1),IR,a);GL(c,x,y-s*.45,s*1.2,AM,.45*a);DOT(c,x,y-s*1.28-Math.abs(Math.sin(t*2.4))*s*.16,s*.06,YL,a*Math.min(1,g*2))};",Zn="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",_e="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.44",pr=[ne("lumen-dot-ring","Vòng chấm neon",2.6,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6638
- ${se}${Qn}
6637
+ }`)],_n=V.find(t=>t.id==="lumen"),ie=(t,e,c,a,o)=>({id:t,name:e,category:_n.name,pack:"lumen",duration:c,params:{accent:_n.accent,position:"center",...a,style:"lumen"},code:o}),le="const NV='#05041a',PK='#ff4fa3',AM='#ffb648',VI='#7a4dff',LV='#c49bff',YL='#fff09a',RD='#ff3a5c',IR=[AM,PK,VI,'#2a1680'],VS=[LV,'#9a7bff',VI,'#1d0f5c'];const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,NV),nx:PC(p.next,NV),fg:PC(p.fg,VI),f2:PC(p.fg2,PK)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.44,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const DOT=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;GL(c,x,y,r*6,col,a);c.save();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.6);c.shadowColor=col;c.shadowBlur=r*3;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const SPH=(c,x,y,r,ry=1,cs=IR,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.beginPath();c.moveTo(x-r,y);c.arc(x,y,r,Math.PI,0);c.ellipse(x,y,r,Math.max(.01,r*ry),0,0,Math.PI);c.closePath();const b=c.createLinearGradient(0,y-r,0,y+r*ry);b.addColorStop(0,cs[0]);b.addColorStop(.38,cs[1]);b.addColorStop(.66,cs[2]);b.addColorStop(1,cs[3]);c.fillStyle=b;c.shadowColor=cs[1];c.shadowBlur=r*.6;c.fill();c.shadowBlur=0;const s=c.createRadialGradient(x-r*.3,y-r*.55,0,x-r*.3,y-r*.55,r);s.addColorStop(0,'rgba(255,255,255,.85)');s.addColorStop(.28,'rgba(255,236,246,.24)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.strokeStyle='rgba(236,220,255,.55)';c.lineWidth=Math.max(1,r*.035);c.stroke();c.restore()};const CC=(c,B,x,y,k,r0=0,col)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k,cl=col||B.K.fg;GL(c,x,y,R+B.u*.3,cl,1-k);const g=c.createRadialGradient(x,y,R*.55,x,y,R+1);g.addColorStop(0,B.K.nx);g.addColorStop(.8,B.K.nx);g.addColorStop(1,M.mix(B.K.nx,cl,.6*(1-k)));c.fillStyle=g;c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();NEON(c,cl,B.u*.006,()=>{c.beginPath();c.arc(x,y,R,0,M.TAU)},0,1-M.range(k,.6,.95))};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const FL=(t,ts,cs)=>{let i=0;ts.forEach(a=>{if(t>=a)i++});return cs[Math.min(i,cs.length-1)]};const POLY=(c,x,y,r,n,rot)=>{c.beginPath();for(let i=0;i<n;i++){const a=rot+i*M.TAU/n;c[i?'lineTo':'moveTo'](x+Math.cos(a)*r,y+Math.sin(a)*r)}c.closePath()};const MOTE=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,s=R(),y=((R()*B.H-t*B.u*(.03+.06*s))%B.H+B.H)%B.H;DOT(c,x,y,B.u*(.0016+.002*s),[PK,LV,AM][i%3],a*(.35+.5*M.noise(i,t*1.5)))}};",Qn="const DRING=(c,x,y,R,n,d,h,a=1,rot=0)=>{if(!(R>0)||!(a>0))return;c.save();c.globalCompositeOperation='lighter';c.globalAlpha=.16*Math.min(1,a);c.strokeStyle=M.mix(AM,VI,h);c.lineWidth=d*7;c.beginPath();c.arc(x,y,R,0,M.TAU);c.stroke();for(let i=0;i<n;i++){const an=rot+i*M.TAU/n,f=(Math.cos(an-rot*.4)+1)/2,col=M.mix(M.mix('#ffc83a',RD,f),f>.5?VI:'#5b6cff',h),px=x+Math.cos(an)*R,py=y+Math.sin(an)*R;c.globalAlpha=.45*Math.min(1,a);c.fillStyle=col;c.beginPath();c.arc(px,py,d*2.4,0,M.TAU);c.fill();c.globalAlpha=Math.min(1,a);c.fillStyle=M.mix(col,'#ffffff',.2);c.beginPath();c.arc(px,py,d*1.15,0,M.TAU);c.fill()}c.restore()};",Ro="const CRT=(c,x,y,s,t,a=1,g=1)=>{if(!(s>0)||!(a>0))return;GL(c,x,y-s*.35,s*3.4,PK,.6*a);for(let i=0;i<7;i++){const f=i/6-.5,x0=x+f*s*1.45,L=s*(1.35+.7*M.noise(i*1.7,.3))*g,ph=t*2.2+i*.9,col=i%2?LV:PK;if(!(L>1))continue;const gr=c.createLinearGradient(0,y,0,y+L);gr.addColorStop(0,M.rgba(col,1));gr.addColorStop(1,M.rgba(VI,0));NEON(c,col,s*.028,()=>{c.beginPath();c.moveTo(x0,y);for(let j=1;j<=8;j++){const k=j/8;c.lineTo(x0+Math.sin(ph-k*2.6)*s*.16*k+f*s*.35*k,y+L*k)}},gr,a*.95)}const sw=Math.sin(t*1.7)*s*.22,Q=[[x+s*.82,y-s*.18],[x+s*1.75,y+s*.45],[x+s*1.25,y-s*1.1],[x+s*2.25,y-s*.75+sw]],pt=k=>{const m=1-k;return[0,1].map(d=>m*m*m*Q[0][d]+3*m*m*k*Q[1][d]+3*m*k*k*Q[2][d]+k*k*k*Q[3][d])},gt=M.clamp(g*1.1-.1);if(gt>0){NEON(c,RD,s*.045,()=>{c.beginPath();for(let i=0;i<=24;i++){const p=pt(i/24*gt);c[i?'lineTo':'moveTo'](p[0],p[1])}},0,a);const p=pt(gt);DOT(c,p[0],p[1],s*.075,AM,a)}SPH(c,x,y,s*(1+.03*Math.sin(t*3.1)),.26+.03*Math.sin(t*3.1+1),IR,a);GL(c,x,y-s*.45,s*1.2,AM,.45*a);DOT(c,x,y-s*1.28-Math.abs(Math.sin(t*2.4))*s*.16,s*.06,YL,a*Math.min(1,g*2))};",Zn="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",_e="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.44",pr=[ie("lumen-dot-ring","Vòng chấm neon",2.6,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6638
+ ${le}${Qn}
6639
6639
  // A neon dotted ring (tiny glowing dots, yellow to red) shrinks to a small ring while its hue turns violet, fattens into a glowing two-tone ring, then its core blooms until the frame is flat next (fields: bg, next, fg, fg2).
6640
6640
  ${_e}
6641
6641
  const sh=M.ease.inOutCubic(M.range(t,.05,1.05)),h=M.ease.inOutCubic(M.range(t,.25,1.1)),rot=t*.9+sh*2.2,fat=M.ease.outCubic(M.range(t,.95,1.45)),gr=M.ease.inOutCubic(M.range(t,1,1.7))
@@ -6649,8 +6649,8 @@
6649
6649
  DOT(ctx,cx,cy,u*.008*fat*(1+.3*Math.sin(t*5)),YL,fat)
6650
6650
  CC(ctx,B,cx,cy,q,R*.9,K.f2)
6651
6651
  FIN(ctx,B)
6652
- }`),ne("lumen-beat-flash","Chớp màu theo nhịp",2.6,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",flash1:"#fff09a",flash2:"#c49bff",base:"#05041a"},`function render(ctx,t,env){
6653
- ${se}
6652
+ }`),ie("lumen-beat-flash","Chớp màu theo nhịp",2.6,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",flash1:"#fff09a",flash2:"#c49bff",base:"#05041a"},`function render(ctx,t,env){
6653
+ ${le}
6654
6654
  // Beat flashes: a glossy violet sphere sits in the centre while the whole background hard-flashes pale yellow then lavender on two beats with a ripple ring each time, then the sphere blooms until the frame is flat next (fields: bg, next, fg, flash1, flash2, base).
6655
6655
  ${_e}
6656
6656
  const p=B.p,f1=PC(p.flash1,YL),f2=PC(p.flash2,LV),bs=PC(p.base,NV),bt=[.5,.62,.76,1.3,1.42,1.56],fc=FL(t,bt,[K.bg,f1,f2,bs,f1,f2,bs])
@@ -6662,8 +6662,8 @@
6662
6662
  SPH(ctx,cx,fy,r,1,[M.mix(LV,'#ffffff',.2),M.mix(K.fg,LV,.4),K.fg,M.mix(K.fg,'#000000',.7)],1)
6663
6663
  CC(ctx,B,cx,fy,q,r,K.fg)
6664
6664
  FIN(ctx,B)
6665
- }`),ne("lumen-jelly-bloom","Quả cầu nở thành sứa",3,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6666
- ${se}
6665
+ }`),ie("lumen-jelly-bloom","Quả cầu nở thành sứa",3,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6666
+ ${le}
6667
6667
  // A glossy violet orb turns iridescent (amber and pink top, violet base), grows and breathes, then squashes into a glowing jelly dome with a soft halo, and its glow blooms until the frame is flat next (fields: bg, next, fg, fg2).
6668
6668
  ${_e}
6669
6669
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.55))),gr=M.ease.inOutCubic(M.range(t,.3,1.6)),ir=M.ease.inOutCubic(M.range(t,.25,1)),sq=M.ease.inOutBack(M.range(t,1.1,1.9)),br=Math.sin(t*3.2)
@@ -6675,8 +6675,8 @@
6675
6675
  MOTE(ctx,B,t,16,9,ir*(1-q))
6676
6676
  CC(ctx,B,cx,by-r*.3,q,r*.8,K.f2)
6677
6677
  FIN(ctx,B)
6678
- }`),ne("lumen-horizon-flash","Vệt sáng chân trời",2.8,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6679
- ${se}
6678
+ }`),ie("lumen-horizon-flash","Vệt sáng chân trời",2.8,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6679
+ ${le}
6680
6680
  // A thin light line (violet, yellow, red) sweeps across the frame like a horizon flash with a bright flare at its head and darkness below it, a glowing dome rises behind the horizon, then the horizon opens into a band of next (fields: bg, next, fg, fg2).
6681
6681
  ${_e}
6682
6682
  const hy=cy+u*.12,sw=M.ease.inOutQuad(M.range(t,0,.95)),hx=M.lerp(0,W*1.05,sw),rise=M.ease.outCubic(M.range(t,.55,1.9)),r=u*.2,dk=M.range(t,.2,.6)*(1-M.range(t,1.4,2.1)*.6)
@@ -6689,8 +6689,8 @@
6689
6689
  if(sw>0){GL(ctx,hx,hy,u*.2*fl,AM,fl);ctx.save();ctx.globalCompositeOperation='lighter';const sg=ctx.createRadialGradient(hx,hy,0,hx,hy,u*.6);sg.addColorStop(0,M.rgba(YL,.8*fl));sg.addColorStop(1,M.rgba(AM,0));ctx.fillStyle=sg;ctx.translate(hx,hy);ctx.scale(1,.05);ctx.beginPath();ctx.arc(0,0,u*.6,0,M.TAU);ctx.fill();ctx.restore();M.spark(ctx,Math.min(hx,W*.98),hy,u*.05*fl,'#ffffff',fl)}
6690
6690
  if(q>0){const h=Math.max(hy,H-hy)*1.02*q;GL(ctx,cx,hy,h+u*.3,K.f2,1-q);ctx.fillStyle=K.nx;ctx.fillRect(0,hy-h,W,h*2);NEON(ctx,K.f2,u*.005,()=>{ctx.beginPath();ctx.moveTo(0,hy-h);ctx.lineTo(W,hy-h);ctx.moveTo(0,hy+h);ctx.lineTo(W,hy+h)},0,1-M.range(q,.6,.95))}
6691
6691
  FIN(ctx,B)
6692
- }`),ne("lumen-creature","Sinh vật phát sáng",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6693
- ${se}${Ro}
6692
+ }`),ie("lumen-creature","Sinh vật phát sáng",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6693
+ ${le}${Ro}
6694
6694
  // The glowing jelly creature: an iridescent dome with swaying light tentacles, a bobbing spark on top and a red curly tendril with an amber spark tip drifts in the dark among light motes, then its glow fills the frame with next (fields: bg, next, fg, fg2).
6695
6695
  ${_e}
6696
6696
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.6))),g=M.ease.inOutCubic(M.range(t,.2,1.4)),s=u*(B.S.port?.15:.13)*pop,x=cx-s*.5+Math.sin(t*.9)*u*.01,y=cy-s*.15+Math.sin(t*1.6)*u*.015
@@ -6699,8 +6699,8 @@
6699
6699
  CRT(ctx,x,y,s,t,1,g)
6700
6700
  CC(ctx,B,x,y-s*.4,q,s*.9,K.f2)
6701
6701
  FIN(ctx,B)
6702
- }`),ne("lumen-orbit-ring","Vòng quỹ đạo neon",3.2,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6703
- ${se}${Ro}
6702
+ }`),ie("lumen-orbit-ring","Vòng quỹ đạo neon",3.2,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6703
+ ${le}${Ro}
6704
6704
  // A big violet neon ring draws itself round a small glowing creature, a light dot orbits along it leaving a trail and a pink diamond rides the ring, then the ring expands until the frame is flat next (fields: bg, next, fg, fg2).
6705
6705
  ${_e}
6706
6706
  const dr=M.ease.inOutCubic(M.range(t,.05,1.05)),R=u*.33*(1+.02*Math.sin(t*2.4)),pop=Math.max(0,M.ease.outBack(M.range(t,0,.6))),s=u*.075*pop,a0=-Math.PI/2
@@ -6713,8 +6713,8 @@
6713
6713
  const da=oa+Math.PI*.85-Math.max(0,t-1.05)*.7,dk=Math.max(0,M.ease.outBack(M.range(t,.9,1.4)));if(dk>0){const dx=cx+Math.cos(da)*R,dy=cy+Math.sin(da)*R;GL(ctx,dx,dy,u*.06,K.f2,dk);ctx.save();ctx.fillStyle=K.f2;ctx.shadowColor=K.f2;ctx.shadowBlur=u*.03;POLY(ctx,dx,dy,u*.022*dk,4,da);ctx.fill();ctx.restore()}
6714
6714
  CC(ctx,B,cx,cy,q,R,K.fg)
6715
6715
  FIN(ctx,B)
6716
- }`),ne("lumen-wedge-fan","Quạt sáng mở",3,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ffb648"},`function render(ctx,t,env){
6717
- ${se}
6716
+ }`),ie("lumen-wedge-fan","Quạt sáng mở",3,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ffb648"},`function render(ctx,t,env){
6717
+ ${le}
6718
6718
  // A pie wedge sweeps open from the edge of a violet neon ring like a glowing fan (violet to amber and yellow with fine stripes) and grows round the clock, then a clock wipe from its leading edge fills the frame with next (fields: bg, next, fg, fg2).
6719
6719
  ${_e}
6720
6720
  const em=Math.max(0,M.ease.outBack(M.range(t,0,.5))),R=u*.22*em,a0=-Math.PI/2,sw=M.ease.inOutCubic(M.range(t,.45,T1)),A=M.TAU*.82*sw,Rw=R*(1+.5*sw)
@@ -6728,8 +6728,8 @@
6728
6728
  DOT(ctx,cx,cy,u*.008*em,LV,1)
6729
6729
  if(q>0){const Rq=RM(B,cx,cy),la=a0+A,b=la+M.TAU*q;ctx.fillStyle=K.nx;ctx.beginPath();ctx.moveTo(cx,cy);ctx.arc(cx,cy,Rq,la,b);ctx.closePath();ctx.fill();NEON(ctx,YL,u*.006,()=>{ctx.beginPath();ctx.moveTo(cx,cy);ctx.lineTo(cx+Math.cos(b)*Rq,cy+Math.sin(b)*Rq)},0,1-M.range(q,.7,.95))}
6730
6730
  FIN(ctx,B)
6731
- }`),ne("lumen-holo-sphere","Quả cầu hologram",2.8,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6732
- ${se}
6731
+ }`),ie("lumen-holo-sphere","Quả cầu hologram",2.8,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6732
+ ${le}
6733
6733
  // A holographic sphere with diagonal iridescent stripes (pink, yellow, lavender) sliding across it, a bright rim and a soft halo grows from the centre, then keeps growing until it fills the frame with next (fields: bg, next, fg, fg2).
6734
6734
  ${_e}
6735
6735
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.6))),gr=M.ease.inOutCubic(M.range(t,.2,T1)),r0=u*(.08+.14*gr)*pop*(1+.02*Math.sin(t*3)),r=r0+(RM(B,cx,cy)-r0)*M.ease.inCubic(q)
@@ -6742,8 +6742,8 @@
6742
6742
  ctx.fillStyle=M.rgba(K.nx,M.ease.inCubic(q));ctx.fillRect(cx-r,cy-r,r*2,r*2);ctx.restore()
6743
6743
  NEON(ctx,LV,u*.004,()=>{ctx.beginPath();ctx.arc(cx,cy,r,0,M.TAU)},0,1-q);ctx.save();ctx.globalAlpha=.8*(1-q);ctx.fillStyle='#ffffff';ctx.beginPath();ctx.ellipse(cx-r*.38,cy-r*.45,r*.14,r*.07,-.7,0,M.TAU);ctx.fill();ctx.restore()}
6744
6744
  FIN(ctx,B)
6745
- }`),ne("lumen-white-flash","Chớp trắng",1.2,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",flash:"#ffffff"},`function render(ctx,t,env){
6746
- ${se}
6745
+ }`),ie("lumen-white-flash","Chớp trắng",1.2,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",flash:"#ffffff"},`function render(ctx,t,env){
6746
+ ${le}
6747
6747
  // Join flash (use between any two scenes): a white light bursts from the centre until the whole frame is white, a violet gradient creeps in from a corner and floods the frame with next (fields: bg, next, fg, flash).
6748
6748
  ${_e}
6749
6749
  const fw=PC(B.p.flash,'#ffffff'),b=M.ease.outCubic(M.range(t,.04,.24)),R=Math.hypot(W,H)
@@ -6752,8 +6752,8 @@
6752
6752
  if(cr>0){const g=ctx.createRadialGradient(x,y,0,x,y,R*(.2+1.1*cr));g.addColorStop(0,M.rgba(K.fg,Math.min(1,cr*1.6)));g.addColorStop(.6,M.rgba(M.mix(K.fg,LV,.5),.5*cr));g.addColorStop(1,M.rgba(LV,0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H)}
6753
6753
  if(q>0){const r=RM(B,x,y)*q,g=ctx.createRadialGradient(x,y,r*.6,x,y,r+1);g.addColorStop(0,K.nx);g.addColorStop(1,M.rgba(K.nx,0));ctx.fillStyle=g;ctx.fillRect(0,0,W,H);ctx.fillStyle=M.rgba(K.nx,M.ease.inCubic(q));ctx.fillRect(0,0,W,H)}
6754
6754
  FIN(ctx,B)
6755
- }`),ne("lumen-ring-tunnel","Đường hầm vòng màu",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6756
- ${se}
6755
+ }`),ie("lumen-ring-tunnel","Đường hầm vòng màu",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6756
+ ${le}
6757
6757
  // Ring tunnel: huge concentric thick rings (pink, amber, violet, lavender) split into pinwheel sectors that turn at different speeds and directions around a small dark core with a cute glowing face, slow zoom in, then the core opens until the frame is flat next (fields: bg, next, fg, fg2).
6758
6758
  ${_e}
6759
6759
  const z=Math.pow(1.6,M.ease.inOutCubic(M.range(t,0,D))*1.1+M.ease.inCubic(q)*2.5),em=M.ease.outCubic(M.range(t,0,.8)),r0=u*.075*z*em,cs=[K.f2,AM,K.fg,LV],dg=Math.hypot(W,H)*.55
@@ -6769,8 +6769,8 @@
6769
6769
  ;[-1,1].forEach(sx=>{ctx.save();ctx.fillStyle='#ffffff';ctx.shadowColor=LV;ctx.shadowBlur=cr*.15;ctx.beginPath();ctx.ellipse(cx+sx*cr*.22,fy-cr*.2,cr*.055,cr*.075*bl,0,0,M.TAU);ctx.fill();ctx.restore()})
6770
6770
  CC(ctx,B,cx,cy,q,cr,LV)
6771
6771
  FIN(ctx,B)
6772
- }`),ne("lumen-neon-word","Chữ neon sống động",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff3a5c",text:"alive"},`function render(ctx,t,env){
6773
- ${se}${Qn}
6772
+ }`),ie("lumen-neon-word","Chữ neon sống động",3.4,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff3a5c",text:"alive"},`function render(ctx,t,env){
6773
+ ${le}${Qn}
6774
6774
  // Neon word: the title (text) in a soft rounded sans with a red-pink to violet gradient and a chromatic glow fades in from a blur and breathes, the dot of an i glows amber, then the word collapses into a dotted ring that blooms until the frame is flat next (fields: text, bg, next, fg, fg2).
6775
6775
  ${_e}
6776
6776
  const sk=M.skin(env,B.p),s=String(B.p.text||''),ap=M.ease.outCubic(M.range(t,.05,.8)),cl=M.ease.inCubic(M.range(t,D-1.2,D-.75)),br=.5+.5*Math.sin(t*2.8)
@@ -6788,8 +6788,8 @@
6788
6788
  GL(ctx,cx,cy,u*.3*cl,K.f2,cl*(1-rg*.5))
6789
6789
  CC(ctx,B,cx,cy,q,R*.9,K.f2)
6790
6790
  FIN(ctx,B)
6791
- }`),ne("lumen-orb-split","Quả cầu tách ba",3.2,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6792
- ${se}
6791
+ }`),ie("lumen-orb-split","Quả cầu tách ba",3.2,{bg:"#05041a",next:"#05041a",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6792
+ ${le}
6793
6793
  // A glossy iridescent orb divides into three glowing orbs (iridescent, pink, violet) that orbit linked by light lines and a thin orbit ring, merge back into one with a flash, then it blooms until the frame is flat next (fields: bg, next, fg, fg2).
6794
6794
  ${_e}
6795
6795
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.55))),r=u*.12*pop,sp=M.ease.outBack(M.range(t,.55,1.15)),mg=M.ease.inOutCubic(M.range(t,1.75,T1-.1)),k=Math.max(0,sp*(1-mg)),rot=t*1.6-.5,ob=u*(B.S.port?.24:.22)*k,rs=r*M.lerp(1,.58,Math.min(1,k))
@@ -6800,8 +6800,8 @@
6800
6800
  const fl=t>T1-.1?Math.exp(-(t-T1+.1)*6):0;GL(ctx,cx,cy,u*.5,'#ffffff',fl*.8)
6801
6801
  CC(ctx,B,cx,cy,q,r*.9,K.f2)
6802
6802
  FIN(ctx,B)
6803
- }`),ne("lumen-caption","Phụ đề neon",3,{text:"Ánh sáng đang sống",position:"lower",fg:"#7a4dff"},`function render(ctx,t,env){
6804
- ${se}
6803
+ }`),ie("lumen-caption","Phụ đề neon",3,{text:"Ánh sáng đang sống",position:"lower",fg:"#7a4dff"},`function render(ctx,t,env){
6804
+ ${le}
6805
6805
  // Overlay caption for scene chains: up to two lines of soft rounded text (text) in a pink to violet neon gradient with a soft glow and a dark halo for readability rises in from a blur; transparent everywhere else (fields: text, fg, position).
6806
6806
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.45,.35),u=S.u,fg=PC(p.fg,VI),s=String(p.text||'')
6807
6807
  if(!s||!(k.v>0))return
@@ -6813,8 +6813,8 @@
6813
6813
  ctx.globalAlpha=a*.7;ctx.filter='blur('+((1-a)*u*.012).toFixed(2)+'px)';ctx.shadowColor='rgba(5,4,26,.9)';ctx.shadowBlur=f.size*.45;ctx.fillStyle='rgba(5,4,26,.55)';ctx.fillText(l,S.cx,y)
6814
6814
  ctx.globalAlpha=a;ctx.shadowColor=PK;ctx.shadowBlur=f.size*.35;ctx.fillStyle=g;ctx.fillText(l,S.cx,y);ctx.shadowColor=fg;ctx.shadowBlur=f.size*.12;ctx.fillText(l,S.cx,y)})
6815
6815
  ctx.restore()
6816
- }`),ne("lumen-orb","Quả cầu óng ánh nhỏ",4,{position:"top-right",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6817
- ${se}${Zn}
6816
+ }`),ie("lumen-orb","Quả cầu óng ánh nhỏ",4,{position:"top-right",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6817
+ ${le}${Zn}
6818
6818
  // Element: a small floating glossy iridescent orb with a soft halo and a light dot circling it on a tilted orbit, in a corner or edge (position: top-right, top-left, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg, fg2).
6819
6819
  const {duration:D,params:p}=env,k=M.io(t,D,.5,.45),u=Math.min(env.width,env.height),r=u*.045,o=SPOT(env,p.position,'top-right',r*5.2,r*3.6),fg=PC(p.fg,VI),f2=PC(p.fg2,PK)
6820
6820
  if(!(k.v>0))return
@@ -6823,15 +6823,15 @@
6823
6823
  if(!front)DOT(ctx,d[0],d[1],r*.12,YL,k.v*.8)
6824
6824
  GL(ctx,x,y,r*2.6*sc,f2,.8*k.v);SPH(ctx,x,y,r*sc*(1+.03*Math.sin(t*3)),1,[AM,f2,fg,'#2a1680'],k.v)
6825
6825
  if(front)DOT(ctx,d[0],d[1],r*.12,YL,k.v)
6826
- }`),ne("lumen-critter","Sinh vật sáng nhỏ",4,{position:"bottom-left",fg:"#7a4dff"},`function render(ctx,t,env){
6827
- ${se}${Ro}${Zn}
6826
+ }`),ie("lumen-critter","Sinh vật sáng nhỏ",4,{position:"bottom-left",fg:"#7a4dff"},`function render(ctx,t,env){
6827
+ ${le}${Ro}${Zn}
6828
6828
  // Element: the small glowing jelly creature (dome, swaying tentacles, curly tendril with a spark tip) bobbing gently in a corner or edge (position: bottom-left, bottom-right, top-left, top-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg).
6829
6829
  const {duration:D,params:p}=env,k=M.io(t,D,.5,.45),u=Math.min(env.width,env.height),s=u*.052,o=SPOT(env,p.position,'bottom-left',s*3.6,s*3.7)
6830
6830
  if(!(k.v>0))return
6831
6831
  const x=o.x-s*.7,y=o.y-s*.35+Math.sin(t*1.5)*s*.14
6832
6832
  CRT(ctx,x,y,s,t,k.v,.4+.6*k.i)
6833
- }`),ne("lumen-spark-trail","Tia sáng bay",1.6,{position:"top",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6834
- ${se}
6833
+ }`),ie("lumen-spark-trail","Tia sáng bay",1.6,{position:"top",fg:"#7a4dff",fg2:"#ff4fa3"},`function render(ctx,t,env){
6834
+ ${le}
6835
6835
  // Accent: a glowing spark flies along a curved path across one edge of the frame (position: top, lower, left, right) leaving a pink, amber and violet light trail with sparkles, never across the centre; use it to accent a cut; transparent elsewhere (fields: position, fg, fg2).
6836
6836
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),fg=PC(p.fg,VI),f2=PC(p.fg2,PK),pos=String(p.position),k=M.io(t,D,.12,.3)
6837
6837
  const E={top:[[.1,.16],[.36,.05],[.64,.2],[.9,.09]],lower:[[.9,.8],[.64,.93],[.36,.78],[.1,.89]],left:[[.08,.12],[.22,.4],[.04,.6],[.14,.88]],right:[[.92,.88],[.78,.6],[.96,.4],[.86,.12]]},Q=(E[pos]||E[pos==='bottom'?'lower':'top']).map(v=>[v[0]*W,v[1]*H])
@@ -6841,8 +6841,8 @@
6841
6841
  if(hd>a0){const g=ctx.createLinearGradient(pa[0],pa[1],ph[0],ph[1]);g.addColorStop(0,M.rgba(fg,0));g.addColorStop(.45,M.rgba(fg,.8));g.addColorStop(.8,f2);g.addColorStop(1,AM);NEON(ctx,f2,u*.005,path(a0),g,k.v);const a1=Math.max(0,hd-tl*.35),pb=pt(a1),g2=ctx.createLinearGradient(pb[0],pb[1],ph[0],ph[1]);g2.addColorStop(0,M.rgba(f2,0));g2.addColorStop(1,AM);NEON(ctx,AM,u*.01,path(a1),g2,k.v)}
6842
6842
  const R=M.rand(13);for(let i=0;i<14;i++){const s0=R()*.95,age=hd-s0;if(age<0||age>.4)continue;const p0=pt(s0),dr=R()*M.TAU,f=age/.4;DOT(ctx,p0[0]+Math.cos(dr)*u*.03*f,p0[1]+Math.sin(dr)*u*.03*f+u*.02*f,u*.0025,i%2?LV:AM,k.v*(1-f))}
6843
6843
  const h=pt(hd);GL(ctx,h[0],h[1],u*.12,f2,.8*k.v);M.spark(ctx,h[0],h[1],u*.035,'#ffffff',k.v);DOT(ctx,h[0],h[1],u*.006,YL,k.v)
6844
- }`)],Jn=V.find(t=>t.id==="rebound"),ie=(t,e,c,a,o)=>({id:t,name:e,category:Jn.name,pack:"rebound",duration:c,params:{accent:Jn.accent,position:"center",...a,style:"rebound"},code:o}),pe="const NV='#07071a',CY='#36d6e7',OR='#ff8a3d',RD='#ff3b3b',YE='#ffd23f',WH='#ffffff',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,MIN=Math.min,ABS=Math.abs,HY=Math.hypot,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},RC=(c,...a)=>c.fillRect(...a);const PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d,OP={l:'r',r:'l',t:'b',b:'t',c:'c'},HT=(t,a)=>t<a?0:Math.exp((a-t)*7);const GL=(c,x,y,r,col,a=1)=>{if(r>0&&a>0){SV(c);c.globalCompositeOperation='lighter';const g=c.createRadialGradient(x,y,0,x,y,r),k=MIN(1,a);g.addColorStop(0,RA(col,.5*k));g.addColorStop(.3,RA(col,.14*k));g.addColorStop(1,RA(col,0));FS(c,g);RC(c,x-r,y-r,2*r,2*r);RS(c)}};const NL=(c,u,col,f,a=1,k=1,n=2,w=1)=>{if(!(a>0)||!(k>0))return;const lw=MAX(1,u*.0026*w);SV(c);GA(c,MIN(1,a));c.lineCap=c.lineJoin='round';if(k<1)c.setLineDash([u*n*k,u*n+9]);BP(c);f();c.strokeStyle=col;c.lineWidth=lw;c.shadowColor=col;c.shadowBlur=lw*7;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.strokeStyle=MX(col,WH,.65);c.lineWidth=lw*.5;c.stroke();RS(c)};const BE=(c,x,y,r,col,a=1)=>{if(a>0&&r>0){SV(c);c.globalCompositeOperation='lighter';GA(c,.28*MIN(1,a));FS(c,col);BP(c);c.arc(x,y,r*2.8,0,TAU);c.fill();GA(c,MIN(1,a));FS(c,MX(col,WH,.5));BP(c);c.arc(x,y,r,0,TAU);c.fill();RS(c)}};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,NV),nx=PC(p.next,NV),ac=PC(p.fg,PC(p.accent,CY)),hi=ED(p.ballIn,'l'),ho=ED(p.ballOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[Math.round(k=='l'?W*f:k=='r'?-W*f:0),Math.round(k=='t'?H*f:k=='b'?-H*f:0)],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]),e=pi?1:E.outCubic(RG(t,0,.35));const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}const g=c.createRadialGradient(W/2,H*.45,0,W/2,H*.45,HY(W,H)*.6);g.addColorStop(0,RA(ac,.09*e));g.addColorStop(1,RA('#000000',.3*e));FS(c,g);RC(c,0,0,W,H);return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,K:{bg,nx,ac},e,dr:pi?1:E.outCubic(RG(t,.03,.55)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const EP=(B,k)=>{const o=B.u*.14;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HC=(B,k)=>[k=='l'?B.W*.36:k=='r'?B.W*.64:B.W*.56,k=='t'?B.H*.32:k=='b'?B.H*.62:B.H*.42];const TS=(B,f)=>L(B.pi?PN+.3:.42,(B.po?B.D-PN:B.D-.42)-.42,f);const HP=(B,k,s)=>{const a=HO(B,k),b=HC(B,k),f=E.inOutQuad(s);return{x:L(a[0],b[0],f),y:L(a[1],b[1],f)-SN(PI*s)*B.u*.12,s:1,q:0}},HW=(B,t)=>B.pi&&t<PN?[OP[B.hi],0]:B.po&&t>B.D-PN?[B.ho,B.D-PN]:0;const PATH=(B,tt,K)=>{const D=B.D,u=B.u,O=B.of(tt),hp=(k,s)=>HP(B,k,s);if(B.pi&&tt<PN)return hp(OP[B.hi],tt/PN);if(B.po&&tt>D-PN)return hp(B.ho,(tt-D+PN)/PN);const Q=K.map(a=>a.slice()),F=Q[0];if(B.pi){F[3]=u*.12;Q.unshift([PN,...HC(B,OP[B.hi]),0,1])}else if(B.hi!='c'){const A=EP(B,B.hi);F[3]=B.hi=='t'?(F[2]-A[1])/4:B.hi=='b'?(A[1]-F[2])/2+u*.15:u*.2;Q.unshift([.1,...A,0,1])}const z=Q[Q.length-1];if(B.po)Q.push([D-PN,...HO(B,B.ho),u*.16,1]);else if(B.ho!='c'){const A=EP(B,B.ho);Q.push([D-.42,...A,B.ho=='b'?(A[1]-z[2])/4:B.ho=='t'?(z[2]-A[1])/4:u*.2,1])}let i=0;while(i<Q.length-2&&tt>Q[i+1][0])i++;const a=Q[i],b=Q[i+1]||a,k=RG(tt,a[0],b[0]);let q=0;Q.forEach(p=>{if(!p[4])q=MAX(q,Math.exp(-Math.pow((tt-p[0])/.05,2)))});let s=1;if(B.hi=='c')s=E.outBack(RG(tt,.18,.5));if(B.ho=='c')s*=1-E.inCubic(RG(tt,D-.62,D-.2));if(!B.pi&&B.hi!='c'&&tt<.1||!B.po&&B.ho!='c'&&tt>D-.42)s=0;return{x:L(a[1],b[1],k)+O[0],y:L(a[2],b[2],k)-4*(b[3]||0)*k*(1-k)+O[1],s:MAX(0,s),q:q*.5}};const BALL=(c,x,y,R,col,st,an,q)=>{if(!(R>.3))return;GL(c,x,y,R*11,col,1);GL(c,x,y,R*4,WH,1);SV(c);c.translate(x,y);FS(c,WH);c.shadowColor=MX(col,WH,.5);c.shadowBlur=R*2.2;if(q>.03){c.translate(0,R*q*.8);c.scale(1+q,1-q*.8);BP(c);c.arc(0,0,R,0,TAU)}else{c.rotate(an);const l=R*2*st,h=R*2/Math.sqrt(st);M.rr(c,-l/2,-h/2,l,h,h/2)}c.fill();RS(c)};const FLY=(c,B,K,r)=>{const t=B.t,w=HW(B,t),F=tt=>w?HP(B,w[0],(tt-w[1])/PN):PATH(B,tt,K),h=F(t);if(!(h.s>0))return;if(B.pz)RS(c);const a=F(t-.025),b=F(t+.025),vx=b.x-a.x,vy=b.y-a.y,st=1+MIN(2.8,HY(vx,vy)/(B.u*.07)),R=r*h.s;SV(c);c.globalCompositeOperation='lighter';c.lineCap='round';c.strokeStyle=MX(B.K.ac,WH,.45);for(let i=1;i<10;i++){const p=F(t-i*.025),o=F(t-i*.025+.025),k=1-i/10;if(!(p.s>0))break;GA(c,k*.5);c.lineWidth=R*1.5*k;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);BALL(c,h.x,h.y,R,B.K.ac,st,Math.atan2(vy,vx+1e-4),h.q);if(B.pz)B.cl()};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02,CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GL(c,x,y,R+B.u*.3,B.K.ac,1-k);FS(c,B.K.nx);BP(c);c.arc(x,y,R,0,TAU);c.fill();NL(c,B.u,B.K.ac,()=>c.arc(x,y,R,0,TAU),1-k,1,1,1.6)}};const END=(c,B)=>{const {W,u,q}=B,s=String(B.p.text||'').trim(),a=B.e*(1-RG(q,0,.4));if(s&&a>0){const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.05,S.w*.86,2),n=f.lines.length,h=n*f.lh+f.size;SV(c);GA(c,a*.55);FS(c,NV);c.shadowColor=NV;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,a);c.font=f.font;c.textAlign='center';c.textBaseline='middle';c.shadowColor=B.K.ac;c.shadowBlur=f.size*.4;FS(c,WH);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh));RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,B.H)}if(B.pz)RS(c)};",ts="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",ze="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,dr,q,port}=B,T=f=>TS(B,f)",Qe={bg:"#07071a",next:"#07071a",fg:"#36d6e7",pan:"",text:""},dr=[ie("rebound-dots-merge","Chấm sáng hợp thành bóng",2.6,{...Qe,ballIn:"c",ballOut:"r"},`function render(c,t,env){
6845
- ${pe}
6844
+ }`)],Jn=V.find(t=>t.id==="rebound"),re=(t,e,c,a,o)=>({id:t,name:e,category:Jn.name,pack:"rebound",duration:c,params:{accent:Jn.accent,position:"center",...a,style:"rebound"},code:o}),ge="const NV='#07071a',CY='#36d6e7',OR='#ff8a3d',RD='#ff3b3b',YE='#ffd23f',WH='#ffffff',E=M.ease,L=M.lerp,RG=M.range,MX=M.mix,RA=M.rgba,TAU=M.TAU,PI=Math.PI,SN=Math.sin,CS=Math.cos,MAX=Math.max,MIN=Math.min,ABS=Math.abs,HY=Math.hypot,BP=c=>c.beginPath(),SV=c=>c.save(),RS=c=>c.restore(),FS=(c,v)=>{c.fillStyle=v},GA=(c,v)=>{c.globalAlpha=v},RC=(c,...a)=>c.fillRect(...a);const PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d,ED=(k,d)=>/^[lrtbc]$/.test(k)?k:d,OP={l:'r',r:'l',t:'b',b:'t',c:'c'},HT=(t,a)=>t<a?0:Math.exp((a-t)*7);const GL=(c,x,y,r,col,a=1)=>{if(r>0&&a>0){SV(c);c.globalCompositeOperation='lighter';const g=c.createRadialGradient(x,y,0,x,y,r),k=MIN(1,a);g.addColorStop(0,RA(col,.5*k));g.addColorStop(.3,RA(col,.14*k));g.addColorStop(1,RA(col,0));FS(c,g);RC(c,x-r,y-r,2*r,2*r);RS(c)}};const NL=(c,u,col,f,a=1,k=1,n=2,w=1)=>{if(!(a>0)||!(k>0))return;const lw=MAX(1,u*.0026*w);SV(c);GA(c,MIN(1,a));c.lineCap=c.lineJoin='round';if(k<1)c.setLineDash([u*n*k,u*n+9]);BP(c);f();c.strokeStyle=col;c.lineWidth=lw;c.shadowColor=col;c.shadowBlur=lw*7;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.strokeStyle=MX(col,WH,.65);c.lineWidth=lw*.5;c.stroke();RS(c)};const BE=(c,x,y,r,col,a=1)=>{if(a>0&&r>0){SV(c);c.globalCompositeOperation='lighter';GA(c,.28*MIN(1,a));FS(c,col);BP(c);c.arc(x,y,r*2.8,0,TAU);c.fill();GA(c,MIN(1,a));FS(c,MX(col,WH,.5));BP(c);c.arc(x,y,r,0,TAU);c.fill();RS(c)}};const PN=.7,BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},bg=PC(p.bg,NV),nx=PC(p.next,NV),ac=PC(p.fg,PC(p.accent,CY)),hi=ED(p.ballIn,'l'),ho=ED(p.ballOut,'r'),pn=String(p.pan||''),pi=pn.includes('i')&&hi!='c',po=pn.includes('o')&&ho!='c',V=(k,f)=>[Math.round(k=='l'?W*f:k=='r'?-W*f:0),Math.round(k=='t'?H*f:k=='b'?-H*f:0)],of=tt=>pi&&tt<PN?V(hi,1-E.inOutCubic(RG(tt,0,PN))):po&&tt>D-PN?V(ho,E.inOutCubic(RG(tt,D-PN,D))):[0,0],o=of(t),pz=!!(o[0]||o[1]),e=pi?1:E.outCubic(RG(t,0,.35));const cl=()=>{SV(c);c.translate(o[0],o[1]);BP(c);c.rect(0,0,W,H);c.clip()};if(pz){if(!(t>0)&&pi||t>=D&&po)return null;cl();FS(c,bg);RC(c,0,0,W,H)}else{FS(c,t>=D?nx:bg);RC(c,0,0,W,H);if(!(t>0)||t>=D)return null}const g=c.createRadialGradient(W/2,H*.45,0,W/2,H*.45,HY(W,H)*.6);g.addColorStop(0,RA(ac,.09*e));g.addColorStop(1,RA('#000000',.3*e));FS(c,g);RC(c,0,0,W,H);return{W,H,D,p,t,env,u:MIN(W,H),port:H>W*1.1,cx:W/2,cy:H/2,hi,ho,pi,po,of,pz,cl,K:{bg,nx,ac},e,dr:pi?1:E.outCubic(RG(t,.03,.55)),q:po?0:E.inOutCubic(RG(t,D-.44,D-.04))}};const EP=(B,k)=>{const o=B.u*.14;return k=='l'?[-o,B.H*.42]:k=='r'?[B.W+o,B.H*.42]:k=='t'?[B.W*.56,-o]:k=='b'?[B.W*.56,B.H+o]:[B.cx,B.cy]},HO=(B,k)=>[k=='l'?B.W*.18:k=='r'?B.W*.82:B.W*.56,k=='t'?B.H*.2:k=='b'?B.H*.8:B.H*.42],HC=(B,k)=>[k=='l'?B.W*.36:k=='r'?B.W*.64:B.W*.56,k=='t'?B.H*.32:k=='b'?B.H*.62:B.H*.42];const TS=(B,f)=>L(B.pi?PN+.3:.42,(B.po?B.D-PN:B.D-.42)-.42,f);const HP=(B,k,s)=>{const a=HO(B,k),b=HC(B,k),f=E.inOutQuad(s);return{x:L(a[0],b[0],f),y:L(a[1],b[1],f)-SN(PI*s)*B.u*.12,s:1,q:0}},HW=(B,t)=>B.pi&&t<PN?[OP[B.hi],0]:B.po&&t>B.D-PN?[B.ho,B.D-PN]:0;const PATH=(B,tt,K)=>{const D=B.D,u=B.u,O=B.of(tt),hp=(k,s)=>HP(B,k,s);if(B.pi&&tt<PN)return hp(OP[B.hi],tt/PN);if(B.po&&tt>D-PN)return hp(B.ho,(tt-D+PN)/PN);const Q=K.map(a=>a.slice()),F=Q[0];if(B.pi){F[3]=u*.12;Q.unshift([PN,...HC(B,OP[B.hi]),0,1])}else if(B.hi!='c'){const A=EP(B,B.hi);F[3]=B.hi=='t'?(F[2]-A[1])/4:B.hi=='b'?(A[1]-F[2])/2+u*.15:u*.2;Q.unshift([.1,...A,0,1])}const z=Q[Q.length-1];if(B.po)Q.push([D-PN,...HO(B,B.ho),u*.16,1]);else if(B.ho!='c'){const A=EP(B,B.ho);Q.push([D-.42,...A,B.ho=='b'?(A[1]-z[2])/4:B.ho=='t'?(z[2]-A[1])/4:u*.2,1])}let i=0;while(i<Q.length-2&&tt>Q[i+1][0])i++;const a=Q[i],b=Q[i+1]||a,k=RG(tt,a[0],b[0]);let q=0;Q.forEach(p=>{if(!p[4])q=MAX(q,Math.exp(-Math.pow((tt-p[0])/.05,2)))});let s=1;if(B.hi=='c')s=E.outBack(RG(tt,.18,.5));if(B.ho=='c')s*=1-E.inCubic(RG(tt,D-.62,D-.2));if(!B.pi&&B.hi!='c'&&tt<.1||!B.po&&B.ho!='c'&&tt>D-.42)s=0;return{x:L(a[1],b[1],k)+O[0],y:L(a[2],b[2],k)-4*(b[3]||0)*k*(1-k)+O[1],s:MAX(0,s),q:q*.5}};const BALL=(c,x,y,R,col,st,an,q)=>{if(!(R>.3))return;GL(c,x,y,R*11,col,1);GL(c,x,y,R*4,WH,1);SV(c);c.translate(x,y);FS(c,WH);c.shadowColor=MX(col,WH,.5);c.shadowBlur=R*2.2;if(q>.03){c.translate(0,R*q*.8);c.scale(1+q,1-q*.8);BP(c);c.arc(0,0,R,0,TAU)}else{c.rotate(an);const l=R*2*st,h=R*2/Math.sqrt(st);M.rr(c,-l/2,-h/2,l,h,h/2)}c.fill();RS(c)};const FLY=(c,B,K,r)=>{const t=B.t,w=HW(B,t),F=tt=>w?HP(B,w[0],(tt-w[1])/PN):PATH(B,tt,K),h=F(t);if(!(h.s>0))return;if(B.pz)RS(c);const a=F(t-.025),b=F(t+.025),vx=b.x-a.x,vy=b.y-a.y,st=1+MIN(2.8,HY(vx,vy)/(B.u*.07)),R=r*h.s;SV(c);c.globalCompositeOperation='lighter';c.lineCap='round';c.strokeStyle=MX(B.K.ac,WH,.45);for(let i=1;i<10;i++){const p=F(t-i*.025),o=F(t-i*.025+.025),k=1-i/10;if(!(p.s>0))break;GA(c,k*.5);c.lineWidth=R*1.5*k;BP(c);c.moveTo(p.x,p.y);c.lineTo(o.x,o.y);c.stroke()}RS(c);BALL(c,h.x,h.y,R,B.K.ac,st,Math.atan2(vy,vx+1e-4),h.q);if(B.pz)B.cl()};const RM=(B,x,y)=>HY(MAX(x,B.W-x),MAX(y,B.H-y))*1.02,CC=(c,B,x,y,k,r0=0)=>{if(k>0){const R=L(r0,RM(B,x,y),k);GL(c,x,y,R+B.u*.3,B.K.ac,1-k);FS(c,B.K.nx);BP(c);c.arc(x,y,R,0,TAU);c.fill();NL(c,B.u,B.K.ac,()=>c.arc(x,y,R,0,TAU),1-k,1,1,1.6)}};const END=(c,B)=>{const {W,u,q}=B,s=String(B.p.text||'').trim(),a=B.e*(1-RG(q,0,.4));if(s&&a>0){const S=M.safe(B.env,'lower'),f=M.fit(c,s,z=>M.skin(B.env,B.p).font(z,'s','500'),u*.05,S.w*.86,2),n=f.lines.length,h=n*f.lh+f.size;SV(c);GA(c,a*.55);FS(c,NV);c.shadowColor=NV;c.shadowBlur=h*.6;RC(c,-h,S.y-h/2,W+h*2,h);c.shadowBlur=0;GA(c,a);c.font=f.font;c.textAlign='center';c.textBaseline='middle';c.shadowColor=B.K.ac;c.shadowBlur=f.size*.4;FS(c,WH);f.lines.forEach((l,i)=>c.fillText(l,B.cx,S.y+(i-(n-1)/2)*f.lh));RS(c)}if(q>=1){FS(c,B.K.nx);RC(c,0,0,W,B.H)}if(B.pz)RS(c)};",ts="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",ze="const B=BEGIN(c,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,dr,q,port}=B,T=f=>TS(B,f)",Qe={bg:"#07071a",next:"#07071a",fg:"#36d6e7",pan:"",text:""},dr=[re("rebound-dots-merge","Chấm sáng hợp thành bóng",2.6,{...Qe,ballIn:"c",ballOut:"r"},`function render(c,t,env){
6845
+ ${ge}
6846
6846
  // Dots merge: five small glowing dots (cyan, orange, red, yellow, white) spiral in, a thin cyan diamond outline draws between them, they merge into the glowing white ball that drops onto a neon floor line, squashes, bounces away on ballOut, then the diamond opens and fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6847
6847
  ${ze},r=u*.034,my=cy-u*.08,fy=cy+u*.3,m=E.inOutCubic(RG(t,.02,.48)),C=[K.ac,OR,RD,YE,WH],ds=u*(.11*E.outBack(RG(t,.1,.42))+.3*E.outCubic(RG(t,.55,1.3))),Q=[[T(0),cx,my,0,1],[T(.4),cx,fy-r,(fy-r-my)/4],[T(1),cx+u*.2,fy-r,u*.22]]
6848
6848
  for(let i=0;i<5;i++){const a=i*TAU/5+t*2.4+m*2,R=u*.3*(1-m),x=cx+CS(a)*R,y=my+SN(a)*R;BE(c,x,y,u*.009,C[i],e*(1-RG(t,.44,.54)));if(m<1)NL(c,u,C[i],()=>{c.moveTo(x,y);c.arc(cx,my,R,a,a-.7,true)},.6*e*(1-m))}
@@ -6853,8 +6853,8 @@
6853
6853
  FLY(c,B,Q,r)
6854
6854
  CC(c,B,cx,my,q,ds*.7)
6855
6855
  END(c,B)
6856
- }`),ie("rebound-brick-tower","Tháp gạch trên bánh xe",3,{...Qe,ballIn:"t",ballOut:"r"},`function render(c,t,env){
6857
- ${pe}
6856
+ }`),re("rebound-brick-tower","Tháp gạch trên bánh xe",3,{...Qe,ballIn:"t",ballOut:"r"},`function render(c,t,env){
6857
+ ${ge}
6858
6858
  // Brick tower: a tower of thin outlined neon bricks (red, orange, cyan, offset rows) stands on a big outlined wheel with turning spokes and horizontal speed lines; the ball falls on top, bounces, wobbles the tower and lands on the floor line before leaving; the wheel fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6859
6859
  ${ze},r=u*.032,R=u*.17,wy=cy+u*.17,fy=wy+R,bh=u*.05,bw=u*.1,top=wy-R-bh*4,C=[RD,OR,K.ac],Q=[[T(0),cx,top-r],[T(.42),cx+u*.03,top-r,u*.14],[T(1),cx+u*.34,fy-r,u*.18]],j=HT(t,Q[0][0])+HT(t,Q[1][0])
6860
6860
  NL(c,u,WH,()=>{c.moveTo(cx-W*.46*dr,fy);c.lineTo(cx+W*.46*dr,fy)},.8)
@@ -6866,8 +6866,8 @@
6866
6866
  FLY(c,B,Q,r)
6867
6867
  CC(c,B,cx,wy,q,R)
6868
6868
  END(c,B)
6869
- }`),ie("rebound-ramp-shot","Phóng lên dốc",2.8,{...Qe,ballIn:"l",ballOut:"t"},`function render(c,t,env){
6870
- ${pe}
6869
+ }`),re("rebound-ramp-shot","Phóng lên dốc",2.8,{...Qe,ballIn:"l",ballOut:"t"},`function render(c,t,env){
6870
+ ${ge}
6871
6871
  // Ramp shot: on a neon floor line a small outlined step and an orange ramp triangle; the ball lands on the step, squashes flat on the floor, shoots up the ramp as a long smear into a red ring target over a red glow column, the room lights red with a cyan ring above, then the target fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6872
6872
  ${ze},r=u*.032,fy=cy+u*.3,rx0=cx-u*.2,rx1=cx+u*.06,ry=fy-u*.2,tx=cx+u*.24,ty=cy-u*.24,sx=cx-u*.44,Q=[[T(0),sx+u*.07,fy-u*.07-r],[T(.3),cx-u*.27,fy-r,u*.1],[T(.4),rx0,fy-r,0,1],[T(.55),rx1-u*.01,ry-r,0,1],[T(1),tx,ty,u*.12,1]],hit=E.outCubic(RG(t,Q[4][0]-.05,Q[4][0]+.3))
6873
6873
  GL(c,tx,ty,u*.95,RD,.55*hit);SV(c);c.globalCompositeOperation='lighter';const g=c.createLinearGradient(0,ty,0,fy);g.addColorStop(0,RA(RD,.05));g.addColorStop(1,RA(RD,.4*e));FS(c,g);RC(c,tx-u*.06,ty,u*.12,fy-ty);RS(c)
@@ -6880,8 +6880,8 @@
6880
6880
  FLY(c,B,Q,r)
6881
6881
  CC(c,B,tx,ty,q,rr)
6882
6882
  END(c,B)
6883
- }`),ie("rebound-chevron-field","Trường răng cưa",2.8,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6884
- ${pe}
6883
+ }`),re("rebound-chevron-field","Trường răng cưa",2.8,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6884
+ ${ge}
6885
6885
  // Chevron field: zigzag W-shaped dotted lines of orange and white beads fan across the frame and drift down; two light pillars (vertical columns of cyan beads with a falling light streak) stand in it and the ball bounces off their tops; the second pillar top fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6886
6886
  ${ze},r=u*.03,P1=[cx-u*.15,cy-u*.02],P2=[cx+u*.17,cy+u*.13],Q=[[T(0),P1[0],P1[1]-r],[T(.55),P2[0],P2[1]-r,u*.2]],sp=u*.026,n=Math.ceil(W/sp)+2
6887
6887
  for(let j=0;j<8;j++){const y0=(j/8*H*1.2+t*u*.08)%(H*1.2)-H*.12,A=u*(.025+.01*j),col=j%2?OR:WH;for(let i=0;i<n;i++){if(i>n*dr*1.2-j)break;const x=i*sp-sp,f=((x-cx)/(u*.2)%1+1)%1,y=y0+ABS(f*2-1)*A*2+ABS(x-cx)*.18;BE(c,x,y,u*.0026,i%4?col:YE,e*.9)}}
@@ -6891,8 +6891,8 @@
6891
6891
  FLY(c,B,Q,r)
6892
6892
  CC(c,B,P2[0],P2[1],q,u*.05)
6893
6893
  END(c,B)
6894
- }`),ie("rebound-piston-launch","Trụ phóng bóng",3,{...Qe,ballIn:"l",ballOut:"t"},`function render(c,t,env){
6895
- ${pe}
6894
+ }`),re("rebound-piston-launch","Trụ phóng bóng",3,{...Qe,ballIn:"l",ballOut:"t"},`function render(c,t,env){
6895
+ ${ge}
6896
6896
  // Piston launch: an amber 3D cylinder (gradient body, thin bands) stands on a glowing cyan disc platform; the ball lands on it, the pillar shoots up like a piston and launches the ball upward with an orange shock ring at its top; the top fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6897
6897
  ${ze},r=u*.032,fy=cy+u*.3,ex=u*.065,ey=ex*.32,t0=T(.45),t1=T(.62),h0=u*.17,h1=u*.45,hh=t<t1?L(h0,h1,RG(t,t0,t1)):h1-SN(RG(t,t1,t1+.3)*PI)*u*.035,yt=fy-hh,Q=[[T(0),cx,fy-h0-r],[t0,cx,fy-h0-r,0,1],[t1,cx,fy-h1-r,0,1]],sk=RG(t,t1,t1+.6)
6898
6898
  GL(c,cx,fy,u*.4,K.ac,.7*e);SV(c);GA(c,.25*e);FS(c,K.ac);BP(c);c.ellipse(cx,fy,u*.24,u*.055,0,0,TAU);c.fill();RS(c)
@@ -6903,8 +6903,8 @@
6903
6903
  FLY(c,B,Q,r)
6904
6904
  CC(c,B,cx,yt,q,ex)
6905
6905
  END(c,B)
6906
- }`),ie("rebound-tube-slide","Trượt qua ống chữ U",2.8,{...Qe,ballIn:"t",ballOut:"r"},`function render(c,t,env){
6907
- ${pe}
6906
+ }`),re("rebound-tube-slide","Trượt qua ống chữ U",2.8,{...Qe,ballIn:"t",ballOut:"r"},`function render(c,t,env){
6907
+ ${ge}
6908
6908
  // Tube slide: the camera follows the ball falling as a long white smear into an outlined U-tube (cyan, orange and red outlines, glassy core), it slides round the bend, shoots out of the other arm onto a small ledge and leaves; the bend fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6909
6909
  ${ze},r=u*.03,Rm=u*.15,tw=u*.042,ya=cy-u*.34,yb=cy+u*.08,yr=cy-u*.1,xl=cx-Rm,xr=cx+Rm,lx=xr+u*.15,ly=yr-u*.02,Q=[[T(0),xl,ya,0,1],[T(.28),xl,yb,(yb-ya)/4,1]]
6910
6910
  for(let j=1;j<4;j++){const a=PI-j*PI/4;Q.push([T(.28+j*.09),cx+CS(a)*Rm,yb+SN(a)*Rm,0,1])}
@@ -6918,8 +6918,8 @@
6918
6918
  FLY(c,B,Q,r)
6919
6919
  CC(c,B,cx,yb+Rm,q,tw)
6920
6920
  END(c,B)
6921
- }`),ie("rebound-gradient-tile","Ô vuông chuyển sắc",2.6,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6922
- ${pe}
6921
+ }`),re("rebound-gradient-tile","Ô vuông chuyển sắc",2.6,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6922
+ ${ge}
6923
6923
  // Gradient tile: a thin red square outline spins in and fills into a glowing red-to-orange gradient rounded square inside a thin cyan orbit circle with an orbiting bead; the ball lands and bounces on it, squashing it, then the tile grows to fill the frame in next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6924
6924
  ${ze},r=u*.032,S0=u*.3,ty=cy+u*.06,top=ty-S0/2,Q=[[T(0),cx-u*.05,top-r],[T(.45),cx+u*.05,top-r,u*.14],[T(.8),cx-u*.01,top-r,u*.08]],sq=.05*(HT(t,Q[0][0])+HT(t,Q[1][0])+HT(t,Q[2][0])),ro=(1-E.outBack(RG(t,.02,.5)))*PI*.75,fi=E.inOutCubic(RG(t,.25,.75)),S=S0*(.7+.3*e)
6925
6925
  const ob=t*1.8;NL(c,u,K.ac,()=>c.arc(cx,ty,S0*.88,0,TAU),.75*e,dr,1.7);BE(c,cx+CS(ob)*S0*.88,ty+SN(ob)*S0*.88,u*.006,K.ac,e);NL(c,u,MX(K.ac,WH,.4),()=>c.arc(cx,ty,S0*1.02,ob+2,ob+3),.5*e)
@@ -6928,8 +6928,8 @@
6928
6928
  FLY(c,B,Q,r)
6929
6929
  if(q>0){GL(c,cx,ty,u*.8,OR,1-q);FS(c,K.nx);M.rr(c,L(cx-S0/2,-4,q),L(ty-S0/2,-4,q),L(S0,W+8,q),L(S0,H+8,q),S0*.16*(1-q));c.fill()}
6930
6930
  END(c,B)
6931
- }`),ie("rebound-skyline-hop","Nảy qua mái phố",3.2,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6932
- ${pe}
6931
+ }`),re("rebound-skyline-hop","Nảy qua mái phố",3.2,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6932
+ ${ge}
6933
6933
  // Skyline hop: thin neon outlined buildings like a bar chart (cyan, orange, red, yellow) with bead windows step down to the right while the camera pans right; the ball hops roof to roof, each roof flashing on contact; the last roof fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6934
6934
  ${ze},r=u*.028,bw=u*.12,gp=u*.035,gy=cy+u*.32,v=u*.11,sc=v*(t-D/2),x0=cx-2.4*(bw+gp),WX=i=>x0+i*(bw+gp),Y=i=>gy-u*(port?1.45:1)*MAX(.1,.4-.055*i+(i%2)*.035),C=[K.ac,OR,RD,YE],Q=[1,2,3,4].map((i,j)=>{const k=T(j/3);return[k,WX(i)+bw/2-v*(k-D/2),Y(i)-r,u*.13]})
6935
6935
  for(let i=-6;i<14;i++){const x=x0+i*(bw+gp)*1.3-sc*.5,hb=u*(port?1.45:1)*(.3+.18*Math.pow(SN(i*1.7),2));if(x>W||x+bw<0)continue;NL(c,u,MX(K.ac,K.bg,.55),()=>c.rect(x,gy-hb-u*.1,bw*1.1,hb+u*.1),.4*e,dr,1)}
@@ -6943,8 +6943,8 @@
6943
6943
  FLY(c,B,Q,r)
6944
6944
  CC(c,B,WX(4)+bw/2-sc,Y(4),q,u*.04)
6945
6945
  END(c,B)
6946
- }`),ie("rebound-frame-in-frame","Khung lồng khung",2.8,{...Qe,ballIn:"t",ballOut:"r"},`function render(c,t,env){
6947
- ${pe}
6946
+ }`),re("rebound-frame-in-frame","Khung lồng khung",2.8,{...Qe,ballIn:"t",ballOut:"r"},`function render(c,t,env){
6947
+ ${ge}
6948
6948
  // Frame in frame: a cyan and yellow bordered screen within the screen zooms in, holding an outlined red rectangle, a slowly tilting cyan square and a glowing yellow-to-orange bar over a pale cyan diamond; the ball drops in and bounces on the bar, then the inner screen grows to fill the frame in next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6949
6949
  ${ze},r=u*.03,fh=port?H*.5:H*.72,fw=port?W*.8:fh*1.3,zm=B.pi?1:.86+.14*E.outCubic(RG(t,0,.42)),by=cy+fh*.2,Q=[[T(0),cx-u*.06,by-r],[T(.5),cx+u*.07,by-r,u*.16],[T(.85),cx+u*.02,by-r,u*.09]],hk=HT(t,Q[0][0])+HT(t,Q[1][0])+HT(t,Q[2][0])
6950
6950
  SV(c);c.translate(cx,cy);c.scale(zm,zm);GA(c,e);FS(c,RA(K.ac,.05));RC(c,-fw/2,-fh/2,fw,fh);RS(c)
@@ -6958,8 +6958,8 @@
6958
6958
  FLY(c,B,Q,r)
6959
6959
  if(q>0){FS(c,K.nx);RC(c,L(cx-fw/2,-2,q),L(cy-fh/2,-2,q),L(fw,W+4,q),L(fh,H+4,q));NL(c,u,K.ac,()=>c.rect(L(cx-fw/2,-2,q),L(cy-fh/2,-2,q),L(fw,W+4,q),L(fh,H+4,q)),1-q,1,1,1.5)}
6960
6960
  END(c,B)
6961
- }`),ie("rebound-radial-web","Mạng tia phóng xạ",2.6,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6962
- ${pe}
6961
+ }`),re("rebound-radial-web","Mạng tia phóng xạ",2.6,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6962
+ ${ge}
6963
6963
  // Radial web: dotted neon rays (cyan, orange, red) radiate from the centre with concentric rings racing outward like a zoom tunnel; the ball spirals round the centre through the web, then the core opens and fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6964
6964
  ${ze},r=u*.03,C=[K.ac,OR,RD],Rr=u*.2,R0=u*.05,RX=RM(B,cx,cy),Q=[0,1,2,3,4,5].map(j=>{const a=PI+j*1.15,k=Rr*(1-j*.09);return[T(j/5),cx+CS(a)*k,cy+SN(a)*k,0,1]})
6965
6965
  GL(c,cx,cy,u*.3,K.ac,.45*e)
@@ -6969,8 +6969,8 @@
6969
6969
  FLY(c,B,Q,r)
6970
6970
  CC(c,B,cx,cy,q,R0)
6971
6971
  END(c,B)
6972
- }`),ie("rebound-atom-arches","Nguyên tử giữa vòm",2.8,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6973
- ${pe}
6972
+ }`),re("rebound-atom-arches","Nguyên tử giữa vòm",2.8,{...Qe,ballIn:"l",ballOut:"r"},`function render(c,t,env){
6973
+ ${ge}
6974
6974
  // Atom arches: an ornate frame of layered red and orange outlines with rows of repeated arches and a tall arch window; the ball lands on the sill, rises to the centre and hovers while three white atom orbits with electrons spin round it, drops back and leaves; the centre fills next (fields: bg, next, fg, ballIn, ballOut, pan, text).
6975
6975
  ${ze},r=u*.03,fw=port?W*.84:H*1.05,fh=port?H*.6:H*.84,sl=cy+fh*.28,ay=cy-u*.04,Q=[[T(0),cx-u*.06,sl-r],[T(.35),cx,ay,u*.06,1],[T(.72),cx,ay,0,1],[T(1),cx+u*.05,sl-r,(sl-r-ay)/4]],at=RG(t,Q[1][0]-.15,Q[1][0])*(1-RG(t,Q[2][0],Q[2][0]+.2)),aw=u*.2,n=Math.max(5,Math.round(fw/(u*.09))),w=fw/n
6976
6976
  for(let i=0;i<3;i++){const d=i*u*.022;NL(c,u,i%2?OR:RD,()=>c.rect(cx-fw/2+d,cy-fh/2+d,fw-2*d,fh-2*d),e,dr,(fw+fh)*2/u)}
@@ -6982,8 +6982,8 @@
6982
6982
  FLY(c,B,Q,r)
6983
6983
  CC(c,B,cx,ay,q,u*.05)
6984
6984
  END(c,B)
6985
- }`),ie("rebound-neon-word","Chữ neon bóng nảy",3.4,{...Qe,ballIn:"l",ballOut:"c",text:"rebound"},`function render(c,t,env){
6986
- ${pe}
6985
+ }`),re("rebound-neon-word","Chữ neon bóng nảy",3.4,{...Qe,ballIn:"l",ballOut:"c",text:"rebound"},`function render(c,t,env){
6986
+ ${ge}
6987
6987
  // Neon word: the title (text) in a clean white sans with a cyan and red chromatic glow sharpens in over a neon underline; the ball bounces along the top of the letters, then the word collapses into five glowing dots that spread round the centre and fill next (fields: text, bg, next, fg, ballIn, ballOut, pan).
6988
6988
  ${ze},sk=M.skin(env,B.p),s=String(B.p.text||'').trim()||'rebound',S=M.safe(env,'center'),f=M.fit(c,s,z=>sk.font(z,'h','500'),u*(port?.27:.2),S.w*.88,2,.25),n=f.lines.length,lh=f.size*1.3,wm=MAX(...f.lines.map(l=>c.measureText(l).width)),r=u*.03,ty=cy-(n-1)/2*lh-f.size*.4,ap=E.outCubic(RG(t,.06,.6)),cl=E.inCubic(RG(t,D-1.15,D-.65)),Q=[[T(0),cx-wm*.32,ty-r],[T(.45),cx+wm*.04,ty-r,u*.13],[T(.8),cx+wm*.3,ty-r,u*.1]],hk=HT(t,Q[0][0])+HT(t,Q[1][0])+HT(t,Q[2][0])
6989
6989
  if(cl<1){SV(c);c.translate(cx,cy);c.scale(1-cl*.5,1-cl*.85);GA(c,ap*(1-cl));c.font=f.font;c.textAlign='center';c.textBaseline='middle';c.filter='blur('+((1-ap)*u*.015).toFixed(2)+'px)'
@@ -6993,15 +6993,15 @@
6993
6993
  FLY(c,B,Q,r)
6994
6994
  CC(c,B,cx,cy,q,u*.03)
6995
6995
  END(c,{...B,p:{}})
6996
- }`),ie("rebound-gradient-flash","Chớp chuyển sắc",1,{bg:"#07071a",next:"#07071a",fg:"#36d6e7"},`function render(c,t,env){
6997
- ${pe}
6996
+ }`),re("rebound-gradient-flash","Chớp chuyển sắc",1,{bg:"#07071a",next:"#07071a",fg:"#36d6e7"},`function render(c,t,env){
6997
+ ${ge}
6998
6998
  // Join flash (use between any two scenes): a yellow-to-red gradient light bursts from the centre and fills the whole frame on the beat with a white core and thin neon rings, then next floods back in from the centre (fields: bg, next, fg).
6999
6999
  ${ze},b=E.outCubic(RG(t,.02,.22)),RX=RM(B,cx,cy),g=c.createLinearGradient(0,0,W*.3,H)
7000
7000
  g.addColorStop(0,YE);g.addColorStop(.5,OR);g.addColorStop(1,RD)
7001
7001
  if(b>0){FS(c,g);BP(c);c.arc(cx,cy,RX*b,0,TAU);c.fill();GL(c,cx,cy,u*(.4+.8*b),WH,1-RG(t,.15,D*.7));for(let i=0;i<3;i++){const k=RG(t,.04+i*.06,.4+i*.08);NL(c,u,i%2?WH:YE,()=>c.arc(cx,cy,u*.1+k*RX,0,TAU),1-k,1,1,1.4)}}
7002
7002
  CC(c,B,cx,cy,q,0)
7003
7003
  END(c,B)
7004
- }`),ie("rebound-caption","Phụ đề bóng nảy",3,{text:"Bật lên mạnh mẽ",position:"lower",fg:"#36d6e7"},`function render(ctx,t,env){
7004
+ }`),re("rebound-caption","Phụ đề bóng nảy",3,{text:"Bật lên mạnh mẽ",position:"lower",fg:"#36d6e7"},`function render(ctx,t,env){
7005
7005
  // Overlay caption for scene chains: up to two lines of clean white sans text (text) with a cyan neon glow over a soft dark band for readability, popping in with a small bounce; transparent everywhere else (fields: text, fg, position).
7006
7006
  const {duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.3),u=S.u,fg=/^#[0-9a-f]{6}$/i.test(String(p.fg))?p.fg:'#36d6e7',s=String(p.text||'').trim()
7007
7007
  if(!s||!(k.v>0))return
@@ -7011,15 +7011,15 @@
7011
7011
  f.lines.forEach((l,i)=>{const a=M.ease.outBack(M.range(t,i*.08,.45+i*.08)),y=y0+i*lh+(1-a)*u*.03;if(!(a>0))return
7012
7012
  ctx.globalAlpha=Math.min(1,a)*(1-k.o);ctx.shadowColor=fg;ctx.shadowBlur=f.size*.5;ctx.fillStyle='#ffffff';ctx.fillText(l,S.cx,y);ctx.shadowBlur=f.size*.12;ctx.fillText(l,S.cx,y)})
7013
7013
  ctx.restore()
7014
- }`),ie("rebound-ball","Bóng nảy góc",4,{position:"bottom-right",fg:"#36d6e7"},`function render(c,t,env){
7015
- ${pe}${ts}
7014
+ }`),re("rebound-ball","Bóng nảy góc",4,{position:"bottom-right",fg:"#36d6e7"},`function render(c,t,env){
7015
+ ${ge}${ts}
7016
7016
  // Element: a small glowing white ball keeps bouncing on a short neon line in a corner or edge (position: bottom-right, bottom-left, top-left, top-right, top, lower), squashing on each contact and stretching as it flies; loops over any duration; transparent elsewhere (fields: position, fg).
7017
7017
  const {duration:D,params:p}=env,k=M.io(t,D,.45,.4),u=MIN(env.width,env.height),r=u*.018,o=SPOT(env,p.position,'bottom-right',u*.2,u*.22),ac=PC(p.fg,CY),pe=.62,f=(t%pe)/pe,hg=u*.12,y0=o.y+u*.08,yb=y0-r-4*hg*f*(1-f),vy=4*hg*(1-2*f)/pe,x=o.x+SN(t*1.3)*u*.03,q=Math.exp(-Math.pow(MIN(f,1-f)*pe/.05,2))*.5
7018
7018
  if(!(k.v>0))return
7019
7019
  SV(c);GA(c,k.v);NL(c,u,ac,()=>{c.moveTo(o.x-u*.08,y0);c.lineTo(o.x+u*.08,y0)},1,k.i,.16);NL(c,u,OR,()=>{c.moveTo(o.x-u*.05,y0+u*.014);c.lineTo(o.x+u*.05,y0+u*.014)},.7,k.i,.1);GL(c,x,y0,u*.07,ac,q*1.6)
7020
7020
  BALL(c,x,yb,r*(.4+.6*k.i),ac,1+MIN(1.8,ABS(vy)/(u*1.6)),PI/2,q);RS(c)
7021
- }`),ie("rebound-bricks","Chồng gạch neon nhỏ",4,{position:"top-left",fg:"#36d6e7"},`function render(c,t,env){
7022
- ${pe}${ts}
7021
+ }`),re("rebound-bricks","Chồng gạch neon nhỏ",4,{position:"top-left",fg:"#36d6e7"},`function render(c,t,env){
7022
+ ${ge}${ts}
7023
7023
  // Element: a small outlined neon brick stack (red, orange, cyan offset rows) with a little glowing dot bouncing on top, in a corner or edge (position: top-left, top-right, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg).
7024
7024
  const {duration:D,params:p}=env,k=M.io(t,D,.45,.4),u=MIN(env.width,env.height),o=SPOT(env,p.position,'top-left',u*.18,u*.2),ac=PC(p.fg,CY),bw=u*.05,bh=u*.026,base=o.y+u*.08,C=[RD,OR,ac],top=base-3*bh,pe=.7,f=(t%pe)/pe,r=u*.011,q=Math.exp(-Math.pow(MIN(f,1-f)*pe/.05,2))*.5
7025
7025
  if(!(k.v>0))return
@@ -7027,8 +7027,8 @@
7027
7027
  for(let i=0;i<3;i++)for(let j=0;j<2;j++){const x=o.x-bw+j*bw+(i%2?bw*.2:-bw*.2),y=base-(i+1)*bh,g=u*.003,col=C[(i+j)%3];SV(c);GA(c,.12*k.v);FS(c,col);RC(c,x+g,y+g,bw-2*g,bh-2*g);RS(c);NL(c,u,col,()=>c.rect(x+g,y+g,bw-2*g,bh-2*g),1,M.clamp(k.i*1.6-i*.2),.16)}
7028
7028
  NL(c,u,WH,()=>{c.moveTo(o.x-bw*1.6,base);c.lineTo(o.x+bw*1.6,base)},.7,k.i,.16)
7029
7029
  BALL(c,o.x+SN(t*.9)*bw*.4,top-r-4*u*.07*f*(1-f),r*k.i,ac,1+ABS(1-2*f)*.6,PI/2,q);RS(c)
7030
- }`)],es=V.find(t=>t.id==="join"),le=(t,e,c,a,o)=>({id:t,name:e,category:es.name,pack:"join",duration:c,params:{accent:es.accent,position:"center",...a,style:"join"},code:o}),re="const D=env.duration,W=env.width,H=env.height,p=env.params||{},h=D/2,hd=Math.min(h*.4,Math.max(D*.06,.07)),inn=t<h,a=M.clamp(t/(h-hd)),b=M.clamp((t-h-hd)/(h-hd)),full=t>=h-hd&&t<=h+hd,HX=/^#[0-9a-f]{6}$/i,A=HX.test(p.accent)?p.accent:'#ff5a36',B=HX.test(p.fg2)?p.fg2:'#0c0c10',C3=HX.test(p.fg3)?p.fg3:'#f4efe6',u=Math.min(W,H),L=Math.hypot(W,H),port=H>W*1.1,E=M.ease.inOutCubic,m=Math.ceil(u*.01)+2,dk=String(p.dir||''),vert=dk==='t'||dk==='b',w=vert?H:W,v=vert?W:H,ang=dk==='r'?Math.PI:dk==='t'?Math.PI/2:dk==='b'?-Math.PI/2:0,ORI=()=>{ctx.translate(W/2,H/2);ctx.rotate(ang);ctx.translate(-w/2,-v/2)},BASE=c=>{if(full){ctx.fillStyle=c;ctx.fillRect(-m,-m,Math.max(W,H)+2*m,Math.max(W,H)+2*m)}};if(!(t>0&&t<D))return;",gr=[le("join-cube-turn","Khối lập phương xoay",1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7031
- ${re}
7030
+ }`)],es=V.find(t=>t.id==="join"),xe=(t,e,c,a,o)=>({id:t,name:e,category:es.name,pack:"join",duration:c,params:{accent:es.accent,position:"center",...a,style:"join"},code:o}),he="const D=env.duration,W=env.width,H=env.height,p=env.params||{},h=D/2,hd=Math.min(h*.4,Math.max(D*.06,.07)),inn=t<h,a=M.clamp(t/(h-hd)),b=M.clamp((t-h-hd)/(h-hd)),full=t>=h-hd&&t<=h+hd,HX=/^#[0-9a-f]{6}$/i,A=HX.test(p.accent)?p.accent:'#ff5a36',B=HX.test(p.fg2)?p.fg2:'#0c0c10',C3=HX.test(p.fg3)?p.fg3:'#f4efe6',u=Math.min(W,H),L=Math.hypot(W,H),port=H>W*1.1,E=M.ease.inOutCubic,m=Math.ceil(u*.01)+2,dk=String(p.dir||''),vert=dk==='t'||dk==='b',w=vert?H:W,v=vert?W:H,ang=dk==='r'?Math.PI:dk==='t'?Math.PI/2:dk==='b'?-Math.PI/2:0,ORI=()=>{ctx.translate(W/2,H/2);ctx.rotate(ang);ctx.translate(-w/2,-v/2)},BASE=c=>{if(full){ctx.fillStyle=c;ctx.fillRect(-m,-m,Math.max(W,H)+2*m,Math.max(W,H)+2*m)}};if(!(t>0&&t<D))return;",gr=[xe("join-cube-turn","Khối lập phương xoay",1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7031
+ ${he}
7032
7032
  // The frame is the front face of a cube that turns in perspective (dir = the side the new face comes from): the
7033
7033
  // accent side face swings in with lambert shading, an inset bevel and a moving specular band and covers the frame
7034
7034
  // at the midpoint, then keeps turning away while the next face (the new shot) turns in. The void around the cube
@@ -7048,8 +7048,8 @@
7048
7048
  ctx.beginPath();quad(P,Q);ctx.strokeStyle=M.rgba(M.mix(A,'#ffffff',.5),.55*fa);ctx.lineWidth=Math.max(1,u*.004);ctx.stroke()})
7049
7049
  const SE=inn?P0:P3,ea=M.clamp(Math.min(Math.abs(cs),Math.abs(sn))*2.5);if(ea>0){ctx.strokeStyle=M.rgba('#ffffff',.6*ea);ctx.lineWidth=Math.max(1,u*.005);ctx.beginPath();ctx.moveTo(SE[0],SE[1]);ctx.lineTo(SE[0],SE[2]);ctx.stroke()}
7050
7050
  ctx.restore()
7051
- }`),le("join-panel-flip","Tấm lật 3D",1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7052
- ${re}
7051
+ }`),xe("join-panel-flip","Tấm lật 3D",1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7052
+ ${he}
7053
7053
  // The frame splits into vertical panels (4 in 9:16, 6 in 16:9) that flip in 3D one after another (width through
7054
7054
  // 0, perspective on the edges): back faces in accent / partner cover the frame at the midpoint, then the panels keep
7055
7055
  // flipping the same way and the new shot comes round on their front. Gaps show a deep partner void.
@@ -7065,8 +7065,8 @@
7065
7065
  const hg=ctx.createLinearGradient(0,0,0,v);hg.addColorStop(0,'rgba(255,255,255,.1)');hg.addColorStop(.5,'rgba(255,255,255,0)');hg.addColorStop(1,'rgba(0,0,0,.14)');ctx.fillStyle=hg;ctx.fill()
7066
7066
  ctx.strokeStyle=M.rgba(M.mix(col,'#ffffff',.45),.45*ac);ctx.lineWidth=Math.max(1,u*.003);ctx.beginPath();ctx.moveTo(q.cx-q.hw+1,v/2-q.hl);ctx.lineTo(q.cx-q.hw+1,v/2+q.hl);ctx.stroke()})
7067
7067
  ctx.restore()
7068
- }`),le("join-paper-fold","Gấp giấy origami",1.2,{fg2:"#0c0c10",fg3:"#f1ebe0"},`function render(ctx,t,env){
7069
- ${re}
7068
+ }`),xe("join-paper-fold","Gấp giấy origami",1.2,{fg2:"#0c0c10",fg3:"#f1ebe0"},`function render(ctx,t,env){
7069
+ ${he}
7070
7070
  // Origami envelope: four paper flaps hinged on the frame edges (left, right in accent, top, bottom in paper fg3)
7071
7071
  // fold down one after another along their creases, shaded by their tilt and casting a soft shadow, until they meet
7072
7072
  // in the centre and cover the frame; then they unfold in reverse order (the last fold lifts first) to reveal.
@@ -7081,8 +7081,8 @@
7081
7081
  ctx.strokeStyle='rgba(255,255,255,.2)';ctx.lineWidth=Math.max(1,u*.002);ctx.beginPath();ctx.moveTo(M.lerp(mx,ax,.08),M.lerp(my,ay,.08));ctx.lineTo(M.lerp(mx,ax,.9),M.lerp(my,ay,.9));ctx.stroke()
7082
7082
  const sh=ctx.createLinearGradient(mx,my,ax,ay);sh.addColorStop(0,'rgba(255,255,255,0)');sh.addColorStop(M.clamp(.2+.6*k),M.rgba('#ffffff',.16*Math.sin(k*Math.PI)));sh.addColorStop(1,'rgba(255,255,255,0)');tri();ctx.fillStyle=sh;ctx.fill()})
7083
7083
  ctx.restore()
7084
- }`),le("join-page-curl","Cuộn góc trang",1.1,{fg2:"#0c0c10",dir:"b"},`function render(ctx,t,env){
7085
- ${re}
7084
+ }`),xe("join-page-curl","Cuộn góc trang",1.1,{fg2:"#0c0c10",dir:"b"},`function render(ctx,t,env){
7085
+ ${he}
7086
7086
  // A page curl from a corner (dir picks the corner: b = bottom-right): an accent page unrolls diagonally over the
7087
7087
  // frame, its rolled edge a shaded cylinder casting a shadow ahead; covered at the midpoint, the page then peels up
7088
7088
  // from the same corner and rolls on across and off, revealing the new shot behind the roll.
@@ -7095,8 +7095,8 @@
7095
7095
  if(inn){const x=-(rw+sl+2)+run*E(a);ctx.fillStyle=pg;ctx.fillRect(-BIG,-BIG,x+BIG,BIG*2);shade(x+rw,x+rw+sl,.42);roll(x,false)}
7096
7096
  else{const y=-(rw+sl+2)+run*E(b);shade(y,y-sl*.55,.3);ctx.fillStyle=pg;ctx.fillRect(y+rw,-BIG,BIG,BIG*2);shade(y+rw,y+rw+sl*.6,.3);roll(y,true)}
7097
7097
  ctx.restore()
7098
- }`),le("join-paper-tear","Xé giấy hai lớp",1,{fg2:"#0c0c10",fg3:"#f6f1e7",dir:"l"},`function render(ctx,t,env){
7099
- ${re}
7098
+ }`),xe("join-paper-tear","Xé giấy hai lớp",1,{fg2:"#0c0c10",fg3:"#f6f1e7",dir:"l"},`function render(ctx,t,env){
7099
+ ${he}
7100
7100
  // Torn paper: two sheets (partner below, accent on top) rip across with ragged seeded edges, a fibrous paper-core
7101
7101
  // rim (fg3) and a drop shadow; covered at the midpoint, then their torn trailing edges keep sweeping the same way —
7102
7102
  // the accent sheet first, showing the partner sheet, then that one — to reveal the new shot.
@@ -7110,8 +7110,8 @@
7110
7110
  if(inn){const xc=-g-lag+run*E(a);band(xc,ED[0],B,true);band(xc-lag,ED[1],A,true)}
7111
7111
  else{const xa=-g+run*E(b);band(xa-lag,ED[3],B,false);band(xa,ED[2],A,false)}
7112
7112
  ctx.restore()
7113
- }`),le("join-liquid-drip","Chất lỏng nhỏ giọt",1.2,{fg2:"#0c0c10"},`function render(ctx,t,env){
7114
- ${re}
7113
+ }`),xe("join-liquid-drip","Chất lỏng nhỏ giọt",1.2,{fg2:"#0c0c10"},`function render(ctx,t,env){
7114
+ ${he}
7115
7115
  // Thick liquid pours down from the top: rounded drips with bulbous tips (metaball-like) and glossy highlights run
7116
7116
  // ahead of the surface, a partner layer under an accent layer, until the frame is flooded; then the liquid drains
7117
7117
  // down off the bottom, its wavy surface sinking while the drips left hanging from the top shrink back up.
@@ -7129,8 +7129,8 @@
7129
7129
  if(inn){const lev=-mx-m+(H+2*m+mx)*E(a);pour(B,lev+lagL,DB,2,Math.min(1,a*1.15));pour(A,lev,DA,0,a)}
7130
7130
  else{const T=-m-amp+(H+2*m+2*amp+lagL)*E(b);drain(B,T-lagL,DB,2);drain(A,T,DA,0)}
7131
7131
  ctx.restore()
7132
- }`),le("join-ripple-rings","Gợn sóng vòng tròn",1.2,{fg2:"#0c0c10"},`function render(ctx,t,env){
7133
- ${re}
7132
+ }`),xe("join-ripple-rings","Gợn sóng vòng tròn",1.2,{fg2:"#0c0c10"},`function render(ctx,t,env){
7133
+ ${he}
7134
7134
  // Water ripples: concentric accent / partner bands with soft crest highlights expand from a point behind a wobbling
7135
7135
  // wave front (faint rings run ahead on the footage) until they fill the frame; then a rippling hole opens from the
7136
7136
  // same point and races outward while the bands keep travelling out, revealing the new shot.
@@ -7148,8 +7148,8 @@
7148
7148
  const sg=ctx.createRadialGradient(cx,cy,0,cx,cy,Rm);sg.addColorStop(0,'rgba(255,255,255,.07)');sg.addColorStop(1,'rgba(0,0,0,.2)');ctx.fillStyle=sg;ctx.fillRect(-m,-m,W+2*m,H+2*m);ctx.restore()
7149
7149
  const er=inn?R0:R2;if(er>0&&!full){ctx.strokeStyle=M.rgba(M.mix(A,'#ffffff',.55),.8);ctx.lineWidth=Math.max(1,u*.006);ctx.beginPath();wob(er);ctx.stroke()}
7150
7150
  ctx.restore()
7151
- }`),le("join-particle-reform","Hạt tụ rồi tan",1.2,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7152
- ${re}
7151
+ }`),xe("join-particle-reform","Hạt tụ rồi tan",1.2,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7152
+ ${he}
7153
7153
  // Particles disperse → re-form: about two thousand rounded squares fly in spinning from scattered points on the dir
7154
7154
  // side, grow square and settle into a full-cover grid (the far side first); then they break off the grid and fly
7155
7155
  // on out the other side, shrinking and spinning, revealing the new shot.
@@ -7164,8 +7164,8 @@
7164
7164
  if(k>=1){ctx.fillRect(x-.5,y-.5,cs+1,cs+1);continue}
7165
7165
  ctx.save();ctx.translate(x+cs/2+ox,y+cs/2+oy);ctx.rotate(ro);M.rr(ctx,-sz/2,-sz/2,sz,sz,sz/2*(1-k)*.9);ctx.fill();ctx.restore()}
7166
7166
  ctx.restore()
7167
- }`),le("join-split-screen","Chia ba khung",.9,{fg2:"#0c0c10",fg3:"#f4efe6"},`function render(ctx,t,env){
7168
- ${re}
7167
+ }`),xe("join-split-screen","Chia ba khung",.9,{fg2:"#0c0c10",fg3:"#f4efe6"},`function render(ctx,t,env){
7168
+ ${he}
7169
7169
  // Split screen: three panels (horizontal bands in 9:16, columns in 16:9) in accent / partner / fg3 slide in from
7170
7170
  // alternate sides with offset timing, each with a contrasting leading stripe and a drop shadow, tile the frame at
7171
7171
  // the midpoint, then keep sliding the same way out the other side.
@@ -7179,8 +7179,8 @@
7179
7179
  ctx.save();ctx.shadowColor='rgba(0,0,0,.4)';ctx.shadowBlur=u*.04;ctx.fillStyle=g;ctx.fillRect(x,y,ww,hh);ctx.restore()
7180
7180
  ctx.fillStyle=BAR[i];if(port)ctx.fillRect(dirn>0?x+ww:x-bt,y,bt,hh);else ctx.fillRect(x,dirn>0?y+hh:y-bt,ww,bt)}
7181
7181
  ctx.restore()
7182
- }`),le("join-shape-morph","Biến hình khối",1.1,{fg2:"#0c0c10"},`function render(ctx,t,env){
7183
- ${re}
7182
+ }`),xe("join-shape-morph","Biến hình khối",1.1,{fg2:"#0c0c10"},`function render(ctx,t,env){
7183
+ ${he}
7184
7184
  // Shape morph: a circle grows from the centre and morphs into a rounded square, then a soft five-point star (polar
7185
7185
  // radius functions lerped), turning, with a partner shape echoing behind it, until the star covers the frame; then it
7186
7186
  // morphs back star → square → circle while shrinking away to an off-centre point.
@@ -7193,8 +7193,8 @@
7193
7193
  if(S>.5){shape(cx,cy,S,mp,rot);const g=ctx.createRadialGradient(cx-S*.3,cy-S*.35,0,cx,cy,S*1.2);g.addColorStop(0,M.mix(A,'#ffffff',.28));g.addColorStop(.5,A);g.addColorStop(1,M.mix(A,'#000000',.24));ctx.fillStyle=g;ctx.fill()
7194
7194
  ctx.strokeStyle=M.rgba(M.mix(A,'#ffffff',.5),.6);ctx.lineWidth=Math.max(1,u*.007);ctx.stroke();shape(cx,cy,S*.62,mp,rot+.15);ctx.strokeStyle='rgba(255,255,255,.14)';ctx.lineWidth=Math.max(1,u*.004);ctx.stroke()}
7195
7195
  ctx.restore()
7196
- }`),le("join-type-wall","Tường chữ",1.1,{fg2:"#0c0c10",text:"NEXT"},`function render(ctx,t,env){
7197
- ${re}
7196
+ }`),xe("join-type-wall","Tường chữ",1.1,{fg2:"#0c0c10",text:"NEXT"},`function render(ctx,t,env){
7197
+ ${he}
7198
7198
  // Typographic wall: rows of the giant repeated word (text) in the pack's heavy font slide in from alternating sides
7199
7199
  // with a stagger until they tile the frame (rows alternate accent / partner, the word in the other colour, still
7200
7200
  // drifting); then each row keeps sliding the same way out the other side.
@@ -7210,8 +7210,8 @@
7210
7210
  const dr=-sd*(t/D)*rh*2+i*tw*.37,x0=off+((dr%tw)+tw)%tw-tw;for(let x=x0;x<off+W+tw;x+=tw)ctx.fillText(wd,x,(y0+y1)/2+fs*.04)
7211
7211
  ctx.restore()}
7212
7212
  ctx.restore()
7213
- }`),le("join-zoom-object","Phóng xuyên lỗ khóa",1,{fg2:"#0c0c10"},`function render(ctx,t,env){
7214
- ${re}
7213
+ }`),xe("join-zoom-object","Phóng xuyên lỗ khóa",1,{fg2:"#0c0c10"},`function render(ctx,t,env){
7214
+ ${he}
7215
7215
  // Zoom into an object: a keyhole with a metallic accent rim and a dark glass interior zooms up from the centre with
7216
7216
  // the camera (exponential scale, radial speed streaks) until its interior fills the frame; then the same keyhole
7217
7217
  // opening appears in that interior and zooms on past the edges, the new shot seen through it.
@@ -7229,8 +7229,8 @@
7229
7229
  ctx.beginPath();ctx.rect(-m,-m,W+2*m,H+2*m);KH(s*1.18);ctx.fillStyle=glass;ctx.fill('evenodd')
7230
7230
  ctx.beginPath();KH(s*1.18);KH(s);ctx.fillStyle=metal(s);ctx.fill('evenodd')}
7231
7231
  ctx.restore()
7232
- }`),le("join-blinds-3d","Rèm lá 3D",1,{fg2:"#0c0c10",fg3:"#f4efe6"},`function render(ctx,t,env){
7233
- ${re}
7232
+ }`),xe("join-blinds-3d","Rèm lá 3D",1,{fg2:"#0c0c10",fg3:"#f4efe6"},`function render(ctx,t,env){
7233
+ ${he}
7234
7234
  // Venetian blinds: horizontal slats rotate in 3D about their axes (height through sin, lit from above, a bright top
7235
7235
  // lip and a dark bottom edge, a soft shadow on the footage below each one) cascading from the top until they close
7236
7236
  // and cover; then they keep rotating the same way and open again, top first, on the new shot. Two ladder cords.
@@ -7243,8 +7243,8 @@
7243
7243
  const lw=Math.max(1,u*.002);ctx.fillStyle=M.rgba('#ffffff',.3*s.sn);ctx.fillRect(-m,y0,W+2*m,lw);ctx.fillStyle=M.rgba(B,.4*s.sn);ctx.fillRect(-m,y1-lw,W+2*m,lw)})
7244
7244
  const ca=inn?Math.min(1,a*4):1-b;if(ca>0){ctx.fillStyle=M.rgba(C3,.45*ca);[.18,.82].forEach(f=>ctx.fillRect(W*f-Math.max(1,u*.0025),-m,Math.max(2,u*.005),H+2*m))}
7245
7245
  ctx.restore()
7246
- }`),le("join-mosaic-tiles","Ô gạch lật",1.1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7247
- ${re}
7246
+ }`),xe("join-mosaic-tiles","Ô gạch lật",1.1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7247
+ ${he}
7248
7248
  // Mosaic: a grid of big tiles flips in on a diagonal wave from the dir corner (each tile turns about its vertical axis
7249
7249
  // while scaling up, shaded by its angle, corners rounding off as it lands) until the mosaic covers the frame; then
7250
7250
  // the wave runs again the same way and every tile keeps turning past edge-on, revealing the new shot.
@@ -7258,8 +7258,8 @@
7258
7258
  M.rr(ctx,cx-tw/2,cy-th/2,tw,th,rad);ctx.fillStyle=g;ctx.fill()
7259
7259
  if(sn>.3){ctx.strokeStyle=M.rgba('#ffffff',.16*sn);ctx.lineWidth=Math.max(1,T*.018);M.rr(ctx,cx-tw/2+T*.02,cy-th/2+T*.02,tw-T*.04,th-T*.04,rad);ctx.stroke()}}
7260
7260
  ctx.restore()
7261
- }`),le("join-halftone","Chấm lưới in",1.1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7262
- ${re}
7261
+ }`),xe("join-halftone","Chấm lưới in",1.1,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7262
+ ${he}
7263
7263
  // Halftone: two print screens of dots (partner at 15°, accent at 45°) grow from specks to overlapping discs along a
7264
7264
  // diagonal gradient from the dir corner until the accent screen covers the frame; then the dots shrink away again
7265
7265
  // with the wave carrying on in the same direction, revealing the new shot.
@@ -7273,8 +7273,8 @@
7273
7273
  if(inn){layer(.26,c*1.25,M.clamp(a*1.18),B,false);layer(Math.PI/4,c,a,gA,false)}
7274
7274
  else{layer(.26,c*1.25,M.clamp(b*1.18-.18),B,true);layer(Math.PI/4,c,M.clamp(b*1.18),gA,true)}
7275
7275
  ctx.restore()
7276
- }`),le("join-light-leak","Lóe sáng phim",.9,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7277
- ${re}
7276
+ }`),xe("join-light-leak","Lóe sáng phim",.9,{fg2:"#0c0c10",dir:"l"},`function render(ctx,t,env){
7277
+ ${he}
7278
7278
  // Film burn / light leak: warm orange-amber-white radial blooms (additive), an edge leak from the dir side and
7279
7279
  // flickering dust flare up and drift across until the frame is blown out to an opaque warm white at the midpoint;
7280
7280
  // then the blow-out fades and the blooms decay as they drift on, revealing the new shot.
@@ -7287,8 +7287,8 @@
7287
7287
  ctx.globalCompositeOperation='source-over'
7288
7288
  let fb=M.clamp((e-.55)/.45);fb=fb*fb*(3-2*fb);if(fb>0){const g=ctx.createRadialGradient(w*(.3+.4*sP),v*.45,0,w*(.3+.4*sP),v*.45,L*.75);g.addColorStop(0,M.rgba('#fffaf0',fb));g.addColorStop(.45,M.rgba('#ffe6b0',fb));g.addColorStop(1,M.rgba(M.mix(A,'#ffc07a',.55),fb));ctx.fillStyle=g;ctx.fillRect(-m,-m,w+2*m,v+2*m)}
7289
7289
  ctx.restore()
7290
- }`)],cs=V.find(t=>t.id==="fluid"),de=(t,e,c,a,o)=>({id:t,name:e,category:cs.name,pack:"fluid",duration:c,params:{accent:cs.accent,position:"center",...a,style:"fluid"},code:o}),ge="const PL='#14102a',IK='#0d0b1e',PK='#ff6fb5',PE='#ffb38a',LI='#b49cff',MI='#7ee8c8',BU='#ffe38a',WH='#ffffff';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,PL),nx:PC(p.next,PL),fg:PC(p.fg,PK),f2:PC(p.fg2,LI)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.46,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const QM=(B,col)=>M.mix(col,B.K.nx,B.q);const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{const k=.22*Math.min(1,a)*B.e*(1-B.q);if(!(k>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.6);g.addColorStop(0,M.rgba(col,k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const SM=(c,P)=>{const n=P.length,m=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2],s=m(P[0],P[1%n]);c.moveTo(s[0],s[1]);for(let i=1;i<=n;i++){const a=P[i%n],z=m(a,P[(i+1)%n]);c.quadraticCurveTo(a[0],a[1],z[0],z[1])}c.closePath()};const PTS=(x,y,f,n=72)=>{const o=[];for(let i=0;i<n;i++){const a=i/n*M.TAU,r=Math.max(0,f(a));o.push([x+Math.cos(a)*r,y+Math.sin(a)*r])}return o};const WB=(t,s,A)=>a=>1+A*(.55*Math.sin(2*a+t*1.1+s)+.3*Math.sin(3*a-t*1.4+s*1.7)+.15*Math.sin(5*a+t*.8+s*2.3));const LG=(c,x,y,r,c1,c2)=>{const g=c.createRadialGradient(x-r*.35,y-r*.45,r*.05,x,y,Math.max(1,r*1.25));g.addColorStop(0,M.mix(c1,WH,.45));g.addColorStop(.42,c1);g.addColorStop(1,c2);return g};const HL=(c,x,y,r,a=1)=>{if(!(a>0)||!(r>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x-r*.34,y-r*.44);c.rotate(-.6);c.scale(1,.55);const g=c.createRadialGradient(0,0,0,0,0,r*.42);g.addColorStop(0,'rgba(255,255,255,.72)');g.addColorStop(.5,'rgba(255,255,255,.2)');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.arc(0,0,r*.42,0,M.TAU);c.fill();c.fillStyle='rgba(255,255,255,.85)';c.beginPath();c.arc(-r*.05,-r*.02,r*.075,0,M.TAU);c.fill();c.restore()};const GEL=(c,P,x,y,r,c1,c2,k=1)=>{if(!(r>0))return;c.beginPath();SM(c,P);c.fillStyle=LG(c,x,y,r,c1,c2);c.fill();if(!(k>0))return;c.save();c.clip();c.beginPath();c.rect(x-r*6,y-r*6,r*12,r*12);SM(c,P);c.shadowColor=M.rgba(IK,.5*Math.min(1,k));c.shadowBlur=r*.3;c.shadowOffsetX=-r*.07;c.shadowOffsetY=-r*.12;c.fillStyle=IK;c.fill('evenodd');c.restore();HL(c,x,y,r,k)};",Po="const BR=(c,A,B,v=.5)=>{const x1=A[0],y1=A[1],r1=A[2],x2=B[0],y2=B[1],r2=B[2],d=Math.hypot(x2-x1,y2-y1),mx=(r1+r2)*1.3;if(!(r1>0&&r2>0)||d>=mx||d<=Math.abs(r1-r2)+.5)return;const PI=Math.PI,ac=z=>Math.acos(M.clamp(z,-1,1)),o=d<r1+r2,u1=o?ac((r1*r1+d*d-r2*r2)/(2*r1*d)):0,u2=o?ac((r2*r2+d*d-r1*r1)/(2*r2*d)):0,an=Math.atan2(y2-y1,x2-x1),ms=ac((r1-r2)/d),w=v*(o?1:M.clamp((mx-d)/(mx-r1-r2))),a1=an+u1+(ms-u1)*w,a2=an-u1-(ms-u1)*w,a3=an+PI-u2-(PI-u2-ms)*w,a4=an-PI+u2+(PI-u2-ms)*w,V=(x,y,a,r)=>[x+Math.cos(a)*r,y+Math.sin(a)*r],p1=V(x1,y1,a1,r1),p2=V(x1,y1,a2,r1),p3=V(x2,y2,a3,r2),p4=V(x2,y2,a4,r2),k=Math.min(w*2.4,Math.hypot(p3[0]-p1[0],p3[1]-p1[1])/(r1+r2))*Math.min(1,d*2/(r1+r2)),h1=V(p1[0],p1[1],a1-PI/2,r1*k),h2=V(p2[0],p2[1],a2+PI/2,r1*k),h3=V(p3[0],p3[1],a3+PI/2,r2*k),h4=V(p4[0],p4[1],a4-PI/2,r2*k),Q=[p1,p3,p4,p2];let ar=0;for(let i=0;i<4;i++){const a=Q[i],b=Q[(i+1)%4];ar+=a[0]*b[1]-b[0]*a[1]}if(ar>=0){c.moveTo(p1[0],p1[1]);c.bezierCurveTo(h1[0],h1[1],h3[0],h3[1],p3[0],p3[1]);c.lineTo(p4[0],p4[1]);c.bezierCurveTo(h4[0],h4[1],h2[0],h2[1],p2[0],p2[1])}else{c.moveTo(p2[0],p2[1]);c.bezierCurveTo(h2[0],h2[1],h4[0],h4[1],p4[0],p4[1]);c.lineTo(p3[0],p3[1]);c.bezierCurveTo(h3[0],h3[1],h1[0],h1[1],p1[0],p1[1])}c.closePath()};const UNI=(c,L,v=.5)=>{c.beginPath();L.forEach(b=>{if(b[2]>0){c.moveTo(b[0]+b[2],b[1]);c.arc(b[0],b[1],b[2],0,M.TAU)}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)BR(c,L[i],L[j],v)};const UF=(c,L,v=.5,nb)=>{L.forEach(b=>{if(b[2]>0){c.beginPath();c.arc(b[0],b[1],b[2],0,M.TAU);c.fill()}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)if(!nb||nb(i,j)){c.beginPath();BR(c,L[i],L[j],v);c.fill()}};",ur="const FCT=(L,x,y,rm,n=90)=>{const F=(px,py)=>{let s=0;for(const b of L){if(!(b[2]>0))continue;const dx=px-b[0],dy=py-b[1];s+=b[2]*b[2]/(dx*dx+dy*dy+.01)}return s},o=[],st=Math.max(.5,rm/42);for(let i=0;i<n;i++){const a=i/n*M.TAU,ca=Math.cos(a),sa=Math.sin(a);let r=st;while(r<rm&&F(x+ca*r,y+sa*r)>=1)r+=st;let lo=r-st,hi=r;for(let k=0;k<6;k++){const m=(lo+hi)/2;if(F(x+ca*m,y+sa*m)>=1)lo=m;else hi=m}o.push([x+ca*lo,y+sa*lo])}return o};",zo="const TEAR=(c,x,y,r,s=1)=>{const h=y-r*(1+1.4*s);c.moveTo(x,h);c.bezierCurveTo(x+r*.3,y-r*(.55+.7*s),x+r,y-r*.6,x+r,y);c.arc(x,y,r,0,Math.PI);c.bezierCurveTo(x-r,y-r*.6,x-r*.3,y-r*(.55+.7*s),x,h);c.closePath()};const DRIP=(c,x,y,w,L)=>{c.beginPath();if(!(L>0)||!(w>0))return;const b=w*.62*M.clamp(L/(w*1.4),.6,1),e=y+L-b*1.6;c.moveTo(x-w*.75,y-w*.9);c.quadraticCurveTo(x-w*.42,y-w*.3,x-w*.42,y+w*.6);if(e>y+w*.6)c.lineTo(x-w*.38,e);c.quadraticCurveTo(x-w*.38,y+L-b*.9,x-b,y+L);c.arc(x,y+L,b,Math.PI,0,true);c.quadraticCurveTo(x+w*.38,y+L-b*.9,x+w*.38,Math.max(e,y+w*.6));c.lineTo(x+w*.42,y+w*.6);c.quadraticCurveTo(x+w*.42,y-w*.3,x+w*.75,y-w*.9);c.closePath()};",br="const BUB=(c,x,y,r,f1,f2,a=1,sx=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x,y);c.scale(sx,1/sx);const g=c.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(f2,.04));g.addColorStop(.72,M.rgba(f2,.12));g.addColorStop(.93,M.rgba(f1,.42));g.addColorStop(1,'rgba(255,255,255,.6)');c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();const rg=c.createLinearGradient(-r,-r,r,r);rg.addColorStop(0,M.rgba(f1,.85));rg.addColorStop(.5,M.rgba(MI,.6));rg.addColorStop(1,M.rgba(f2,.85));c.strokeStyle=rg;c.lineWidth=Math.max(.8,r*.035);c.stroke();c.lineCap='round';c.strokeStyle='rgba(255,255,255,.75)';c.lineWidth=r*.09;c.beginPath();c.arc(0,0,r*.74,Math.PI*1.08,Math.PI*1.42);c.stroke();c.strokeStyle='rgba(255,255,255,.3)';c.lineWidth=r*.05;c.beginPath();c.arc(0,0,r*.8,Math.PI*.15,Math.PI*.4);c.stroke();c.fillStyle='rgba(255,255,255,.9)';c.beginPath();c.arc(-r*.36,-r*.5,r*.07,0,M.TAU);c.fill();c.restore()};",Bo="const POOL=(c,B,Y,top,c1,c2,k=1)=>{const W=B.W,H=B.H;c.beginPath();c.moveTo(-5,H+5);for(let i=0;i<=64;i++){const x=i/64*W;c.lineTo(x,Y(x))}c.lineTo(W+5,H+5);c.closePath();const g=c.createLinearGradient(0,top-B.u*.04,0,H);g.addColorStop(0,M.mix(c1,WH,.3*k));g.addColorStop(.22,c1);g.addColorStop(1,c2);c.fillStyle=g;c.fill();if(!(k>0))return;c.save();c.beginPath();for(let i=0;i<=64;i++){const x=i/64*W;c[i?'lineTo':'moveTo'](x,Y(x)+B.u*.004)}c.lineCap='round';c.strokeStyle=M.rgba(WH,.5*k);c.lineWidth=B.u*.004;c.stroke();c.globalAlpha=.12*k;c.lineWidth=B.u*.03;c.translate(0,B.u*.02);c.stroke();c.restore()};",as="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:S.x1-w/2,y=P.includes('top')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Ze="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.46",Mr=[de("fluid-blob-morph","Khối lỏng biến hình",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7291
- ${ge}${ur}
7290
+ }`)],cs=V.find(t=>t.id==="fluid"),ue=(t,e,c,a,o)=>({id:t,name:e,category:cs.name,pack:"fluid",duration:c,params:{accent:cs.accent,position:"center",...a,style:"fluid"},code:o}),be="const PL='#14102a',IK='#0d0b1e',PK='#ff6fb5',PE='#ffb38a',LI='#b49cff',MI='#7ee8c8',BU='#ffe38a',WH='#ffffff';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,PL),nx:PC(p.next,PL),fg:PC(p.fg,PK),f2:PC(p.fg2,LI)});const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.46,D-.04))}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const QM=(B,col)=>M.mix(col,B.K.nx,B.q);const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{const k=.22*Math.min(1,a)*B.e*(1-B.q);if(!(k>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.6);g.addColorStop(0,M.rgba(col,k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const SM=(c,P)=>{const n=P.length,m=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2],s=m(P[0],P[1%n]);c.moveTo(s[0],s[1]);for(let i=1;i<=n;i++){const a=P[i%n],z=m(a,P[(i+1)%n]);c.quadraticCurveTo(a[0],a[1],z[0],z[1])}c.closePath()};const PTS=(x,y,f,n=72)=>{const o=[];for(let i=0;i<n;i++){const a=i/n*M.TAU,r=Math.max(0,f(a));o.push([x+Math.cos(a)*r,y+Math.sin(a)*r])}return o};const WB=(t,s,A)=>a=>1+A*(.55*Math.sin(2*a+t*1.1+s)+.3*Math.sin(3*a-t*1.4+s*1.7)+.15*Math.sin(5*a+t*.8+s*2.3));const LG=(c,x,y,r,c1,c2)=>{const g=c.createRadialGradient(x-r*.35,y-r*.45,r*.05,x,y,Math.max(1,r*1.25));g.addColorStop(0,M.mix(c1,WH,.45));g.addColorStop(.42,c1);g.addColorStop(1,c2);return g};const HL=(c,x,y,r,a=1)=>{if(!(a>0)||!(r>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x-r*.34,y-r*.44);c.rotate(-.6);c.scale(1,.55);const g=c.createRadialGradient(0,0,0,0,0,r*.42);g.addColorStop(0,'rgba(255,255,255,.72)');g.addColorStop(.5,'rgba(255,255,255,.2)');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.arc(0,0,r*.42,0,M.TAU);c.fill();c.fillStyle='rgba(255,255,255,.85)';c.beginPath();c.arc(-r*.05,-r*.02,r*.075,0,M.TAU);c.fill();c.restore()};const GEL=(c,P,x,y,r,c1,c2,k=1)=>{if(!(r>0))return;c.beginPath();SM(c,P);c.fillStyle=LG(c,x,y,r,c1,c2);c.fill();if(!(k>0))return;c.save();c.clip();c.beginPath();c.rect(x-r*6,y-r*6,r*12,r*12);SM(c,P);c.shadowColor=M.rgba(IK,.5*Math.min(1,k));c.shadowBlur=r*.3;c.shadowOffsetX=-r*.07;c.shadowOffsetY=-r*.12;c.fillStyle=IK;c.fill('evenodd');c.restore();HL(c,x,y,r,k)};",Po="const BR=(c,A,B,v=.5)=>{const x1=A[0],y1=A[1],r1=A[2],x2=B[0],y2=B[1],r2=B[2],d=Math.hypot(x2-x1,y2-y1),mx=(r1+r2)*1.3;if(!(r1>0&&r2>0)||d>=mx||d<=Math.abs(r1-r2)+.5)return;const PI=Math.PI,ac=z=>Math.acos(M.clamp(z,-1,1)),o=d<r1+r2,u1=o?ac((r1*r1+d*d-r2*r2)/(2*r1*d)):0,u2=o?ac((r2*r2+d*d-r1*r1)/(2*r2*d)):0,an=Math.atan2(y2-y1,x2-x1),ms=ac((r1-r2)/d),w=v*(o?1:M.clamp((mx-d)/(mx-r1-r2))),a1=an+u1+(ms-u1)*w,a2=an-u1-(ms-u1)*w,a3=an+PI-u2-(PI-u2-ms)*w,a4=an-PI+u2+(PI-u2-ms)*w,V=(x,y,a,r)=>[x+Math.cos(a)*r,y+Math.sin(a)*r],p1=V(x1,y1,a1,r1),p2=V(x1,y1,a2,r1),p3=V(x2,y2,a3,r2),p4=V(x2,y2,a4,r2),k=Math.min(w*2.4,Math.hypot(p3[0]-p1[0],p3[1]-p1[1])/(r1+r2))*Math.min(1,d*2/(r1+r2)),h1=V(p1[0],p1[1],a1-PI/2,r1*k),h2=V(p2[0],p2[1],a2+PI/2,r1*k),h3=V(p3[0],p3[1],a3+PI/2,r2*k),h4=V(p4[0],p4[1],a4-PI/2,r2*k),Q=[p1,p3,p4,p2];let ar=0;for(let i=0;i<4;i++){const a=Q[i],b=Q[(i+1)%4];ar+=a[0]*b[1]-b[0]*a[1]}if(ar>=0){c.moveTo(p1[0],p1[1]);c.bezierCurveTo(h1[0],h1[1],h3[0],h3[1],p3[0],p3[1]);c.lineTo(p4[0],p4[1]);c.bezierCurveTo(h4[0],h4[1],h2[0],h2[1],p2[0],p2[1])}else{c.moveTo(p2[0],p2[1]);c.bezierCurveTo(h2[0],h2[1],h4[0],h4[1],p4[0],p4[1]);c.lineTo(p3[0],p3[1]);c.bezierCurveTo(h3[0],h3[1],h1[0],h1[1],p1[0],p1[1])}c.closePath()};const UNI=(c,L,v=.5)=>{c.beginPath();L.forEach(b=>{if(b[2]>0){c.moveTo(b[0]+b[2],b[1]);c.arc(b[0],b[1],b[2],0,M.TAU)}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)BR(c,L[i],L[j],v)};const UF=(c,L,v=.5,nb)=>{L.forEach(b=>{if(b[2]>0){c.beginPath();c.arc(b[0],b[1],b[2],0,M.TAU);c.fill()}});for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)if(!nb||nb(i,j)){c.beginPath();BR(c,L[i],L[j],v);c.fill()}};",ur="const FCT=(L,x,y,rm,n=90)=>{const F=(px,py)=>{let s=0;for(const b of L){if(!(b[2]>0))continue;const dx=px-b[0],dy=py-b[1];s+=b[2]*b[2]/(dx*dx+dy*dy+.01)}return s},o=[],st=Math.max(.5,rm/42);for(let i=0;i<n;i++){const a=i/n*M.TAU,ca=Math.cos(a),sa=Math.sin(a);let r=st;while(r<rm&&F(x+ca*r,y+sa*r)>=1)r+=st;let lo=r-st,hi=r;for(let k=0;k<6;k++){const m=(lo+hi)/2;if(F(x+ca*m,y+sa*m)>=1)lo=m;else hi=m}o.push([x+ca*lo,y+sa*lo])}return o};",zo="const TEAR=(c,x,y,r,s=1)=>{const h=y-r*(1+1.4*s);c.moveTo(x,h);c.bezierCurveTo(x+r*.3,y-r*(.55+.7*s),x+r,y-r*.6,x+r,y);c.arc(x,y,r,0,Math.PI);c.bezierCurveTo(x-r,y-r*.6,x-r*.3,y-r*(.55+.7*s),x,h);c.closePath()};const DRIP=(c,x,y,w,L)=>{c.beginPath();if(!(L>0)||!(w>0))return;const b=w*.62*M.clamp(L/(w*1.4),.6,1),e=y+L-b*1.6;c.moveTo(x-w*.75,y-w*.9);c.quadraticCurveTo(x-w*.42,y-w*.3,x-w*.42,y+w*.6);if(e>y+w*.6)c.lineTo(x-w*.38,e);c.quadraticCurveTo(x-w*.38,y+L-b*.9,x-b,y+L);c.arc(x,y+L,b,Math.PI,0,true);c.quadraticCurveTo(x+w*.38,y+L-b*.9,x+w*.38,Math.max(e,y+w*.6));c.lineTo(x+w*.42,y+w*.6);c.quadraticCurveTo(x+w*.42,y-w*.3,x+w*.75,y-w*.9);c.closePath()};",br="const BUB=(c,x,y,r,f1,f2,a=1,sx=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha=Math.min(1,a);c.translate(x,y);c.scale(sx,1/sx);const g=c.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(f2,.04));g.addColorStop(.72,M.rgba(f2,.12));g.addColorStop(.93,M.rgba(f1,.42));g.addColorStop(1,'rgba(255,255,255,.6)');c.fillStyle=g;c.beginPath();c.arc(0,0,r,0,M.TAU);c.fill();const rg=c.createLinearGradient(-r,-r,r,r);rg.addColorStop(0,M.rgba(f1,.85));rg.addColorStop(.5,M.rgba(MI,.6));rg.addColorStop(1,M.rgba(f2,.85));c.strokeStyle=rg;c.lineWidth=Math.max(.8,r*.035);c.stroke();c.lineCap='round';c.strokeStyle='rgba(255,255,255,.75)';c.lineWidth=r*.09;c.beginPath();c.arc(0,0,r*.74,Math.PI*1.08,Math.PI*1.42);c.stroke();c.strokeStyle='rgba(255,255,255,.3)';c.lineWidth=r*.05;c.beginPath();c.arc(0,0,r*.8,Math.PI*.15,Math.PI*.4);c.stroke();c.fillStyle='rgba(255,255,255,.9)';c.beginPath();c.arc(-r*.36,-r*.5,r*.07,0,M.TAU);c.fill();c.restore()};",Bo="const POOL=(c,B,Y,top,c1,c2,k=1)=>{const W=B.W,H=B.H;c.beginPath();c.moveTo(-5,H+5);for(let i=0;i<=64;i++){const x=i/64*W;c.lineTo(x,Y(x))}c.lineTo(W+5,H+5);c.closePath();const g=c.createLinearGradient(0,top-B.u*.04,0,H);g.addColorStop(0,M.mix(c1,WH,.3*k));g.addColorStop(.22,c1);g.addColorStop(1,c2);c.fillStyle=g;c.fill();if(!(k>0))return;c.save();c.beginPath();for(let i=0;i<=64;i++){const x=i/64*W;c[i?'lineTo':'moveTo'](x,Y(x)+B.u*.004)}c.lineCap='round';c.strokeStyle=M.rgba(WH,.5*k);c.lineWidth=B.u*.004;c.stroke();c.globalAlpha=.12*k;c.lineWidth=B.u*.03;c.translate(0,B.u*.02);c.stroke();c.restore()};",as="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:S.x1-w/2,y=P.includes('top')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",Ze="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q}=B,T1=D-.46",Mr=[ue("fluid-blob-morph","Khối lỏng biến hình",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7291
+ ${be}${ur}
7292
7292
  // A large glossy pink-to-lilac gel blob breathes and morphs between organic shapes while four small droplets orbit and merge into it through soft metaball necks, then it swells until the frame is flat next (fields: bg, next, fg, fg2).
7293
7293
  ${Ze}
7294
7294
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.62))),R=u*(B.S.port?.2:.18)*pop*(1+.035*Math.sin(t*2.4)),L=[[cx,cy,R]],Rm=RM(B,cx,cy),fg=QM(B,K.fg),f2=QM(B,K.f2)
@@ -7299,8 +7299,8 @@
7299
7299
  const P=FCT(L,cx,cy,R*3).map(p=>{const dx=p[0]-cx,dy=p[1]-cy,r=Math.hypot(dx,dy)||1,k=M.lerp(r,Rm*1.06,q)/r;return[cx+dx*k,cy+dy*k]})
7300
7300
  GEL(ctx,P,cx,cy,M.lerp(R*1.15,Rm,q),fg,f2,1-q)
7301
7301
  FIN(ctx,B)
7302
- }`),de("fluid-drop-splash","Giọt nước rơi",3.4,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7303
- ${ge}${zo}${Bo}
7302
+ }`),ue("fluid-drop-splash","Giọt nước rơi",3.4,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7303
+ ${be}${zo}${Bo}
7304
7304
  // A single glossy drop falls in slow motion onto a liquid surface, throws up a crown splash with flying droplets, a central jet and spreading rings, then the surface rises until the frame is flat next (fields: bg, next, fg, fg2).
7305
7305
  ${Ze}
7306
7306
  const ti=1.15,tau=t-ti,fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q,lv0=M.lerp(H*1.03,H*(B.S.port?.64:.66),M.ease.outCubic(M.range(t,0,.55))),lv=M.lerp(lv0,-u*.28,q)
@@ -7318,8 +7318,8 @@
7318
7318
  if(jp>.4){const dy=lv-h-w*2.2-u*.07*Math.sin(Math.PI*M.range(jp,.4,1));ctx.beginPath();ctx.arc(cx,dy,w*.75,0,M.TAU);ctx.fill();HL(ctx,cx,dy,w*.75,k)}}
7319
7319
  if(t<ti){const f=M.range(t,.12,ti),y=M.lerp(-u*.12,lv0-u*.025,f*f),r=u*.032;ctx.beginPath();TEAR(ctx,cx,y,r,.4+.9*f);ctx.fillStyle=LG(ctx,cx,y,r,fg,f2);ctx.fill();HL(ctx,cx,y,r,k)}
7320
7320
  FIN(ctx,B)
7321
- }`),de("fluid-wave-flood","Sóng tràn",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7322
- ${ge}
7321
+ }`),ue("fluid-wave-flood","Sóng tràn",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7322
+ ${be}
7323
7323
  // Four layered sine waves in lilac to pink rise from the bottom with parallax, glossy foam lines on their crests and soft depth shadows, then the front wave floods upward until the frame is flat next (fields: bg, next, fg, fg2).
7324
7324
  ${Ze}
7325
7325
  const cs=[M.mix(K.f2,K.bg,.45),K.f2,M.mix(K.f2,K.fg,.5),K.fg],R=M.rand(5)
@@ -7332,8 +7332,8 @@
7332
7332
  if(kk>0){ctx.save();ctx.beginPath();for(let i=0;i<=60;i++){const x=i/60*W;ctx[i?'lineTo':'moveTo'](x,Y(x)+u*.004)}ctx.lineCap='round';ctx.strokeStyle=M.rgba(WH,(.32+.1*j)*kk);ctx.lineWidth=u*.0045;ctx.stroke();ctx.globalAlpha=.1*kk;ctx.lineWidth=u*.035;ctx.translate(0,u*.025);ctx.stroke();ctx.restore()
7333
7333
  ctx.fillStyle=M.rgba(WH,.55*kk);for(let i=0;i<7;i++){const x=(R()*W+t*u*.05*dir+W*2)%W,y=Y(x)+u*(.012+.05*R());ctx.beginPath();ctx.arc(x,y,u*(.002+.004*R()),0,M.TAU);ctx.fill()}}}
7334
7334
  FIN(ctx,B)
7335
- }`),de("fluid-lava-lamp","Đèn dung nham",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a"},`function render(ctx,t,env){
7336
- ${ge}${Po}
7335
+ }`),ue("fluid-lava-lamp","Đèn dung nham",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a"},`function render(ctx,t,env){
7336
+ ${be}${Po}
7337
7337
  // Lava lamp: warm peach-to-pink wax blobs rise, sink, stretch apart and merge with gooey necks over a warm glow, a blob splits off the bottom pool, then they all gather into one that fills the frame with next (fields: bg, next, fg, fg2).
7338
7338
  ${Ze}
7339
7339
  const R=M.rand(41),L=[],Rm=RM(B,cx,cy),Q=(x,y,r)=>L.push([M.lerp(x,cx,q),M.lerp(y,cy,q),M.lerp(r,Rm*1.04,q)])
@@ -7345,8 +7345,8 @@
7345
7345
  ctx.save();UNI(ctx,L,.55);ctx.fillStyle=g;ctx.shadowColor=M.rgba(K.fg,.55*(1-q));ctx.shadowBlur=u*.07;ctx.fill();ctx.restore();ctx.fillStyle=g;UF(ctx,L,.55);const C=(a,b)=>Math.hypot(L[a][0]-L[b][0],L[a][1]-L[b][1])<(L[a][2]+L[b][2])*1.28;for(let i=0;i<L.length;i++)for(let j=i+1;j<L.length;j++)if(C(i,j))for(let m=j+1;m<L.length;m++)if(C(i,m)&&C(j,m)){ctx.beginPath();ctx.moveTo(L[i][0],L[i][1]);ctx.lineTo(L[j][0],L[j][1]);ctx.lineTo(L[m][0],L[m][1]);ctx.fill()}
7346
7346
  L.forEach(b=>HL(ctx,b[0],b[1],b[2],.6*(1-q)))
7347
7347
  FIN(ctx,B)
7348
- }`),de("fluid-ink-bloom","Mực loang",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7349
- ${ge}
7348
+ }`),ue("fluid-ink-bloom","Mực loang",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7349
+ ${be}
7350
7350
  // Ink in water: pink, lilac and mint ink clouds bloom from drops as layered soft noisy billows with curling tendrils, drifting and sinking slowly, then a cloud of next blooms from the centre and saturates the frame (fields: bg, next, fg, fg2).
7351
7351
  ${Ze}
7352
7352
  const R=M.rand(23),cs=[K.fg,K.f2,MI,M.mix(K.fg,PE,.5),K.f2],Rm=RM(B,cx,cy),ts=[0,.35,.7,1.05,1.4]
@@ -7359,8 +7359,8 @@
7359
7359
  if(g<.6){ctx.fillStyle=M.rgba(cs[i],.8*(1-g/.6));ctx.beginPath();ctx.arc(x,y,u*.03*(1-g*.5),0,M.TAU);ctx.fill()}})
7360
7360
  if(q>0){const rr=Rm*2.1*q,P=PTS(cx,cy,an=>rr*(1+.22*(M.noise(Math.cos(an)*1.4+5,Math.sin(an)*1.4+t*.4)-.5)*2),64),g=ctx.createRadialGradient(cx,cy,0,cx,cy,rr);g.addColorStop(0,K.nx);g.addColorStop(.6,K.nx);g.addColorStop(.74,M.mix(K.nx,K.f2,.45));g.addColorStop(.86,M.rgba(K.fg,.4));g.addColorStop(1,M.rgba(K.fg,0));ctx.fillStyle=g;ctx.beginPath();SM(ctx,P);ctx.fill()}
7361
7361
  FIN(ctx,B)
7362
- }`),de("fluid-bubbles","Bong bóng",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7363
- ${ge}${br}
7362
+ }`),ue("fluid-bubbles","Bong bóng",3.2,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7363
+ ${be}${br}
7364
7364
  // Glossy soap bubbles of many sizes rise with a gentle wobble, iridescent rims and white highlights, while one big bubble floats up to the centre and expands until the frame is flat next (fields: bg, next, fg, fg2).
7365
7365
  ${Ze}
7366
7366
  const R=M.rand(17),Rm=RM(B,cx,cy)
@@ -7371,8 +7371,8 @@
7371
7371
  if(q>0){ctx.fillStyle=M.rgba(K.nx,M.ease.inQuad(q));ctx.beginPath();ctx.arc(bx,by,R2,0,M.TAU);ctx.fill()}
7372
7372
  BUB(ctx,bx,by,R2,K.fg,K.f2,1-q,1+.05*Math.sin(t*3.4)*(1-q))
7373
7373
  FIN(ctx,B)
7374
- }`),de("fluid-pour","Dòng chảy rót",3.4,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a"},`function render(ctx,t,env){
7375
- ${ge}${Bo}
7374
+ }`),ue("fluid-pour","Dòng chảy rót",3.4,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a"},`function render(ctx,t,env){
7375
+ ${be}${Bo}
7376
7376
  // A glossy ribbon of pink-to-peach liquid pours from the top in a soft curve into a pool, splashing droplets and ripples where it lands while the pool level rises, then the pour widens and the pool floods the frame with next (fields: bg, next, fg, fg2).
7377
7377
  ${Ze}
7378
7378
  const R=M.rand(9),fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q,hd=M.ease.inQuad(M.range(t,0,.55)),lvl=M.lerp(H*1.02,H*(B.S.port?.64:.58),M.ease.inOutQuad(M.range(t,.35,T1))),lv=M.lerp(lvl,-u*.28,q),wd=u*(.045+.008*Math.sin(t*3))*(1+q*14),yh=M.lerp(-u*.05,lv+u*.02,hd)
@@ -7385,8 +7385,8 @@
7385
7385
  if(t>.5&&k>0){ctx.fillStyle=M.mix(fg,WH,.25);for(let i=0;i<9;i++){const p=(t*1.5+R())%1,dr=R()<.5?-1:1,sp=u*(.05+.07*R()),x=ix+dr*sp*p,y=lv-u*(.04+.06*R())*Math.sin(Math.PI*p);ctx.beginPath();ctx.arc(x,y,u*.006*(1-p*.5),0,M.TAU);ctx.fill()}
7386
7386
  for(let j=0;j<2;j++){const f=(t*.9+j*.5)%1;ctx.save();ctx.strokeStyle=M.rgba(WH,.4*(1-f)*k);ctx.lineWidth=u*.003;ctx.beginPath();ctx.ellipse(ix,lv+u*.006,u*(.04+.3*f),u*(.04+.3*f)*.15,0,0,M.TAU);ctx.stroke();ctx.restore()}}
7387
7387
  FIN(ctx,B)
7388
- }`),de("fluid-gradient-mesh","Lưới gradient lỏng",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7389
- ${ge}
7388
+ }`),ue("fluid-gradient-mesh","Lưới gradient lỏng",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7389
+ ${be}
7390
7390
  // A slowly flowing pastel gradient mesh (pink, lilac, mint, peach and butter colour points blending) with a liquid-glass sphere drifting across that refracts it, then the sphere bursts into a liquid bloom and the whole mesh flows into next (fields: bg, next, fg, fg2).
7391
7391
  ${Ze}
7392
7392
  const cs=[K.fg,K.f2,MI,PE,BU].map(c=>M.mix(c,K.nx,q*.7)),Rm=RM(B,cx,cy),k=1-q,MX=Math.max(W,H)
@@ -7400,8 +7400,8 @@
7400
7400
  ctx.save();ctx.globalAlpha=k;ctx.strokeStyle='rgba(255,255,255,.55)';ctx.lineWidth=u*.0025;ctx.beginPath();ctx.arc(sx,sy,sr,0,M.TAU);ctx.stroke();ctx.restore();HL(ctx,sx,sy,sr,k);M.spark(ctx,sx+sr*.42,sy-sr*.6,u*.018*(.7+.3*Math.sin(t*3)),'#ffffff',k*.8)}
7401
7401
  if(q>0){const rr=M.lerp(sr,Rm*1.25,q),P=PTS(sx,sy,a=>rr*WB(t*2,3,.1*(1-q))(a),72);const bg=ctx.createRadialGradient(sx-rr*.3,sy-rr*.35,0,sx,sy,rr);bg.addColorStop(0,M.mix(K.nx,WH,.3*(1-q)));bg.addColorStop(.5,M.mix(K.nx,K.fg,.25*(1-q)));bg.addColorStop(1,K.nx);ctx.save();ctx.beginPath();SM(ctx,P);ctx.fillStyle=bg;ctx.shadowColor=M.rgba(WH,.6*(1-q));ctx.shadowBlur=u*.05;ctx.fill();ctx.restore();ctx.save();ctx.strokeStyle=M.rgba(WH,.5*(1-q));ctx.lineWidth=u*.004;ctx.stroke();ctx.restore()}
7402
7402
  FIN(ctx,B)
7403
- }`),de("fluid-melt-word","Chữ tan chảy",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a",text:"flow"},`function render(ctx,t,env){
7404
- ${ge}${zo}${Bo}
7403
+ }`),ue("fluid-melt-word","Chữ tan chảy",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#ffb38a",text:"flow"},`function render(ctx,t,env){
7404
+ ${be}${zo}${Bo}
7405
7405
  // Melting word: the title (text, one or two lines) in a heavy rounded font with a glossy pink-to-peach gel fill pops in, sags and melts, drips run from the bottoms of its letters and fall into a rising pool, then the pool floods the frame with next (fields: text, bg, next, fg, fg2).
7406
7406
  ${Ze}
7407
7407
  const sk=M.skin(env,B.p),s=String(B.p.text||''),fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q,R=M.rand(7),ap=Math.max(0,M.ease.outBack(M.range(t,0,.55))),mt=M.ease.inOutQuad(M.range(t,.5,T1))
@@ -7418,8 +7418,8 @@
7418
7418
  ctx.restore()}
7419
7419
  POOL(ctx,B,Y,lv,fg,f2,k)
7420
7420
  FIN(ctx,B)
7421
- }`),de("fluid-swirl","Xoáy cẩm thạch",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7422
- ${ge}
7421
+ }`),ue("fluid-swirl","Xoáy cẩm thạch",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7422
+ ${be}
7423
7423
  // Marbled swirl: pink, lilac and cream paint bands spread from the centre and twist around it like stirred paint with glossy veins, the swirl tightens, then the next colour pours in from the centre until the frame is flat next (fields: bg, next, fg, fg2).
7424
7424
  ${Ze}
7425
7425
  const cs=[K.fg,K.f2,M.mix(K.fg,WH,.6),M.mix(K.f2,K.fg,.45)],N=8,Rm=RM(B,cx,cy),gr=M.ease.outCubic(M.range(t,0,.6)),Rd=Rm*1.04*gr,tw=M.lerp(1.4,5,M.ease.inOutCubic(M.range(t,0,T1)))+q*3,rot=t*.6+q*2
@@ -7431,8 +7431,8 @@
7431
7431
  const sh=ctx.createRadialGradient(cx-u*.1,cy-u*.12,0,cx,cy,Rd);sh.addColorStop(0,'rgba(255,255,255,.18)');sh.addColorStop(.5,'rgba(255,255,255,0)');sh.addColorStop(1,M.rgba(IK,.3));ctx.fillStyle=sh;ctx.fillRect(0,0,W,H);ctx.restore()}
7432
7432
  if(q>0){const rr=Rm*1.22*q,P=PTS(cx,cy,a=>rr*WB(t*3,1,.12*(1-q))(a+tw*.2),72);ctx.beginPath();SM(ctx,P);ctx.fillStyle=K.nx;ctx.fill();ctx.save();ctx.strokeStyle=M.rgba(WH,.35*(1-q));ctx.lineWidth=u*.004;ctx.stroke();ctx.restore()}
7433
7433
  FIN(ctx,B)
7434
- }`),de("fluid-droplet-grid","Lưới giọt nước",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7435
- ${ge}${Po}
7434
+ }`),ue("fluid-droplet-grid","Lưới giọt nước",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7435
+ ${be}${Po}
7436
7436
  // A grid of glossy gel droplets pops in from the centre, wobbles, then merges neighbour by neighbour through liquid necks into one rippling sheet, and the sheet fills the frame with next (fields: bg, next, fg, fg2).
7437
7437
  ${Ze}
7438
7438
  const s=u*(B.S.port?.17:.16),nx=Math.ceil(W/s/2)+1,ny=Math.ceil(H/s/2)+1,L=[],Rm=RM(B,cx,cy),fg=QM(B,K.fg),f2=QM(B,K.f2),k=1-q
@@ -7444,8 +7444,8 @@
7444
7444
  ctx.save();ctx.fillStyle=g;ctx.shadowColor=M.rgba(IK,.45*k);ctx.shadowBlur=s*.15;ctx.shadowOffsetY=s*.05;ctx.fill();ctx.restore();ctx.fillStyle=g;L.forEach(b=>{if(b[2]>0){ctx.beginPath();ctx.arc(b[0],b[1],b[2],0,M.TAU);ctx.fill()}});L.forEach((b,x)=>{if(b[4]<ny){ctx.beginPath();BR(ctx,b,L[x+1],.5);ctx.fill()}if(b[3]<nx){ctx.beginPath();BR(ctx,b,L[x+2*ny+1],.5);ctx.fill()}})
7445
7445
  if(k>0)L.forEach(b=>HL(ctx,b[0],b[1],b[2],k*(.9-.45*b[5])))
7446
7446
  FIN(ctx,B)
7447
- }`),de("fluid-glass-orb","Quả cầu thuỷ tinh lỏng",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7448
- ${ge}
7447
+ }`),ue("fluid-glass-orb","Quả cầu thuỷ tinh lỏng",3.6,{bg:"#14102a",next:"#14102a",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7448
+ ${be}
7449
7449
  // A liquid-glass orb: refracted inner gradient, pink-to-lilac liquid sloshing inside with a glossy meniscus and rising bubbles, caustic light at the bottom and a bright rim, then the liquid fills it and the orb grows until the frame is flat next (fields: bg, next, fg, fg2).
7450
7450
  ${Ze}
7451
7451
  const pop=Math.max(0,M.ease.outBack(M.range(t,0,.6))),Rm=RM(B,cx,cy),k=1-q,x=cx,y=cy-u*.02+Math.sin(t*1.4)*u*.012*k,R0=u*(B.S.port?.27:.25)*pop,R=M.lerp(R0,Rm*1.03,q),fg=QM(B,K.fg),f2=QM(B,K.f2),Rn=M.rand(3)
@@ -7464,8 +7464,8 @@
7464
7464
  ctx.restore()
7465
7465
  if(k>0){ctx.save();ctx.globalAlpha=k;const rg=ctx.createLinearGradient(x-R,y-R,x+R,y+R);rg.addColorStop(0,'rgba(255,255,255,.8)');rg.addColorStop(1,M.rgba(K.fg,.5));ctx.strokeStyle=rg;ctx.lineWidth=Math.max(1,R*.012);ctx.beginPath();ctx.arc(x,y,R,0,M.TAU);ctx.stroke();ctx.restore();HL(ctx,x,y,R,k);M.spark(ctx,x+R*.45,y-R*.55,u*.02*(.6+.4*Math.sin(t*3)),'#ffffff',k*.8)}
7466
7466
  FIN(ctx,B)
7467
- }`),de("fluid-caption","Phụ đề lỏng",3,{text:"Mềm mại như dòng chảy",position:"lower",fg:"#ff6fb5"},`function render(ctx,t,env){
7468
- ${ge}
7467
+ }`),ue("fluid-caption","Phụ đề lỏng",3,{text:"Mềm mại như dòng chảy",position:"lower",fg:"#ff6fb5"},`function render(ctx,t,env){
7468
+ ${be}
7469
7469
  // Overlay caption for scene chains: up to two lines of rounded white text (text) with a soft pink glow over a soft dark band for readability rise in with a gentle liquid overshoot in the lower third; transparent everywhere else (fields: text, fg, position).
7470
7470
  const {duration:D,params:p}=env,S=M.safe(env,p.position||'lower'),sk=M.skin(env,p),k=M.io(t,D,.5,.35),u=S.u,fg=PC(p.fg,PK),s=String(p.text||'')
7471
7471
  if(!s||!(k.v>0))return
@@ -7476,16 +7476,16 @@
7476
7476
  ctx.save();ctx.globalAlpha=M.ease.outCubic(a)*(1-k.o);ctx.translate(S.cx,y);ctx.scale(1,.85+.15*o);const g=ctx.createLinearGradient(0,-f.size*.5,0,f.size*.5);g.addColorStop(0,'#ffffff');g.addColorStop(1,M.mix('#ffffff',fg,.18));ctx.fillStyle=g
7477
7477
  ctx.shadowColor=M.rgba(fg,.85);ctx.shadowBlur=f.size*.55;ctx.fillText(l,0,0);ctx.shadowColor=M.rgba(IK,.6);ctx.shadowBlur=f.size*.12;ctx.shadowOffsetY=f.size*.03;ctx.fillText(l,0,0);ctx.restore()})
7478
7478
  ctx.restore()
7479
- }`),de("fluid-blob-el","Khối lỏng nhỏ",4,{position:"top-right",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7480
- ${ge}${Po}${as}
7479
+ }`),ue("fluid-blob-el","Khối lỏng nhỏ",4,{position:"top-right",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7480
+ ${be}${Po}${as}
7481
7481
  // Element: a small glossy gradient gel blob that breathes and morphs in a corner (position: top-right, top-left, bottom-left, bottom-right) while a tiny droplet orbits, pulls away and rejoins it; loops over any duration; transparent elsewhere (fields: position, fg, fg2).
7482
7482
  const {duration:D,params:p}=env,k=M.io(t,D,.5,.45),u=Math.min(env.width,env.height),r0=u*.05,o=SPOT(env,p.position,'top-right',r0*4.6,r0*4.6),fg=PC(p.fg,PK),f2=PC(p.fg2,LI)
7483
7483
  if(!(k.v>0))return
7484
7484
  const x=o.x,y=o.y+Math.sin(t*1.6)*r0*.12,r=r0*(.5+.5*k.i),wb=WB(t,3,.09),a=t*1.8,d=r*(1.2+.5*(.5+.5*Math.sin(t*2.2))),sx=x+Math.cos(a)*d,sy=y+Math.sin(a)*d*.8,rs=r*.32,ra=r*wb(Math.atan2(sy-y,sx-x))
7485
7485
  ctx.save();ctx.globalAlpha=k.v;ctx.beginPath();BR(ctx,[x,y,ra],[sx,sy,rs],.5);ctx.moveTo(sx+rs,sy);ctx.arc(sx,sy,rs,0,M.TAU);ctx.fillStyle=LG(ctx,x,y,r,fg,f2);ctx.fill()
7486
7486
  GEL(ctx,PTS(x,y,an=>r*wb(an),56),x,y,r,fg,f2,1);HL(ctx,sx,sy,rs,1);ctx.restore()
7487
- }`),de("fluid-drip-el","Giọt nhỏ rơi",3,{position:"top-left",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7488
- ${ge}${zo}${as}
7487
+ }`),ue("fluid-drip-el","Giọt nhỏ rơi",3,{position:"top-left",fg:"#ff6fb5",fg2:"#b49cff"},`function render(ctx,t,env){
7488
+ ${be}${zo}${as}
7489
7489
  // Element: a small glossy drip swells at the top edge in a corner, falls and lands with a splash ring and tiny droplets, again and again (position: top-left, top-right, bottom-left, bottom-right); transparent elsewhere (fields: position, fg, fg2).
7490
7490
  const {width:W,height:H,duration:D,params:p}=env,k=M.io(t,D,.3,.35),u=Math.min(W,H),r=u*.028,o=SPOT(env,p.position,'top-left',u*.14,u*.26),fg=PC(p.fg,PK),f2=PC(p.fg2,LI),top=o.P.includes('top'),y0=top?0:o.y-u*.12,yl=o.y+u*.08,x=o.x
7491
7491
  if(!(k.v>0))return
@@ -7496,7 +7496,7 @@
7496
7496
  else{const f=(ph-.74)/.26,rx=r*(1+5*M.ease.outCubic(f));ctx.strokeStyle=M.rgba(fg,.75*(1-f));ctx.lineWidth=Math.max(1,u*.003);ctx.beginPath();ctx.ellipse(x,yl,rx,rx*.28,0,0,M.TAU);ctx.stroke();ctx.strokeStyle=M.rgba(WH,.5*(1-f));ctx.beginPath();ctx.ellipse(x,yl,rx*.6,rx*.17,0,0,M.TAU);ctx.stroke()
7497
7497
  for(let j=0;j<3;j++){ctx.beginPath();ctx.arc(x+(j-1)*r*2.6*f,yl-r*3*Math.sin(Math.PI*f)*(j===1?1.4:1),r*.28*(1-f*.5),0,M.TAU);ctx.fill()}}
7498
7498
  ctx.restore()
7499
- }`)],os=V.find(t=>t.id==="promo"),ue=(t,e,c,a,o)=>({id:t,name:e,category:os.name,pack:"promo",duration:c,params:{accent:os.accent,position:"center",...a,style:"promo"},code:o}),co="const BK='#05050b',VI='#8a5cff',BL='#3d6bff',CY='#2fe0ff',MG='#ff4fd8',OR='#ff9a3c',WW='#fff3e2';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,BK),nx:PC(p.next,BK),fg:PC(p.fg,VI),f2:PC(p.fg2,CY)});const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GRD=(c,x0,y0,x1,y1,cs)=>{const g=c.createLinearGradient(x0,y0,x1,y1);cs.forEach((col,i)=>g.addColorStop(i/(cs.length-1),col));return g},RG=(c,x,y,w,h,an,cs)=>GRD(c,x+w/2-Math.cos(an)*w/2,y+h/2-Math.sin(an)*h/2,x+w/2+Math.cos(an)*w/2,y+h/2+Math.sin(an)*h/2,cs);",Je=co+"const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.45,D-.04)),sk:M.skin(env,p),s:String(p.text==null?'':p.text).trim()}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const DUST=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,y=R()*B.H,tw=.5+.5*Math.sin(t*(1.5+R()*2)+R()*9),r=B.u*(.001+.0016*R());if(tw*a>.05){c.save();c.globalAlpha=Math.min(1,tw*a*.8);c.fillStyle=[WW,CY,VI,MG][i%4];c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()}}};const RCV=(c,B,x,y,w,h,r,k,col,lc)=>{if(!(k>0))return;const Q=B.u*.08,X=M.lerp(x,-Q,k),Y=M.lerp(y,-Q,k),X2=M.lerp(x+w,B.W+Q,k),Y2=M.lerp(y+h,B.H+Q,k);GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.8,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);const m=M.range(k,.45,.95),g=c.createLinearGradient(X,Y,X2,Y2);[lc||col,col,M.mix(col,'#8a5cff',.7),M.mix(col,'#05050b',.5)].forEach((v,i)=>g.addColorStop(i/3,M.mix(v,B.K.nx,m)));c.fillStyle=g;c.shadowColor=col;c.shadowBlur=B.u*.08*(1-k);M.rr(c,X,Y,X2-X,Y2-Y,r*(1-k));c.fill();c.restore();GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.6,'#ffffff',.9*(1-k))};const TX=(c,B,s,x,y,sz,mw,n,a=1,gc=VI,al='center',wt='600')=>{if(!s||!(a>0))return null;const f=M.fit(c,s,z=>B.sk.font(z,'h',wt),sz,mw,n,.35),lh=f.size*1.28,L=f.lines.length;c.save();c.font=f.font;c.textAlign=al;c.textBaseline='middle';c.globalAlpha=Math.min(1,a);c.fillStyle='#ffffff';f.lines.forEach((l,i)=>{const yy=y+(i-(L-1)/2)*lh;c.shadowColor=gc;c.shadowBlur=f.size*.5;c.fillText(l,x,yy);c.shadowBlur=f.size*.12;c.fillText(l,x,yy)});c.restore();return f};",ga="const STAR=(c,x,y,s,col,a=1,r=0)=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*.8,col,k);c.save();c.globalCompositeOperation='lighter';c.translate(x,y);c.rotate(r);for(let i=0;i<2;i++){const L=s*(i?.62:1);c.save();c.rotate(i*Math.PI/2);c.scale(1,.04);const g=c.createRadialGradient(0,0,0,0,0,L);g.addColorStop(0,M.rgba('#ffffff',k));g.addColorStop(.22,M.rgba(col,.7*k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.beginPath();c.arc(0,0,L,0,M.TAU);c.fill();c.restore()}c.globalAlpha=k;c.fillStyle='#ffffff';c.shadowColor=col;c.shadowBlur=s*.1;c.beginPath();for(let i=0;i<8;i++){const d=i%2?s*.03:s*.17,an=i*Math.PI/4;c.lineTo(Math.cos(an)*d,Math.sin(an)*d)}c.closePath();c.fill();c.restore()};",ns="const CC=(c,B,x,y,k,r0,col,lc)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k;GL(c,x,y,R+B.u*.3,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);c.fillStyle=lc?M.mix(lc,B.K.nx,M.range(k,.5,.95)):B.K.nx;c.shadowColor=col;c.shadowBlur=B.u*.1*(1-k);c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();c.restore();GL(c,x,y,R*1.1,'#ffffff',.9*(1-k))};",ao="const CARD=(c,x,y,w,h,r,cs,an,a=1)=>{if(!(w>1)||!(h>1)||!(a>0))return;const m=Math.min(w,h),lw=Math.max(1.5,m*.014);c.save();c.globalAlpha=Math.min(1,a);M.rr(c,x,y,w,h,r);const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'rgba(30,26,54,.93)');g.addColorStop(1,'rgba(7,7,15,.95)');c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=m*.22;c.fill();c.shadowBlur=lw*6;c.lineWidth=lw;c.strokeStyle=RG(c,x,y,w,h,an,cs);c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.lineWidth=lw*.4;c.strokeStyle='rgba(255,255,255,.45)';c.stroke();const s=c.createLinearGradient(0,y,0,y+h*.45);s.addColorStop(0,'rgba(255,255,255,.13)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.restore()};",Ba="const GN={spark:'sparkle',image:'mountain',eye:'eye',search:'search',music:'music',heart:'heart',chat:'chat',wave:'pulse',flower:'lotus',star:'star',play:'play'};const ICON=(c,x,y,s,gl,ca,cb,a=1,bl=0,rot=0)=>{if(!(s>1)||!(a>0))return;const k=Math.min(1,a),h=s/2,r=s*.26,lw=Math.max(1.2,s*.028);GL(c,x,y,s*1.25,ca,.5*k);c.save();c.translate(x,y);c.rotate(rot);c.globalAlpha=k;if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';M.rr(c,-h,-h,s,s,r);const g=c.createLinearGradient(0,-h,0,h);g.addColorStop(0,'rgba(46,40,78,.96)');g.addColorStop(1,'rgba(9,9,19,.97)');c.fillStyle=g;c.fill();const ig=c.createRadialGradient(0,h*.7,0,0,h*.7,s*.85);ig.addColorStop(0,M.rgba(cb,.5));ig.addColorStop(1,M.rgba(cb,0));c.fillStyle=ig;c.fill();c.lineWidth=lw;c.strokeStyle=GRD(c,-h,-h,h,h,[M.mix(ca,'#ffffff',.55),ca,cb]);c.shadowColor=ca;c.shadowBlur=lw*5;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';const sg=c.createLinearGradient(0,-h,0,0);sg.addColorStop(0,'rgba(255,255,255,.24)');sg.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=sg;M.rr(c,-h+lw,-h+lw,s-lw*2,h*.9,r*.85);c.fill();c.globalCompositeOperation='source-over';if(gl)GL(c,0,0,s*.42,ca,.7);if(gl==='diamond'){c.save();c.scale(s*.5,s*.5);c.beginPath();c.moveTo(-.5,-.12);c.lineTo(-.26,-.42);c.lineTo(.26,-.42);c.lineTo(.5,-.12);c.lineTo(0,.46);c.closePath();c.moveTo(-.5,-.12);c.lineTo(.5,-.12);c.lineWidth=.07;c.lineJoin='round';c.strokeStyle=M.mix(ca,'#ffffff',.35);c.shadowColor=ca;c.shadowBlur=s*.12;c.stroke();c.restore()}else if(gl)M.glyph(c,GN[gl]||gl,0,0,s*.52,{color:M.mix(ca,'#ffffff',.3),width:2.2});c.restore()};",ss="const MARK=(c,x,y,s,a=1,rot=0,cs=[OR,MG,VI])=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*2.6,cs[0],.6*k);c.save();c.translate(x,y);c.rotate(rot);for(let i=0;i<3;i++){c.save();c.rotate(i*M.TAU/3);const g=c.createLinearGradient(0,-s*.96,0,s*.12);g.addColorStop(0,M.mix(cs[0],'#ffffff',.5));g.addColorStop(.35,cs[0]);g.addColorStop(.75,cs[1]);g.addColorStop(1,cs[2]);c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=s*.25;c.globalAlpha=k*.92;c.globalCompositeOperation=i?'screen':'source-over';c.beginPath();c.ellipse(0,-s*.4,s*.25,s*.55,0,0,M.TAU);c.fill();c.shadowBlur=0;c.globalCompositeOperation='source-over';c.globalAlpha=k*.7;c.strokeStyle='#ffffff';c.lineWidth=s*.03;c.lineCap='round';c.beginPath();c.ellipse(0,-s*.4,s*.19,s*.47,0,Math.PI*1.1,Math.PI*1.45);c.stroke();c.restore()}c.restore();GL(c,x,y,s*.5,WW,.35*k)};",is="const ARW=(c,x,y,a,col,al=1)=>{if(!(a>0)||!(al>0))return;GL(c,x,y,a*3,col,al);c.save();c.globalAlpha=Math.min(1,al);c.beginPath();c.moveTo(x,y-a);c.lineTo(x+a*.62,y+a*.55);c.lineTo(x,y+a*.2);c.lineTo(x-a*.62,y+a*.55);c.closePath();const g=c.createLinearGradient(x,y-a,x,y+a*.55);g.addColorStop(0,'#ffffff');g.addColorStop(.5,M.mix(col,'#ffffff',.4));g.addColorStop(1,col);c.fillStyle=g;c.shadowColor=col;c.shadowBlur=a*.6;c.fill();c.shadowBlur=0;c.lineJoin='round';c.strokeStyle='rgba(255,255,255,.8)';c.lineWidth=Math.max(1,a*.04);c.stroke();c.restore()};",ls="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",tc="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q,S,s}=B,P=S.port",yr=[ue("promo-logo-spark","Logo loé sáng",2.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff9a3c",text:"Logo"},`function render(ctx,t,env){
7499
+ }`)],os=V.find(t=>t.id==="promo"),Me=(t,e,c,a,o)=>({id:t,name:e,category:os.name,pack:"promo",duration:c,params:{accent:os.accent,position:"center",...a,style:"promo"},code:o}),co="const BK='#05050b',VI='#8a5cff',BL='#3d6bff',CY='#2fe0ff',MG='#ff4fd8',OR='#ff9a3c',WW='#fff3e2';const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CK=p=>({bg:PC(p.bg,BK),nx:PC(p.next,BK),fg:PC(p.fg,VI),f2:PC(p.fg2,CY)});const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const k=Math.min(1,a),g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.5*k));g.addColorStop(.35,M.rgba(col,.15*k));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GRD=(c,x0,y0,x1,y1,cs)=>{const g=c.createLinearGradient(x0,y0,x1,y1);cs.forEach((col,i)=>g.addColorStop(i/(cs.length-1),col));return g},RG=(c,x,y,w,h,an,cs)=>GRD(c,x+w/2-Math.cos(an)*w/2,y+h/2-Math.sin(an)*h/2,x+w/2+Math.cos(an)*w/2,y+h/2+Math.sin(an)*h/2,cs);",Je=co+"const BEGIN=(c,t,env)=>{const W=env.width,H=env.height,D=env.duration,p=env.params||{},K=CK(p);if(!(t>0)||t>=D){c.fillStyle=t>=D?K.nx:K.bg;c.fillRect(0,0,W,H);return null}c.fillStyle=K.bg;c.fillRect(0,0,W,H);const S=M.safe(env,p.position);return{W,H,D,p,K,S,u:S.u,cx:W/2,cy:H/2,e:M.range(t,0,.35),q:M.ease.inOutCubic(M.range(t,D-.45,D-.04)),sk:M.skin(env,p),s:String(p.text==null?'':p.text).trim()}};const RM=(B,x,y)=>Math.max(Math.hypot(x,y),Math.hypot(B.W-x,y),Math.hypot(x,B.H-y),Math.hypot(B.W-x,B.H-y))*1.02;const NEON=(c,col,w,draw,sty,a=1)=>{if(!(w>0)||!(a>0))return;const k=Math.min(1,a);c.save();c.globalAlpha=k;c.lineCap='round';c.lineJoin='round';c.strokeStyle=sty||col;c.lineWidth=w;c.shadowColor=col;c.shadowBlur=w*5;draw();c.stroke();c.shadowBlur=w*1.6;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.globalAlpha=k*.6;c.strokeStyle=M.mix(col,'#ffffff',.7);c.lineWidth=w*.32;c.stroke();c.restore()};const FIN=(c,B)=>{if(B.q>=1){c.fillStyle=B.K.nx;c.fillRect(0,0,B.W,B.H)}};const AMB=(c,B,a=1,x=B.cx,y=B.cy,col=B.K.fg)=>{if(!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,Math.hypot(B.W,B.H)*.55);g.addColorStop(0,M.rgba(col,.2*Math.min(1,a)*B.e));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.fillRect(0,0,B.W,B.H)};const DUST=(c,B,t,n,sd,a=1)=>{const R=M.rand(sd);for(let i=0;i<n;i++){const x=R()*B.W,y=R()*B.H,tw=.5+.5*Math.sin(t*(1.5+R()*2)+R()*9),r=B.u*(.001+.0016*R());if(tw*a>.05){c.save();c.globalAlpha=Math.min(1,tw*a*.8);c.fillStyle=[WW,CY,VI,MG][i%4];c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()}}};const RCV=(c,B,x,y,w,h,r,k,col,lc)=>{if(!(k>0))return;const Q=B.u*.08,X=M.lerp(x,-Q,k),Y=M.lerp(y,-Q,k),X2=M.lerp(x+w,B.W+Q,k),Y2=M.lerp(y+h,B.H+Q,k);GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.8,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);const m=M.range(k,.45,.95),g=c.createLinearGradient(X,Y,X2,Y2);[lc||col,col,M.mix(col,'#8a5cff',.7),M.mix(col,'#05050b',.5)].forEach((v,i)=>g.addColorStop(i/3,M.mix(v,B.K.nx,m)));c.fillStyle=g;c.shadowColor=col;c.shadowBlur=B.u*.08*(1-k);M.rr(c,X,Y,X2-X,Y2-Y,r*(1-k));c.fill();c.restore();GL(c,(X+X2)/2,(Y+Y2)/2,Math.max(X2-X,Y2-Y)*.6,'#ffffff',.9*(1-k))};const TX=(c,B,s,x,y,sz,mw,n,a=1,gc=VI,al='center',wt='600')=>{if(!s||!(a>0))return null;const f=M.fit(c,s,z=>B.sk.font(z,'h',wt),sz,mw,n,.35),lh=f.size*1.28,L=f.lines.length;c.save();c.font=f.font;c.textAlign=al;c.textBaseline='middle';c.globalAlpha=Math.min(1,a);c.fillStyle='#ffffff';f.lines.forEach((l,i)=>{const yy=y+(i-(L-1)/2)*lh;c.shadowColor=gc;c.shadowBlur=f.size*.5;c.fillText(l,x,yy);c.shadowBlur=f.size*.12;c.fillText(l,x,yy)});c.restore();return f};",ga="const STAR=(c,x,y,s,col,a=1,r=0)=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*.8,col,k);c.save();c.globalCompositeOperation='lighter';c.translate(x,y);c.rotate(r);for(let i=0;i<2;i++){const L=s*(i?.62:1);c.save();c.rotate(i*Math.PI/2);c.scale(1,.04);const g=c.createRadialGradient(0,0,0,0,0,L);g.addColorStop(0,M.rgba('#ffffff',k));g.addColorStop(.22,M.rgba(col,.7*k));g.addColorStop(1,M.rgba(col,0));c.fillStyle=g;c.beginPath();c.arc(0,0,L,0,M.TAU);c.fill();c.restore()}c.globalAlpha=k;c.fillStyle='#ffffff';c.shadowColor=col;c.shadowBlur=s*.1;c.beginPath();for(let i=0;i<8;i++){const d=i%2?s*.03:s*.17,an=i*Math.PI/4;c.lineTo(Math.cos(an)*d,Math.sin(an)*d)}c.closePath();c.fill();c.restore()};",ns="const CC=(c,B,x,y,k,r0,col,lc)=>{if(!(k>0))return;const R=r0+(RM(B,x,y)-r0)*k;GL(c,x,y,R+B.u*.3,col,1-k);c.save();c.globalAlpha=Math.min(1,k*2.5);c.fillStyle=lc?M.mix(lc,B.K.nx,M.range(k,.5,.95)):B.K.nx;c.shadowColor=col;c.shadowBlur=B.u*.1*(1-k);c.beginPath();c.arc(x,y,R,0,M.TAU);c.fill();c.restore();GL(c,x,y,R*1.1,'#ffffff',.9*(1-k))};",ao="const CARD=(c,x,y,w,h,r,cs,an,a=1)=>{if(!(w>1)||!(h>1)||!(a>0))return;const m=Math.min(w,h),lw=Math.max(1.5,m*.014);c.save();c.globalAlpha=Math.min(1,a);M.rr(c,x,y,w,h,r);const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'rgba(30,26,54,.93)');g.addColorStop(1,'rgba(7,7,15,.95)');c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=m*.22;c.fill();c.shadowBlur=lw*6;c.lineWidth=lw;c.strokeStyle=RG(c,x,y,w,h,an,cs);c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';c.lineWidth=lw*.4;c.strokeStyle='rgba(255,255,255,.45)';c.stroke();const s=c.createLinearGradient(0,y,0,y+h*.45);s.addColorStop(0,'rgba(255,255,255,.13)');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fill();c.restore()};",Ba="const GN={spark:'sparkle',image:'mountain',eye:'eye',search:'search',music:'music',heart:'heart',chat:'chat',wave:'pulse',flower:'lotus',star:'star',play:'play'};const ICON=(c,x,y,s,gl,ca,cb,a=1,bl=0,rot=0)=>{if(!(s>1)||!(a>0))return;const k=Math.min(1,a),h=s/2,r=s*.26,lw=Math.max(1.2,s*.028);GL(c,x,y,s*1.25,ca,.5*k);c.save();c.translate(x,y);c.rotate(rot);c.globalAlpha=k;if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';M.rr(c,-h,-h,s,s,r);const g=c.createLinearGradient(0,-h,0,h);g.addColorStop(0,'rgba(46,40,78,.96)');g.addColorStop(1,'rgba(9,9,19,.97)');c.fillStyle=g;c.fill();const ig=c.createRadialGradient(0,h*.7,0,0,h*.7,s*.85);ig.addColorStop(0,M.rgba(cb,.5));ig.addColorStop(1,M.rgba(cb,0));c.fillStyle=ig;c.fill();c.lineWidth=lw;c.strokeStyle=GRD(c,-h,-h,h,h,[M.mix(ca,'#ffffff',.55),ca,cb]);c.shadowColor=ca;c.shadowBlur=lw*5;c.stroke();c.shadowBlur=0;c.globalCompositeOperation='lighter';const sg=c.createLinearGradient(0,-h,0,0);sg.addColorStop(0,'rgba(255,255,255,.24)');sg.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=sg;M.rr(c,-h+lw,-h+lw,s-lw*2,h*.9,r*.85);c.fill();c.globalCompositeOperation='source-over';if(gl)GL(c,0,0,s*.42,ca,.7);if(gl==='diamond'){c.save();c.scale(s*.5,s*.5);c.beginPath();c.moveTo(-.5,-.12);c.lineTo(-.26,-.42);c.lineTo(.26,-.42);c.lineTo(.5,-.12);c.lineTo(0,.46);c.closePath();c.moveTo(-.5,-.12);c.lineTo(.5,-.12);c.lineWidth=.07;c.lineJoin='round';c.strokeStyle=M.mix(ca,'#ffffff',.35);c.shadowColor=ca;c.shadowBlur=s*.12;c.stroke();c.restore()}else if(gl)M.glyph(c,GN[gl]||gl,0,0,s*.52,{color:M.mix(ca,'#ffffff',.3),width:2.2});c.restore()};",ss="const MARK=(c,x,y,s,a=1,rot=0,cs=[OR,MG,VI])=>{if(!(s>0)||!(a>0))return;const k=Math.min(1,a);GL(c,x,y,s*2.6,cs[0],.6*k);c.save();c.translate(x,y);c.rotate(rot);for(let i=0;i<3;i++){c.save();c.rotate(i*M.TAU/3);const g=c.createLinearGradient(0,-s*.96,0,s*.12);g.addColorStop(0,M.mix(cs[0],'#ffffff',.5));g.addColorStop(.35,cs[0]);g.addColorStop(.75,cs[1]);g.addColorStop(1,cs[2]);c.fillStyle=g;c.shadowColor=cs[1];c.shadowBlur=s*.25;c.globalAlpha=k*.92;c.globalCompositeOperation=i?'screen':'source-over';c.beginPath();c.ellipse(0,-s*.4,s*.25,s*.55,0,0,M.TAU);c.fill();c.shadowBlur=0;c.globalCompositeOperation='source-over';c.globalAlpha=k*.7;c.strokeStyle='#ffffff';c.lineWidth=s*.03;c.lineCap='round';c.beginPath();c.ellipse(0,-s*.4,s*.19,s*.47,0,Math.PI*1.1,Math.PI*1.45);c.stroke();c.restore()}c.restore();GL(c,x,y,s*.5,WW,.35*k)};",is="const ARW=(c,x,y,a,col,al=1)=>{if(!(a>0)||!(al>0))return;GL(c,x,y,a*3,col,al);c.save();c.globalAlpha=Math.min(1,al);c.beginPath();c.moveTo(x,y-a);c.lineTo(x+a*.62,y+a*.55);c.lineTo(x,y+a*.2);c.lineTo(x-a*.62,y+a*.55);c.closePath();const g=c.createLinearGradient(x,y-a,x,y+a*.55);g.addColorStop(0,'#ffffff');g.addColorStop(.5,M.mix(col,'#ffffff',.4));g.addColorStop(1,col);c.fillStyle=g;c.shadowColor=col;c.shadowBlur=a*.6;c.fill();c.shadowBlur=0;c.lineJoin='round';c.strokeStyle='rgba(255,255,255,.8)';c.lineWidth=Math.max(1,a*.04);c.stroke();c.restore()};",ls="const SPOT=(env,pos,def,w,h)=>{const S=M.safe(env,'center'),L=['top-left','top-right','bottom-left','bottom-right','top','lower','bottom'],P=L.includes(pos)?pos:def,x=P.includes('left')?S.x0+w/2:P.includes('right')?S.x1-w/2:S.cx,y=P==='top'||P.includes('top-')?S.top+h/2:S.bot-h/2;return{x,y,P,S}};",tc="const B=BEGIN(ctx,t,env);if(!B)return;const {W,H,D,K,u,cx,cy,e,q,S,s}=B,P=S.port",yr=[Me("promo-logo-spark","Logo loé sáng",2.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff9a3c",text:"Logo"},`function render(ctx,t,env){
7500
7500
  ${Je}${ns}${ga}${ss}
7501
7501
  // Logo spark: a tiny white star spark flashes in the dark, a glossy three-petal logo mark blooms out of it with a warm orange glow and a faint violet halo ring, the wordmark (text, optional) slides out beside it, then the mark swells into warm light that fills the frame with next (fields: text, bg, next, fg, fg2).
7502
7502
  ${tc}
@@ -7512,7 +7512,7 @@
7512
7512
  if(s)TX(ctx,B,s,mx+A/2+gap-(1-wm)*u*.04,my,sz,mw,1,wm*(1-q),K.f2,'left')
7513
7513
  CC(ctx,B,mx,my,q,ms*.8,K.f2,M.mix(K.f2,WW,.35))
7514
7514
  FIN(ctx,B)
7515
- }`),ue("promo-flare-card","Tia sao và thẻ kính",2.8,{bg:"#05050b",next:"#05050b",fg:"#3d6bff",fg2:"#ff9a3c",text:"Thương hiệu"},`function render(ctx,t,env){
7515
+ }`),Me("promo-flare-card","Tia sao và thẻ kính",2.8,{bg:"#05050b",next:"#05050b",fg:"#3d6bff",fg2:"#ff9a3c",text:"Thương hiệu"},`function render(ctx,t,env){
7516
7516
  ${Je}${ga}${ao}
7517
7517
  // Flare card: a blue four-point lens star flare sweeps across the dark frame while a glowing glass card with a bright gradient rim slides up from the bottom-left behind the title (text, optional) and warm light (white, orange, pink, violet) pools inside it, then the card grows until the frame is flat next (fields: text, bg, next, fg, fg2).
7518
7518
  ${tc}
@@ -7529,7 +7529,7 @@
7529
7529
  STAR(ctx,fx,fy,u*(P?.75:.6),K.fg,fa)
7530
7530
  RCV(ctx,B,px-cw/2,py-ch/2,cw,ch,r,q,K.f2,M.mix(K.f2,WW,.5))
7531
7531
  FIN(ctx,B)
7532
- }`),ue("promo-aurora-card","Thẻ ánh sáng cực quang",3.2,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Sáng tạo không giới hạn"},`function render(ctx,t,env){
7532
+ }`),Me("promo-aurora-card","Thẻ ánh sáng cực quang",3.2,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Sáng tạo không giới hạn"},`function render(ctx,t,env){
7533
7533
  ${Je}${ao}
7534
7534
  // Aurora card: a big glass card fills most of the frame with swirling aurora light inside it (violet, blue, cyan, magenta, orange blobs and glowing ribbons) under a turning gradient rim, the title (text, optional) glows on top, then the card expands until the frame is flat next (fields: text, bg, next, fg, fg2).
7535
7535
  ${tc}
@@ -7545,7 +7545,7 @@
7545
7545
  TX(ctx,B,s,cx,cy,u*.1,cw*.8,3,M.ease.outCubic(M.range(t,.2,.8))*(1-q),K.fg)
7546
7546
  RCV(ctx,B,x,y,cw,ch,r,q,K.fg,M.mix(K.fg,'#ffffff',.35))
7547
7547
  FIN(ctx,B)
7548
- }`),ue("promo-card-pill","Thẻ thu thành viên sáng",2.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff4fd8",text:""},`function render(ctx,t,env){
7548
+ }`),Me("promo-card-pill","Thẻ thu thành viên sáng",2.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff4fd8",text:""},`function render(ctx,t,env){
7549
7549
  ${Je}${ao}
7550
7550
  // Card to pill: a glowing glass card with warm light inside collapses into a glowing white pill (with a lens streak and soft violet bloom) that hums, an optional short label (text) shows inside it, then the pill swells until the frame is flat next (fields: text, bg, next, fg, fg2).
7551
7551
  ${tc}
@@ -7560,7 +7560,7 @@
7560
7560
  if(s){const f=M.fit(ctx,s,z=>B.sk.font(z,'h','600'),ph*.4,pw-ph,1,.4);ctx.save();ctx.globalAlpha=M.range(t,1.2,1.5)*(1-q);ctx.font=f.font;ctx.fillStyle='#16112e';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(f.lines[0],cx,cy);ctx.restore()}
7561
7561
  RCV(ctx,B,x,y,cw,ch,r,q,K.fg,M.mix(K.fg,'#ffffff',.5))
7562
7562
  FIN(ctx,B)
7563
- }`),ue("promo-prompt-bar","Thanh gõ lệnh neon",3.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Một mẫu thật đẹp|Logo nổi bật|Video ra mắt"},`function render(ctx,t,env){
7563
+ }`),Me("promo-prompt-bar","Thanh gõ lệnh neon",3.6,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Một mẫu thật đẹp|Logo nổi bật|Video ra mắt"},`function render(ctx,t,env){
7564
7564
  ${Je}
7565
7565
  // Prompt bar: a dark glass search capsule with a moving neon gradient border (violet, cyan, green, magenta) and two light comets running round it types the words of text (split by |) letter by letter with a caret, deleting between words, a search icon on the right, the glow under it shifting blue, violet, cyan per word; with no text it types a short ellipsis; then the bar floods the frame with next (fields: text, bg, next, fg, fg2).
7566
7566
  ${tc}
@@ -7583,7 +7583,7 @@
7583
7583
  ctx.restore()
7584
7584
  RCV(ctx,B,x,y,bw,bh,bh/2,q,gc,M.mix(gc,'#ffffff',.5))
7585
7585
  FIN(ctx,B)
7586
- }`),ue("promo-icon-cloud","Đám biểu tượng kính",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Mọi nhu cầu"},`function render(ctx,t,env){
7586
+ }`),Me("promo-icon-cloud","Đám biểu tượng kính",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Mọi nhu cầu"},`function render(ctx,t,env){
7587
7587
  ${Je}${Ba}
7588
7588
  // Icon cloud: a burst of 3D glass app icons (sparkle, image, eye, search, music, wave, flower, heart, diamond, chat, star, play) with glowing coloured rims drifts toward the camera at different depths (parallax, scale, depth blur) around the centre word (text, optional), then one icon flies in and swells until the frame is flat next (fields: text, bg, next, fg, fg2).
7589
7589
  ${tc}
@@ -7602,7 +7602,7 @@
7602
7602
  ic.filter(o=>o.z<=1.5).forEach(dr)
7603
7603
  RCV(ctx,B,cx-hs/2,cy-hs/2,hs,hs,hs*.26,q,K.fg,M.mix(K.f2,'#ffffff',.4))
7604
7604
  FIN(ctx,B)
7605
- }`),ue("promo-icon-converge","Biểu tượng hội tụ",3,{bg:"#05050b",next:"#05050b",fg:"#3d6bff",fg2:"#ff9a3c"},`function render(ctx,t,env){
7605
+ }`),Me("promo-icon-converge","Biểu tượng hội tụ",3,{bg:"#05050b",next:"#05050b",fg:"#3d6bff",fg2:"#ff9a3c"},`function render(ctx,t,env){
7606
7606
  ${Je}${Ba}
7607
7607
  // Icons converge: a ring of 3D glass app icons pops in, spirals inward and merges in a flash into one big glass icon with a blue and orange rim showing bouncing typing dots, which turn into a glowing arrow-up, then the icon swells until the frame is flat next (fields: bg, next, fg, fg2).
7608
7608
  ${tc}
@@ -7618,7 +7618,7 @@
7618
7618
  if(am>0){const a=Z*.26*(.6+.4*am),ay=cy-Z*.03*Math.sin(t*3)*am;NEON(ctx,K.fg,Z*.05,()=>{ctx.beginPath();ctx.moveTo(cx,ay+a);ctx.lineTo(cx,ay-a);ctx.moveTo(cx-a*.72,ay-a*.22);ctx.lineTo(cx,ay-a);ctx.lineTo(cx+a*.72,ay-a*.22)},GRD(ctx,cx,ay+a,cx,ay-a,[K.f2,'#ffffff']),am)}}
7619
7619
  RCV(ctx,B,cx-Z/2,cy-Z/2,Z,Z,Z*.26,q,K.fg,M.mix(K.f2,'#ffffff',.4))
7620
7620
  FIN(ctx,B)
7621
- }`),ue("promo-arrow-launch","Mũi tên phóng lên",2.8,{bg:"#05050b",next:"#05050b",fg:"#2fe0ff",fg2:"#8a5cff"},`function render(ctx,t,env){
7621
+ }`),Me("promo-arrow-launch","Mũi tên phóng lên",2.8,{bg:"#05050b",next:"#05050b",fg:"#2fe0ff",fg2:"#8a5cff"},`function render(ctx,t,env){
7622
7622
  ${Je}${ga}${is}
7623
7623
  // Arrow launch: a glowing cyan arrow rises from the bottom like a ship with a long tapered light trail (white, cyan, violet), sparks shedding behind it and a star glint at its nose, then the trail floods sideways until the frame is flat next while the arrow flies off (fields: bg, next, fg, fg2).
7624
7624
  ${tc}
@@ -7634,7 +7634,7 @@
7634
7634
  ARW(ctx,ax,ay,a,K.fg,fa)
7635
7635
  STAR(ctx,ax,ay-a,u*.16*(.75+.25*Math.sin(t*6)),K.fg,.85*M.range(t,.3,.8)*fa)
7636
7636
  FIN(ctx,B)
7637
- }`),ue("promo-dome-horizon","Chân trời vòm tím",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff4fd8",text:"Keep moving"},`function render(ctx,t,env){
7637
+ }`),Me("promo-dome-horizon","Chân trời vòm tím",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff4fd8",text:"Keep moving"},`function render(ctx,t,env){
7638
7638
  ${Je}${ga}${is}
7639
7639
  // Dome horizon: a huge violet glowing planet dome arcs down from the top with a bright magenta rim and an atmosphere glow beneath it, a lens star flare blooms on its rim, the line (text, optional) fades in under it and a small cyan arrow hovers below, then the dome sinks over the frame until it is flat next (fields: text, bg, next, fg, fg2).
7640
7640
  ${tc}
@@ -7649,7 +7649,7 @@
7649
7649
  ARW(ctx,cx,yb+u*(P?.42:.3)+Math.sin(t*2.4)*u*.012,u*.035,CY,M.range(t,.9,1.3)*(1-q))
7650
7650
  if(q>0){const yy=M.lerp(yc,cy,q);ctx.save();ctx.globalAlpha=Math.min(1,q*4);ctx.fillStyle=M.mix(M.mix(K.fg,'#04020a',.4),K.nx,M.range(q,.2,.85));ctx.beginPath();ctx.arc(cx,yy,R,0,M.TAU);ctx.fill();ctx.restore();NEON(ctx,K.f2,u*.004,()=>{ctx.beginPath();ctx.arc(cx,yy,R,0,M.TAU)},0,1-M.range(q,.5,.9))}
7651
7651
  FIN(ctx,B)
7652
- }`),ue("promo-feature-cards","Ba thẻ tính năng",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Tạo nhanh|Đẹp chuẩn|Dễ chia sẻ"},`function render(ctx,t,env){
7652
+ }`),Me("promo-feature-cards","Ba thẻ tính năng",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:"Tạo nhanh|Đẹp chuẩn|Dễ chia sẻ"},`function render(ctx,t,env){
7653
7653
  ${Je}${ao}${Ba}
7654
7654
  // Feature cards: up to three glass feature cards (a glowing glass icon and a short line each, from text split by |) fan in one after another with gradient rims, stacked in 9:16 and side by side in 16:9; with no text three glass icon tiles fan in; then the middle card grows until the frame is flat next (fields: text, bg, next, fg, fg2).
7655
7655
  ${tc}
@@ -7668,7 +7668,7 @@
7668
7668
  ctx.restore()}
7669
7669
  if(mr)RCV(ctx,B,mr[0],mr[1],w,h,u*.04,q,CS[mi%3][0],M.mix(CS[mi%3][0],'#ffffff',.4))
7670
7670
  FIN(ctx,B)
7671
- }`),ue("promo-cta-button","Nút bấm kêu gọi",3,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff9a3c",text:"Thử ngay"},`function render(ctx,t,env){
7671
+ }`),Me("promo-cta-button","Nút bấm kêu gọi",3,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#ff9a3c",text:"Thử ngay"},`function render(ctx,t,env){
7672
7672
  ${Je}
7673
7673
  // CTA button: a glowing violet-magenta-orange gradient pill button with a moving sheen, the call to action (text, optional) and an arrow, a cursor glides in and clicks it (press down, ripple rings, sparkle burst), then the button swells until the frame is flat next (fields: text, bg, next, fg, fg2).
7674
7674
  ${tc}
@@ -7691,7 +7691,7 @@
7691
7691
  const mv=M.ease.inOutCubic(M.range(t,.3,ck-.1)),ca=M.range(t,.25,.45)*(1-q);if(ca>0){ctx.save();ctx.globalAlpha=ca;M.cursor(ctx,M.lerp(cx+W*.32,px,mv),M.lerp(cy+H*(P?.22:.35),py,mv),u*.05*(1-.12*pr),0,'#ffffff');ctx.restore()}
7692
7692
  RCV(ctx,B,cx-bw/2*sc,cy-bh/2*sc,bw*sc,bh*sc,bh/2*sc,q,K.fg,M.mix(K.fg,'#ffffff',.3))
7693
7693
  FIN(ctx,B)
7694
- }`),ue("promo-glass-orbit","Biểu tượng xoay quanh logo",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:""},`function render(ctx,t,env){
7694
+ }`),Me("promo-glass-orbit","Biểu tượng xoay quanh logo",3.4,{bg:"#05050b",next:"#05050b",fg:"#8a5cff",fg2:"#2fe0ff",text:""},`function render(ctx,t,env){
7695
7695
  ${Je}${ns}${Ba}${ss}
7696
7696
  // Glass orbit: the glossy logo mark glows in the centre while six 3D glass app icons orbit it on a tilted ellipse with true depth order (back icons smaller, dimmer, softly blurred) along a gradient light ring, an optional line (text) under it, then the mark swells into light until the frame is flat next (fields: text, bg, next, fg, fg2).
7697
7697
  ${tc}
@@ -7712,7 +7712,7 @@
7712
7712
  TX(ctx,B,s,cx,cy+ry+u*(P?.2:.17),u*(P?.075:.065),S.w*.9,2,M.ease.outCubic(M.range(t,.5,1))*(1-q),K.fg)
7713
7713
  CC(ctx,B,cx,cy,q,ms*.8,K.fg,M.mix(K.fg,WW,.3))
7714
7714
  FIN(ctx,B)
7715
- }`),ue("promo-caption","Phụ đề Promo",3,{text:"Ra mắt hôm nay",position:"lower",fg:"#8a5cff"},`function render(ctx,t,env){
7715
+ }`),Me("promo-caption","Phụ đề Promo",3,{text:"Ra mắt hôm nay",position:"lower",fg:"#8a5cff"},`function render(ctx,t,env){
7716
7716
  ${co}
7717
7717
  // Overlay caption for promo chains: up to two lines of clean white sans (text) with a soft violet glow over a soft dark band for readability rises in from a blur in the lower third (or top / center); transparent everywhere else (fields: text, position, fg).
7718
7718
  const {width:W,duration:D,params:p}=env,S=M.safe(env,p.position),sk=M.skin(env,p),k=M.io(t,D,.4,.35),u=S.u,fg=PC(p.fg,VI),s=String(p.text||'').trim()
@@ -7723,7 +7723,7 @@
7723
7723
  f.lines.forEach((l,i)=>{const a=M.ease.outCubic(M.range(t,i*.1,.5+i*.1))*(1-k.o),y=y0+i*lh+(1-a)*u*.02;if(!(a>0))return
7724
7724
  ctx.globalAlpha=a;ctx.filter='blur('+((1-a)*u*.01).toFixed(2)+'px)';ctx.shadowColor=fg;ctx.shadowBlur=f.size*.45;ctx.fillText(l,S.cx,y);ctx.shadowColor=M.mix(fg,'#ffffff',.5);ctx.shadowBlur=f.size*.1;ctx.fillText(l,S.cx,y)})
7725
7725
  ctx.restore()
7726
- }`),ue("promo-glass-icon","Biểu tượng kính nổi",4,{position:"top-right",glyph:"spark",fg:"#8a5cff",fg2:"#2fe0ff"},`function render(ctx,t,env){
7726
+ }`),Me("promo-glass-icon","Biểu tượng kính nổi",4,{position:"top-right",glyph:"spark",fg:"#8a5cff",fg2:"#2fe0ff"},`function render(ctx,t,env){
7727
7727
  ${co}${ga}${Ba}${ls}
7728
7728
  // Element: one floating 3D glass app icon (dark glass, glowing gradient rim, a glowing glyph: spark, image, eye, search, music, heart, chat, diamond) bobbing and tilting gently with a twinkling star glint on its corner, in a corner or edge (position: top-right, top-left, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: glyph, position, fg, fg2).
7729
7729
  const {duration:D,params:p}=env,k=M.io(t,D,.45,.4),u=Math.min(env.width,env.height),sz=u*.12,o=SPOT(env,p.position,'top-right',sz*1.6,sz*1.6),fg=PC(p.fg,VI),f2=PC(p.fg2,CY),gl=['spark','image','eye','search','music','heart','chat','diamond'].includes(p.glyph)?p.glyph:'spark'
@@ -7731,7 +7731,7 @@
7731
7731
  const sc=.6+.4*M.ease.outBack(k.i),y=o.y+Math.sin(t*1.7)*sz*.08,s=sz*sc,tw=Math.max(0,Math.sin(t*2.3))
7732
7732
  ICON(ctx,o.x,y,s,gl,fg,f2,k.v,0,Math.sin(t*1.2)*.08)
7733
7733
  STAR(ctx,o.x+s*.42,y-s*.42,sz*.55*tw,f2,k.v*tw)
7734
- }`),ue("promo-star-flare","Tia sao lấp lánh",3,{position:"top-left",fg:"#3d6bff",fg2:"#8a5cff"},`function render(ctx,t,env){
7734
+ }`),Me("promo-star-flare","Tia sao lấp lánh",3,{position:"top-left",fg:"#3d6bff",fg2:"#8a5cff"},`function render(ctx,t,env){
7735
7735
  ${co}${ga}${ls}
7736
7736
  // Element: a four-point lens star flare (white core, long thin coloured streaks) twinkling and slowly turning in a corner or edge with a smaller companion glint (position: top-left, top-right, bottom-left, bottom-right, top, lower); loops over any duration; transparent elsewhere (fields: position, fg, fg2).
7737
7737
  const {duration:D,params:p}=env,k=M.io(t,D,.3,.4),u=Math.min(env.width,env.height),sz=u*.16,o=SPOT(env,p.position,'top-left',sz*1.4,sz),fg=PC(p.fg,BL),f2=PC(p.fg2,VI)
@@ -7900,10 +7900,10 @@
7900
7900
  f.lines.forEach((l,i)=>{const a=M.ease.outCubic(M.range(t,i*.1,.5+i*.1))*(1-k.o),y=y0+i*lh+(1-a)*u*.02;if(!(a>0))return
7901
7901
  ctx.globalAlpha=a;ctx.filter='blur('+((1-a)*u*.01).toFixed(2)+'px)';ctx.fillStyle='#ffffff';ctx.shadowColor=fg;ctx.shadowBlur=f.size*.5;ctx.fillText(l,S.cx,y);ctx.shadowBlur=f.size*.1;ctx.shadowColor='rgba(18,10,6,.8)';ctx.fillText(l,S.cx,y)})
7902
7902
  ctx.restore()
7903
- }`)],hs=V.find(t=>t.id==="glass"),Lc=(t,e,c,a,o)=>({id:t,name:e,category:hs.name,pack:"glass",duration:c,params:{accent:hs.accent,bg:"none",...a,style:"glass"},code:o}),Dc="const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CY='#3fd8ff';const BG=(c,env,p,t,A)=>{if(!HX.test(String(p.bg)))return;const W=env.width,H=env.height,b=p.bg,L=Math.hypot(W,H);c.fillStyle=b;c.fillRect(0,0,W,H);const g=c.createLinearGradient(0,0,W,H);g.addColorStop(0,M.rgba(b,0));g.addColorStop(.6,M.rgba(M.mix(b,A,.22),.85));g.addColorStop(1,M.rgba(M.mix(b,A,.4),1));c.fillStyle=g;c.fillRect(0,0,W,H);c.save();c.globalCompositeOperation='lighter';c.translate(W*(.62+.05*Math.sin(t*.5)),H*.45);c.rotate(.62);const bm=c.createLinearGradient(-L*.09,0,L*.09,0);bm.addColorStop(0,'rgba(0,0,0,0)');bm.addColorStop(.5,M.rgba(M.mix(A,'#9fb4ff',.4),.16));bm.addColorStop(1,'rgba(0,0,0,0)');c.fillStyle=bm;c.fillRect(-L*.09,-L,L*.18,L*2);c.restore();const v=c.createRadialGradient(W/2,H/2,Math.min(W,H)*.3,W/2,H/2,L*.62);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,.55)');c.fillStyle=v;c.fillRect(0,0,W,H)};const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.55*Math.min(1,a)));g.addColorStop(.4,M.rgba(col,.16*Math.min(1,a)));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GR=(n,s)=>{const x=String(Math.round(Math.abs(n)));let o='';for(let i=0;i<x.length;i++){if(i&&(x.length-i)%3===0)o+=s;o+=x[i]}return(n<0?'-':'')+o};const FLY=(c,x,y,i,o,u,dir=1)=>{c.translate(x+(1-i)*u*.1*dir-o*u*.08,y+(1-i)*u*.14+o*u*.02);c.rotate((1-i)*-.22*dir+o*.08);const s=.82+.18*i-.06*o;c.scale(s,s);c.transform(1,-.035,.06,1,0,0);c.globalAlpha*=M.clamp(i*1.4)*(1-o);const b=((1-i)+o)*u*.014;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)'};const PANEL=(c,x,y,w,h,r,t,A,sw=1)=>{const f=c.createLinearGradient(x,y,x+w*.3,y+h);f.addColorStop(0,'rgba(34,40,64,.62)');f.addColorStop(1,'rgba(5,7,18,.82)');c.fillStyle=f;M.rr(c,x,y,w,h,r);c.fill();c.save();M.rr(c,x,y,w,h,r);c.clip();GL(c,x+w*.08,y+h*.95,Math.max(w,h)*.55,A,.55);if(sw){const s=((t*.42+.15)%1.5)/1.2,bx=x-w*.5+w*1.9*s,bw=Math.max(w,h)*.22,g=c.createLinearGradient(bx,0,bx+bw,0);g.addColorStop(0,'rgba(255,255,255,0)');g.addColorStop(.5,'rgba(255,255,255,'+(.3*sw)+')');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.moveTo(bx,y);c.lineTo(bx+bw,y);c.lineTo(bx+bw-h*.7,y+h);c.lineTo(bx-h*.7,y+h);c.closePath();c.fill()}c.restore();const e=c.createLinearGradient(x,y,x+w,y+h);e.addColorStop(0,'rgba(236,240,255,.85)');e.addColorStop(.5,'rgba(150,160,190,.3)');e.addColorStop(1,'rgba(220,228,255,.7)');c.strokeStyle=e;c.lineWidth=Math.max(1,Math.min(w,h)*.012);M.rr(c,x,y,w,h,r);c.stroke()};const WL=(c,sk,s,x,y,size,role,col,t,t0,step,o,maxW,glow,al='center')=>{const ws=String(s).split(' ').filter(Boolean);if(!ws.length||!(size>0))return 0;let z=size;c.font=sk.font(z,role);let tw=c.measureText(ws.join(' ')).width;if(tw>maxW){z*=maxW/tw;c.font=sk.font(z,role);tw=maxW}const sp=c.measureText(' ').width,st=Math.min(.08,.45/ws.length);let px=al==='left'?x:x-tw/2;c.textAlign='left';c.textBaseline='alphabetic';ws.forEach((w,i)=>{const t1=Array.isArray(t0)?(t0[i]??t0[t0.length-1]??0):t0+i*step,a=M.ease.outCubic(M.range(t,t1,t1+.3)),e=M.ease.inCubic(M.range(o,i*st,i*st+.55)),ww=c.measureText(w).width;if(a>0&&e<1){c.save();c.globalAlpha*=a*(1-e);const b=(1-a)*z*.12+e*z*.25;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)';c.fillStyle=col;if(glow){c.shadowColor=col;c.shadowBlur=z*.3}c.fillText(w,px-e*z*1.4+(1-a)*z*.2,y+[0,.09,-.05][i%3]*z+(1-a)*z*.4);c.restore()}px+=ww+sp});return z};const TITLE=(c,sk,p,S,t,o,A,t0=.15)=>{const a=String(p.text||''),b=String(p.sub||''),n=a.split(' ').filter(Boolean).length,u=S.u,y=S.H*(S.port?.165:.15);if(a)WL(c,sk,a,S.cx-u*.03,y,u*(S.port?.05:.052),'s','#f2f5ff',t,t0,.16,o,S.w*.9,0);if(b)WL(c,sk,b,S.cx+u*.05,y+u*(S.port?.105:.095),u*(S.port?.1:.088),'h',A,t,t0+n*.16+.1,.18,o,S.w*.86,1);return !!(a||b)};const BOX=(S,ar,has,pos)=>{const top=has?S.H*(S.port?.29:.3):S.top+S.H*.02,b0=pos==='lower'?Math.max(top,S.H*.5):top,b1=pos==='top'?Math.min(S.bot,S.H*.66):S.bot,ah=(b1-b0)*.9,w=Math.min(S.w*(S.port?.86:.62),ah*ar),h=w/ar;return{w,h,x:S.cx-w/2,y:(b0+b1)/2-h/2,cx:S.cx,cy:(b0+b1)/2}};",ta="const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),A=sk.acc,u=S.u,i=M.ease.outCubic(M.range(t,.02,.45)),o=M.ease.inCubic(M.range(t,D-.3,D));BG(ctx,env,p,t,A);const has=TITLE(ctx,sk,p,S,t,o,A)",mr=[Lc("glass-orb-rise","Quả cầu trợ lý",4,{text:"Nếu bạn có thể",sub:"giao dịch",position:"center"},`function render(ctx,t,env){
7903
+ }`)],hs=V.find(t=>t.id==="glass"),Lc=(t,e,c,a,o)=>({id:t,name:e,category:hs.name,pack:"glass",duration:c,params:{accent:hs.accent,bg:"none",...a,style:"glass"},code:o}),Dc="const HX=/^#[0-9a-f]{6}$/i,PC=(v,d)=>HX.test(String(v))?v:d,CY='#3fd8ff';const BG=(c,env,p,t,A)=>{if(!HX.test(String(p.bg)))return;const W=env.width,H=env.height,b=p.bg,L=Math.hypot(W,H);c.fillStyle=b;c.fillRect(0,0,W,H);const g=c.createLinearGradient(0,0,W,H);g.addColorStop(0,M.rgba(b,0));g.addColorStop(.6,M.rgba(M.mix(b,A,.22),.85));g.addColorStop(1,M.rgba(M.mix(b,A,.4),1));c.fillStyle=g;c.fillRect(0,0,W,H);c.save();c.globalCompositeOperation='lighter';c.translate(W*(.62+.05*Math.sin(t*.5)),H*.45);c.rotate(.62);const bm=c.createLinearGradient(-L*.09,0,L*.09,0);bm.addColorStop(0,'rgba(0,0,0,0)');bm.addColorStop(.5,M.rgba(M.mix(A,'#9fb4ff',.4),.16));bm.addColorStop(1,'rgba(0,0,0,0)');c.fillStyle=bm;c.fillRect(-L*.09,-L,L*.18,L*2);c.restore();const v=c.createRadialGradient(W/2,H/2,Math.min(W,H)*.3,W/2,H/2,L*.62);v.addColorStop(0,'rgba(0,0,0,0)');v.addColorStop(1,'rgba(0,0,0,.55)');c.fillStyle=v;c.fillRect(0,0,W,H)};const GL=(c,x,y,r,col,a=1)=>{if(!(r>0)||!(a>0))return;const g=c.createRadialGradient(x,y,0,x,y,r);g.addColorStop(0,M.rgba(col,.55*Math.min(1,a)));g.addColorStop(.4,M.rgba(col,.16*Math.min(1,a)));g.addColorStop(1,M.rgba(col,0));c.save();c.globalCompositeOperation='lighter';c.fillStyle=g;c.beginPath();c.arc(x,y,r,0,M.TAU);c.fill();c.restore()};const GR=(n,s)=>{const x=String(Math.round(Math.abs(n)));let o='';for(let i=0;i<x.length;i++){if(i&&(x.length-i)%3===0)o+=s;o+=x[i]}return(n<0?'-':'')+o};const FLY=(c,x,y,i,o,u,dir=1)=>{c.translate(x+(1-i)*u*.1*dir-o*u*.08,y+(1-i)*u*.14+o*u*.02);c.rotate((1-i)*-.22*dir+o*.08);const s=.82+.18*i-.06*o;c.scale(s,s);c.transform(1,-.035,.06,1,0,0);c.globalAlpha*=M.clamp(i*1.4)*(1-o);const b=((1-i)+o)*u*.014;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)'};const PANEL=(c,x,y,w,h,r,t,A,sw=1)=>{const f=c.createLinearGradient(x,y,x+w*.3,y+h);f.addColorStop(0,'rgba(34,40,64,.62)');f.addColorStop(1,'rgba(5,7,18,.82)');c.fillStyle=f;M.rr(c,x,y,w,h,r);c.fill();c.save();M.rr(c,x,y,w,h,r);c.clip();GL(c,x+w*.08,y+h*.95,Math.max(w,h)*.55,A,.55);if(sw){const s=((t*.42+.15)%1.5)/1.2,bx=x-w*.5+w*1.9*s,bw=Math.max(w,h)*.22,g=c.createLinearGradient(bx,0,bx+bw,0);g.addColorStop(0,'rgba(255,255,255,0)');g.addColorStop(.5,'rgba(255,255,255,'+(.3*sw)+')');g.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=g;c.beginPath();c.moveTo(bx,y);c.lineTo(bx+bw,y);c.lineTo(bx+bw-h*.7,y+h);c.lineTo(bx-h*.7,y+h);c.closePath();c.fill()}c.restore();const e=c.createLinearGradient(x,y,x+w,y+h);e.addColorStop(0,'rgba(236,240,255,.85)');e.addColorStop(.5,'rgba(150,160,190,.3)');e.addColorStop(1,'rgba(220,228,255,.7)');c.strokeStyle=e;c.lineWidth=Math.max(1,Math.min(w,h)*.012);M.rr(c,x,y,w,h,r);c.stroke()};const WL=(c,sk,s,x,y,size,role,col,t,t0,step,o,maxW,glow,al='center')=>{const ws=String(s).split(' ').filter(Boolean);if(!ws.length||!(size>0))return 0;let z=size;c.font=sk.font(z,role);let tw=c.measureText(ws.join(' ')).width;if(tw>maxW){z*=maxW/tw;c.font=sk.font(z,role);tw=maxW}const sp=c.measureText(' ').width,st=Math.min(.08,.45/ws.length);let px=al==='left'?x:x-tw/2;c.textAlign='left';c.textBaseline='alphabetic';ws.forEach((w,i)=>{const t1=Array.isArray(t0)?(t0[i]??t0[t0.length-1]??0):t0+i*step,a=M.ease.outCubic(M.range(t,t1,t1+.3)),e=M.ease.inCubic(M.range(o,i*st,i*st+.55)),ww=c.measureText(w).width;if(a>0&&e<1){c.save();c.globalAlpha*=a*(1-e);const b=(1-a)*z*.12+e*z*.25;if(b>.4)c.filter='blur('+b.toFixed(1)+'px)';c.fillStyle=col;if(glow){c.shadowColor=col;c.shadowBlur=z*.3}c.fillText(w,px-e*z*1.4+(1-a)*z*.2,y+[0,.09,-.05][i%3]*z+(1-a)*z*.4);c.restore()}px+=ww+sp});return z};const TITLE=(c,sk,p,S,t,o,A,t0=.15)=>{const a=String(p.text||''),b=String(p.sub||''),n=a.split(' ').filter(Boolean).length,u=S.u,y=S.H*(S.port?.165:.15);if(a)WL(c,sk,a,S.cx-u*.03,y,u*(S.port?.05:.052),'s','#f2f5ff',t,t0,.16,o,S.w*.9,0);if(b)WL(c,sk,b,S.cx+u*.05,y+u*(S.port?.105:.095),u*(S.port?.1:.088),'h',A,t,t0+n*.16+.1,.18,o,S.w*.86,1);return !!(a||b)};const BOX=(S,ar,has,pos)=>{const top=has?S.H*(S.port?.29:.3):S.top+S.H*.02,b0=pos==='lower'?Math.max(top,S.H*.5):top,b1=pos==='top'?Math.min(S.bot,S.H*.66):S.bot,ah=(b1-b0)*.9,w=Math.min(S.w*(S.port?.86:.62),ah*ar),h=w/ar;return{w,h,x:S.cx-w/2,y:(b0+b1)/2-h/2,cx:S.cx,cy:(b0+b1)/2}};",ea="const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),A=sk.acc,u=S.u,i=M.ease.outCubic(M.range(t,.02,.45)),o=M.ease.inCubic(M.range(t,D-.3,D));BG(ctx,env,p,t,A);const has=TITLE(ctx,sk,p,S,t,o,A)",mr=[Lc("glass-orb-rise","Quả cầu trợ lý",4,{text:"Nếu bạn có thể",sub:"giao dịch",position:"center"},`function render(ctx,t,env){
7904
7904
  ${Dc}
7905
7905
  // A glowing assistant orb with two blinking eyes rises from a lit blue horizon dome, a soft halo pulsing under it; optional lead words + big blue keyword above (fields: text, sub, accent, bg).
7906
- ${ta}
7906
+ ${ea}
7907
7907
  const B=BOX(S,1,has,p.position),R=B.w*.42,dt=B.y+B.h*.66,k=M.ease.outCubic(M.range(t,.1,1)),r=B.w*.17,ry=dt-M.ease.outBack(M.range(t,.35,1.25))*B.h*.3+Math.sin(t*1.6)*u*.006
7908
7908
  ctx.save();ctx.globalAlpha=(1-o)*k
7909
7909
  GL(ctx,B.cx,dt+R*.2,R*1.7,A,.9)
@@ -7920,7 +7920,7 @@
7920
7920
  }`),Lc("glass-balance","Thẻ số dư",4.5,{label:"Số dư",from:86744,number:1e5,prefix:"$",text:"",sub:"",position:"center"},`function render(ctx,t,env){
7921
7921
  ${Dc}
7922
7922
  // A glass balance card flies in over a pulsing equaliser of dim blue blocks and its number counts up fast from "from" to "number" with a prefix; optional words above (fields: label, from, number, prefix, text, sub, accent, bg).
7923
- ${ta}
7923
+ ${ea}
7924
7924
  const B=BOX(S,1.15,has,p.position),cols=14,rows=10,cw=B.w/cols,ch=B.h*.9/rows,k=M.ease.outCubic(M.range(t,0,.6))*(1-o)
7925
7925
  for(let c=0;c<cols;c++){const lv=.25+.65*M.noise(c*.7,t*1.3)*M.clamp(1-Math.abs(c-cols/2+.5)/cols*.6);for(let r=0;r<rows;r++){const on=r/rows<lv*M.range(t,c*.03,c*.03+.6);ctx.fillStyle=M.rgba(M.mix(A,'#1a2a7a',.35),(on?.42:.08)*k*(1-r/rows*.35));ctx.fillRect(B.x+c*cw+cw*.14,B.y+B.h*.95-(r+1)*ch+ch*.18,cw*.72,ch*.64)}}
7926
7926
  const v0=+p.from||0,v1=Number.isFinite(+p.number)?+p.number:0,run=M.ease.outCubic(M.range(t,.55,Math.max(1.2,D*.62))),val=v0+(v1-v0)*run,pre=String(p.prefix||''),sep=pre==='$'?',':'.'
@@ -7934,7 +7934,7 @@
7934
7934
  }`),Lc("glass-coin-bars","Cột xu tăng",4.5,{items:"35|52|70|100",symbol:"$",text:"Bạn có",sub:"kỹ năng",position:"center"},`function render(ctx,t,env){
7935
7935
  ${Dc}
7936
7936
  // A tilted glass panel where blue bars (items = heights) grow one after another, each topped by a glowing coin with a symbol that pops up; optional words above (fields: items, symbol, text, sub, accent, bg).
7937
- ${ta}
7937
+ ${ea}
7938
7938
  const B=BOX(S,1.35,has,p.position),vs=String(p.items||'').split('|').map(x=>parseFloat(String(x).replace(',','.'))).filter(Number.isFinite).slice(0,5),vals=vs.length?vs:[35,52,70,100],mx=Math.max(...vals,1),n=vals.length
7939
7939
  const w=B.w*.9,h=w/1.6,pi=M.ease.outCubic(M.range(t,.02,.45))
7940
7940
  ctx.save();FLY(ctx,B.cx,B.cy,pi,o,u)
@@ -7949,7 +7949,7 @@
7949
7949
  }`),Lc("glass-step-chart","Biểu đồ bậc thang",4.5,{items:"22|38|38|58|58|84",text:"Họ cấp cho bạn",sub:"nguồn vốn",position:"center"},`function render(ctx,t,env){
7950
7950
  ${Dc}
7951
7951
  // A blocky step chart (items = step heights) fills in left to right inside a glass panel over a faint grid, a glowing dot riding the top edge; optional words above (fields: items, text, sub, accent, bg).
7952
- ${ta}
7952
+ ${ea}
7953
7953
  const B=BOX(S,1.5,has,p.position),vs=String(p.items||'').split('|').map(x=>parseFloat(String(x).replace(',','.'))).filter(Number.isFinite).slice(0,8),vals=vs.length>1?vs:[22,38,38,58,58,84],mx=Math.max(...vals,1),n=vals.length
7954
7954
  const w=B.w*.94,h=w/1.6,pi=M.ease.outCubic(M.range(t,.02,.45)),k=M.ease.inOutCubic(M.range(t,.4,D-1.1))
7955
7955
  ctx.save();FLY(ctx,B.cx,B.cy,pi,o,u,-1)
@@ -7965,7 +7965,7 @@
7965
7965
  }`),Lc("glass-line-target","Đường cong về đích",4.5,{text:"Tất cả những gì bạn cần",sub:"vượt thử thách",position:"center"},`function render(ctx,t,env){
7966
7966
  ${Dc}
7967
7967
  // A smooth curve draws across a glass panel, a dot travels it to a ring target at the end; the ring fills blue and a check mark draws in; optional words above (fields: text, sub, accent, bg).
7968
- ${ta}
7968
+ ${ea}
7969
7969
  const B=BOX(S,1.5,has,p.position),w=B.w*.94,h=w/1.6,pi=M.ease.outCubic(M.range(t,.02,.45)),k=M.ease.inOutCubic(M.range(t,.45,2.1))
7970
7970
  ctx.save();FLY(ctx,B.cx,B.cy,pi,o,u)
7971
7971
  PANEL(ctx,-w/2,-h/2,w,h,h*.08,t,A,.9)
@@ -7983,7 +7983,7 @@
7983
7983
  }`),Lc("glass-candles","Nến trong kính",5,{text:"Bạn giao dịch",sub:"tài khoản thật",position:"center"},`function render(ctx,t,env){
7984
7984
  ${Dc}
7985
7985
  // Candles print one by one on a grid inside a tall glass panel (white up, blue down) while a thin orbit ring circles the panel and a blue light streak sweeps round it; optional words above (fields: text, sub, accent, bg).
7986
- ${ta}
7986
+ ${ea}
7987
7987
  const B=BOX(S,.95,has,p.position),h=B.h*.86,w=h*.9,pi=M.ease.outCubic(M.range(t,.02,.45)),R=M.rand(17),n=11
7988
7988
  ctx.save();FLY(ctx,B.cx,B.cy,pi,o,u,-1)
7989
7989
  const rx=w*.78,ry=h*.62,an=t*1.7,ra=M.clamp(M.range(t,.4,1))
@@ -8001,7 +8001,7 @@
8001
8001
  }`),Lc("glass-progress","Vòng phần trăm",4.5,{number:90,text:"Bạn giữ tới",sub:"lợi nhuận",position:"center"},`function render(ctx,t,env){
8002
8002
  ${Dc}
8003
8003
  // A glass square with a progress ring counting 0 to number percent, a big electric-blue number percent under it and a small label; small lead words above the square (fields: number, text, sub, accent, bg).
8004
- ${ta.replace("const has=TITLE(ctx,sk,p,S,t,o,A)","const has=0")}
8004
+ ${ea.replace("const has=TITLE(ctx,sk,p,S,t,o,A)","const has=0")}
8005
8005
  const B=BOX(S,.85,0,p.position),q=Math.max(0,Math.min(100,Number.isFinite(+p.number)?+p.number:90)),s=Math.min(B.w*.5,B.h*.42),sy=B.y+B.h*.36,pi=M.ease.outCubic(M.range(t,.02,.45)),k=M.ease.inOutCubic(M.range(t,.6,D-1.2))
8006
8006
  WL(ctx,sk,String(p.text||''),B.cx,sy-s*.68,u*(S.port?.048:.05),'s','#f2f5ff',t,.1,.16,o,S.w*.9,0)
8007
8007
  ctx.save();FLY(ctx,B.cx,sy,pi,o,u)
@@ -8016,7 +8016,7 @@
8016
8016
  }`),Lc("glass-emblem","Biểu tượng và giá",4.5,{number:99,prefix:"$",text:"Tất cả chỉ từ",position:"center"},`function render(ctx,t,env){
8017
8017
  ${Dc}
8018
8018
  // An abstract glowing shield mark draws itself with a blue-to-cyan gradient stroke and lights up, then the price (prefix + number) pops in under it with a small tag swinging from it; small lead words above (fields: number, prefix, text, accent, bg).
8019
- ${ta.replace("const has=TITLE(ctx,sk,p,S,t,o,A)","const has=0")}
8019
+ ${ea.replace("const has=TITLE(ctx,sk,p,S,t,o,A)","const has=0")}
8020
8020
  const B=BOX(S,.9,0,p.position),s=Math.min(B.w*.5,B.h*.4),ey=B.y+B.h*.36,k=M.ease.inOutCubic(M.range(t,.05,1.3)),lw=s*.11
8021
8021
  WL(ctx,sk,String(p.text||''),B.cx,ey-s*.82,u*(S.port?.048:.05),'s','#f2f5ff',t,.6,.16,o,S.w*.9,0)
8022
8022
  const cv=(P0,P1,P2,n=20)=>{const r=[];for(let j=0;j<=n;j++){const q=j/n,m=1-q;r.push([m*m*P0[0]+2*m*q*P1[0]+q*q*P2[0],m*m*P0[1]+2*m*q*P1[1]+q*q*P2[1]])}return r}
@@ -8059,7 +8059,7 @@
8059
8059
  if(a>0&&e<1){ctx.save();ctx.globalAlpha*=M.clamp(a)*(1-e)*fade;ctx.font=sk.font(z,x.B?'h':'s');ctx.textAlign='left';ctx.textBaseline='alphabetic';const bl=(1-M.clamp(a))*z*.15+e*z*.25;if(bl>.4)ctx.filter='blur('+bl.toFixed(1)+'px)'
8060
8060
  const cx=px+ww/2,cy=y-z*.35;ctx.translate(cx-e*z*1.3,cy+(1-M.clamp(a))*z*(x.B?0:.4));const sc=x.B?.6+.4*a:1;ctx.scale(sc,sc);ctx.fillStyle=x.B?A:'#f2f5ff';if(x.B){ctx.shadowColor=A;ctx.shadowBlur=z*.28}ctx.fillText(x.w,-ww/2,z*.35);ctx.restore()}
8061
8061
  px+=ww+g.sp*g.k})})
8062
- }`)],fs=V.find(t=>t.id==="clipooxmotion"),O=(t,e,c,a,o)=>({id:t,name:e,category:fs.name,pack:"clipooxmotion",duration:c,params:{accent:fs.accent,position:"center",...a,style:"clipooxmotion"},code:o}),kt=(...t)=>({...O(...t),formats:["portrait"]}),oc=(...t)=>({...O(...t),formats:["landscape"]}),U="const LM='#8afb00',BK='#0d0d0d';const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);const MONO=(s,w='700')=>w+' '+Math.round(s*10)/10+'px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace';const OUT=(c,t,D,cx,cy,hold)=>{const o=hold?0:M.ease.inCubic(M.range(t,D-.4,D));c.save();if(o>0){c.globalAlpha*=1-o;c.filter='blur('+(o*16).toFixed(1)+'px)';c.translate(cx,cy);c.scale(1+o*.12,1+o*.12);c.translate(-cx,-cy)}return o};",it="const LOGO=(c,x,y,h,col,a=1,rot=0)=>{if(!(h>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.fillStyle=col;c.fill('evenodd');c.restore()};",We="const APP=(c,x,y,s,a=1,rot=0)=>{if(!(s>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.shadowColor='rgba(60,110,0,.35)';c.shadowBlur=s*.25;c.shadowOffsetY=s*.06;c.fillStyle=LM;c.beginPath();c.roundRect(-s/2,-s/2,s,s,s*.22);c.fill();c.shadowColor='transparent';const g=c.createLinearGradient(0,-s/2,0,s/2);g.addColorStop(0,'rgba(255,255,255,.28)');g.addColorStop(.5,'rgba(255,255,255,0)');c.fillStyle=g;c.fill();c.restore();LOGO(c,x,y+s*.02,s*.66,BK,a,rot)};",Wa="const SMR=(c,dx,draw,n=7)=>{if(Math.abs(dx)<1){draw();return}const a0=c.globalAlpha;for(let i=n;i>=0;i--){c.save();c.globalAlpha=a0*(i?.22*(1-i/(n+1)):1);c.translate(-dx*i/n,0);draw();c.restore()}};",kr=U+it+We+Wa,ke="const PA='#f7f8f3',GR='#6b7064';const BG=(c,W,H,u,t)=>{c.fillStyle=PA;c.fillRect(0,0,W,H);[[.04,.04,'#c9ff80',.5],[.97,.98,LM,.32],[.92,.03,'#e6ffc4',.55],[.03,.97,'#eaffd2',.45]].forEach((v,i)=>{const x=W*(v[0]+Math.sin(t*.5+i*2)*.05),y=H*(v[1]+Math.cos(t*.4+i)*.05),R=Math.max(W,H)*.36,g=c.createRadialGradient(x,y,0,x,y,R);g.addColorStop(0,M.rgba(v[2],v[3]));g.addColorStop(1,M.rgba(v[2],0));c.fillStyle=g;c.fillRect(0,0,W,H)});c.fillStyle='rgba(13,13,13,.07)';const s=u*.04,d=Math.max(1.2,u*.0022);for(let x=s/2;x<W;x+=s)for(let y=s/2;y<H;y+=s)c.fillRect(x,y,d,d)};",Ft=kr+ke+"const MKR=(c,x,y,w,h,k,col=LM)=>{if(!(k>0))return;const sl=h*.18;c.save();c.fillStyle=col;c.beginPath();c.moveTo(x+sl,y-h/2);c.lineTo(x+sl+w*k,y-h/2);c.lineTo(x+w*k-sl,y+h/2);c.lineTo(x-sl,y+h/2);c.closePath();c.fill();c.restore()};"+"const EXT=(c,s,x,y,size,a=1)=>{c.save();c.globalAlpha*=a;c.fillStyle=LM;c.fillText(s,x+size*.035,y+size*.05);c.fillStyle=BK;c.fillText(s,x,y);c.restore()};",xt="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))BG(ctx,W,H,u,t);",Z="const DB='#050605',WH='#f2f5ee',DG='#7d8478';const DBG=(c,W,H,u,t)=>{c.fillStyle=DB;c.fillRect(0,0,W,H);const g=c.createRadialGradient(W/2,H*.38,0,W/2,H*.38,Math.max(W,H)*.6);g.addColorStop(0,'rgba(138,251,0,.08)');g.addColorStop(1,'rgba(138,251,0,0)');c.fillStyle=g;c.fillRect(0,0,W,H);c.fillStyle='rgba(255,255,255,.028)';const s=Math.max(3,u*.006);for(let y=0;y<H;y+=s)c.fillRect(0,y,W,1)};",Ha="const GLOWB=(c,x,y,txt,f,s,k=1,g=1)=>{if(!(k>0)||!txt)return;c.save();c.font=f;const w=c.measureText(txt).width+s*2,h=s*2.1;c.translate(x,y);c.scale(k,k);c.shadowColor=LM;c.shadowBlur=s*1.8*g;const gr=c.createLinearGradient(0,-h/2,0,h/2);gr.addColorStop(0,'#d2ff6e');gr.addColorStop(1,LM);c.fillStyle=gr;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h/2);c.fill();c.shadowBlur=0;c.fillStyle=BK;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,h*.03);c.restore()};",ps="const CHIP=(c,x,y,txt,s,a=1)=>{if(!(a>0)||!txt)return;c.save();c.globalAlpha*=a;c.font=MONO(s,'700');const w=c.measureText(txt).width+s*2.7,h=s*1.9;c.strokeStyle=LM;c.lineWidth=Math.max(1,s*.1);c.fillStyle='rgba(138,251,0,.08)';c.beginPath();c.roundRect(x-w/2,y-h/2,w,h,h*.3);c.fill();c.stroke();c.fillStyle=LM;c.textAlign='left';c.textBaseline='middle';c.fillText(txt,x-w/2+s*1.75,y);c.restore();LOGO(c,x-w/2+s*1,y,s*1.05,LM,a)};",Sr="const SPK=(c,x,y,r,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.fillStyle='#ffffff';c.shadowColor=LM;c.shadowBlur=r*.9;c.beginPath();c.moveTo(0,-r);c.quadraticCurveTo(0,0,r,0);c.quadraticCurveTo(0,0,0,r);c.quadraticCurveTo(0,0,-r,0);c.quadraticCurveTo(0,0,0,-r);c.fill();c.restore()};",oo="const CARD=(c,x,y,w,h,r,a=1)=>{if(!(a>0))return;c.save();c.globalAlpha*=a;const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'#1c1e1c');g.addColorStop(1,'#0f100f');c.fillStyle=g;c.beginPath();c.roundRect(x,y,w,h,r);c.fill();c.strokeStyle='rgba(255,255,255,.1)';c.lineWidth=1;c.stroke();c.restore()};const SPIN=(c,x,y,r,t)=>{c.save();c.strokeStyle=LM;c.lineWidth=Math.max(1.5,r*.28);c.lineCap='round';c.beginPath();c.arc(x,y,r,t*6,t*6+4.2);c.stroke();c.restore()};",La="const GT=(c,s,x,y,w,t,al='left',a=1,dk=0)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.textAlign=al;const o=((t*.35)%1)*w*2,x0=al==='center'?x-w/2:x,g=c.createLinearGradient(x0-w+o,0,x0+w+o,0),cs=dk?['#2f6a00','#5cc400','#1d3d00','#2f6a00']:[LM,'#f4ffd0','#ffffff',LM];cs.forEach((v,i)=>g.addColorStop(i/3,v));c.fillStyle=g;c.fillText(s,x,y);c.restore()};",ds="const WM=(c,W,H,u,t)=>{if(!ON(p))return;LOGO(c,W*.5+Math.sin(t*.25)*u*.04,H*.56,Math.max(W,H)*1.1,'#151715')};",gs="const COIN=(c,x,y,r,fl,rot,a=1,bl=0)=>{if(!(r>0)||!(a>0))return;const sy=Math.abs(Math.cos(fl)),th=r*.16*Math.sqrt(1-sy*sy)+r*.05,ry=Math.max(.5,r*sy);c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';c.fillStyle='#4f9a00';c.beginPath();c.ellipse(0,th,r,ry,0,0,M.TAU);c.fill();c.fillRect(-r,0,r*2,th);const g=c.createRadialGradient(-r*.3,-r*.3*sy,r*.1,0,0,r*1.1);g.addColorStop(0,'#eaff9e');g.addColorStop(.6,'#a6f02a');g.addColorStop(1,'#6cc000');c.fillStyle=g;c.beginPath();c.ellipse(0,0,r,ry,0,0,M.TAU);c.fill();c.strokeStyle='rgba(60,120,0,.5)';c.lineWidth=r*.05;c.beginPath();c.ellipse(0,0,r*.82,Math.max(.4,r*.82*sy),0,0,M.TAU);c.stroke();c.scale(1,Math.max(.05,sy));LOGO(c,0,0,r*.9,'rgba(70,130,0,.55)');c.restore()};",tt="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))DBG(ctx,W,H,u,t);",uc="const VW=PT?S.w:Math.min(S.w,H*.62),VX=cx-VW/2,VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT;",nc=U.replace("LM='#8afb00'",()=>"LM=/^#[0-9a-f]{6}$/i.test(String((env.params||{}).accent))?env.params.accent:'#8afb00'").replace("c.filter='blur('+(o*16).toFixed(1)+'px)';","")+"const WH='#f4f6f0',GF='#2b2e2c';",sc=t=>"const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const VW="+(t?"PT?W*.78:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.07:cx-VW/2":"S.x0")+",VT="+(t?"PT?H*.11:H*.1":"S.top")+",VB="+(t?"PT?H*.8:H*.9":"S.bot")+",VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2,TL="+(t?"1":"PT?1:0")+";",Kc="const BGX=(c,m)=>{if(!ON(p))return;const L=m==='paper';c.fillStyle=L?'#f7f8f3':m==='graph'?'#e9ebe6':'#050605';c.fillRect(0,0,W,H);const g=c.createRadialGradient(cx,H*.42,0,cx,H*.42,Math.max(W,H)*.7);g.addColorStop(0,M.rgba(LM,L?.16:.1));g.addColorStop(1,M.rgba(LM,0));c.fillStyle=g;c.fillRect(0,0,W,H)};",Da="const PW=(s,x)=>{ctx.font=sk.font(s,'s','800');return ctx.measureText(x).width+s*1.4};const PILL=(c,x,y,s,txt,bg,fg,k=1,bd,rot=0,rr=.5)=>{if(!txt||!(k>0))return 0;c.save();const w=PW(s,txt),h=s*1.7;c.translate(x,y);c.rotate(rot);c.scale(k,k);c.fillStyle=bg;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h*rr);c.fill();if(bd){c.strokeStyle=bd;c.lineWidth=Math.max(1,s*.09);c.stroke()}c.fillStyle=fg;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,s*.06);c.restore();return w};",vr="const FP=(c,x,y,h)=>{c.save();c.translate(x,y);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.restore()};",Ho="const FPILL=(x,y,s,txt,t0,al)=>{String(txt||'').split('|').map(v=>v.trim()).filter(Boolean).slice(0,2).forEach((l,i)=>{const w=PW(s,l),k=Math.max(0,M.spring(t-t0-i*.12,{freq:1.6,damp:7}));PILL(ctx,al==='center'?x:x-w/2,y+i*s*1.85,s,l,i?BK:LM,i?LM:BK,k,0,0,.4)})};",us=t=>`function render(ctx,t,env){
8062
+ }`)],fs=V.find(t=>t.id==="clipooxmotion"),O=(t,e,c,a,o)=>({id:t,name:e,category:fs.name,pack:"clipooxmotion",duration:c,params:{accent:fs.accent,position:"center",...a,style:"clipooxmotion"},code:o}),kt=(...t)=>({...O(...t),formats:["portrait"]}),oc=(...t)=>({...O(...t),formats:["landscape"]}),U="const LM='#8afb00',BK='#0d0d0d';const ON=p=>!(p.bg===false||p.bg==='false'||p.bg===0);const MONO=(s,w='700')=>w+' '+Math.round(s*10)/10+'px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace';const OUT=(c,t,D,cx,cy,hold)=>{const o=hold?0:M.ease.inCubic(M.range(t,D-.4,D));c.save();if(o>0){c.globalAlpha*=1-o;c.filter='blur('+(o*16).toFixed(1)+'px)';c.translate(cx,cy);c.scale(1+o*.12,1+o*.12);c.translate(-cx,-cy)}return o};",it="const LOGO=(c,x,y,h,col,a=1,rot=0)=>{if(!(h>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.fillStyle=col;c.fill('evenodd');c.restore()};",We="const APP=(c,x,y,s,a=1,rot=0)=>{if(!(s>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);c.shadowColor='rgba(60,110,0,.35)';c.shadowBlur=s*.25;c.shadowOffsetY=s*.06;c.fillStyle=LM;c.beginPath();c.roundRect(-s/2,-s/2,s,s,s*.22);c.fill();c.shadowColor='transparent';const g=c.createLinearGradient(0,-s/2,0,s/2);g.addColorStop(0,'rgba(255,255,255,.28)');g.addColorStop(.5,'rgba(255,255,255,0)');c.fillStyle=g;c.fill();c.restore();LOGO(c,x,y+s*.02,s*.66,BK,a,rot)};",Wa="const SMR=(c,dx,draw,n=7)=>{if(Math.abs(dx)<1){draw();return}const a0=c.globalAlpha;for(let i=n;i>=0;i--){c.save();c.globalAlpha=a0*(i?.22*(1-i/(n+1)):1);c.translate(-dx*i/n,0);draw();c.restore()}};",kr=U+it+We+Wa,ve="const PA='#f7f8f3',GR='#6b7064';const BG=(c,W,H,u,t)=>{c.fillStyle=PA;c.fillRect(0,0,W,H);[[.04,.04,'#c9ff80',.5],[.97,.98,LM,.32],[.92,.03,'#e6ffc4',.55],[.03,.97,'#eaffd2',.45]].forEach((v,i)=>{const x=W*(v[0]+Math.sin(t*.5+i*2)*.05),y=H*(v[1]+Math.cos(t*.4+i)*.05),R=Math.max(W,H)*.36,g=c.createRadialGradient(x,y,0,x,y,R);g.addColorStop(0,M.rgba(v[2],v[3]));g.addColorStop(1,M.rgba(v[2],0));c.fillStyle=g;c.fillRect(0,0,W,H)});c.fillStyle='rgba(13,13,13,.07)';const s=u*.04,d=Math.max(1.2,u*.0022);for(let x=s/2;x<W;x+=s)for(let y=s/2;y<H;y+=s)c.fillRect(x,y,d,d)};",Ft=kr+ve+"const MKR=(c,x,y,w,h,k,col=LM)=>{if(!(k>0))return;const sl=h*.18;c.save();c.fillStyle=col;c.beginPath();c.moveTo(x+sl,y-h/2);c.lineTo(x+sl+w*k,y-h/2);c.lineTo(x+w*k-sl,y+h/2);c.lineTo(x-sl,y+h/2);c.closePath();c.fill();c.restore()};"+"const EXT=(c,s,x,y,size,a=1)=>{c.save();c.globalAlpha*=a;c.fillStyle=LM;c.fillText(s,x+size*.035,y+size*.05);c.fillStyle=BK;c.fillText(s,x,y);c.restore()};",xt="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))BG(ctx,W,H,u,t);",Z="const DB='#050605',WH='#f2f5ee',DG='#7d8478';const DBG=(c,W,H,u,t)=>{c.fillStyle=DB;c.fillRect(0,0,W,H);const g=c.createRadialGradient(W/2,H*.38,0,W/2,H*.38,Math.max(W,H)*.6);g.addColorStop(0,'rgba(138,251,0,.08)');g.addColorStop(1,'rgba(138,251,0,0)');c.fillStyle=g;c.fillRect(0,0,W,H);c.fillStyle='rgba(255,255,255,.028)';const s=Math.max(3,u*.006);for(let y=0;y<H;y+=s)c.fillRect(0,y,W,1)};",Ha="const GLOWB=(c,x,y,txt,f,s,k=1,g=1)=>{if(!(k>0)||!txt)return;c.save();c.font=f;const w=c.measureText(txt).width+s*2,h=s*2.1;c.translate(x,y);c.scale(k,k);c.shadowColor=LM;c.shadowBlur=s*1.8*g;const gr=c.createLinearGradient(0,-h/2,0,h/2);gr.addColorStop(0,'#d2ff6e');gr.addColorStop(1,LM);c.fillStyle=gr;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h/2);c.fill();c.shadowBlur=0;c.fillStyle=BK;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,h*.03);c.restore()};",ps="const CHIP=(c,x,y,txt,s,a=1)=>{if(!(a>0)||!txt)return;c.save();c.globalAlpha*=a;c.font=MONO(s,'700');const w=c.measureText(txt).width+s*2.7,h=s*1.9;c.strokeStyle=LM;c.lineWidth=Math.max(1,s*.1);c.fillStyle='rgba(138,251,0,.08)';c.beginPath();c.roundRect(x-w/2,y-h/2,w,h,h*.3);c.fill();c.stroke();c.fillStyle=LM;c.textAlign='left';c.textBaseline='middle';c.fillText(txt,x-w/2+s*1.75,y);c.restore();LOGO(c,x-w/2+s*1,y,s*1.05,LM,a)};",Sr="const SPK=(c,x,y,r,a=1)=>{if(!(r>0)||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.fillStyle='#ffffff';c.shadowColor=LM;c.shadowBlur=r*.9;c.beginPath();c.moveTo(0,-r);c.quadraticCurveTo(0,0,r,0);c.quadraticCurveTo(0,0,0,r);c.quadraticCurveTo(0,0,-r,0);c.quadraticCurveTo(0,0,0,-r);c.fill();c.restore()};",oo="const CARD=(c,x,y,w,h,r,a=1)=>{if(!(a>0))return;c.save();c.globalAlpha*=a;const g=c.createLinearGradient(0,y,0,y+h);g.addColorStop(0,'#1c1e1c');g.addColorStop(1,'#0f100f');c.fillStyle=g;c.beginPath();c.roundRect(x,y,w,h,r);c.fill();c.strokeStyle='rgba(255,255,255,.1)';c.lineWidth=1;c.stroke();c.restore()};const SPIN=(c,x,y,r,t)=>{c.save();c.strokeStyle=LM;c.lineWidth=Math.max(1.5,r*.28);c.lineCap='round';c.beginPath();c.arc(x,y,r,t*6,t*6+4.2);c.stroke();c.restore()};",La="const GT=(c,s,x,y,w,t,al='left',a=1,dk=0)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.textAlign=al;const o=((t*.35)%1)*w*2,x0=al==='center'?x-w/2:x,g=c.createLinearGradient(x0-w+o,0,x0+w+o,0),cs=dk?['#2f6a00','#5cc400','#1d3d00','#2f6a00']:[LM,'#f4ffd0','#ffffff',LM];cs.forEach((v,i)=>g.addColorStop(i/3,v));c.fillStyle=g;c.fillText(s,x,y);c.restore()};",ds="const WM=(c,W,H,u,t)=>{if(!ON(p))return;LOGO(c,W*.5+Math.sin(t*.25)*u*.04,H*.56,Math.max(W,H)*1.1,'#151715')};",gs="const COIN=(c,x,y,r,fl,rot,a=1,bl=0)=>{if(!(r>0)||!(a>0))return;const sy=Math.abs(Math.cos(fl)),th=r*.16*Math.sqrt(1-sy*sy)+r*.05,ry=Math.max(.5,r*sy);c.save();c.globalAlpha*=Math.min(1,a);c.translate(x,y);c.rotate(rot);if(bl>.4)c.filter='blur('+bl.toFixed(1)+'px)';c.fillStyle='#4f9a00';c.beginPath();c.ellipse(0,th,r,ry,0,0,M.TAU);c.fill();c.fillRect(-r,0,r*2,th);const g=c.createRadialGradient(-r*.3,-r*.3*sy,r*.1,0,0,r*1.1);g.addColorStop(0,'#eaff9e');g.addColorStop(.6,'#a6f02a');g.addColorStop(1,'#6cc000');c.fillStyle=g;c.beginPath();c.ellipse(0,0,r,ry,0,0,M.TAU);c.fill();c.strokeStyle='rgba(60,120,0,.5)';c.lineWidth=r*.05;c.beginPath();c.ellipse(0,0,r*.82,Math.max(.4,r*.82*sy),0,0,M.TAU);c.stroke();c.scale(1,Math.max(.05,sy));LOGO(c,0,0,r*.9,'rgba(70,130,0,.55)');c.restore()};",tt="const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,p.position||'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);if(ON(p))DBG(ctx,W,H,u,t);",uc="const VW=PT?S.w:Math.min(S.w,H*.62),VX=cx-VW/2,VT=PT?H*.11:H*.1,VB=PT?H*.8:H*.9,VH=VB-VT;",nc=U.replace("LM='#8afb00'",()=>"LM=/^#[0-9a-f]{6}$/i.test(String((env.params||{}).accent))?env.params.accent:'#8afb00'").replace("c.filter='blur('+(o*16).toFixed(1)+'px)';","")+"const WH='#f4f6f0',GF='#2b2e2c';",sc=t=>"const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p);const VW="+(t?"PT?W*.78:Math.min(S.w,H*.62)":"S.w")+",VX="+(t?"PT?W*.07:cx-VW/2":"S.x0")+",VT="+(t?"PT?H*.11:H*.1":"S.top")+",VB="+(t?"PT?H*.8:H*.9":"S.bot")+",VH=VB-VT,VC=VX+VW/2,VM=(VT+VB)/2,TL="+(t?"1":"PT?1:0")+";",Kc="const BGX=(c,m)=>{if(!ON(p))return;const L=m==='paper';c.fillStyle=L?'#f7f8f3':m==='graph'?'#e9ebe6':'#050605';c.fillRect(0,0,W,H);const g=c.createRadialGradient(cx,H*.42,0,cx,H*.42,Math.max(W,H)*.7);g.addColorStop(0,M.rgba(LM,L?.16:.1));g.addColorStop(1,M.rgba(LM,0));c.fillStyle=g;c.fillRect(0,0,W,H)};",Da="const PW=(s,x)=>{ctx.font=sk.font(s,'s','800');return ctx.measureText(x).width+s*1.4};const PILL=(c,x,y,s,txt,bg,fg,k=1,bd,rot=0,rr=.5)=>{if(!txt||!(k>0))return 0;c.save();const w=PW(s,txt),h=s*1.7;c.translate(x,y);c.rotate(rot);c.scale(k,k);c.fillStyle=bg;c.beginPath();c.roundRect(-w/2,-h/2,w,h,h*rr);c.fill();if(bd){c.strokeStyle=bd;c.lineWidth=Math.max(1,s*.09);c.stroke()}c.fillStyle=fg;c.textAlign='center';c.textBaseline='middle';c.fillText(txt,0,s*.06);c.restore();return w};",vr="const FP=(c,x,y,h)=>{c.save();c.translate(x,y);c.scale(h/318,h/318);c.translate(-256,-251);c.beginPath();c.moveTo(256,410);c.bezierCurveTo(170,410,113,346,118,270);c.bezierCurveTo(121,218,148,180,186,146);c.bezierCurveTo(184,168,190,186,204,198);c.bezierCurveTo(214,150,238,114,272,92);c.bezierCurveTo(280,128,302,150,336,172);c.bezierCurveTo(374,198,396,238,396,280);c.bezierCurveTo(396,353,334,410,256,410);c.closePath();c.moveTo(318,290);c.arc(258,290,60,0,M.TAU,true);c.restore()};",Ho="const FPILL=(x,y,s,txt,t0,al)=>{String(txt||'').split('|').map(v=>v.trim()).filter(Boolean).slice(0,2).forEach((l,i)=>{const w=PW(s,l),k=Math.max(0,M.spring(t-t0-i*.12,{freq:1.6,damp:7}));PILL(ctx,al==='center'?x:x-w/2,y+i*s*1.85,s,l,i?BK:LM,i?LM:BK,k,0,0,.4)})};",us=t=>`function render(ctx,t,env){
8063
8063
  // ${t?"Vertical AI prompt box (9:16)":"AI prompt box"}: a white chat input card pops in under a 'Clipoox × partner' header, the prompt types in letter by letter with a blinking caret, the lime send button pulses, then the words whip-zoom at the camera (fields: text = prompt, sub = partner, bg).
8064
8064
  ${nc}${it}${We}${sc(t)}${Kc}
8065
8065
  BGX(ctx,'paper')
@@ -8766,7 +8766,7 @@
8766
8766
  f.lines.forEach((l,i)=>{ctx.globalAlpha=M.range(t,.1+i*.12,.4+i*.12)*(1-M.range(t,D-.25,D));ctx.fillText(l,W/2,H/2+(i-(f.lines.length-1)/2)*f.lh*1.05)})
8767
8767
  }`),O("clipoox-coin-rain","Mưa xu + tiêu đề",4,{num:"TẶNG",text:"THÊM CREDIT",pill:"KHI NẠP GÓI CLIPOOX"},`function render(ctx,t,env){
8768
8768
  // Coin rain: glossy lime coins stamped with the flame tumble down past the camera (near ones blurred), the big number pops, the word slides out between lime brackets and a black pill with lime text lands under it (fields: num, text, pill, bg).
8769
- ${U}${it}${ke}${gs}${xt}
8769
+ ${U}${it}${ve}${gs}${xt}
8770
8770
  OUT(ctx,t,D,cx,cy)
8771
8771
  const R=M.rand(12),cs=[];for(let i=0;i<20;i++)cs.push({x:R(),z:R(),s:R(),ph:R()*6,sp:.6+R()*.8,w:R()*2-1})
8772
8772
  cs.sort((a,b)=>a.z-b.z)
@@ -8783,7 +8783,7 @@
8783
8783
  ctx.restore()
8784
8784
  }`),O("clipoox-chip-circuit","Chip API + mạch sáng",4,{brand:"CLIPOOX",label:"{MCP}",tags:"+25 CR|+100 CR|+300 CR"},`function render(ctx,t,env){
8785
8785
  // Chip circuit: a thick lime API chip turns slightly in 3D, glowing lime circuit traces draw out from its sides at right angles, and at their ends stacks of coins pop up with dark value tags (fields: brand, label, tags with |, bg).
8786
- ${U}${it}${ke}${gs}${xt}
8786
+ ${U}${it}${ve}${gs}${xt}
8787
8787
  OUT(ctx,t,D,cx,cy)
8788
8788
  const s=u*(PT?.26:.24),sk2=.12*Math.sin(t*.8),ck=Math.max(0,M.spring(t-.05,{freq:1.3,damp:7}))
8789
8789
  const TR=[[[-.5,-.2],[-1.2,-.2],[-1.2,-.75],[-2.2,-.75]],[[.5,.15],[1.3,.15],[1.3,.6],[2.3,.6]],[[0,-.5],[0,-1],[.9,-1],[.9,-1.6]],[[-.5,.3],[-1,.3],[-1,1],[-1.9,1]],[[.5,-.3],[1.7,-.3],[1.7,-1.1]]]
@@ -8798,7 +8798,7 @@
8798
8798
  ctx.restore();ctx.restore()
8799
8799
  }`),O("clipoox-glitch-headline","Chữ glitch + mã nhị phân",3,{text:"AI ĐẾN TRƯỚC|DÙNG TRƯỚC"},`function render(ctx,t,env){
8800
8800
  // Glitch headline: on white with crop marks, faint binary columns and code lines, a heavy two-line headline resolves left to right out of random lime and magenta glyphs with sliced horizontal glitch bands and flickering tracking boxes, and glitches again on the way out (fields: text with |, bg).
8801
- ${U}${ke}${xt}
8801
+ ${U}${ve}${xt}
8802
8802
  if(ON(p)){ctx.fillStyle='#fbfbfc';ctx.fillRect(0,0,W,H);ctx.strokeStyle='rgba(13,13,13,.35)';ctx.lineWidth=1;const m=u*.12;[[m,m],[W-m,m],[m,H-m],[W-m,H-m]].forEach(([x,y])=>{ctx.beginPath();ctx.moveTo(x-8,y);ctx.lineTo(x+8,y);ctx.moveTo(x,y-8);ctx.lineTo(x,y+8);ctx.stroke()})
8803
8803
  const R=M.rand(Math.floor(t*6));ctx.font=MONO(u*.016,'400');ctx.fillStyle='rgba(13,13,13,.18)';for(let i=0;i<9;i++){let b='';for(let j=0;j<18;j++)b+=R()<.5?'0':'1';ctx.fillText(b,W-u*.32,u*.05+i*u*.022)}for(let i=0;i<5;i++)ctx.fillText('const v'+i+' = render(t);',u*.05,H-u*.18+i*u*.022)}
8804
8804
  const ls=String(p.text||'').split('|').map(v=>v.trim().toUpperCase()).filter(Boolean).slice(0,3),s=u*(PT?.11:.12),y0=cy-(ls.length-1)*s*.55,A='#%&@/<>[]{}=+*01ABXZQ',gl=Math.max(1-M.range(t,0,.35),M.range(t,D-.35,D))
@@ -8823,7 +8823,7 @@
8823
8823
  ctx.restore()
8824
8824
  }`),O("clipoox-model-wheel","Bánh xe tên model",4,{top:"MỌI MODEL",bottom:"TRONG MỘT NƠI",items:"Seedance 2.5|Kling 3.0|Gemini Omni|Wan 2.7|Happy Horse 1.1"},`function render(ctx,t,env){
8825
8825
  // Model wheel: corner labels (top-left with ticking slashes, bottom-right with an underscore) frame a list of model names on a turning drum; each step the drum spins with motion blur and the name at the arrow becomes big and black while the others tilt away small and grey (fields: top, bottom, items with |, bg).
8826
- ${U}${ke}${xt}
8826
+ ${U}${ve}${xt}
8827
8827
  OUT(ctx,t,D,cx,cy)
8828
8828
  const it=String(p.items||'').split('|').map(v=>v.trim()).filter(Boolean);if(!it.length)return
8829
8829
  const n=it.length,step=.55,st=Math.max(0,t-.3)/step,pos=Math.floor(st)+M.ease.inOutCubic(M.clamp((st%1)*2.2)),spd=Math.abs(Math.sin(Math.PI*M.clamp((st%1)*2.2))),R=u*(PT?.42:.36),ax=PT?S.x0+u*.06:cx-u*.42
@@ -8861,7 +8861,7 @@
8861
8861
  ctx.restore()
8862
8862
  }`),O("clipoox-notch-frame","Khung viền có nhãn",3.5,{label:"Clipoox",text:"500 TRIỆU VNĐ",sub:"DOANH THU",theme:"light",backdrop:"none"},`function render(ctx,t,env){
8863
8863
  // Notch frame: a rounded frame draws itself out from a notch in its top edge where the flame and a label sit, a lime-to-magenta light runs round the border, the big figure pops inside and a caption sits under the frame; backdrop can be a grid of people dots, a turning lime wire globe or a halftone grid; theme light or dark (fields: label, text, sub, theme, backdrop, bg).
8864
- ${U}${it}${ke}${Z}
8864
+ ${U}${it}${ve}${Z}
8865
8865
  const W=env.width,H=env.height,D=env.duration,p=env.params||{},S=M.safe(env,'center'),u=S.u,cx=W/2,cy=H/2,PT=S.port,sk=M.skin(env,p),dk=p.theme==='dark',ink=dk?'#f2f5ee':BK
8866
8866
  if(ON(p)){if(dk)DBG(ctx,W,H,u,t);else{ctx.fillStyle='#fbfbfc';ctx.fillRect(0,0,W,H)}}
8867
8867
  const bd=String(p.backdrop||''),fw=Math.min(S.w,u*(PT?.9:1.05)),fh=fw*.36,x0=cx-fw/2,y0=cy-fh/2,r=fh*.3
@@ -8905,7 +8905,7 @@
8905
8905
  ctx.restore()
8906
8906
  }`),O("clipoox-big-percent","Số % lớn chạy",3,{to:15,suffix:"%",text:"TIẾT KIỆM KHI MUA GÓI NĂM"},`function render(ctx,t,env){
8907
8907
  // Big percent: a giant blurred lime figure sweeps through the frame, then the black number counts up fast with its digits blurring as they change and settles, the caption typing under it with its newest letters lime (fields: to, suffix, text, bg).
8908
- ${U}${ke}${xt}
8908
+ ${U}${ve}${xt}
8909
8909
  OUT(ctx,t,D,cx,cy)
8910
8910
  const to=+p.to||0,suf=String(p.suffix||''),s=u*(PT?.26:.3),sw=M.range(t,0,.45)
8911
8911
  if(sw<1){ctx.save();ctx.globalAlpha=Math.sin(Math.PI*sw)*.8;ctx.filter='blur('+(u*.03).toFixed(1)+'px)';ctx.font=sk.font(s*2.4,'n','900');ctx.fillStyle=LM;ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(String(Math.round(to*.4)),cx+(.5-sw)*W*.8,cy);ctx.restore()}
@@ -8927,7 +8927,7 @@
8927
8927
  ctx.restore()
8928
8928
  }`),O("clipoox-dot-grid-stat","Số + lưới chấm halftone",3.5,{value:25,total:300,text:"CREDIT KHỞI ĐẦU VỚI GÓI STARTER"},`function render(ctx,t,env){
8929
8929
  // Dot grid stat: the big black number counts up with a lime underline drawing under it and its caption, while a halftone grid beside it fills dot by dot in black to the share value / total; at the end the grid swells into big blurred dots (fields: value, total, text, bg).
8930
- ${U}${ke}${xt}
8930
+ ${U}${ve}${xt}
8931
8931
  const v=+p.value||0,tot=Math.max(1,+p.total||100),fr=Math.min(1,v/tot),ck=M.ease.outCubic(M.range(t,.2,1.6)),sw=M.ease.inCubic(M.range(t,D-.8,D))
8932
8932
  const cols=20,rows=25,gs=Math.min(PT?S.w/cols:W*.38/cols,H*.6/rows),gx=PT?cx-cols*gs/2:cx+u*.12,gy=PT?S.top:cy-rows*gs/2,fill=Math.floor(cols*rows*fr*ck)
8933
8933
  ctx.save();if(sw>0){ctx.translate(gx+cols*gs/2,cy);ctx.scale(1+sw*2.5,1+sw*2.5);ctx.translate(-(gx+cols*gs/2),-cy);ctx.filter='blur('+(sw*4).toFixed(1)+'px)'}
@@ -8946,7 +8946,7 @@
8946
8946
  const br=String(p.brand||''),s=u*.075;ctx.font=sk.font(s,'s','700');const w=ctx.measureText(br).width+s*1.4,k=M.range(t,0,.12);ctx.globalAlpha=k;LOGO(ctx,cx-w/2+s*.5,cy,s*1.15,fg);ctx.fillStyle=fg;ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillText(br,cx-w/2+s*1.35,cy+s*.04)
8947
8947
  }`),O("clipoox-sticker-stack","Nhãn dán chéo xếp chồng",4,{brand:"Clipoox",text:"BỘ KỸ NĂNG|SẢN XUẤT|CLIPOOX",sub:"DÀNH CHO CLIPOOX CANVAS",desc:""},`function render(ctx,t,env){
8948
8948
  // Sticker stack: the brand name types in beside the flame, then up to three tilted label stickers slap down one after another (lime with black type, then black with white type) with a small shake, the sub line fades in under them and an optional paragraph blurs in line by line (fields: brand, text with |, sub, desc, bg).
8949
- ${U}${it}${ke}${xt}
8949
+ ${U}${it}${ve}${xt}
8950
8950
  OUT(ctx,t,D,cx,cy)
8951
8951
  const ls=String(p.text||'').split('|').map(v=>v.trim().toUpperCase()).filter(Boolean).slice(0,3),desc=String(p.desc||''),s=u*(PT?.13:desc?.15:.19),N=ls.length,yc=desc?cy-s*.9:cy,y0=yc-(N-1)*s*.5
8952
8952
  const br=String(p.brand||'');if(br){const bs=s*.3,n=Math.round(br.length*M.range(t,0,.4));ctx.font=sk.font(bs,'s','700');const w=ctx.measureText(br).width+bs*1.4;LOGO(ctx,cx-w/2+bs*.5,y0-s*1,bs*1.2,BK,M.range(t,0,.1));ctx.fillStyle=BK;ctx.textAlign='left';ctx.textBaseline='middle';ctx.fillText(br.slice(0,n),cx-w/2+bs*1.3,y0-s*1)}
@@ -8959,7 +8959,7 @@
8959
8959
  ctx.restore()
8960
8960
  }`),O("clipoox-slash-list","Danh sách lệnh /",3.5,{items:"/tach-nen|/chinh-mau|/dung-canh-3d|/xoa-vat-the|/sua-anh|/ghep-canh",size:1},`function render(ctx,t,env){
8961
8961
  // Slash list: command lines appear one after another, each a heavy black slash followed by the command typing itself in deep lime with a caret, stacked and centred; the newest line is the brightest (fields: items with |, size, bg).
8962
- ${U}${ke}${xt}
8962
+ ${U}${ve}${xt}
8963
8963
  OUT(ctx,t,D,cx,cy)
8964
8964
  const it=String(p.items||'').split('|').map(v=>v.trim().replace(/^[/]+/,'')).filter(Boolean).slice(0,10),n=it.length;if(!n)return
8965
8965
  const s=Math.min(u*.075*(+p.size||1),H*.72/n/1.25),lh=s*1.25,gap=Math.min(.3,(D-1.2)/n),y0=cy-(n-1)*lh/2
@@ -8993,7 +8993,7 @@
8993
8993
  ctx.restore()
8994
8994
  }`),O("clipoox-url-live","Gõ URL + đã ra mắt",3.5,{url:"clipoox.com",brand:"Clipoox",tag:"MCP",pill:"ĐÃ RA MẮT!"},`function render(ctx,t,env){
8995
8995
  // URL live: on white with crop marks and faint binary, the web address types itself big with a caret, then shrinks up as the flame and brand name assemble beside a lime-bracketed tag, and a black pill with lime type pops under it (fields: url, brand, tag, pill, bg).
8996
- ${U}${it}${ke}${xt}
8996
+ ${U}${it}${ve}${xt}
8997
8997
  if(ON(p)){ctx.fillStyle='#fbfbfc';ctx.fillRect(0,0,W,H);ctx.strokeStyle='rgba(13,13,13,.3)';ctx.lineWidth=1;const m=u*.1;[[m,m],[W-m,m],[m,H-m],[W-m,H-m]].forEach(([x,y])=>{ctx.beginPath();ctx.moveTo(x-8,y);ctx.lineTo(x+8,y);ctx.moveTo(x,y-8);ctx.lineTo(x,y+8);ctx.stroke()});const R=M.rand(Math.floor(t*5));ctx.font=MONO(u*.014,'400');ctx.fillStyle='rgba(13,13,13,.15)';for(let i=0;i<8;i++){let b='';for(let j=0;j<16;j++)b+=R()<.5?'0':'1';ctx.fillText(b,W-u*.3,u*.04+i*u*.02)}}
8998
8998
  OUT(ctx,t,D,cx,cy)
8999
8999
  const url=String(p.url||''),mv=M.ease.inOutCubic(M.range(t,1.1,1.6)),us=u*(.09-.045*mv),uy=cy-mv*u*.12,n=Math.round(url.length*M.range(t,.1,.9))
@@ -9067,7 +9067,7 @@
9067
9067
  ctx.restore()
9068
9068
  }`),O("clipoox-checklist","Checklist từng bước",4.5,{head:"Bắt đầu với Clipoox",items:"*Đăng ký|*Chọn gói|*Chọn model yêu thích|*Tạo video đầu tiên",notes:"|25 · 100 · 300 credit|ảnh & video|",foot:"tại clipoox.com"},`function render(ctx,t,env){
9069
9069
  // Checklist: a small heading, then steps arrive one by one in a slight staircase — each a lime highlight bar that wipes in behind the step text with a black tick box snapping on at its end and a small grey note beside it; a footnote closes the list (fields: head, items with |, notes with |, foot, bg).
9070
- ${U}${ke}${xt}
9070
+ ${U}${ve}${xt}
9071
9071
  if(ON(p)){ctx.fillStyle='#fbfbfc';ctx.fillRect(0,0,W,H)}
9072
9072
  OUT(ctx,t,D,cx,cy)
9073
9073
  const it=String(p.items||'').split('|').map(v=>v.trim()).filter(Boolean).slice(0,6),nt=String(p.notes||'').split('|'),n=it.length;if(!n)return
@@ -9103,7 +9103,7 @@
9103
9103
  ctx.restore()
9104
9104
  }`),O("clipoox-lock-cta","Khoá ưu đãi + ổ khoá kính",3,{text:"KHOÁ ƯU ĐÃI",sub:"clipoox.com"},`function render(ctx,t,env){
9105
9105
  // Lock CTA: on clean white the call to action types in heavy black between braces with its first letters lime, and a glossy glass padlock swings in beside it and clicks shut (fields: text, sub, bg).
9106
- ${U}${ke}${xt}
9106
+ ${U}${ve}${xt}
9107
9107
  if(ON(p)){ctx.fillStyle='#fbfbfc';ctx.fillRect(0,0,W,H)}
9108
9108
  OUT(ctx,t,D,cx,cy)
9109
9109
  const tx=String(p.text||'').toUpperCase(),s=u*(PT?.09:.1),n=Math.round(tx.length*M.range(t,.1,.7));ctx.font=sk.font(s,'h','900');const w=ctx.measureText(tx).width,x0=cx-w/2-s*.3,y=cy
@@ -9247,7 +9247,7 @@
9247
9247
  ctx.restore()
9248
9248
  }`),kt("clipoox-v-top-banner","Dọc: banner trên đầu khung",3,{text:"Mẹo dựng video nhanh",sub:"CLIPOOX",position:"top",bg:!1},`function render(ctx,t,env){
9249
9249
  // Top banner overlay (9:16): a lime pill with the flame drops into the top safe area above the speaker's head, its text typing in letter by letter with a blinking caret, a small dark chip with the sub pops under it; it lifts out at the end (fields: text, sub, position, bg).
9250
- ${U}${it}${ke}${xt}${uc}
9250
+ ${U}${it}${ve}${xt}${uc}
9251
9251
  const o=M.ease.inCubic(M.range(t,D-.35,D)),k=M.ease.outBack(M.range(t,0,.4))
9252
9252
  ctx.textBaseline='middle';ctx.textAlign='left'
9253
9253
  const tx=String(p.text||'');if(!tx)return
@@ -9428,8 +9428,8 @@
9428
9428
  ctx.font=bf.font;ctx.fillStyle=M.readable(acc);ctx.fillText(bf.lines[0]||'',-u*.025,bf.size*.04);const ax=bw/2-u*.06;ctx.strokeStyle=M.readable(acc);ctx.lineWidth=u*.006;ctx.lineCap='round';ctx.beginPath();ctx.moveTo(ax-u*.015,-u*.015);ctx.lineTo(ax,0);ctx.lineTo(ax-u*.015,u*.015);ctx.stroke()
9429
9429
  const rq=M.range((t-1)%1.6,0,.8);if(t>1&&rq<1){ctx.strokeStyle=M.rgba('#ffffff',.7*(1-rq));ctx.lineWidth=u*.004;ctx.beginPath();ctx.arc(bw*.28,bh*.1,u*.012+u*.05*rq,0,M.TAU);ctx.stroke()}ctx.restore()}
9430
9430
  ctx.restore()
9431
- }`)],Ps=V.find(t=>t.id==="course"),Kt=(t,e,c,a,o)=>({id:t,name:e,category:Ps.name,pack:"course",duration:c,params:{accent:Ps.accent,position:"lower",...a,style:"course"},code:o}),ua="const HX=/^#[0-9a-f]{6}$/i,AC=p=>HX.test(String(p.accent))?p.accent:'#3d7bff',NV='#0a1636',LT=String((env.params||{}).look)==='light';const NE=A=>{const n=parseInt(String(A).slice(1,7),16);return (n>>16&255)>(n&255)+60};const FD=(t,D,f,a,b)=>{const s=String(f||'both'),i=s==='both'||s==='in'?M.ease.outCubic(M.range(t,0,a)):1,o=s==='both'||s==='out'?M.ease.inCubic(M.range(t,D-b,D)):0;return i*(1-o)};",zs="const RRP=(c,x,y,w,h,r)=>{r=Math.max(0,Math.min(r,w/2,h/2));c.moveTo(x+r,y);c.arcTo(x+w,y,x+w,y+h,r);c.arcTo(x+w,y+h,x,y+h,r);c.arcTo(x,y+h,x,y,r);c.arcTo(x,y,x+w,y,r);c.closePath()};const EDGE=(W,H,x,y,w,h)=>({x:Math.max(W*.04,Math.min(W*.96-w,x)),y:Math.max(H*.04,Math.min(H*.96-h,y))});",Lo="const IK=s=>{s=String(s);if(s.length<5)return s;const m=s[0]==='#'?[1,3,5].map(i=>parseInt(s.slice(i,i+2),16)):(s.match(/[0-9.]+/g)||[]).map(Number),a=m[3]==null?1:m[3],l=(m[0]*.3+m[1]*.59+m[2]*.11)/255;return l>.55?(a<.97||l<.95?'rgba(70,72,88,'+a+')':'#1b1b22'):s};const GLL=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(28,22,40,.2)';c.shadowBlur=h*.4;c.shadowOffsetY=h*.12;const q=M.clamp((hi-.3)*3.4),g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#ffffff',M.mix(A,'#ffffff',.12),q));g.addColorStop(1,M.mix('#f3f2f6',M.mix(A,'#000000',.1),q));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.lineWidth=Math.max(1,Math.min(w,h)*.014);c.strokeStyle=M.rgba(M.mix('#dad8e0',A,Math.min(1,hi*1.4)),.9);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLN=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,0,0,.6)';c.shadowBlur=h*.3;c.shadowOffsetY=h*.08;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#171c2e',A,.08+hi*.3));g.addColorStop(1,M.mix('#05060c',A,hi*.2));c.globalAlpha=k*.9;c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.55);s.addColorStop(0,'rgba(255,255,255,'+(.08+.06*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.55);c.restore();const lw=Math.max(1.2,Math.min(Math.min(w,h)*.03,1.4+Math.min(w,h)*.012));c.lineWidth=lw;c.shadowColor=A;c.shadowBlur=Math.min(w,h)*(.16+.22*hi);c.strokeStyle=M.rgba(A,.75+.25*hi);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.lineWidth=Math.max(1,lw*.4);c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.6),.55+.4*hi);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLS=(c,x,y,w,h,r,a=1,hi=0,A='#3d7bff')=>{if(!(w>1)||!(h>1)||!(a>0))return;const k=Math.min(1,a);if(LT){GLL(c,x,y,w,h,r,k,hi,A);return}if(NE(A)){GLN(c,x,y,w,h,r,k,hi,A);return}c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,6,28,.42)';c.shadowBlur=h*.32;c.shadowOffsetY=h*.09;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#33569e',A,hi*.85));g.addColorStop(1,M.mix('#0c1a44',M.mix(A,'#06102e',.45),hi*.85));c.globalAlpha=k*(.8+.2*hi);c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.6);s.addColorStop(0,'rgba(255,255,255,'+(.16+.12*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.6);c.restore();c.lineWidth=Math.max(1,Math.min(Math.min(w,h)*.03,1.6+Math.min(w,h)*.006));c.strokeStyle='rgba(196,218,255,'+(.3+.5*hi)+')';M.rr(c,x,y,w,h,r);c.stroke();if(hi>0){c.shadowColor=A;c.shadowBlur=h*.55*hi;c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.35),.85*hi);M.rr(c,x,y,w,h,r);c.stroke()}c.restore()};const TXT=(c,s,x,y,f,z,col='#ffffff',al='left',a=1)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.font=f;c.textAlign=al;c.textBaseline='alphabetic';const k=LT?IK(col):col;if(k!==col){c.shadowColor='rgba(255,255,255,.65)';c.shadowBlur=z*.2}else{c.shadowColor='rgba(0,6,26,.5)';c.shadowBlur=z*.22;c.shadowOffsetY=z*.04}c.fillStyle=k;c.fillText(s,x,y);c.restore()};",Se=ua+zs+Lo+"const TILE=(c,sk,x,y,w,h,s,a,hi,A,role='n')=>{GLS(c,x,y,w,h,Math.min(w,h)*.24,a,hi,A);const z=h*.46;c.save();c.font=sk.font(z,role);const f=M.fit(c,s,q=>sk.font(q,role),z,w*.8,1,.4);c.restore();TXT(c,f.lines[0]||'',x+w/2,y+h*.5+f.size*.36,f.font,f.size,hi>.5?'#fff':'rgba(255,255,255,'+(.8+.2*hi)+')','center',a)};",Bs="const BL=b=>{const n=parseInt(String(b).slice(1,7),16);return ((n>>16&255)*.3+(n>>8&255)*.59+(n&255)*.11)>140};",Ws="const HW=(c,s,x,y,z,f,col,k,sd,al)=>{const ch=[...String(s||'').normalize('NFC')],n=ch.length;if(!n)return 0;c.save();c.font=f;c.textAlign='center';c.textBaseline='alphabetic';const ws=ch.map(q=>c.measureText(q).width),tw=ws.reduce((a,b)=>a+b,0);let px=al==='center'?x-tw/2:al==='right'?x-tw:x;const v=k*n*1.08;c.fillStyle=col;c.strokeStyle=col;c.lineJoin='round';c.lineWidth=z*.05;for(let i=0;i<n;i++){const q=M.clamp(v-i);if(q>0&&ch[i]!==' '){c.save();c.globalAlpha*=Math.min(1,q*1.8);c.translate(px+ws[i]/2+M.wob(sd,i,z*.025),y+M.wob(sd,i+40,z*.035));c.rotate(M.wob(sd,i+80,.09));const e=.72+.28*M.ease.outBack(q);c.scale(e,e);c.fillText(ch[i],0,0);c.strokeText(ch[i],0,0);c.restore()}px+=ws[i]}c.restore();return tw};const RB=(x,y,w,h,o,sd)=>[...M.linePts(x-o,y,x+w+o,y,sd,14,o*.3),...M.linePts(x+w,y-o*.5,x+w,y+h+o,sd+1,10,o*.3),...M.linePts(x+w+o*.5,y+h,x-o,y+h,sd+2,14,o*.3),...M.linePts(x,y+h+o*.5,x+o*.3,y-o*1.4,sd+3,10,o*.3)];",Ar=[Kt("course-question-nav","Thanh điều hướng câu hỏi",5,{text:"Làm sao để viết câu lệnh cho AI hiệu quả?",number:1,total:15,sub:"Q",lift:0},`function render(ctx,t,env){
9432
- ${Se}
9431
+ }`)],Ps=V.find(t=>t.id==="course"),Kt=(t,e,c,a,o)=>({id:t,name:e,category:Ps.name,pack:"course",duration:c,params:{accent:Ps.accent,position:"lower",...a,style:"course"},code:o}),ua="const HX=/^#[0-9a-f]{6}$/i,AC=p=>HX.test(String(p.accent))?p.accent:'#3d7bff',NV='#0a1636',LT=String((env.params||{}).look)==='light';const NE=A=>{const n=parseInt(String(A).slice(1,7),16);return (n>>16&255)>(n&255)+60};const FD=(t,D,f,a,b)=>{const s=String(f||'both'),i=s==='both'||s==='in'?M.ease.outCubic(M.range(t,0,a)):1,o=s==='both'||s==='out'?M.ease.inCubic(M.range(t,D-b,D)):0;return i*(1-o)};",zs="const RRP=(c,x,y,w,h,r)=>{r=Math.max(0,Math.min(r,w/2,h/2));c.moveTo(x+r,y);c.arcTo(x+w,y,x+w,y+h,r);c.arcTo(x+w,y+h,x,y+h,r);c.arcTo(x,y+h,x,y,r);c.arcTo(x,y,x+w,y,r);c.closePath()};const EDGE=(W,H,x,y,w,h)=>({x:Math.max(W*.04,Math.min(W*.96-w,x)),y:Math.max(H*.04,Math.min(H*.96-h,y))});",Lo="const IK=s=>{s=String(s);if(s.length<5)return s;const m=s[0]==='#'?[1,3,5].map(i=>parseInt(s.slice(i,i+2),16)):(s.match(/[0-9.]+/g)||[]).map(Number),a=m[3]==null?1:m[3],l=(m[0]*.3+m[1]*.59+m[2]*.11)/255;return l>.55?(a<.97||l<.95?'rgba(70,72,88,'+a+')':'#1b1b22'):s};const GLL=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(28,22,40,.2)';c.shadowBlur=h*.4;c.shadowOffsetY=h*.12;const q=M.clamp((hi-.3)*3.4),g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#ffffff',M.mix(A,'#ffffff',.12),q));g.addColorStop(1,M.mix('#f3f2f6',M.mix(A,'#000000',.1),q));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.lineWidth=Math.max(1,Math.min(w,h)*.014);c.strokeStyle=M.rgba(M.mix('#dad8e0',A,Math.min(1,hi*1.4)),.9);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLN=(c,x,y,w,h,r,k,hi,A)=>{c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,0,0,.6)';c.shadowBlur=h*.3;c.shadowOffsetY=h*.08;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#171c2e',A,.08+hi*.3));g.addColorStop(1,M.mix('#05060c',A,hi*.2));c.globalAlpha=k*.9;c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.55);s.addColorStop(0,'rgba(255,255,255,'+(.08+.06*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.55);c.restore();const lw=Math.max(1.2,Math.min(Math.min(w,h)*.03,1.4+Math.min(w,h)*.012));c.lineWidth=lw;c.shadowColor=A;c.shadowBlur=Math.min(w,h)*(.16+.22*hi);c.strokeStyle=M.rgba(A,.75+.25*hi);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.lineWidth=Math.max(1,lw*.4);c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.6),.55+.4*hi);M.rr(c,x,y,w,h,r);c.stroke();c.restore()};const GLS=(c,x,y,w,h,r,a=1,hi=0,A='#3d7bff')=>{if(!(w>1)||!(h>1)||!(a>0))return;const k=Math.min(1,a);if(LT){GLL(c,x,y,w,h,r,k,hi,A);return}if(NE(A)){GLN(c,x,y,w,h,r,k,hi,A);return}c.save();c.globalAlpha*=k;c.shadowColor='rgba(0,6,28,.42)';c.shadowBlur=h*.32;c.shadowOffsetY=h*.09;const g=c.createLinearGradient(x,y,x,y+h);g.addColorStop(0,M.mix('#33569e',A,hi*.85));g.addColorStop(1,M.mix('#0c1a44',M.mix(A,'#06102e',.45),hi*.85));c.globalAlpha=k*(.8+.2*hi);c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();c.shadowColor='transparent';c.globalAlpha=k;c.save();M.rr(c,x,y,w,h,r);c.clip();const s=c.createLinearGradient(x,y,x,y+h*.6);s.addColorStop(0,'rgba(255,255,255,'+(.16+.12*hi)+')');s.addColorStop(1,'rgba(255,255,255,0)');c.fillStyle=s;c.fillRect(x,y,w,h*.6);c.restore();c.lineWidth=Math.max(1,Math.min(Math.min(w,h)*.03,1.6+Math.min(w,h)*.006));c.strokeStyle='rgba(196,218,255,'+(.3+.5*hi)+')';M.rr(c,x,y,w,h,r);c.stroke();if(hi>0){c.shadowColor=A;c.shadowBlur=h*.55*hi;c.strokeStyle=M.rgba(M.mix(A,'#ffffff',.35),.85*hi);M.rr(c,x,y,w,h,r);c.stroke()}c.restore()};const TXT=(c,s,x,y,f,z,col='#ffffff',al='left',a=1)=>{if(!s||!(a>0))return;c.save();c.globalAlpha*=Math.min(1,a);c.font=f;c.textAlign=al;c.textBaseline='alphabetic';const k=LT?IK(col):col;if(k!==col){c.shadowColor='rgba(255,255,255,.65)';c.shadowBlur=z*.2}else{c.shadowColor='rgba(0,6,26,.5)';c.shadowBlur=z*.22;c.shadowOffsetY=z*.04}c.fillStyle=k;c.fillText(s,x,y);c.restore()};",Te=ua+zs+Lo+"const TILE=(c,sk,x,y,w,h,s,a,hi,A,role='n')=>{GLS(c,x,y,w,h,Math.min(w,h)*.24,a,hi,A);const z=h*.46;c.save();c.font=sk.font(z,role);const f=M.fit(c,s,q=>sk.font(q,role),z,w*.8,1,.4);c.restore();TXT(c,f.lines[0]||'',x+w/2,y+h*.5+f.size*.36,f.font,f.size,hi>.5?'#fff':'rgba(255,255,255,'+(.8+.2*hi)+')','center',a)};",Bs="const BL=b=>{const n=parseInt(String(b).slice(1,7),16);return ((n>>16&255)*.3+(n>>8&255)*.59+(n&255)*.11)>140};",Ws="const HW=(c,s,x,y,z,f,col,k,sd,al)=>{const ch=[...String(s||'').normalize('NFC')],n=ch.length;if(!n)return 0;c.save();c.font=f;c.textAlign='center';c.textBaseline='alphabetic';const ws=ch.map(q=>c.measureText(q).width),tw=ws.reduce((a,b)=>a+b,0);let px=al==='center'?x-tw/2:al==='right'?x-tw:x;const v=k*n*1.08;c.fillStyle=col;c.strokeStyle=col;c.lineJoin='round';c.lineWidth=z*.05;for(let i=0;i<n;i++){const q=M.clamp(v-i);if(q>0&&ch[i]!==' '){c.save();c.globalAlpha*=Math.min(1,q*1.8);c.translate(px+ws[i]/2+M.wob(sd,i,z*.025),y+M.wob(sd,i+40,z*.035));c.rotate(M.wob(sd,i+80,.09));const e=.72+.28*M.ease.outBack(q);c.scale(e,e);c.fillText(ch[i],0,0);c.strokeText(ch[i],0,0);c.restore()}px+=ws[i]}c.restore();return tw};const RB=(x,y,w,h,o,sd)=>[...M.linePts(x-o,y,x+w+o,y,sd,14,o*.3),...M.linePts(x+w,y-o*.5,x+w,y+h+o,sd+1,10,o*.3),...M.linePts(x+w+o*.5,y+h,x-o,y+h,sd+2,14,o*.3),...M.linePts(x,y+h+o*.5,x+o*.3,y-o*1.4,sd+3,10,o*.3)];",Ar=[Kt("course-question-nav","Thanh điều hướng câu hỏi",5,{text:"Làm sao để viết câu lệnh cho AI hiệu quả?",number:1,total:15,sub:"Q",lift:0},`function render(ctx,t,env){
9432
+ ${Te}
9433
9433
  // Question navigator lower third: a row of small dark-blue glass tiles 1..total (the current one, number, lit in the accent and lifted) above a glass bar with a badge (sub + number: Q1 / Chương 2 / Bước 3) and the question in quotes (text); transparent elsewhere (fields: text, number, sub, total, lift, position lower | top).
9434
9434
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k=M.io(t,D,.6,.4),A=AC(p)
9435
9435
  if(!(k.v>0))return
@@ -9450,7 +9450,7 @@
9450
9450
  const ta=M.ease.outCubic(M.range(t,.4,.8));f.lines.forEach((l,i)=>TXT(ctx,l,x0+ins+bW+pad,by+ins*.3+f.size*1.12+i*f.size*1.38+(1-ta)*fs*.35,sk.font(f.size,'q'),f.size,'#ffffff','left',k.v*ta))
9451
9451
  ctx.restore()}
9452
9452
  }`),Kt("course-step-tiles","Ô các bước",4,{items:"Hỏi AI|Kiểm tra|Áp dụng",number:1,lift:0},`function render(ctx,t,env){
9453
- ${Se}
9453
+ ${Te}
9454
9454
  // Step tiles: a row of dark-blue glass tiles with white numbers at the bottom, the current step (number) expanded into a wider lit tile that shows its label (items split by |, e.g. Ask it | 2 | 3); transparent elsewhere (fields: items, number, lift, position lower | top).
9455
9455
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k=M.io(t,D,.5,.4),A=AC(p)
9456
9456
  if(!(k.v>0))return
@@ -9470,7 +9470,7 @@
9470
9470
  else TILE(ctx,sk,xx,yy,sw,sh,/^[0-9]+$/.test(L[i])?L[i]:String(i+1),al*(i+1<cur?1:.9),0,A)}
9471
9471
  x+=w+g}
9472
9472
  }`),Kt("course-tool-badge","Thẻ công cụ",4,{text:"Trợ lý AI",sub:"tro-ly-ai.vi",glyph:"robot",position:"right",posX:-1,posY:-1},`function render(ctx,t,env){
9473
- ${Se}
9473
+ ${Te}
9474
9474
  // Tool badge: a rounded dark-blue glass card with an app icon tile (glyph) and the tool name (text) over its web address (sub), beside the presenter or in a corner (position right, left, top-right, top-left, bottom-right, bottom-left; posX / posY 0..1 = its centre, posY alone = its height on that side), slides in from its side; transparent elsewhere (fields: text, sub, glyph, position, posX, posY).
9475
9475
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k=M.io(t,D,.55,.4),A=AC(p)
9476
9476
  if(!(k.v>0))return
@@ -9488,7 +9488,7 @@
9488
9488
  TXT(ctx,fN.lines[0],tx,y+h*(two?.47:.5)+(two?0:fN.size*.36),fN.font,fN.size,'#ffffff','left',k.v*ta*(name?1:0))
9489
9489
  if(url){const uy=y+h*(name?.78:.5)+(name?0:fU.size*.36);ctx.save();ctx.globalAlpha*=k.v*ta;M.glyph(ctx,'link',tx+sz*.45,uy-sz*.34,sz*.85,{color:LT?'#8a8d9c':'#bcd4ff',glow:false,width:2.2});ctx.restore();TXT(ctx,fU.lines[0],tx+sz*1.3,uy,fU.font,fU.size,'rgba(214,228,255,.92)','left',k.v*ta)}
9490
9490
  }`),Kt("course-chapter-card","Thẻ chương",3.5,{text:"Viết câu lệnh hiệu quả",sub:"Cách hỏi để AI hiểu đúng ý bạn",number:2,label:"Chương",bg:"#08122c",position:"center"},`function render(ctx,t,env){
9491
- ${Se}
9491
+ ${Te}
9492
9492
  // Chapter title card, full frame: a deep navy backdrop with drifting soft blue light, a big glass tile with the chapter number (number) under a small label (label: Chương / Chapter / Phần), the chapter title (text) and a subtitle (sub) slide in beside it (stacked in 9:16), an accent line grows; content fades at the end (fields: text, sub, number, label, bg).
9493
9493
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,A=AC(p),bg=HX.test(String(p.bg))?p.bg:'#08122c'
9494
9494
  const r0=ctx.createRadialGradient(W*.5,H*.45,0,W*.5,H*.45,Math.hypot(W,H)*.6);r0.addColorStop(0,M.mix(bg,A,LT?.05:.22));r0.addColorStop(1,bg);ctx.fillStyle=r0;ctx.fillRect(0,0,W,H)
@@ -9505,7 +9505,7 @@
9505
9505
  const ly=ty+hT+u*.012,lw=u*(P?.18:.14)*M.ease.inOutCubic(M.range(t,.45,.95));if(lw>1){ctx.save();ctx.globalAlpha*=k.v;ctx.fillStyle=A;ctx.shadowColor=A;ctx.shadowBlur=u*.02;M.rr(ctx,P?W/2-lw/2:tx,ly,lw,u*.006,u*.003);ctx.fill();ctx.restore()}
9506
9506
  fS.lines.forEach((l,i)=>TXT(ctx,l,tx+sx*.6,ly+u*.02+fS.size*1.12+i*fS.size*1.38,fS.font,fS.size,'rgba(214,228,255,.9)',al,k.v*a2*(sub?1:0)))
9507
9507
  }`),Kt("course-key-takeaway","Thẻ ý chính",5,{text:"Ghi nhớ",items:"Nói rõ mục tiêu|Cho ví dụ cụ thể|Kiểm tra lại kết quả",glyph:"bulb",position:"right",posX:-1,posY:-1,width:.34},`function render(ctx,t,env){
9508
- ${Se}
9508
+ ${Te}
9509
9509
  // Key takeaway card: a dark-blue glass card beside the presenter with an icon tile (glyph) and a title (text: Ghi nhớ / Key takeaways) over up to 3 numbered lines (items) that tick in one by one (position right, left, center, top, lower; posX / posY 0..1 = its centre, posY alone = its height; width = card width, a fraction of the frame in 16:9); transparent elsewhere (fields: text, items, glyph, position, posX, posY, width).
9510
9510
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k=M.io(t,D,.55,.4),A=AC(p)
9511
9511
  if(!(k.v>0))return
@@ -9521,7 +9521,7 @@
9521
9521
  if(a>0){ctx.save();ctx.globalAlpha*=k.v*a;ctx.fillStyle=M.mix(A,'#ffffff',.1);ctx.beginPath();ctx.arc(dx,dy,d/2*Math.max(0,M.ease.outBack(a)),0,M.TAU);ctx.fill();ctx.restore();TXT(ctx,String(i+1),dx,dy+d*.55*.36,sk.font(d*.55,'n'),d*.55,'#fff','center',k.v*a)}
9522
9522
  f.lines.forEach((l,j)=>TXT(ctx,l,x+pd+iz*1.6+(1-a)*u*.02,yy+f.size*1.12+j*f.size*1.38,f.font,f.size,'#ffffff','left',k.v*a));yy+=rows[i]+iz*.35})
9523
9523
  }`),Kt("course-progress-bar","Thanh tiến độ bài học",6,{from:0,to:.1,ticks:".25|.5|.75",text:"",fade:"both",position:"top"},`function render(ctx,t,env){
9524
- ${Se}
9524
+ ${Te}
9525
9525
  // Lesson progress bar: a thin glass track across the top (or bottom: position lower) that fills from from to to (0..1 of the whole lesson) over the layer with a glowing head, chapter ticks at ticks (fractions split by |) that light up once passed and an optional small chapter label (text); fade both | in | out | none so back-to-back pieces read as one bar (fields: from, to, ticks, text, fade, position).
9526
9526
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,A=AC(p)
9527
9527
  const f0=M.clamp(+p.from||0),f1=M.clamp(Number.isFinite(+p.to)?+p.to:1),a=FD(t,D,p.fade,.4,.4)
@@ -9533,7 +9533,7 @@
9533
9533
  ctx.fillStyle='#ffffff';ctx.shadowColor=A;ctx.shadowBlur=th*3;ctx.beginPath();ctx.arc(xv,y,th*1.15*(1+.12*Math.sin(t*4)),0,M.TAU);ctx.fill();ctx.restore()
9534
9534
  const s=String(p.text||'').trim();if(s){const fz=u*.026,f=M.fit(ctx,s,z=>sk.font(z,'q'),fz,(x1-x0)*.6,1,.6),lb=String(p.position)==='lower'?y-th-f.size*.55:y+th+f.size*1.35;TXT(ctx,f.lines[0],x0,lb,f.font,f.size,'#ffffff','left',a)}
9535
9535
  }`),Kt("course-screen-frame","Khung cửa sổ màn hình",8,{text:"trinh-duyet.vi/bai-hoc",cw:.84,ch:.84,cy:.53,posX:-1,posY:-1,zw:.22,fade:"both",bg:"#0b1636",position:"center"},`function render(ctx,t,env){
9536
- ${Se}
9536
+ ${Te}
9537
9537
  // Screen recording frame: a browser / app window drawn AROUND a screen-recording layer (the hole in the middle shows the recording placed at cw × ch of the frame, centred at cy) — navy backdrop, rounded corners, a light title bar with three dots and an address pill (text), a soft shadow; posX / posY (0..1) = centre of an optional highlight box (zw of the frame wide) that dims the rest of the screen; fade both | in | out | none for back-to-back pieces (fields: text, cw, ch, cy, posX, posY, zw, fade, bg).
9538
9538
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),k={v:FD(t,D,p.fade,.3,.3)},bg=HX.test(String(p.bg))?p.bg:'#0b1636'
9539
9539
  if(!(k.v>0))return
@@ -9550,7 +9550,7 @@
9550
9550
  ctx.strokeStyle=M.mix(A,'#ffffff',.2);ctx.lineWidth=Math.max(2,u*.005);ctx.shadowColor=A;ctx.shadowBlur=u*(.02+.01*Math.sin(t*3));ctx.globalAlpha=k.v*hl;ctx.beginPath();RRP(ctx,zx,zy,zw,zh,zr);ctx.stroke()}
9551
9551
  ctx.restore()
9552
9552
  }`),Kt("course-callout","Mũi tên chỉ vùng màn hình",4,{text:"Bấm vào đây",posX:.62,posY:.42,bw:.18,bh:.1,position:"center"},`function render(ctx,t,env){
9553
- ${Se}
9553
+ ${Te}
9554
9554
  // Screen callout: a glowing accent box drawn round a region of a screen recording (posX / posY 0..1 = its centre, bw × bh of the frame) with a curved arrow from a dark-blue glass label (text) placed on the side with more room; transparent elsewhere (fields: text, posX, posY, bw, bh).
9555
9555
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),k=M.io(t,D,.3,.35),P=H>W*1.1
9556
9556
  if(!(k.v>0))return
@@ -9567,7 +9567,7 @@
9567
9567
  if(ag>.9){const a1=pt(.9),a2=pt(1),an=Math.atan2(a2[1]-a1[1],a2[0]-a1[0]),hs=lw*3.2;ctx.fillStyle=A;ctx.beginPath();ctx.moveTo(a2[0],a2[1]);ctx.lineTo(a2[0]-Math.cos(an-.45)*hs,a2[1]-Math.sin(an-.45)*hs);ctx.lineTo(a2[0]-Math.cos(an+.45)*hs,a2[1]-Math.sin(an+.45)*hs);ctx.closePath();ctx.fill()}ctx.restore()}
9568
9568
  const pp=Math.max(0,M.ease.outBack(M.range(t,.5,.85)));if(pp>0){const w=lw2*pp,h=lh*pp;GLS(ctx,lx+(lw2-w)/2,ly+(lh-h)/2,w,h,h*.4,k.v,0,A);TXT(ctx,f.lines[0],lx+lw2/2,ly+lh/2+f.size*.36*pp,sk.font(f.size*pp,'q'),f.size,'#ffffff','center',k.v)}
9569
9569
  }`),Kt("course-pip-frame","Khung cửa sổ người nói",8,{text:"",posX:.8,posY:.44,pw:.28,ph:.56,radius:.07,fade:"both",position:"right"},`function render(ctx,t,env){
9570
- ${Se}
9570
+ ${Te}
9571
9571
  // Speaker picture-in-picture frame: a glowing neon border (accent) with rounded corners drawn round the presenter's small window (posX / posY 0..1 = its centre, pw × ph of the frame, radius = corner of the window width) over an overhead / whiteboard shot, a soft shadow outside, a light running round the edge, an optional name tag (text) under it; the window itself stays transparent; fade both | in | out | none for back-to-back pieces (fields: text, posX, posY, pw, ph, radius, fade).
9572
9572
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),a=FD(t,D,p.fade,.45,.35)
9573
9573
  if(!(a>0))return
@@ -9582,7 +9582,7 @@
9582
9582
  GLS(ctx,tx,ty,tw+f.size*1.2,th,th*.45,ta,0,A);TXT(ctx,f.lines[0],x+w/2,ty+th/2+f.size*.36,f.font,f.size,'#ffffff','center',ta)}
9583
9583
  ctx.restore()
9584
9584
  }`),Kt("course-label-tag","Nhãn chủ đề",4,{text:"TẬP TRƯỚC",sub:"Mô hình 5 chữ A",glyph:"play",position:"lower-left",posX:-1,posY:-1,width:.22},`function render(ctx,t,env){
9585
- ${Se}
9585
+ ${Te}
9586
9586
  // Label tag: a small dark-glass tag in a lower corner with an accent edge — an icon tile (glyph) beside a bold caps title (text, e.g. PREVIOUS EPISODE / a framework name) over one sub line (sub); slides in from its side, the icon pops (position lower-left, lower-right, top-left, top-right; posX / posY 0..1 = its centre; width = tag width, a fraction of the frame in 16:9); transparent elsewhere (fields: text, sub, glyph, position, posX, posY, width).
9587
9587
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k=M.io(t,D,.5,.4),A=AC(p)
9588
9588
  if(!(k.v>0))return
@@ -9600,7 +9600,7 @@
9600
9600
  if(sub)TXT(ctx,fS.lines[0],tx,y+h*(title?.79:.5)+(title?0:fS.size*.36),fS.font,fS.size,'rgba(255,255,255,.8)','left',k.v*ta)
9601
9601
  ctx.restore()
9602
9602
  }`),Kt("course-journey-line","Đường hành trình",8,{text:"",items:"Khởi đầu|Tăng tốc|Về đích",from:0,to:1,glyph:"user",photo:"",ring:0,posY:.8,position:"lower"},`function render(ctx,t,env){
9603
- ${Se}
9603
+ ${Te}
9604
9604
  // Journey line: a glowing light-saber line (accent, white-hot core) drawn across the lower third with milestone dots and labels (items split by |) and a round avatar dot (glyph, or a photo sticker id in photo; ring 1 = only its glowing ring, a picture layer sits inside) sliding along it from from to to (0..1 of the line, linear between 0.6 s and the last 0.8 s) — a progress / story arc; an optional label rides above the dot (text); posY = the line height 0..1 (fields: text, items, from, to, glyph, photo, ring, posY).
9605
9605
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k=M.io(t,D,.5,.4),A=AC(p)
9606
9606
  if(!(k.v>0))return
@@ -9619,7 +9619,7 @@
9619
9619
  const s=String(p.text||'').trim();if(s){const f=M.fit(ctx,s,z=>sk.font(z,'h'),u*.032,S.w*.3,1,.6);ctx.font=f.font;const tw=ctx.measureText(f.lines[0]).width,lx=Math.max(x0+tw/2,Math.min(x1-tw/2,dx));TXT(ctx,f.lines[0],lx,y-r-u*.03,f.font,f.size,'#ffffff','center',M.range(t,.5,.9))}
9620
9620
  ctx.restore()}
9621
9621
  }`),Kt("course-photo-pop","Ảnh bật ra",4,{text:"",photo:"",glyph:"camera",tile:2,scribble:0,posX:.72,posY:.42,size:.3,rot:-6},`function render(ctx,t,env){
9622
- ${Se}
9622
+ ${Te}
9623
9623
  // Photo pop beside the presenter: a square photo tile (size of the short side, centred at posX / posY 0..1, turned rot degrees) popping in with a little rotation, framed in a glowing accent edge with a soft shadow, and / or a hand-drawn accent scribble circle that draws itself round it (scribble 1); tile 2 = draws its own picture (photo sticker id, else a glyph), tile 1 = frame only (a photo layer sits under it, already popped), tile 0 = no frame (a cut-out portrait under the scribble); an optional caption under it (text); transparent elsewhere (fields: text, photo, glyph, tile, scribble, posX, posY, size, rot).
9624
9624
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),k=M.io(t,D,.35,.35)
9625
9625
  if(!(k.v>0))return
@@ -9634,7 +9634,7 @@
9634
9634
  const c=String(p.text||'').trim();if(c){const f=M.fit(ctx,c,z=>sk.font(z,'h'),u*.032,Math.max(s*1.3,u*.3),1,.6),ta=M.ease.outCubic(M.range(t,.35,.75));ctx.font=f.font;const tw=ctx.measureText(f.lines[0]).width,th=f.size*1.7,yy=cy+s*(+p.scribble===1?.78:.62)+u*.015
9635
9635
  GLS(ctx,cx-tw/2-f.size*.6,yy,tw+f.size*1.2,th,th*.45,k.v*ta,.4,A);TXT(ctx,f.lines[0],cx,yy+th/2+f.size*.36,f.font,f.size,'#ffffff','center',k.v*ta)}
9636
9636
  }`),Kt("course-cover-insert","Bìa sách / sản phẩm",5,{text:"TƯ DUY KINH DOANH",sub:"Sách nên đọc",cover:2,posX:.72,posY:.46,size:.5,aspect:.68,rot:-7},`function render(ctx,t,env){
9637
- ${Se}
9637
+ ${Te}
9638
9638
  // Book / product cover insert beside the presenter: a cover (size = its height of the frame, aspect = width / height, centred at posX / posY 0..1, tilted rot degrees) popping in with a soft shadow and a glowing accent edge, a light sheen sweeping across once; cover 2 = draws its own placeholder cover (title text, author / tag line sub), cover 1 = edge + sheen + a tag (sub) over a real cover picture layer under it (already popped); transparent elsewhere (fields: text, sub, cover, posX, posY, size, aspect, rot).
9639
9639
  const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),sk=M.skin(env,p),A=AC(p),k=M.io(t,D,.35,.35)
9640
9640
  if(!(k.v>0))return
@@ -9651,7 +9651,7 @@
9651
9651
  const tg=own?'':String(p.sub||'').trim();if(tg){const f=M.fit(ctx,tg,z=>sk.font(z,'h','800'),u*.03,w*1.2,1,.6),ta=M.ease.outCubic(M.range(t,.45,.85));ctx.font=f.font;const tw=ctx.measureText(f.lines[0]).width,th=f.size*1.7;GLS(ctx,-tw/2-f.size*.6,h/2+u*.02,tw+f.size*1.2,th,th*.45,ta,.5,A);TXT(ctx,f.lines[0],0,h/2+u*.02+th/2+f.size*.36,f.font,f.size,'#ffffff','center',ta)}
9652
9652
  ctx.restore()}
9653
9653
  }`),Kt("course-framework-stack","Khung mô hình xếp tầng",8,{text:"MÔ HÌNH 5A",items:"target:Aware — Nhận biết|heart:Appeal — Thu hút|search:Ask — Tìm hiểu|cart:Act — Hành động|megaphone:Advocate — Giới thiệu",at:"",fade:"both",position:"left",posX:-1,posY:-1,width:.26},`function render(ctx,t,env){
9654
- ${Se}
9654
+ ${Te}
9655
9655
  // Framework stack: 2–6 dark-glass cards with accent edges stacked diagonally on one side (position left | right; posX / posY 0..1 = the stack centre; width = card width, a fraction of the frame in 16:9), each an icon tile (item "glyph:Title — sub", else its number) + a bold title + a sub line, revealed one by one as they are spoken (at = layer seconds split by |, a negative time = already shown; else evenly), the newest lit; an optional caps header above (text, e.g. the 5 A's); fade both | in | out | none for back-to-back pieces; transparent elsewhere (fields: text, items, at, fade, position, posX, posY, width).
9656
9656
  const {width:W,height:H,duration:D,params:p}=env,S=M.safe(env,'center'),sk=M.skin(env,p),u=S.u,P=S.port,k={v:FD(t,D,p.fade,.4,.45)},A=AC(p),cont=String(p.fade)==='none'||String(p.fade)==='out'
9657
9657
  if(!(k.v>0))return
@@ -10939,7 +10939,7 @@
10939
10939
  const hp=M.ease.outBack(M.range(t,.32,.7)),ph=t>.75?((t-.75)%.8)/.8:1,beat=1+.24*Math.exp(-ph*5.5),hx=x+w-pr-hs
10940
10940
  if(hp>0){ctx.save();ctx.shadowColor='rgba(255,45,70,.75)';ctx.shadowBlur=hs*1.3;ctx.fillStyle='#ff2d46';M.icon(ctx,'heart',hx,hs*.06,hs*hp*beat);ctx.restore()}
10941
10941
  ctx.restore()
10942
- }`)],Ri=V.find(t=>t.id==="faceholo"),ve=(t,e,c,a,o)=>({id:t,name:e,category:Ri.name,pack:"faceholo",duration:c,params:{accent:Ri.accent,position:"center",...a,style:"faceholo"},code:o}),Te="const HEX=(v,d)=>/^#[0-9a-f]{6}$/i.test(v)?v:d;const ENV=(t,D)=>{const i=M.ease.outCubic(M.range(t,0,.4)),o=M.ease.inQuad(M.range(t,D-.3,D)),f=t<.42?(M.noise(t*40,5)>.32?1:.45):.93+.07*M.noise(t*6,9);return {i,a:M.clamp(M.range(t,0,.25))*(1-o)*f,s:.85+.15*i}};const FR=(W,H,lo,hi)=>{let w=W*.9,h=H*.9;if(w/h>hi)w=h*hi;if(w/h<lo)h=w/lo;return {x:(W-w)/2,y:(H-h)/2,w,h,u:Math.min(w,h)}};const GL=(c,col,b)=>{c.shadowColor=col;c.shadowBlur=b};const PANEL=(c,x,y,w,h,r,col,u)=>{c.save();const g=c.createLinearGradient(x,y,x+w*.4,y+h);g.addColorStop(0,M.rgba(col,.2));g.addColorStop(1,M.rgba(col,.05));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();GL(c,M.rgba(col,.85),u*.03);c.strokeStyle=M.rgba(M.mix(col,'#ffffff',.4),.9);c.lineWidth=Math.max(1,u*.004);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.strokeStyle='rgba(255,255,255,.25)';c.lineWidth=Math.max(1,u*.002);c.beginPath();c.moveTo(x+r,y+u*.012);c.lineTo(x+w-r,y+u*.012);c.stroke();c.restore()};const SCAN=(c,x,y,w,h,u,t,col)=>{c.save();c.shadowBlur=0;c.fillStyle=M.rgba(col,.05);const g=Math.max(3,u*.009);for(let v=y;v<y+h;v+=g)c.fillRect(x,v,w,Math.max(1,g*.35));const b=y-h*.2+((t*.3)%1)*h*1.4,a=Math.max(y,b-h*.15),z=Math.min(y+h,b);if(z>a){const q=c.createLinearGradient(0,b-h*.15,0,b);q.addColorStop(0,M.rgba(col,0));q.addColorStop(1,M.rgba(col,.12));c.fillStyle=q;c.fillRect(x,a,w,z-a)}c.restore()};const OPEN=(c,env,t,lo,hi2,rad)=>{const E=ENV(t,env.duration);if(E.a<=0)return null;const B=FR(env.width,env.height,lo,hi2),sk=M.skin(env,env.params),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),cx=B.x+B.w/2,cy=B.y+B.h/2,u=B.u,lw=Math.max(1,u*.004);c.save();c.globalAlpha=E.a;c.translate(cx,cy);c.scale(E.s,E.s);c.translate(-cx,-cy);PANEL(c,B.x,B.y,B.w,B.h,u*rad,acc,u);c.save();M.rr(c,B.x,B.y,B.w,B.h,u*rad);c.clip();SCAN(c,B.x,B.y,B.w,B.h,u,t,acc);c.restore();c.lineWidth=lw;c.strokeStyle=hi;c.fillStyle=hi;GL(c,M.rgba(acc,.9),u*.018);c.lineCap='round';c.lineJoin='round';c.textBaseline='alphabetic';return {...B,E,sk,acc,hi,cx,cy,lw}};",gx=[ve("fh-call-panel","Cuộc gọi hologram",6,{text:"Russel Roy",sub:"+123 456 7890",number:83},Te+`function render(ctx,t,env){
10942
+ }`)],Ri=V.find(t=>t.id==="faceholo"),Yt=(t,e,c,a,o)=>({id:t,name:e,category:Ri.name,pack:"faceholo",duration:c,params:{accent:Ri.accent,position:"center",...a,style:"faceholo"},code:o}),_t="const HEX=(v,d)=>/^#[0-9a-f]{6}$/i.test(v)?v:d;const ENV=(t,D)=>{const i=M.ease.outCubic(M.range(t,0,.4)),o=M.ease.inQuad(M.range(t,D-.3,D)),f=t<.42?(M.noise(t*40,5)>.32?1:.45):.93+.07*M.noise(t*6,9);return {i,a:M.clamp(M.range(t,0,.25))*(1-o)*f,s:.85+.15*i}};const FR=(W,H,lo,hi)=>{let w=W*.9,h=H*.9;if(w/h>hi)w=h*hi;if(w/h<lo)h=w/lo;return {x:(W-w)/2,y:(H-h)/2,w,h,u:Math.min(w,h)}};const GL=(c,col,b)=>{c.shadowColor=col;c.shadowBlur=b};const PANEL=(c,x,y,w,h,r,col,u)=>{c.save();const g=c.createLinearGradient(x,y,x+w*.4,y+h);g.addColorStop(0,M.rgba(col,.2));g.addColorStop(1,M.rgba(col,.05));c.fillStyle=g;M.rr(c,x,y,w,h,r);c.fill();GL(c,M.rgba(col,.85),u*.03);c.strokeStyle=M.rgba(M.mix(col,'#ffffff',.4),.9);c.lineWidth=Math.max(1,u*.004);M.rr(c,x,y,w,h,r);c.stroke();c.shadowBlur=0;c.strokeStyle='rgba(255,255,255,.25)';c.lineWidth=Math.max(1,u*.002);c.beginPath();c.moveTo(x+r,y+u*.012);c.lineTo(x+w-r,y+u*.012);c.stroke();c.restore()};const SCAN=(c,x,y,w,h,u,t,col)=>{c.save();c.shadowBlur=0;c.fillStyle=M.rgba(col,.05);const g=Math.max(3,u*.009);for(let v=y;v<y+h;v+=g)c.fillRect(x,v,w,Math.max(1,g*.35));const b=y-h*.2+((t*.3)%1)*h*1.4,a=Math.max(y,b-h*.15),z=Math.min(y+h,b);if(z>a){const q=c.createLinearGradient(0,b-h*.15,0,b);q.addColorStop(0,M.rgba(col,0));q.addColorStop(1,M.rgba(col,.12));c.fillStyle=q;c.fillRect(x,a,w,z-a)}c.restore()};const OPEN=(c,env,t,lo,hi2,rad)=>{const E=ENV(t,env.duration);if(E.a<=0)return null;const B=FR(env.width,env.height,lo,hi2),sk=M.skin(env,env.params),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),cx=B.x+B.w/2,cy=B.y+B.h/2,u=B.u,lw=Math.max(1,u*.004);c.save();c.globalAlpha=E.a;c.translate(cx,cy);c.scale(E.s,E.s);c.translate(-cx,-cy);PANEL(c,B.x,B.y,B.w,B.h,u*rad,acc,u);c.save();M.rr(c,B.x,B.y,B.w,B.h,u*rad);c.clip();SCAN(c,B.x,B.y,B.w,B.h,u,t,acc);c.restore();c.lineWidth=lw;c.strokeStyle=hi;c.fillStyle=hi;GL(c,M.rgba(acc,.9),u*.018);c.lineCap='round';c.lineJoin='round';c.textBaseline='alphabetic';return {...B,E,sk,acc,hi,cx,cy,lw}};",gx=[Yt("fh-call-panel","Cuộc gọi hologram",6,{text:"Russel Roy",sub:"+123 456 7890",number:83},_t+`function render(ctx,t,env){
10943
10943
  // Hologram phone-call panel filling its frame: "Ongoing call" + a timer counting up from numberValue seconds, an avatar ring, the contact name (text) and number (subText), a live voice waveform, gear / mute / speaker buttons down the left edge.
10944
10944
  // Translucent cool-blue glass, thin glowing lines, scanlines; drawn flat and unmirrored (the face pin tilts / mirrors it).
10945
10945
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),E=ENV(t,D)
@@ -10987,7 +10987,7 @@
10987
10987
  for(let i=0;i<n;i++){const tp=Math.pow(Math.sin(Math.PI*(i+.5)/n),.6),v=.12+.88*tp*Math.pow(M.noise(i*.42,t*2.4),1.4)*(.6+.4*Math.sin(t*3.1+i*.3)),bh=Math.max(lw,amp*v*k);ctx.rect(sx+i*step+step*.28,wy-bh,step*.44,bh*2)}
10988
10988
  ctx.fill();ctx.restore()}
10989
10989
  ctx.restore()
10990
- }`),ve("fh-keypad","Bàn phím hologram",6,{text:"123 456 7890"},Te+`function render(ctx,t,env){
10990
+ }`),Yt("fh-keypad","Bàn phím hologram",6,{text:"123 456 7890"},_t+`function render(ctx,t,env){
10991
10991
  // Hologram dial pad filling its frame: a 3 x 4 grid of glass circle keys 1-9, *, 0, # with phone letter rows; the keys light up one after another in a slow ripple while the number (text) types into the display above.
10992
10992
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),E=ENV(t,D)
10993
10993
  if(E.a<=0)return
@@ -11015,7 +11015,7 @@
11015
11015
  if(S[i]){ctx.globalAlpha*=.7;ctx.font=sk.font(c*.085,'s','500');M.ls(ctx,c*.02);ctx.fillText(S[i],0,c*.19)}
11016
11016
  ctx.restore()}
11017
11017
  ctx.restore()
11018
- }`),ve("fh-text-column","Cột chữ hologram",8,{text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse.",sub:"Notes"},Te+`function render(ctx,t,env){
11018
+ }`),Yt("fh-text-column","Cột chữ hologram",8,{text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse.",sub:"Notes"},_t+`function render(ctx,t,env){
11019
11019
  // Hologram text column filling a tall frame: small justified lines of text scroll slowly upward with a few highlighted words and image tiles between the paragraphs, under a header label (subText).
11020
11020
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.72),E=ENV(t,D)
11021
11021
  if(E.a<=0)return
@@ -11049,7 +11049,7 @@
11049
11049
  ctx.beginPath();ctx.moveTo(tx+tw*.1,ty+tH*.82);ctx.lineTo(tx+tw*.38,ty+tH*.42);ctx.lineTo(tx+tw*.56,ty+tH*.64);ctx.lineTo(tx+tw*.7,ty+tH*.5);ctx.lineTo(tx+tw*.9,ty+tH*.82);ctx.stroke()
11050
11050
  ctx.beginPath();ctx.arc(tx+tw*.76,ty+tH*.27,Math.min(tw,tH)*.09,0,M.TAU);ctx.stroke();tx+=tw+gp})}}
11051
11051
  ctx.restore();ctx.restore()
11052
- }`),ve("fh-face-scan","Quét khuôn mặt",4,{color:"#39ff88"},Te+`function render(ctx,t,env){
11052
+ }`),Yt("fh-face-scan","Quét khuôn mặt",4,{color:"#39ff88"},_t+`function render(ctx,t,env){
11053
11053
  // Face scan mesh pinned exactly on a face: a wireframe head (oval about 80 % of the frame height) with latitude / longitude curves, eye, brow, nose and mouth contours, bright vertices, a scan line sweeping top to bottom and corner brackets. color = mesh colour.
11054
11054
  const {width:W,height:H,duration:D,params:p}=env,E=ENV(t,D),col=HEX(p.color,'#39ff88'),hi=M.mix(col,'#ffffff',.55),acc=HEX(p.accent,'#7fd8ff')
11055
11055
  if(E.a<=0)return
@@ -11095,7 +11095,7 @@
11095
11095
  ctx.stroke();ctx.strokeStyle=M.rgba(acc,.8);ctx.lineWidth=lw;ctx.beginPath()
11096
11096
  for(let i=0;i<=20;i++){const yy=by0+L*1.4+(bh-L*2.8)*i/20;ctx.moveTo(bx0,yy);ctx.lineTo(bx0+u*(i%5?.012:.026)*bk,yy)}
11097
11097
  ctx.stroke();ctx.restore()
11098
- }`),ve("fh-chat-bubble","Bong bóng chat 3D",4,{color:"#b9a6ff"},Te+`function render(ctx,t,env){
11098
+ }`),Yt("fh-chat-bubble","Bong bóng chat 3D",4,{color:"#b9a6ff"},_t+`function render(ctx,t,env){
11099
11099
  // 3D chat bubble filling its frame: a glossy lilac / white speech bubble with three typing dots pops in with an overshoot and floats gently while small hearts drift up behind it. color = bubble tint.
11100
11100
  const {width:W,height:H,duration:D,params:p}=env,col=HEX(p.color,'#b9a6ff'),deep=M.mix(col,'#3a2380',.55),E=ENV(t,D)
11101
11101
  if(E.a<=0)return
@@ -11126,7 +11126,7 @@
11126
11126
  const dg=ctx.createRadialGradient(dx-r*.35,dy-r*.35,r*.1,dx,dy,r);dg.addColorStop(0,M.mix(deep,'#ffffff',.45));dg.addColorStop(1,deep)
11127
11127
  ctx.globalAlpha=E.a*(.6+.4*up);ctx.fillStyle=dg;ctx.beginPath();ctx.arc(dx,dy,r,0,M.TAU);ctx.fill()}
11128
11128
  ctx.restore()
11129
- }`),ve("fh-data-ring","Vòng dữ liệu",6,{text:"Sync",number:87},Te+`function render(ctx,t,env){
11129
+ }`),Yt("fh-data-ring","Vòng dữ liệu",6,{text:"Sync",number:87},_t+`function render(ctx,t,env){
11130
11130
  // Data ring around a head filling its frame: a circular HUD of tick marks, counter-rotating arc segments, a progress arc counting up to numberValue % and a small readout with a label (text) outside the ring.
11131
11131
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),E=ENV(t,D)
11132
11132
  if(E.a<=0)return
@@ -11165,7 +11165,7 @@
11165
11165
  if(lab){const f=M.fit(ctx,lab,z=>sk.font(z,'s','500'),fl,u*.22,1,.5);ctx.font=f.font;M.ls(ctx,f.size*.18);ctx.globalAlpha=E.a*k*.8;ctx.fillText(f.lines[0]||'',ax,wide?ay-u*.018:ay);M.ls(ctx,0)}
11166
11166
  ctx.globalAlpha=E.a*k;ctx.font=sk.font(fn,'n','300');ctx.fillText(num,ax,wide?ay+fn*.95:ay+fn*(lab?1:.4))}
11167
11167
  ctx.restore()
11168
- }`),ve("fh-music-player","Trình phát nhạc hologram",6,{text:"Midnight City",sub:"Night Drive Club"},Te+`function render(ctx,t,env){
11168
+ }`),Yt("fh-music-player","Trình phát nhạc hologram",6,{text:"Midnight City",sub:"Night Drive Club"},_t+`function render(ctx,t,env){
11169
11169
  // Hologram music player filling its frame: an album square with a turning disc, the song (text) and artist (subText), a small spectrum, a moving progress bar with times, previous / pause / next buttons.
11170
11170
  const p=env.params,O=OPEN(ctx,env,t,.62,1.7,.07);if(!O)return
11171
11171
  const {x,y,w,h,u,sk,acc,hi,E,lw}=O,st=k=>M.ease.outCubic(M.range(t,k,k+.35)),port=h>w*1.4,pad=u*.08
@@ -11196,7 +11196,7 @@
11196
11196
  for(const s of [-1,1]){const qx=cx2+s*g,q=r*.4;ctx.beginPath();ctx.moveTo(qx+s*q*.5,cy2);ctx.lineTo(qx-s*q*.6,cy2-q);ctx.lineTo(qx-s*q*.6,cy2+q);ctx.closePath();ctx.fill();ctx.beginPath();ctx.moveTo(qx+s*q*.75,cy2-q);ctx.lineTo(qx+s*q*.75,cy2+q);ctx.stroke()}
11197
11197
  ctx.restore()}
11198
11198
  ctx.restore()
11199
- }`),ve("fh-heart-rate","Nhịp tim hologram",6,{number:96},Te+`function render(ctx,t,env){
11199
+ }`),Yt("fh-heart-rate","Nhịp tim hologram",6,{number:96},_t+`function render(ctx,t,env){
11200
11200
  // Hologram heart-rate panel filling its frame: a small heart and HEART RATE label, the bpm (numberValue) large and pulsing on every beat, min / max, an ECG trace scrolling across a faint grid.
11201
11201
  const p=env.params,O=OPEN(ctx,env,t,.75,1.9,.07);if(!O)return
11202
11202
  const {x,y,w,h,u,sk,acc,hi,E,lw}=O,st=k=>M.ease.outCubic(M.range(t,k,k+.35)),pad=u*.08
@@ -11222,7 +11222,7 @@
11222
11222
  for(let i=0;i<=200;i++){const xn=i/200;if(xn<1-k)continue;const tt=t-(1-xn)*win,ph=((tt/per)%1+1)%1;ly=em-ecg(ph)*amp;go++?ctx.lineTo(ex+ew*xn,ly):ctx.moveTo(ex+ew*xn,ly)}
11223
11223
  ctx.stroke();ctx.fillStyle='#ffffff';ctx.beginPath();ctx.arc(ex+ew,ly,u*.011,0,M.TAU);ctx.fill();ctx.restore()}
11224
11224
  ctx.restore()
11225
- }`),ve("fh-profile-card","Thẻ hồ sơ hologram",6,{text:"Rina",sub:"Cosplayer · Bangkok",number:128400},Te+`function render(ctx,t,env){
11225
+ }`),Yt("fh-profile-card","Thẻ hồ sơ hologram",6,{text:"Rina",sub:"Cosplayer · Bangkok",number:128400},_t+`function render(ctx,t,env){
11226
11226
  // Hologram profile card filling its frame: an avatar ring with a verified badge, the name (text) and role (subText), three stat columns (followers = numberValue, likes, posts) counting up.
11227
11227
  const p=env.params,O=OPEN(ctx,env,t,.62,1.5,.07);if(!O)return
11228
11228
  const {x,y,w,h,u,sk,acc,hi,E,lw,cx}=O,st=k=>M.ease.outCubic(M.range(t,k,k+.35)),pad=u*.08
@@ -11252,7 +11252,7 @@
11252
11252
  if(i){ctx.globalAlpha=E.a*k*.25;ctx.beginPath();ctx.moveTo(x+pad+cw*i,sy-u*.07);ctx.lineTo(x+pad+cw*i,sy+u*.07);ctx.stroke()}}
11253
11253
  ctx.restore()}
11254
11254
  ctx.restore()
11255
- }`),ve("fh-notify-stack","Chồng thông báo",6,{items:"Mia: Where are you now?|Ken: The show starts at 8|Nora: Sent you the photos|Leo: Dinner after this?"},Te+`function render(ctx,t,env){
11255
+ }`),Yt("fh-notify-stack","Chồng thông báo",6,{items:"Mia: Where are you now?|Ken: The show starts at 8|Nora: Sent you the photos|Leo: Dinner after this?"},_t+`function render(ctx,t,env){
11256
11256
  // Notification stack filling its frame: up to four message notifications (items "Sender: message") drop in one after another, the newest on top pushing the older ones down; app dot with the initial, sender, one line, time.
11257
11257
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),E=ENV(t,D)
11258
11258
  if(E.a<=0)return
@@ -11272,7 +11272,7 @@
11272
11272
  ctx.font=sk.font(ch*.17,'s','400');ctx.textAlign='right';ctx.globalAlpha=E.a*a*.6;ctx.fillText(sl<.5?'now':Math.round(sl)+'m',x0+cw-ch*.25,cy+ch*.4)
11273
11273
  f=M.fit(ctx,msg,z=>sk.font(z,'s','300'),ch*.2,tw,1,.6);ctx.font=f.font;ctx.textAlign='left';ctx.globalAlpha=E.a*a*.85;ctx.fillText(f.lines[0]||'',tx,cy+ch*.75);ctx.restore()}
11274
11274
  ctx.restore()
11275
- }`),ve("fh-radar-map","Radar bản đồ",6,{text:"Siam Square",number:1.2},Te+`function render(ctx,t,env){
11275
+ }`),Yt("fh-radar-map","Radar bản đồ",6,{text:"Siam Square",number:1.2},_t+`function render(ctx,t,env){
11276
11276
  // Radar map filling its frame: a circular radar over a street grid with range rings and a sweeping beam, blips flaring as it passes, a pulsing pin with a label tag (text) and the distance (numberValue km).
11277
11277
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),E=ENV(t,D)
11278
11278
  if(E.a<=0)return
@@ -11305,7 +11305,7 @@
11305
11305
  ctx.globalAlpha=E.a*M.clamp(pk);ctx.fillStyle='rgba(6,18,26,.55)';M.rr(ctx,tx,ty,tw,th,th*.2);ctx.fill();ctx.stroke();ctx.fillStyle=hi;ctx.textBaseline='alphabetic'
11306
11306
  if(lab){ctx.font=f.font;ctx.fillText(f.lines[0]||'',tx+tw/2,ty+th*.47)}ctx.font=sk.font(u*.03,'n','400');ctx.globalAlpha*=.8;ctx.fillText(dist,tx+tw/2,ty+th*.82)}
11307
11307
  ctx.restore()
11308
- }`),ve("fh-target-lock","Khoá mục tiêu",4,{text:"LOCKED",color:"#ff5a6e"},Te+`function render(ctx,t,env){
11308
+ }`),Yt("fh-target-lock","Khoá mục tiêu",4,{text:"LOCKED",color:"#ff5a6e"},_t+`function render(ctx,t,env){
11309
11309
  // Target lock on a face (centred, the box about 80 % of the frame height like fh-face-scan): corner brackets snap in, a dashed circle turns, crosshair ticks close in, a TRACKING readout counts up then flips to the lock label (text) in the lock colour (color).
11310
11310
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.7),E=ENV(t,D),lc=HEX(p.color,'#ff5a6e')
11311
11311
  if(E.a<=0)return
@@ -11334,7 +11334,7 @@
11334
11334
  const pc=on?98+Math.round(M.noise(t*3,2)*1.4):Math.round(98*M.range(t,.35,TL));ctx.font=sk.font(fs*.9,'n','400');ctx.globalAlpha=E.a*tr*.8;ctx.fillText(pc+'%',lx,ly+fs*1.4)}
11335
11335
  if(on&&lk<1){ctx.globalAlpha=E.a*(1-lk)*.5;ctx.lineWidth=lw*3;ctx.beginPath();ctx.arc(cx,cy,R*(1+lk*.3),0,M.TAU);ctx.stroke()}
11336
11336
  ctx.restore()
11337
- }`),ve("fh-translate","Dịch song ngữ",5,{text:"สวัสดีค่ะ",sub:"Xin chào",lang:"TH → VI"},Te+`function render(ctx,t,env){
11337
+ }`),Yt("fh-translate","Dịch song ngữ",5,{text:"สวัสดีค่ะ",sub:"Xin chào",lang:"TH → VI"},_t+`function render(ctx,t,env){
11338
11338
  // Live translate bubble filling its frame: a glass speech bubble with a language chip (lang), the heard words (text) fading in, then the translation (subText) typing in with a caret under a divider.
11339
11339
  const {width:W,height:H,duration:D,params:p}=env,sk=M.skin(env,p),acc=sk.acc,hi=M.mix(acc,'#ffffff',.72),E=ENV(t,D)
11340
11340
  if(E.a<=0)return
@@ -11357,7 +11357,7 @@
11357
11357
  ctx.font=f.font;ctx.globalAlpha=E.a;ctx.fillStyle='#ffffff';ctx.fillText(s,x+pad,y2)
11358
11358
  if(n<ch.length||Math.floor(t*2.2)%2===0){ctx.fillStyle=hi;ctx.fillRect(x+pad+ctx.measureText(s).width+u*.012,y2-f.size*.8,Math.max(1,u*.008),f.size*.95)}}
11359
11359
  ctx.restore()
11360
- }`),ve("fh-weather","Thời tiết hologram",6,{text:"Bangkok",sub:"Clear night",number:29},Te+`function render(ctx,t,env){
11360
+ }`),Yt("fh-weather","Thời tiết hologram",6,{text:"Bangkok",sub:"Clear night",number:29},_t+`function render(ctx,t,env){
11361
11361
  // Hologram weather panel filling its frame: a line-art moon behind a drifting cloud with twinkling stars, the temperature (numberValue °C) large, the city (text) and sky (subText), a four-slot hourly row.
11362
11362
  const p=env.params,O=OPEN(ctx,env,t,.62,1.7,.07);if(!O)return
11363
11363
  const {x,y,w,h,u,sk,acc,hi,E,lw,cx}=O,st=k=>M.ease.outCubic(M.range(t,k,k+.35)),pad=u*.08,port=h>w*1.35,deg=Number.isFinite(+p.number)?Math.round(+p.number):29
@@ -11391,6 +11391,72 @@
11391
11391
  ctx.font=sk.font(Math.min(u*.045,cw*.22),'n','400');ctx.fillText((deg-[0,1,1,2][i])+'°',sx,ry+rh*.93)}
11392
11392
  ctx.restore()}
11393
11393
  ctx.restore()
11394
+ }`),Yt("fh-eyes-glow","Mắt phát sáng",4,{color:"#ff3818"},_t+`function render(ctx,t,env){
11395
+ // Donghua / Cinema glowing eyes pinned to the 3D face (place: scan): dual blazing eye cores + horizontal anamorphic glint + rising energy sparks.
11396
+ const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),cx=W/2,cy=H/2,rx=u*.30,ry=u*.40,E=ENV(t,D)
11397
+ if(E.a<=0)return
11398
+ const col=String(p.color||'#ff3818'),hi=M.mix(col,'#ffffff',.78),pulse=.84+.16*Math.sin(t*11)
11399
+ const intro=M.ease.outCubic(M.range(t,0,.28)),ey=cy-ry*.14,dx=rx*.36
11400
+ ctx.save();ctx.globalAlpha=E.a*intro;ctx.globalCompositeOperation='lighter'
11401
+ for(const s of [-1,1]){
11402
+ const ex=cx+s*dx,r0=u*.032*pulse,r1=u*.13*pulse
11403
+ const g=ctx.createRadialGradient(ex,ey,0,ex,ey,r1)
11404
+ g.addColorStop(0,'#ffffff');g.addColorStop(.22,hi);g.addColorStop(.55,M.rgba(col,.65));g.addColorStop(1,'rgba(0,0,0,0)')
11405
+ ctx.fillStyle=g;ctx.beginPath();ctx.arc(ex,ey,r1,0,M.TAU);ctx.fill()
11406
+ const sw=u*.24*pulse,sh=u*.012
11407
+ const sg=ctx.createLinearGradient(ex-sw,ey,ex+sw,ey)
11408
+ sg.addColorStop(0,'rgba(0,0,0,0)');sg.addColorStop(.35,M.rgba(col,.7));sg.addColorStop(.5,'#ffffff');sg.addColorStop(.65,M.rgba(col,.7));sg.addColorStop(1,'rgba(0,0,0,0)')
11409
+ ctx.fillStyle=sg;ctx.fillRect(ex-sw,ey-sh/2,sw*2,sh)
11410
+ ctx.fillStyle='#ffffff';ctx.beginPath();ctx.ellipse(ex,ey,r0*1.15,r0*.72,0,0,M.TAU);ctx.fill()
11411
+ for(let i=0;i<5;i++){
11412
+ const ph=(t*1.4+i*.23+(s>0?.5:0))%1,px=ex+s*(u*.02+ph*u*.11)+Math.sin(t*6+i)*u*.012,py=ey-ph*u*.14,a=(1-ph)*Math.min(1,ph*6)
11413
+ ctx.fillStyle=M.rgba(hi,a*.9);ctx.beginPath();ctx.arc(px,py,u*.006*(1-ph*.5),0,M.TAU);ctx.fill()
11414
+ }
11415
+ }
11416
+ ctx.restore()
11417
+ }`),Yt("fh-forehead-rune","Phù văn trán",4,{color:"#ff6a14"},_t+`function render(ctx,t,env){
11418
+ // Donghua / Cinema glowing forehead rune seal (place: scan): geometric flame-lotus emblem + counter-rotating inner rune ring.
11419
+ const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),cx=W/2,cy=H/2,ry=u*.40,E=ENV(t,D)
11420
+ if(E.a<=0)return
11421
+ const col=String(p.color||'#ff6a14'),hi=M.mix(col,'#ffffff',.72),fy=cy-ry*.48,R=u*.075,lw=Math.max(1.2,u*.0045)
11422
+ const intro=M.ease.outBack(M.range(t,.02,.42)),pulse=.85+.15*Math.sin(t*7.5)
11423
+ ctx.save();ctx.globalAlpha=E.a*M.clamp(intro*1.4);ctx.translate(cx,fy);ctx.scale(intro,intro);ctx.globalCompositeOperation='lighter'
11424
+ const g=ctx.createRadialGradient(0,0,0,0,0,R*2.1)
11425
+ g.addColorStop(0,M.rgba(hi,.7*pulse));g.addColorStop(.45,M.rgba(col,.38*pulse));g.addColorStop(1,'rgba(0,0,0,0)')
11426
+ ctx.fillStyle=g;ctx.beginPath();ctx.arc(0,0,R*2.1,0,M.TAU);ctx.fill()
11427
+ GL(ctx,M.rgba(col,.95),u*.016);ctx.strokeStyle=hi;ctx.lineWidth=lw
11428
+ ctx.save();ctx.rotate(t*.55);ctx.setLineDash([R*.28,R*.18]);ctx.beginPath();ctx.arc(0,0,R,0,M.TAU);ctx.stroke();ctx.setLineDash([]);ctx.restore()
11429
+ ctx.save();ctx.rotate(-t*.35);ctx.strokeStyle=col;ctx.lineWidth=lw*1.2;ctx.beginPath()
11430
+ for(let i=0;i<6;i++){const a=i*Math.PI/3;ctx.moveTo(0,0);ctx.quadraticCurveTo(Math.cos(a-.35)*R*.72,Math.sin(a-.35)*R*.72,Math.cos(a)*R*.88,Math.sin(a)*R*.88);ctx.quadraticCurveTo(Math.cos(a+.35)*R*.72,Math.sin(a+.35)*R*.72,0,0)}
11431
+ ctx.stroke();ctx.restore()
11432
+ ctx.fillStyle='#ffffff';ctx.beginPath();ctx.moveTo(0,-R*.58);ctx.quadraticCurveTo(R*.28,0,0,R*.42);ctx.quadraticCurveTo(-R*.28,0,0,-R*.58);ctx.fill()
11433
+ ctx.restore()
11434
+ }`),Yt("fh-energy-veins","Gân năng lượng mặt",4,{color:"#ff2640"},_t+`function render(ctx,t,env){
11435
+ // Emissive magma / lightning veins spreading across cheeks & temples (place: scan): animated growth + traveling energy pulse.
11436
+ const {width:W,height:H,duration:D,params:p}=env,u=Math.min(W,H),cx=W/2,cy=H/2,rx=u*.30,ry=u*.40,E=ENV(t,D)
11437
+ if(E.a<=0)return
11438
+ const col=String(p.color||'#ff2640'),hi=M.mix(col,'#ffffff',.75),lw=Math.max(1.2,u*.0042)
11439
+ const grow=M.ease.outCubic(M.range(t,.02,.65)),pulse=.75+.25*Math.sin(t*12)
11440
+ const branches=[
11441
+ [[.28,-.06],[.46,.04],[.62,.16],[.74,.32]],
11442
+ [[.46,.04],[.60,.02],[.76,.08]],
11443
+ [[.34,.08],[.48,.22],[.58,.38]],
11444
+ [[.26,-.24],[.44,-.30],[.64,-.26],[.78,-.16]],
11445
+ [[.44,-.30],[.56,-.40],[.68,-.44]],
11446
+ ]
11447
+ ctx.save();ctx.globalAlpha=E.a;ctx.globalCompositeOperation='lighter';ctx.lineCap='round';ctx.lineJoin='round'
11448
+ GL(ctx,M.rgba(col,.95),u*.018)
11449
+ for(const s of [-1,1]){
11450
+ for(let b=0;b<branches.length;b++){
11451
+ const pts=branches[b],segMax=(pts.length-1)*grow
11452
+ if(segMax<=0)continue
11453
+ const drawPath=()=>{ctx.beginPath();ctx.moveTo(cx+s*pts[0][0]*rx,cy+pts[0][1]*ry)
11454
+ for(let i=1;i<pts.length;i++){const k=M.clamp(segMax-(i-1));if(k<=0)break;const px=M.lerp(pts[i-1][0],pts[i][0],k),py=M.lerp(pts[i-1][1],pts[i][1],k);ctx.lineTo(cx+s*px*rx,cy+py*ry)}}
11455
+ ctx.strokeStyle=M.rgba(col,.85*pulse);ctx.lineWidth=lw*2.1;drawPath();ctx.stroke()
11456
+ ctx.strokeStyle=M.rgba(hi,.95*pulse);ctx.lineWidth=lw*.85;drawPath();ctx.stroke()
11457
+ }
11458
+ }
11459
+ ctx.restore()
11394
11460
  }`)],Pi=V.find(t=>t.id==="history"),Xc=(t,e,c,a,o)=>({id:t,name:e,category:Pi.name,pack:"history",duration:c,params:{accent:Pi.accent,position:"center",...a,style:"history"},code:o}),Fc="const E=M.ease,RG=M.range,L=M.lerp,RA=M.rgba,CL=M.clamp,MIN=Math.min,MAX=Math.max,PC=(v,d)=>/^#[0-9a-f]{6}$/i.test(String(v))?v:d;const FT=(env,k,fb)=>(env.fonts||{})[k]||fb,SERIF=(env,z)=>'italic 800 '+Math.round(z)+'px '+FT(env,'play','Georgia, serif'),COND=(env,z)=>'700 '+Math.round(z)+'px '+FT(env,'oswald','Arial Narrow, sans-serif'),HEAVY=(env,z)=>'900 '+Math.round(z)+'px '+FT(env,'bevn','system-ui, sans-serif');const GRAIN=(c,W,H,t,a)=>{const R=M.rand(Math.floor(t*24)*13+5),n=Math.round(W*H/2400);c.save();for(let i=0;i<n;i++){c.fillStyle=i%2?'rgba(255,238,215,'+(.06*a)+')':'rgba(0,0,0,'+(.09*a)+')';c.fillRect(R()*W,R()*H,1.6,1.6)}c.restore()};const WL=(c,W,H,t,D,a,tint,veil)=>{if(a<=0)return;const u=MIN(W,H),pr=D>0?CL(t/D):0;c.save();c.globalAlpha=a;const ww=u*.95,wh=u*1.25,b=u*.05,cx=L(W*.1,W*.8,pr),cy=H*.44,ps=[];for(let i=0;i<2;i++)for(let j=0;j<3;j++)ps.push([-ww/2+i*ww/2+b/2,-wh/2+j*wh/3+b/2,ww/2-b,wh/3-b]);const path=()=>{c.beginPath();ps.forEach(q=>c.rect(q[0],q[1],q[2],q[3]))};c.save();c.translate(cx,cy);c.rotate(-.12);c.transform(1,.16,-.5,1,0,0);c.filter='blur('+Math.round(u*.012)+'px)';c.beginPath();c.rect(-W*4,-H*4,W*8,H*8);ps.forEach(q=>c.rect(q[0],q[1],q[2],q[3]));c.fillStyle='rgba(30,13,2,'+veil+')';c.fill('evenodd');c.fillStyle=RA(tint,.3);path();c.fill();c.filter='none';c.restore();const g=c.createRadialGradient(cx,cy,0,cx,cy,u*.95);g.addColorStop(0,RA(tint,.16));g.addColorStop(1,RA(tint,0));c.fillStyle=g;c.fillRect(0,0,W,H);const R=M.rand(7);for(let i=0;i<34;i++){const x=(R()*W+t*u*.012*(R()+.2))%W,y=(R()*H+H-t*u*.007*R())%H,s=u*(.0012+R()*.0026);c.fillStyle=RA(tint,MAX(0,.22+.25*Math.sin(t*1.7+i)));c.beginPath();c.arc(x,y,s,0,M.TAU);c.fill()}c.restore()};",ux=[Xc("hist-window-light","Nắng cửa sổ trượt trên cảnh",6,{color:"#ffb35c",numberValue:.8},`function render(ctx,t,env){
11395
11461
  ${Fc}
11396
11462
  // Warm window light sweeping slowly across the shot (a look over a wall, a photo or footage): the tilted shape of a
@@ -12956,8 +13022,8 @@ function render(t,env){
12956
13022
  const m=num.userData.set(e.outCubic(M.range(t,.3,2.6)));m.material.opacity=M.range(t,.3,.5);num.scale.setScalar(Math.max(.001,nfit*k*pulse))
12957
13023
  const lk=e.outCubic(M.range(t,.6,1.1));label.material.opacity=lk;label.position.y=-1.75-(1-lk)*.25
12958
13024
  M3.orbit(env.camera,.12*Math.sin(t*.6),{radius:dist,height:0,target:[0,-.05,0]})
12959
- }`)],Di=Object.freeze({id:"clipoox3d",name:"Clipoox 3D",tag:"Cảnh 3D SaaS kiểu đất sét bóng: màn hình, điện thoại, bảng số liệu, logo Clipoox"}),Sx=Hi+"const LM0='#8afb00',BK='#0d0d0d',WH='#f4f6f0';let A=LM0,MT=null;const TONE={graphite:['#262a21','#0a0b09'],moss:['#1d2a10','#060905'],haze:['#2b3125','#0b0d0a']};const CBG=(scene,env,tone,gl)=>BGP(scene,env,{top:TONE[tone][0],bot:TONE[tone][1],glows:(gl||[[.5,.45,.55,.18]]).map(v=>[v[0],v[1],v[2],A,v[3]]),vig:.5});const MATS=()=>({dark:M3.glossy('#23271f',{roughness:.32}),light:M3.glossy('#eef1ea',{roughness:.28}),lime:M3.glossy(A,{roughness:.22}),silver:M3.metal('#c9cdc4',{roughness:.26}),glass:M3.glass('#e9ffd0',{opacity:.3}),ink:M3.glossy(BK,{roughness:.3}),glow:M3.glow(A)});const FLAME=()=>{const P=(x,y)=>[(x-256)/318,(251-y)/318],s=new THREE.Shape(),o=P(256,410);s.moveTo(o[0],o[1]);const B=(a,b,c,d,e,f)=>{const p1=P(a,b),p2=P(c,d),p3=P(e,f);s.bezierCurveTo(p1[0],p1[1],p2[0],p2[1],p3[0],p3[1])};B(170,410,113,346,118,270);B(121,218,148,180,186,146);B(184,168,190,186,204,198);B(214,150,238,114,272,92);B(280,128,302,150,336,172);B(374,198,396,238,396,280);B(396,353,334,410,256,410);const h=new THREE.Path(),c=P(258,290);h.absarc(c[0],c[1],60/318,0,Math.PI*2,true);s.holes.push(h);return s};const APPT=s=>{const g=new THREE.Group();g.add(EL(M3.roundedBox(s,s,s*.24,s*.23),MT.lime));const fg=new THREE.ExtrudeGeometry(FLAME(),{depth:.14,bevelEnabled:true,bevelThickness:.03,bevelSize:.02,bevelSegments:2,curveSegments:12});fg.center();const f=EL(fg,MT.ink);f.scale.setScalar(s*.6);f.position.z=s*.12+.02;g.add(f);return g};const UI=(kind,w,h,o)=>{o=o||{};return M3.paint(w,h,(x,W,H)=>{const u=Math.min(W,H*2.4)/400,lt=!!o.light,bg=lt?'#f6f7f2':'#171a16',ln=lt?'rgba(0,0,0,.10)':'rgba(255,255,255,.12)',ln2=lt?'rgba(0,0,0,.2)':'rgba(255,255,255,.3)',ink=lt?'#15171a':'#eef2ea',a=A;const RR=(X,Y,w2,h2,r,c)=>{x.fillStyle=c;x.beginPath();x.roundRect(X,Y,Math.max(1,w2),Math.max(1,h2),Math.max(0,Math.min(r,h2/2,w2/2)));x.fill()};RR(0,0,W,H,18*u,bg);const bar=o.bar!==false;if(bar){[0,1,2].forEach(i=>{x.fillStyle=i?ln2:a;x.beginPath();x.arc(22*u+i*16*u,20*u,5*u,0,M.TAU);x.fill()});RR(80*u,16*u,W*.35,8*u,4*u,ln)}const L=18*u,R=W-18*u,T=bar?40*u:16*u,B=H-16*u,cw=R-L,ch=B-T;const BARS=(X,Y,w2,h2,v)=>v.forEach((k,i)=>{const bw=w2/v.length*.62,bx=X+i*w2/v.length+(w2/v.length-bw)/2;RR(bx,Y+h2*(1-k),bw,h2*k,5*u,i===v.length-1?a:ln2)});const LINE=(X,Y,w2,h2,v)=>{x.beginPath();v.forEach((k,i)=>{const px=X+i*w2/(v.length-1),py=Y+h2*(1-k);i?x.lineTo(px,py):x.moveTo(px,py)});x.strokeStyle=a;x.lineWidth=5*u;x.lineJoin='round';x.lineCap='round';x.stroke();x.lineTo(X+w2,Y+h2);x.lineTo(X,Y+h2);x.closePath();const g=x.createLinearGradient(0,Y,0,Y+h2);g.addColorStop(0,M.rgba(a,.35));g.addColorStop(1,M.rgba(a,0));x.fillStyle=g;x.fill()};const AV=(X,Y,r,l)=>{r=Math.max(2,r);x.fillStyle=a;x.beginPath();x.arc(X,Y,r,0,M.TAU);x.fill();x.fillStyle=BK;x.font='800 '+Math.round(r*1.1)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText(l||'C',X,Y+r*.05)};if(kind==='bars')BARS(L,T+6*u,cw,ch-6*u,[.45,.7,.55,.85,.62,1]);else if(kind==='line')LINE(L,T+8*u,cw,ch-8*u,[.3,.5,.42,.7,.6,.92]);else if(kind==='table'){const n=Math.max(2,Math.min(5,Math.floor(ch/(34*u))));for(let i=0;i<n;i++){const y=T+i*ch/n+ch/n/2;x.fillStyle=ln2;x.beginPath();x.arc(L+10*u,y,8*u,0,M.TAU);x.fill();RR(L+28*u,y-5*u,cw*.38,10*u,5*u,ln2);RR(L+28*u+cw*.45,y-5*u,cw*.2,10*u,5*u,ln);RR(R-50*u,y-8*u,50*u,16*u,8*u,i===1?a:ln)}}else if(kind==='video'){RR(L,T,cw,ch-26*u,10*u,'#0b0c0a');const cx=L+cw/2,cy=T+(ch-26*u)/2,r=Math.min(cw,ch)*.16;x.fillStyle=a;x.beginPath();x.arc(cx,cy,r,0,M.TAU);x.fill();x.fillStyle=BK;x.beginPath();x.moveTo(cx-r*.3,cy-r*.45);x.lineTo(cx+r*.5,cy);x.lineTo(cx-r*.3,cy+r*.45);x.closePath();x.fill();RR(L,B-12*u,cw,8*u,4*u,ln2);RR(L,B-12*u,cw*.42,8*u,4*u,a)}else if(kind==='profile'||kind==='chip'){const r=Math.min(ch*.4,30*u);AV(L+r+2*u,T+ch/2,r,o.letter);RR(L+r*2+16*u,T+ch/2-r*.55,cw*.45,r*.42,r*.2,ink);RR(L+r*2+16*u,T+ch/2+r*.15,cw*.3,r*.34,r*.17,ln2)}else if(kind==='donut'){const cx=W/2,cy=T+ch/2,r=Math.min(cw,ch)*.36;x.lineWidth=r*.36;x.strokeStyle=ln2;x.beginPath();x.arc(cx,cy,Math.max(1,r),0,M.TAU);x.stroke();x.strokeStyle=a;x.lineCap='round';x.beginPath();x.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*.68);x.stroke();x.fillStyle=ink;x.font='800 '+Math.round(r*.55)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText('68%',cx,cy)}else if(kind==='chat'){[[0,.62,0],[1,.5,1],[0,.4,0]].forEach((v,i)=>{const bw=cw*v[1],y=T+i*ch/3+4*u,bh=ch/3-10*u;RR(v[0]?R-bw:L,y,bw,bh,bh/2,v[2]?a:ln2)})}else if(kind==='post'){const s=ch;const g=x.createLinearGradient(L,T,L+s,T+s);g.addColorStop(0,a);g.addColorStop(1,M.mix(a,'#1a2a05',.6));RR(L,T,s,s,8*u,g);RR(L+s+14*u,T+s*.18,cw-s-14*u,s*.2,s*.1,ink);RR(L+s+14*u,T+s*.56,(cw-s-14*u)*.6,s*.18,s*.09,ln2)}else if(kind==='feed'){RR(L,T,cw*.5,22*u,11*u,a);for(let i=0;i<4;i++){const y=T+40*u+i*(ch-40*u)/4,hh=(ch-40*u)/4-14*u;RR(L,y,cw,hh,14*u,ln);RR(L+10*u,y+10*u,hh-20*u,hh-20*u,10*u,i%2?ln2:M.rgba(a,.75));RR(L+hh,y+hh*.25,cw*.45,hh*.14,hh*.07,ink);RR(L+hh,y+hh*.55,cw*.3,hh*.12,hh*.06,ln2)}}else if(kind==='glyph'){const cx=W/2,cy=H/2,s=W*.24;x.strokeStyle=a;x.fillStyle=a;x.lineWidth=W*.055;x.lineJoin='round';x.lineCap='round';x.beginPath();const g=o.g;if(g==='chat'){x.roundRect(cx-s,cy-s*.75,s*2,s*1.35,s*.4);x.moveTo(cx-s*.4,cy+s*.6);x.lineTo(cx-s*.7,cy+s);x.lineTo(cx-s*.05,cy+s*.6);x.stroke();[-.45,0,.45].forEach(d=>{x.beginPath();x.arc(cx+d*s,cy-s*.08,s*.12,0,M.TAU);x.fill()})}else if(g==='bag'){x.roundRect(cx-s*.85,cy-s*.4,s*1.7,s*1.35,s*.2);x.stroke();x.beginPath();x.arc(cx,cy-s*.4,s*.45,Math.PI,0);x.stroke()}else if(g==='globe'){x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.ellipse(cx,cy,s*.42,s,0,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s,cy);x.lineTo(cx+s,cy);x.moveTo(cx-s*.85,cy-s*.5);x.lineTo(cx+s*.85,cy-s*.5);x.moveTo(cx-s*.85,cy+s*.5);x.lineTo(cx+s*.85,cy+s*.5);x.stroke()}else if(g==='mega'){x.moveTo(cx-s*.8,cy-s*.3);x.lineTo(cx+s*.6,cy-s*.85);x.lineTo(cx+s*.6,cy+s*.85);x.lineTo(cx-s*.8,cy+s*.3);x.closePath();x.stroke();x.beginPath();x.moveTo(cx-s*.45,cy+s*.35);x.lineTo(cx-s*.3,cy+s*.95);x.stroke()}else if(g==='mail'){x.roundRect(cx-s,cy-s*.7,s*2,s*1.4,s*.15);x.moveTo(cx-s*.9,cy-s*.55);x.lineTo(cx,cy+s*.1);x.lineTo(cx+s*.9,cy-s*.55);x.stroke()}else {x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s*.3,cy-s*.45);x.lineTo(cx+s*.5,cy);x.lineTo(cx-s*.3,cy+s*.45);x.closePath();x.fill()}}else if(kind==='toolbar'){AV(L+ch*.4,T+ch/2,ch*.34,'C');for(let i=0;i<4;i++)RR(L+ch+i*cw*.13,T+ch*.32,cw*.1,ch*.36,ch*.18,i===0?a:ln2);RR(R-cw*.16,T+ch*.22,cw*.16,ch*.56,ch*.28,a)}else if(kind==='panel'){x.strokeStyle=ln;x.lineWidth=1.5*u;for(let i=1;i<6;i++){const y=T+i*ch/6;x.beginPath();x.moveTo(L,y);x.lineTo(R,y);x.stroke()}}else {const sw=cw*.16;RR(L,T,sw,ch,10*u,ln);for(let i=0;i<4;i++)RR(L+10*u,T+14*u+i*26*u,sw-20*u,10*u,5*u,i?ln2:a);const X=L+sw+12*u,cw2=R-X;for(let i=0;i<3;i++){RR(X+i*cw2/3,T,cw2/3-10*u,ch*.26,10*u,ln);RR(X+i*cw2/3+10*u,T+ch*.07,cw2/3*.4,ch*.06,4*u,ln2);RR(X+i*cw2/3+10*u,T+ch*.16,cw2/3*.55,ch*.06,4*u,i?ink:a)}BARS(X,T+ch*.34,cw2*.45,ch*.64,[.4,.62,.5,.8,.66,1]);LINE(X+cw2*.52,T+ch*.36,cw2*.48,ch*.6,[.25,.45,.35,.62,.55,.85])}})};const CARD=(w,h,kind,o)=>{o=o||{};const g=new THREE.Group(),d=o.d||.09,r=o.r||Math.min(w,h)*.14;g.add(EL(M3.roundedBox(w,h,d,r),o.light?MT.light:MT.dark));const px=Math.min(640,Math.max(220,Math.round(240*w))),f=EL(new THREE.PlaneGeometry(w-.05,h-.05),new THREE.MeshBasicMaterial({map:UI(kind,px,Math.round(px*(h-.05)/(w-.05)),o),alphaTest:.5,toneMapped:false}));f.position.z=d/2+.004;g.add(f);return g};const FLOATS=(parent,n,seed,bx)=>{const r=M.rand(seed),geos=[new THREE.TorusGeometry(.3,.12,12,32),new THREE.SphereGeometry(.24,22,14),M3.roundedBox(.36,.36,.36,.08),new THREE.CapsuleGeometry(.12,.32,4,10)],mats=[MT.lime,MT.silver,MT.dark,MT.glass,MT.lime,MT.light],out=[];for(let i=0;i<n;i++){const m=EL(geos[i%4],mats[Math.floor(r()*mats.length)]);m.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],s:.55+r()*.7,ph:r()*6.3,sp:[(r()-.5)*1.4,(r()-.5)*1.4,(r()-.5)*.8],r0:[r()*6,r()*6,r()*6]};parent.add(m);out.push(m)}return out};const FLOATU=(list,t,t0,amp)=>list.forEach((m,i)=>{const u=m.userData,b=u.b,a=amp??1,k=M.ease.outBack(M.range(t,t0+i*.04,t0+.55+i*.04));m.position.set(b[0]+Math.sin(t*.5+u.ph)*.18*a,b[1]+Math.sin(t*.8+u.ph*1.3)*.22*a,b[2]);m.rotation.set(u.r0[0]+t*u.sp[0],u.r0[1]+t*u.sp[1],u.r0[2]+t*u.sp[2]);m.scale.setScalar(Math.max(.001,u.s*k))});const BOKEH=(parent,n,seed,bx)=>{const r=M.rand(seed),out=[];for(let i=0;i<n;i++){const s=new THREE.Sprite(new THREE.SpriteMaterial({map:SOFT(),color:new THREE.Color(r()<.6?A:'#ffffff'),transparent:true,opacity:.08+r()*.2,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));const z=.4+r()*1.6;s.scale.set(z,z,1);s.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],ph:r()*6.3,o:s.material.opacity};parent.add(s);out.push(s)}return out};const BOKU=(list,t,k)=>list.forEach(s=>{const u=s.userData;s.position.set(u.b[0]+Math.sin(t*.3+u.ph)*.3,u.b[1]+Math.cos(t*.25+u.ph)*.3,u.b[2]);s.material.opacity=u.o*k});const PED=r=>{const g=new THREE.Group();g.add(EL(new THREE.CylinderGeometry(r,r*1.05,.42,56),MT.dark));const ring=EL(new THREE.TorusGeometry(r*1.005,.035,8,80),MT.glow);ring.rotation.x=Math.PI/2;ring.position.y=.21;g.add(ring);const disc=EL(new THREE.PlaneGeometry(r*3.4,r*3.4),new THREE.MeshBasicMaterial({map:SOFT(),color:new THREE.Color(A),transparent:true,opacity:.5,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));disc.rotation.x=-Math.PI/2;disc.position.y=-.22;g.add(disc);g.userData={ring,disc};return g};const CURSOR=()=>{const s=new THREE.Shape();[[0,0],[0,-.62],[.16,-.48],[.27,-.72],[.37,-.67],[.26,-.44],[.46,-.44]].forEach((p,i)=>i?s.lineTo(p[0],p[1]):s.moveTo(p[0],p[1]));s.closePath();return EL(new THREE.ExtrudeGeometry(s,{depth:.05,bevelEnabled:true,bevelThickness:.02,bevelSize:.02,bevelSegments:2}),M3.glossy('#ffffff',{roughness:.2}))};const RIPPLE=()=>EL(new THREE.RingGeometry(.16,.22,48),M3.glow(A,{transparent:true,opacity:0,depthWrite:false,side:THREE.DoubleSide}));const INIT=(scene,env)=>{FT=env.fonts.mont;A=env.params.color||LM0;MT=MATS();M3.studio(scene,{intensity:1.05,rim:M.mix(A,'#ffffff',.4)});return env.height>env.width};",ea=(t,e,c,a,o)=>({id:t,name:e,category:"Clipoox 3D",pack:Di.id,kind:"three",duration:c,params:{...a,color:"#8afb00",bg:!0},code:Sx+`
12960
- `+o}),vx=[ea("c3d-monitor-pedestal","Màn hình trên bệ sáng 3D",6,{title:"Mọi kênh bán hàng, một màn hình"},`// Monitor on a glowing round pedestal; UI cards fly out of the screen and stack around it; headline above.
13025
+ }`)],Di=Object.freeze({id:"clipoox3d",name:"Clipoox 3D",tag:"Cảnh 3D SaaS kiểu đất sét bóng: màn hình, điện thoại, bảng số liệu, logo Clipoox"}),Sx=Hi+"const LM0='#8afb00',BK='#0d0d0d',WH='#f4f6f0';let A=LM0,MT=null;const TONE={graphite:['#262a21','#0a0b09'],moss:['#1d2a10','#060905'],haze:['#2b3125','#0b0d0a']};const CBG=(scene,env,tone,gl)=>BGP(scene,env,{top:TONE[tone][0],bot:TONE[tone][1],glows:(gl||[[.5,.45,.55,.18]]).map(v=>[v[0],v[1],v[2],A,v[3]]),vig:.5});const MATS=()=>({dark:M3.glossy('#23271f',{roughness:.32}),light:M3.glossy('#eef1ea',{roughness:.28}),lime:M3.glossy(A,{roughness:.22}),silver:M3.metal('#c9cdc4',{roughness:.26}),glass:M3.glass('#e9ffd0',{opacity:.3}),ink:M3.glossy(BK,{roughness:.3}),glow:M3.glow(A)});const FLAME=()=>{const P=(x,y)=>[(x-256)/318,(251-y)/318],s=new THREE.Shape(),o=P(256,410);s.moveTo(o[0],o[1]);const B=(a,b,c,d,e,f)=>{const p1=P(a,b),p2=P(c,d),p3=P(e,f);s.bezierCurveTo(p1[0],p1[1],p2[0],p2[1],p3[0],p3[1])};B(170,410,113,346,118,270);B(121,218,148,180,186,146);B(184,168,190,186,204,198);B(214,150,238,114,272,92);B(280,128,302,150,336,172);B(374,198,396,238,396,280);B(396,353,334,410,256,410);const h=new THREE.Path(),c=P(258,290);h.absarc(c[0],c[1],60/318,0,Math.PI*2,true);s.holes.push(h);return s};const APPT=s=>{const g=new THREE.Group();g.add(EL(M3.roundedBox(s,s,s*.24,s*.23),MT.lime));const fg=new THREE.ExtrudeGeometry(FLAME(),{depth:.14,bevelEnabled:true,bevelThickness:.03,bevelSize:.02,bevelSegments:2,curveSegments:12});fg.center();const f=EL(fg,MT.ink);f.scale.setScalar(s*.6);f.position.z=s*.12+.02;g.add(f);return g};const UI=(kind,w,h,o)=>{o=o||{};return M3.paint(w,h,(x,W,H)=>{const u=Math.min(W,H*2.4)/400,lt=!!o.light,bg=lt?'#f6f7f2':'#171a16',ln=lt?'rgba(0,0,0,.10)':'rgba(255,255,255,.12)',ln2=lt?'rgba(0,0,0,.2)':'rgba(255,255,255,.3)',ink=lt?'#15171a':'#eef2ea',a=A;const RR=(X,Y,w2,h2,r,c)=>{x.fillStyle=c;x.beginPath();x.roundRect(X,Y,Math.max(1,w2),Math.max(1,h2),Math.max(0,Math.min(r,h2/2,w2/2)));x.fill()};RR(0,0,W,H,18*u,bg);const bar=o.bar!==false;if(bar){[0,1,2].forEach(i=>{x.fillStyle=i?ln2:a;x.beginPath();x.arc(22*u+i*16*u,20*u,5*u,0,M.TAU);x.fill()});RR(80*u,16*u,W*.35,8*u,4*u,ln)}const L=18*u,R=W-18*u,T=bar?40*u:16*u,B=H-16*u,cw=R-L,ch=B-T;const BARS=(X,Y,w2,h2,v)=>v.forEach((k,i)=>{const bw=w2/v.length*.62,bx=X+i*w2/v.length+(w2/v.length-bw)/2;RR(bx,Y+h2*(1-k),bw,h2*k,5*u,i===v.length-1?a:ln2)});const LINE=(X,Y,w2,h2,v)=>{x.beginPath();v.forEach((k,i)=>{const px=X+i*w2/(v.length-1),py=Y+h2*(1-k);i?x.lineTo(px,py):x.moveTo(px,py)});x.strokeStyle=a;x.lineWidth=5*u;x.lineJoin='round';x.lineCap='round';x.stroke();x.lineTo(X+w2,Y+h2);x.lineTo(X,Y+h2);x.closePath();const g=x.createLinearGradient(0,Y,0,Y+h2);g.addColorStop(0,M.rgba(a,.35));g.addColorStop(1,M.rgba(a,0));x.fillStyle=g;x.fill()};const AV=(X,Y,r,l)=>{r=Math.max(2,r);x.fillStyle=a;x.beginPath();x.arc(X,Y,r,0,M.TAU);x.fill();x.fillStyle=BK;x.font='800 '+Math.round(r*1.1)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText(l||'C',X,Y+r*.05)};if(kind==='bars')BARS(L,T+6*u,cw,ch-6*u,[.45,.7,.55,.85,.62,1]);else if(kind==='line')LINE(L,T+8*u,cw,ch-8*u,[.3,.5,.42,.7,.6,.92]);else if(kind==='table'){const n=Math.max(2,Math.min(5,Math.floor(ch/(34*u))));for(let i=0;i<n;i++){const y=T+i*ch/n+ch/n/2;x.fillStyle=ln2;x.beginPath();x.arc(L+10*u,y,8*u,0,M.TAU);x.fill();RR(L+28*u,y-5*u,cw*.38,10*u,5*u,ln2);RR(L+28*u+cw*.45,y-5*u,cw*.2,10*u,5*u,ln);RR(R-50*u,y-8*u,50*u,16*u,8*u,i===1?a:ln)}}else if(kind==='video'){RR(L,T,cw,ch-26*u,10*u,'#0b0c0a');const cx=L+cw/2,cy=T+(ch-26*u)/2,r=Math.min(cw,ch)*.16;x.fillStyle=a;x.beginPath();x.arc(cx,cy,r,0,M.TAU);x.fill();x.fillStyle=BK;x.beginPath();x.moveTo(cx-r*.3,cy-r*.45);x.lineTo(cx+r*.5,cy);x.lineTo(cx-r*.3,cy+r*.45);x.closePath();x.fill();RR(L,B-12*u,cw,8*u,4*u,ln2);RR(L,B-12*u,cw*.42,8*u,4*u,a)}else if(kind==='profile'||kind==='chip'){const r=Math.min(ch*.4,30*u);AV(L+r+2*u,T+ch/2,r,o.letter);RR(L+r*2+16*u,T+ch/2-r*.55,cw*.45,r*.42,r*.2,ink);RR(L+r*2+16*u,T+ch/2+r*.15,cw*.3,r*.34,r*.17,ln2)}else if(kind==='donut'){const cx=W/2,cy=T+ch/2,r=Math.min(cw,ch)*.36;x.lineWidth=r*.36;x.strokeStyle=ln2;x.beginPath();x.arc(cx,cy,Math.max(1,r),0,M.TAU);x.stroke();x.strokeStyle=a;x.lineCap='round';x.beginPath();x.arc(cx,cy,r,-Math.PI/2,-Math.PI/2+M.TAU*.68);x.stroke();x.fillStyle=ink;x.font='800 '+Math.round(r*.55)+'px '+FT;x.textAlign='center';x.textBaseline='middle';x.fillText('68%',cx,cy)}else if(kind==='chat'){[[0,.62,0],[1,.5,1],[0,.4,0]].forEach((v,i)=>{const bw=cw*v[1],y=T+i*ch/3+4*u,bh=ch/3-10*u;RR(v[0]?R-bw:L,y,bw,bh,bh/2,v[2]?a:ln2)})}else if(kind==='post'){const s=ch;const g=x.createLinearGradient(L,T,L+s,T+s);g.addColorStop(0,a);g.addColorStop(1,M.mix(a,'#1a2a05',.6));RR(L,T,s,s,8*u,g);RR(L+s+14*u,T+s*.18,cw-s-14*u,s*.2,s*.1,ink);RR(L+s+14*u,T+s*.56,(cw-s-14*u)*.6,s*.18,s*.09,ln2)}else if(kind==='feed'){RR(L,T,cw*.5,22*u,11*u,a);for(let i=0;i<4;i++){const y=T+40*u+i*(ch-40*u)/4,hh=(ch-40*u)/4-14*u;RR(L,y,cw,hh,14*u,ln);RR(L+10*u,y+10*u,hh-20*u,hh-20*u,10*u,i%2?ln2:M.rgba(a,.75));RR(L+hh,y+hh*.25,cw*.45,hh*.14,hh*.07,ink);RR(L+hh,y+hh*.55,cw*.3,hh*.12,hh*.06,ln2)}}else if(kind==='glyph'){const cx=W/2,cy=H/2,s=W*.24;x.strokeStyle=a;x.fillStyle=a;x.lineWidth=W*.055;x.lineJoin='round';x.lineCap='round';x.beginPath();const g=o.g;if(g==='chat'){x.roundRect(cx-s,cy-s*.75,s*2,s*1.35,s*.4);x.moveTo(cx-s*.4,cy+s*.6);x.lineTo(cx-s*.7,cy+s);x.lineTo(cx-s*.05,cy+s*.6);x.stroke();[-.45,0,.45].forEach(d=>{x.beginPath();x.arc(cx+d*s,cy-s*.08,s*.12,0,M.TAU);x.fill()})}else if(g==='bag'){x.roundRect(cx-s*.85,cy-s*.4,s*1.7,s*1.35,s*.2);x.stroke();x.beginPath();x.arc(cx,cy-s*.4,s*.45,Math.PI,0);x.stroke()}else if(g==='globe'){x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.ellipse(cx,cy,s*.42,s,0,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s,cy);x.lineTo(cx+s,cy);x.moveTo(cx-s*.85,cy-s*.5);x.lineTo(cx+s*.85,cy-s*.5);x.moveTo(cx-s*.85,cy+s*.5);x.lineTo(cx+s*.85,cy+s*.5);x.stroke()}else if(g==='mega'){x.moveTo(cx-s*.8,cy-s*.3);x.lineTo(cx+s*.6,cy-s*.85);x.lineTo(cx+s*.6,cy+s*.85);x.lineTo(cx-s*.8,cy+s*.3);x.closePath();x.stroke();x.beginPath();x.moveTo(cx-s*.45,cy+s*.35);x.lineTo(cx-s*.3,cy+s*.95);x.stroke()}else if(g==='mail'){x.roundRect(cx-s,cy-s*.7,s*2,s*1.4,s*.15);x.moveTo(cx-s*.9,cy-s*.55);x.lineTo(cx,cy+s*.1);x.lineTo(cx+s*.9,cy-s*.55);x.stroke()}else {x.arc(cx,cy,s,0,M.TAU);x.stroke();x.beginPath();x.moveTo(cx-s*.3,cy-s*.45);x.lineTo(cx+s*.5,cy);x.lineTo(cx-s*.3,cy+s*.45);x.closePath();x.fill()}}else if(kind==='toolbar'){AV(L+ch*.4,T+ch/2,ch*.34,'C');for(let i=0;i<4;i++)RR(L+ch+i*cw*.13,T+ch*.32,cw*.1,ch*.36,ch*.18,i===0?a:ln2);RR(R-cw*.16,T+ch*.22,cw*.16,ch*.56,ch*.28,a)}else if(kind==='panel'){x.strokeStyle=ln;x.lineWidth=1.5*u;for(let i=1;i<6;i++){const y=T+i*ch/6;x.beginPath();x.moveTo(L,y);x.lineTo(R,y);x.stroke()}}else {const sw=cw*.16;RR(L,T,sw,ch,10*u,ln);for(let i=0;i<4;i++)RR(L+10*u,T+14*u+i*26*u,sw-20*u,10*u,5*u,i?ln2:a);const X=L+sw+12*u,cw2=R-X;for(let i=0;i<3;i++){RR(X+i*cw2/3,T,cw2/3-10*u,ch*.26,10*u,ln);RR(X+i*cw2/3+10*u,T+ch*.07,cw2/3*.4,ch*.06,4*u,ln2);RR(X+i*cw2/3+10*u,T+ch*.16,cw2/3*.55,ch*.06,4*u,i?ink:a)}BARS(X,T+ch*.34,cw2*.45,ch*.64,[.4,.62,.5,.8,.66,1]);LINE(X+cw2*.52,T+ch*.36,cw2*.48,ch*.6,[.25,.45,.35,.62,.55,.85])}})};const CARD=(w,h,kind,o)=>{o=o||{};const g=new THREE.Group(),d=o.d||.09,r=o.r||Math.min(w,h)*.14;g.add(EL(M3.roundedBox(w,h,d,r),o.light?MT.light:MT.dark));const px=Math.min(640,Math.max(220,Math.round(240*w))),f=EL(new THREE.PlaneGeometry(w-.05,h-.05),new THREE.MeshBasicMaterial({map:UI(kind,px,Math.round(px*(h-.05)/(w-.05)),o),alphaTest:.5,toneMapped:false}));f.position.z=d/2+.004;g.add(f);return g};const FLOATS=(parent,n,seed,bx)=>{const r=M.rand(seed),geos=[new THREE.TorusGeometry(.3,.12,12,32),new THREE.SphereGeometry(.24,22,14),M3.roundedBox(.36,.36,.36,.08),new THREE.CapsuleGeometry(.12,.32,4,10)],mats=[MT.lime,MT.silver,MT.dark,MT.glass,MT.lime,MT.light],out=[];for(let i=0;i<n;i++){const m=EL(geos[i%4],mats[Math.floor(r()*mats.length)]);m.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],s:.55+r()*.7,ph:r()*6.3,sp:[(r()-.5)*1.4,(r()-.5)*1.4,(r()-.5)*.8],r0:[r()*6,r()*6,r()*6]};parent.add(m);out.push(m)}return out};const FLOATU=(list,t,t0,amp)=>list.forEach((m,i)=>{const u=m.userData,b=u.b,a=amp??1,k=M.ease.outBack(M.range(t,t0+i*.04,t0+.55+i*.04));m.position.set(b[0]+Math.sin(t*.5+u.ph)*.18*a,b[1]+Math.sin(t*.8+u.ph*1.3)*.22*a,b[2]);m.rotation.set(u.r0[0]+t*u.sp[0],u.r0[1]+t*u.sp[1],u.r0[2]+t*u.sp[2]);m.scale.setScalar(Math.max(.001,u.s*k))});const BOKEH=(parent,n,seed,bx)=>{const r=M.rand(seed),out=[];for(let i=0;i<n;i++){const s=new THREE.Sprite(new THREE.SpriteMaterial({map:SOFT(),color:new THREE.Color(r()<.6?A:'#ffffff'),transparent:true,opacity:.08+r()*.2,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));const z=.4+r()*1.6;s.scale.set(z,z,1);s.userData={b:[bx[0]+r()*(bx[1]-bx[0]),bx[2]+r()*(bx[3]-bx[2]),bx[4]+r()*(bx[5]-bx[4])],ph:r()*6.3,o:s.material.opacity};parent.add(s);out.push(s)}return out};const BOKU=(list,t,k)=>list.forEach(s=>{const u=s.userData;s.position.set(u.b[0]+Math.sin(t*.3+u.ph)*.3,u.b[1]+Math.cos(t*.25+u.ph)*.3,u.b[2]);s.material.opacity=u.o*k});const PED=r=>{const g=new THREE.Group();g.add(EL(new THREE.CylinderGeometry(r,r*1.05,.42,56),MT.dark));const ring=EL(new THREE.TorusGeometry(r*1.005,.035,8,80),MT.glow);ring.rotation.x=Math.PI/2;ring.position.y=.21;g.add(ring);const disc=EL(new THREE.PlaneGeometry(r*3.4,r*3.4),new THREE.MeshBasicMaterial({map:SOFT(),color:new THREE.Color(A),transparent:true,opacity:.5,depthWrite:false,blending:THREE.AdditiveBlending,toneMapped:false}));disc.rotation.x=-Math.PI/2;disc.position.y=-.22;g.add(disc);g.userData={ring,disc};return g};const CURSOR=()=>{const s=new THREE.Shape();[[0,0],[0,-.62],[.16,-.48],[.27,-.72],[.37,-.67],[.26,-.44],[.46,-.44]].forEach((p,i)=>i?s.lineTo(p[0],p[1]):s.moveTo(p[0],p[1]));s.closePath();return EL(new THREE.ExtrudeGeometry(s,{depth:.05,bevelEnabled:true,bevelThickness:.02,bevelSize:.02,bevelSegments:2}),M3.glossy('#ffffff',{roughness:.2}))};const RIPPLE=()=>EL(new THREE.RingGeometry(.16,.22,48),M3.glow(A,{transparent:true,opacity:0,depthWrite:false,side:THREE.DoubleSide}));const INIT=(scene,env)=>{FT=env.fonts.mont;A=env.params.color||LM0;MT=MATS();M3.studio(scene,{intensity:1.05,rim:M.mix(A,'#ffffff',.4)});return env.height>env.width};",ca=(t,e,c,a,o)=>({id:t,name:e,category:"Clipoox 3D",pack:Di.id,kind:"three",duration:c,params:{...a,color:"#8afb00",bg:!0},code:Sx+`
13026
+ `+o}),vx=[ca("c3d-monitor-pedestal","Màn hình trên bệ sáng 3D",6,{title:"Mọi kênh bán hàng, một màn hình"},`// Monitor on a glowing round pedestal; UI cards fly out of the screen and stack around it; headline above.
12961
13027
  let root,mon,ped,cards=[],fl=[],bk=[],title,dist=10,port=false,spots=[],ty=2.75
12962
13028
  function setup(THREE,scene,camera,env){
12963
13029
  const p=env.params;port=INIT(scene,env)
@@ -12988,7 +13054,7 @@ function render(t,env){
12988
13054
  const tk=e.outCubic(M.range(t,1.2,1.9));title.material.opacity=tk;title.position.set(0,ty-(1-tk)*.3,.4)
12989
13055
  const a=M.lerp(port?-.16:-.3,port?.16:.28,e.inOutCubic(t/D))
12990
13056
  M3.orbit(env.camera,a,{radius:dist*(1.06-.06*e.outCubic(t/D)),height:dist*.1,target:[0,port?.25:.5,0]})
12991
- }`),ea("c3d-phone-feed","Điện thoại & thẻ nội dung xếp chồng 3D",5,{big:"10x",text:"nội dung mỗi ngày"},`// A tilted phone; content cards multiply out of its screen and stack fast; a big counting number + caption.
13057
+ }`),ca("c3d-phone-feed","Điện thoại & thẻ nội dung xếp chồng 3D",5,{big:"10x",text:"nội dung mỗi ngày"},`// A tilted phone; content cards multiply out of its screen and stack fast; a big counting number + caption.
12992
13058
  let root,phone,stack=[],num,cap,fl=[],bk=[],dist,port,np,nfit=1
12993
13059
  function setup(THREE,scene,camera,env){
12994
13060
  const p=env.params;port=INIT(scene,env)
@@ -13019,7 +13085,7 @@ function render(t,env){
13019
13085
  const ck=e.outCubic(M.range(t,.9,1.4));cap.material.opacity=ck
13020
13086
  FLOATU(fl,t,.2,1);BOKU(bk,t,M.range(t,0,1))
13021
13087
  M3.orbit(env.camera,M.lerp(-.14,.12,e.inOutCubic(t/D)),{radius:dist*(1.05-.05*e.outCubic(t/D)),height:dist*.06,target:[0,port?.1:0,0]})
13022
- }`),ea("c3d-floating-chaos","Thẻ bay hỗn loạn rồi đứng hình 3D",5,{title:"Quá nhiều việc rời rạc?"},`// Cards and shapes tumble in from everywhere, then freeze mid-air (a soft flash); the headline lands in the middle.
13088
+ }`),ca("c3d-floating-chaos","Thẻ bay hỗn loạn rồi đứng hình 3D",5,{title:"Quá nhiều việc rời rạc?"},`// Cards and shapes tumble in from everywhere, then freeze mid-air (a soft flash); the headline lands in the middle.
13023
13089
  let root,items=[],title,flash,dist,port,tfit=1
13024
13090
  function setup(THREE,scene,camera,env){
13025
13091
  const p=env.params;port=INIT(scene,env)
@@ -13044,7 +13110,7 @@ function render(t,env){
13044
13110
  const fk=M.range(t,1.55,2.3);flash.material.opacity=.35*Math.sin(Math.PI*fk)
13045
13111
  const tk=e.outBack(M.range(t,1.75,2.3));title.scale.setScalar(Math.max(.001,tfit*tk));title.material.opacity=M.range(t,1.75,2)
13046
13112
  M3.orbit(env.camera,M.lerp(-.1,.14,e.inOutCubic(t/D)),{radius:dist*(1.12-.12*e.outCubic(M.range(t,0,2))),height:dist*.04,target:[0,0,0]})
13047
- }`),ea("c3d-channel-hub","Logo trung tâm nối các kênh 3D",5,{title:"Một nơi quản lý mọi kênh",items:"Mạng xã hội|Cửa hàng|Website|Quảng cáo"},`// The Clipoox tile in the centre; channel blocks (abstract glyphs) linked to it by glowing lime lines with pulses.
13113
+ }`),ca("c3d-channel-hub","Logo trung tâm nối các kênh 3D",5,{title:"Một nơi quản lý mọi kênh",items:"Mạng xã hội|Cửa hàng|Website|Quảng cáo"},`// The Clipoox tile in the centre; channel blocks (abstract glyphs) linked to it by glowing lime lines with pulses.
13048
13114
  let root,hub,halo,blocks=[],lines=[],pulses=[],labels=[],title,dist,port,ty
13049
13115
  function setup(THREE,scene,camera,env){
13050
13116
  const p=env.params;port=INIT(scene,env)
@@ -13076,7 +13142,7 @@ function render(t,env){
13076
13142
  pulses[i].position.set(d.x*(.85+L*u),d.y*(.85+L*u),-.35);pulses[i].scale.setScalar(on?Math.max(.001,Math.sin(Math.PI*u)):.001)})
13077
13143
  title.material.opacity=e.outCubic(M.range(t,.3,.9))
13078
13144
  M3.orbit(env.camera,M.lerp(-.2,.2,e.inOutCubic(t/D)),{radius:dist*(1.05-.05*e.outCubic(t/D)),height:dist*.08,target:[0,port?.15:.15,0]})
13079
- }`),ea("c3d-dashboard-live","Bảng số liệu trực tiếp 3D",6,{value:"1.250.000",label:"Doanh thu hôm nay"},`// A big 3D dashboard: bars grow, a line draws, the number counts up, a LIVE dot blinks, a cursor taps a bar (ripple).
13145
+ }`),ca("c3d-dashboard-live","Bảng số liệu trực tiếp 3D",6,{value:"1.250.000",label:"Doanh thu hôm nay"},`// A big 3D dashboard: bars grow, a line draws, the number counts up, a LIVE dot blinks, a cursor taps a bar (ripple).
13080
13146
  let root,pg,bars=[],tube,TN=96,head,curve,num,nfit=1,lab,dot,live,cur,rip,side=[],fl=[],bk=[],dist,port,tgt
13081
13147
  function setup(THREE,scene,camera,env){
13082
13148
  const p=env.params;port=INIT(scene,env)
@@ -13116,7 +13182,7 @@ function render(t,env){
13116
13182
  side.forEach((c,i)=>{const kk=e.outBack(M.range(t,1+i*.3,1.6+i*.3)),q=c.userData.p;c.position.set(q[0],q[1]+BOB(t,i),q[2]);c.scale.setScalar(Math.max(.001,kk));c.rotation.set(.06,(q[0]<0?.25:-.25),0)})
13117
13183
  FLOATU(fl,t,.4,1);BOKU(bk,t,M.range(t,0,1))
13118
13184
  M3.orbit(env.camera,M.lerp(port?-.14:-.24,port?.12:.2,e.inOutCubic(t/D)),{radius:dist*(1.05-.05*e.outCubic(t/D)),height:dist*.08,target:[0,0,0]})
13119
- }`),ea("c3d-window-assemble","Cửa sổ UI lắp ráp thành không gian làm việc 3D",6,{title:"Tất cả trong một không gian"},`// Windows (chart, table, video player, profile chips, toolbar) fly in and assemble into one workspace; camera dollies in.
13185
+ }`),ca("c3d-window-assemble","Cửa sổ UI lắp ráp thành không gian làm việc 3D",6,{title:"Tất cả trong một không gian"},`// Windows (chart, table, video player, profile chips, toolbar) fly in and assemble into one workspace; camera dollies in.
13120
13186
  let root,wins=[],back,title,fl=[],bk=[],dist,port,ctr
13121
13187
  function setup(THREE,scene,camera,env){
13122
13188
  const p=env.params;port=INIT(scene,env)
@@ -13142,7 +13208,7 @@ function render(t,env){
13142
13208
  FLOATU(fl,t,.5,1);BOKU(bk,t,M.range(t,0,1))
13143
13209
  const kc=e.inOutCubic(M.range(t,0,4.2))
13144
13210
  M3.orbit(env.camera,M.lerp(port?.35:.55,port?.04:.06,kc)+.03*Math.max(0,t-4.2),{radius:dist*M.lerp(1.5,1.02,kc),height:dist*M.lerp(.3,.06,kc),target:[0,ctr,0]})
13145
- }`),ea("c3d-orbit-shapes","Khối 3D trôi nổi (nền chuyển cảnh)",8,{speed:1},`// Ambient background: glossy donuts, spheres, cubes and capsules drifting with depth (bokeh), slow camera orbit; centre kept clear for text.
13211
+ }`),ca("c3d-orbit-shapes","Khối 3D trôi nổi (nền chuyển cảnh)",8,{speed:1},`// Ambient background: glossy donuts, spheres, cubes and capsules drifting with depth (bokeh), slow camera orbit; centre kept clear for text.
13146
13212
  let root,fl=[],bk=[],near=[],port
13147
13213
  function setup(THREE,scene,camera,env){
13148
13214
  port=INIT(scene,env)
@@ -13158,7 +13224,7 @@ function render(t,env){
13158
13224
  const D=env.duration,s=+env.params.speed||1,e=M.ease
13159
13225
  FLOATU(fl,t*s,-2,1.4);BOKU(bk,t*s,1);BOKU(near,t*s,1)
13160
13226
  M3.orbit(env.camera,-.35+.7*e.inOutQuad(M.clamp(t/D))*Math.min(2,s),{radius:port?14:10,height:.6,target:[0,0,0]})
13161
- }`),ea("c3d-plane-logo","Máy bay giấy hoá logo Clipoox 3D",5,{name:"Clipoox",url:"clipoox.com"},`// A lime glider flies across with a spark trail, then resolves into the Clipoox mark on its app tile + name + url.
13227
+ }`),ca("c3d-plane-logo","Máy bay giấy hoá logo Clipoox 3D",5,{name:"Clipoox",url:"clipoox.com"},`// A lime glider flies across with a spark trail, then resolves into the Clipoox mark on its app tile + name + url.
13162
13228
  let root,gl,trail=[],curve,tile,ring,flash,name,url,sparks=[],dist,port
13163
13229
  function setup(THREE,scene,camera,env){
13164
13230
  const p=env.params;port=INIT(scene,env)
@@ -13450,7 +13516,161 @@ function render(ctx,t,env){
13450
13516
  const rs=M.rand(17+(p.seed|0));ctx.strokeStyle=M.rgba(p.core,.9*e);ctx.lineWidth=1.8*k
13451
13517
  for(let i=0;i<14;i++){const a=-Math.PI*(.05+.9*rs()),d=(40+260*rs())*k*Math.min(1,u*3),l=(8+18*rs())*k;ctx.beginPath();ctx.moveTo(cx+Math.cos(a)*d,cy+Math.sin(a)*d);ctx.lineTo(cx+Math.cos(a)*(d+l),cy+Math.sin(a)*(d+l));ctx.stroke()}
13452
13518
  ctx.restore()
13453
- }`}),ca=[{id:"aurora-bg",name:"Nền aurora",category:"Nền",duration:6,params:{colorA:"#0b1026",colorB:"#6a3cff",colorC:"#00e0c6",speed:1},code:`function render(ctx,t,env){
13519
+ }`}),Ex=Object.freeze({id:"vfx-weapon-slash",name:"Vệt chém kiếm khí",category:"VFX",duration:.55,params:{color:"#38bdf8",core:"#ffffff",angle:-28,arc:155,flip:!1,width:1,size:1,glow:1,speed:1,sparks:!0,seed:13},code:`function render(ctx,t,env){
13520
+ const {width:W,height:H,params:p}=env,spd=Math.max(.3,Math.min(3,Number(p.speed)||1)),D=(env.duration||.55)/spd
13521
+ if(t<0||t>D)return
13522
+ const u=t/D,k=H/720*(p.size||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),cx=(p.x??.5)*W,cy=(p.y??.5)*H
13523
+ const dir=p.flip?-1:1,ang0=(p.angle??-28)*Math.PI/180,span=Math.max(40,Math.min(280,p.arc||155))*Math.PI/180
13524
+ const head=Math.min(1,Math.pow(u/.42,.65)),tail=Math.max(0,Math.min(head,(u-.14)/.78))
13525
+ const fade=Math.pow(Math.max(0,1-Math.max(0,u-.25)/.75),1.35)
13526
+ if(head-tail<.005||fade<=.005)return
13527
+ const R=260*k,wBase=46*k*(p.width||1),N=44
13528
+ const pt=(q,dr)=>{const a=(-span/2+span*q)*dir;return [Math.cos(a)*(R+dr)-R*.58,Math.sin(a)*(R+dr)*.78]}
13529
+ ctx.save();ctx.translate(cx,cy);ctx.rotate(ang0);ctx.globalCompositeOperation='lighter'
13530
+ const drawCrescent=(scaleW,col,alpha,blur)=>{
13531
+ ctx.save();if(blur*gl>0){ctx.shadowColor=p.color;ctx.shadowBlur=blur*gl}
13532
+ ctx.beginPath()
13533
+ for(let i=0;i<=N;i++){const f=i/N,q=tail+(head-tail)*f,w=wBase*scaleW*Math.sin(Math.pow(f,.7)*Math.PI);const [x,y]=pt(q,w*.68);i?ctx.lineTo(x,y):ctx.moveTo(x,y)}
13534
+ for(let i=N;i>=0;i--){const f=i/N,q=tail+(head-tail)*f,w=wBase*scaleW*Math.sin(Math.pow(f,.7)*Math.PI);const [x,y]=pt(q,-w*.32);ctx.lineTo(x,y)}
13535
+ ctx.closePath();ctx.fillStyle=M.rgba(col,Math.min(1,alpha*fade));ctx.fill();ctx.restore()
13536
+ }
13537
+ // Outer plasma sheath, saturated energy blade, razor white-hot core + silky curling qi wisps
13538
+ drawCrescent(2.4,p.color,.16*Math.min(1.6,gl),42*k)
13539
+ drawCrescent(1.85,p.color,.32*Math.min(1.5,gl),28*k)
13540
+ drawCrescent(1.08,p.color,.86,14*k)
13541
+ drawCrescent(.46,p.core,.98,4*k)
13542
+ for(let s=0;s<7;s++){const off=(s-3)*wBase*.28,ph=s*1.3;ctx.beginPath()
13543
+ for(let i=0;i<=N;i++){const f=i/N,q=tail+(head-tail)*f,curl=Math.sin(f*Math.PI*2.5-u*9+ph)*wBase*.22;const [x,y]=pt(q,(off+curl)*Math.sin(f*Math.PI));i?ctx.lineTo(x,y):ctx.moveTo(x,y)}
13544
+ ctx.strokeStyle=M.rgba(s===3?p.core:p.color,(s===3?.48:.16)*fade*Math.min(1.4,gl));ctx.lineWidth=(s===3?2.2:8+s%3*4)*k;ctx.lineCap='round';ctx.stroke()}
13545
+ // Leading tip flare + center slash gleam
13546
+ if(u<.58&&gl>.05){const [hx,hy]=pt(head,0),fl=(1-u/.58),r=85*k*fl*(.6+.4*gl)
13547
+ const g=ctx.createRadialGradient(hx,hy,0,hx,hy,r);g.addColorStop(0,M.rgba(p.core,.98*fl));g.addColorStop(.38,M.rgba(p.color,.58*fl));g.addColorStop(1,M.rgba(p.color,0))
13548
+ ctx.fillStyle=g;ctx.fillRect(hx-r,hy-r,r*2,r*2)}
13549
+ // Trailing energy sparks shed along the arc
13550
+ if(p.sparks){const rnd=M.rand((p.seed|0)||13);ctx.lineCap='round'
13551
+ for(let i=0;i<26;i++){const sq=rnd(),born=sq*.32,age=(t-born)/(D*.72);if(age<=0||age>=1)continue
13552
+ const [bx,by]=pt(sq,(rnd()-.5)*wBase*1.4),out=(30+rnd()*130)*k*age,a=(-span/2+span*sq)*dir+(rnd()-.5)*.6
13553
+ const sx=bx+Math.cos(a)*out,sy=by+Math.sin(a)*out,len=(14+rnd()*34)*k*(1-age*.7),al=Math.pow(1-age,1.15)*fade
13554
+ ctx.strokeStyle=M.rgba(i%3?p.color:p.core,al);ctx.lineWidth=(1.6+rnd()*1.8)*k
13555
+ ctx.beginPath();ctx.moveTo(sx,sy);ctx.lineTo(sx-Math.cos(a)*len,sy-Math.sin(a)*len);ctx.stroke()}}
13556
+ ctx.restore()
13557
+ }`}),qx=Object.freeze({id:"vfx-cross-slash",name:"Song trảm chữ thập",category:"VFX",duration:.65,params:{color:"#f43f5e",core:"#fff5f7",angle:-35,spread:78,delay:.08,width:1,size:1,glow:1,speed:1,sparks:!0,seed:17},code:`function render(ctx,t,env){
13558
+ const {width:W,height:H,params:p}=env,spd=Math.max(.3,Math.min(3,Number(p.speed)||1)),D=(env.duration||.65)/spd
13559
+ if(t<0||t>D)return
13560
+ const k=H/720*(p.size||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),cx=(p.x??.5)*W,cy=(p.y??.5)*H
13561
+ const a1=(p.angle??-35)*Math.PI/180,sp=(p.spread??78)*Math.PI/180,dly=Math.max(0,Math.min(.25,p.delay??.08))/spd
13562
+ ctx.save();ctx.translate(cx,cy);ctx.globalCompositeOperation='lighter'
13563
+ const stroke=(delay,rot)=>{
13564
+ const lt=t-delay,dur=D-delay;if(lt<=0||lt>=dur)return
13565
+ const u=lt/dur,head=Math.min(1,Math.pow(u/.28,.6)),tail=Math.max(0,(u-.18)/.76),fade=Math.pow(Math.max(0,1-Math.max(0,u-.22)/.78),1.4)
13566
+ if(head-tail<.01||fade<=.01)return
13567
+ const L=340*k,w=22*k*(p.width||1)
13568
+ ctx.save();ctx.rotate(rot)
13569
+ const x0=-L+2*L*tail,x1=-L+2*L*head,xm=(x0+x1)/2
13570
+ const draw=(mw,col,al,bl)=>{ctx.save();if(bl*gl>0){ctx.shadowColor=p.color;ctx.shadowBlur=bl*gl}
13571
+ ctx.beginPath();ctx.moveTo(x0,0);ctx.quadraticCurveTo(xm,-w*mw,x1,0);ctx.quadraticCurveTo(xm,w*mw,x0,0);ctx.closePath()
13572
+ ctx.fillStyle=M.rgba(col,Math.min(1,al*fade));ctx.fill();ctx.restore()}
13573
+ draw(1.8,p.color,.34*Math.min(1.5,gl),24*k);draw(1.0,p.color,.85,10*k);draw(.38,p.core,.98,3*k)
13574
+ ctx.restore()
13575
+ }
13576
+ stroke(0,a1);stroke(dly,a1+sp)
13577
+ // Blazing intersection star-flare when second slash crosses the first
13578
+ const ft=t-dly;if(ft>0&&ft<.32/spd&&gl>.05){const fl=Math.min(1,ft/(.03/spd))*Math.pow(1-ft/(.32/spd),1.6),r=135*k*fl*(.6+.4*gl)
13579
+ const g=ctx.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(p.core,.95*fl));g.addColorStop(.35,M.rgba(p.color,.55*fl));g.addColorStop(1,M.rgba(p.color,0))
13580
+ ctx.fillStyle=g;ctx.fillRect(-r,-r,r*2,r*2)
13581
+ ctx.strokeStyle=M.rgba(p.core,.9*fl);ctx.lineWidth=2.4*k
13582
+ for(let i=0;i<2;i++){const a=a1+(i?sp:0)+Math.PI/4,rl=150*k*fl;ctx.beginPath();ctx.moveTo(-Math.cos(a)*rl,-Math.sin(a)*rl);ctx.lineTo(Math.cos(a)*rl,Math.sin(a)*rl);ctx.stroke()}}
13583
+ // Directional clash sparks from intersection
13584
+ if(p.sparks!==false){const rnd=M.rand((p.seed|0)||17);ctx.lineCap='round'
13585
+ for(let i=0;i<22;i++){const age=(t-dly*.75)/(D*.75);if(age<=0||age>=1)continue
13586
+ const a=rnd()*Math.PI*2,dist=(35+rnd()*240)*k*(1-Math.exp(-4*age)),len=(10+rnd()*26)*k*(1-age),al=Math.pow(1-age,1.3)
13587
+ ctx.strokeStyle=M.rgba(i%2?p.color:p.core,al);ctx.lineWidth=(1.4+rnd()*1.6)*k
13588
+ ctx.beginPath();ctx.moveTo(Math.cos(a)*dist,Math.sin(a)*dist);ctx.lineTo(Math.cos(a)*(dist+len),Math.sin(a)*(dist+len));ctx.stroke()}}
13589
+ ctx.restore()
13590
+ }`}),Gx=Object.freeze({id:"vfx-clash-sparks",name:"Tia lửa giao kiếm",category:"VFX",duration:.75,params:{color:"#ffb02e",core:"#ffffff",sparks:36,size:1,glow:1,flare:1,ring:!0,seed:23},code:`function render(ctx,t,env){
13591
+ const {width:W,height:H,params:p}=env,D=env.duration||.75
13592
+ if(t<0||t>D)return
13593
+ const u=t/D,k=H/720*(p.size||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),flScale=Math.max(0,Math.min(2.5,p.flare??1))
13594
+ const cx=(p.x??.5)*W,cy=(p.y??.5)*H,N=Math.max(0,Math.min(80,p.sparks|0))
13595
+ ctx.save();ctx.translate(cx,cy);ctx.globalCompositeOperation='lighter'
13596
+ // Core flash + blazing 4-point anamorphic clash star
13597
+ if(u<.52&&flScale>.05){const fl=Math.min(1,t/.02)*Math.pow(1-u/.52,1.35),r=195*k*fl*flScale
13598
+ const g=ctx.createRadialGradient(0,0,0,0,0,r);g.addColorStop(0,M.rgba(p.core,.98*fl));g.addColorStop(.28,M.rgba(p.color,.72*fl));g.addColorStop(1,M.rgba(p.color,0))
13599
+ ctx.fillStyle=g;ctx.fillRect(-r,-r,r*2,r*2)
13600
+ const flare=(len,wid,ang)=>{ctx.save();ctx.rotate(ang);const sg=ctx.createLinearGradient(-len,0,len,0)
13601
+ sg.addColorStop(0,M.rgba(p.color,0));sg.addColorStop(.5,M.rgba(p.core,.95*fl));sg.addColorStop(1,M.rgba(p.color,0))
13602
+ ctx.fillStyle=sg;ctx.beginPath();ctx.moveTo(-len,0);ctx.quadraticCurveTo(0,-wid,len,0);ctx.quadraticCurveTo(0,wid,-len,0);ctx.fill();ctx.restore()}
13603
+ flare(380*k*fl*flScale,13*k*fl,0);flare(185*k*fl*flScale,8*k*fl,Math.PI/2);flare(150*k*fl*flScale,5*k*fl,Math.PI/4);flare(150*k*fl*flScale,5*k*fl,-Math.PI/4)}
13604
+ // Soft glowing double shockwave rings
13605
+ if(p.ring!==false&&u<.62){const ru=u/.62,rad=(26+255*(1-Math.exp(-4.2*ru)))*k,ra=Math.pow(1-ru,1.55)*.9
13606
+ const rg=ctx.createRadialGradient(0,0,Math.max(1,rad-28*k),0,0,rad+24*k)
13607
+ rg.addColorStop(0,M.rgba(p.color,0));rg.addColorStop(.55,M.rgba(p.color,ra*.42*Math.min(1.5,gl)));rg.addColorStop(1,M.rgba(p.color,0))
13608
+ ctx.fillStyle=rg;ctx.beginPath();ctx.arc(0,0,rad+24*k,0,Math.PI*2);ctx.fill()
13609
+ ctx.strokeStyle=M.rgba(p.core,ra*.85);ctx.lineWidth=(4.5*(1-ru)+1.2)*k;ctx.shadowColor=p.color;ctx.shadowBlur=18*k*gl
13610
+ ctx.beginPath();ctx.arc(0,0,rad,0,Math.PI*2);ctx.stroke();ctx.shadowBlur=0}
13611
+ // High-velocity metallic sparks with gravity & velocity-stretched glowing trails
13612
+ const rnd=M.rand((p.seed|0)||23);ctx.lineCap='round'
13613
+ for(let i=0;i<N;i++){
13614
+ const a=rnd()*Math.PI*2,sp=(380+rnd()*880)*k,life=.42+rnd()*.58,q=t/life
13615
+ if(q>=1)continue
13616
+ const drag=(1-Math.exp(-3.1*t))/3.1,x=Math.cos(a)*sp*drag,y=Math.sin(a)*sp*drag+420*k*t*t
13617
+ const vx=Math.cos(a)*sp*Math.exp(-3.1*t),vy=Math.sin(a)*sp*Math.exp(-3.1*t)+840*k*t,al=Math.pow(1-q,1.05)
13618
+ ctx.strokeStyle=M.rgba(i%3?p.color:p.core,al);ctx.lineWidth=(1.8+rnd()*2.4)*k*(1-q*.45);ctx.shadowColor=p.color;ctx.shadowBlur=8*k*gl
13619
+ ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x-vx*.048,y-vy*.048);ctx.stroke()
13620
+ }
13621
+ ctx.shadowBlur=0;ctx.restore()
13622
+ }`}),Ox=Object.freeze({id:"vfx-energy-ribbon",name:"Vệt năng lượng chuyển động",category:"VFX",duration:3,params:{color:"#38bdf8",core:"#ffffff",width:1,length:.35,glow:1,sparks:!0,fps:30,t0:0,n:0},code:`function render(ctx,t,env){
13623
+ const {width:W,height:H,fps:F,params:p}=env,k=H/720*(p.width||1),gl=Math.max(0,Math.min(2.5,p.glow??1)),n=p.n|0
13624
+ if(n<2)return
13625
+ let s='';for(let i=0;i<15;i++)s+=p['p'+i]||''
13626
+ const at=i=>[parseInt(s.substr(i*4,2),36)/1295*W,parseInt(s.substr(i*4+2,2),36)/1295*H]
13627
+ const h=(t-(p.t0||0))*(p.fps||30),tail=h-(p.length||.35)*(p.fps||30)
13628
+ if(h<0||tail>n-1)return
13629
+ const i0=Math.max(0,Math.ceil(tail)),i1=Math.min(n-1,Math.floor(h)),pts=[]
13630
+ if(tail>0&&i0>0){const a=at(i0-1),b=at(i0),f=tail-(i0-1);pts.push([a[0]+(b[0]-a[0])*f,a[1]+(b[1]-a[1])*f])}
13631
+ for(let i=i0;i<=i1;i++)pts.push(at(i))
13632
+ if(h<n-1&&i1+1<n){const a=at(i1),b=at(i1+1),f=h-i1;pts.push([a[0]+(b[0]-a[0])*f,a[1]+(b[1]-a[1])*f])}
13633
+ if(pts.length<2)return
13634
+ // Compute smooth normals along the ribbon so width tapers cleanly from tail (0) to glowing head (1)
13635
+ const L=pts.length,norms=[]
13636
+ for(let i=0;i<L;i++){const a=pts[Math.max(0,i-1)],b=pts[Math.min(L-1,i+1)],dx=b[0]-a[0],dy=b[1]-a[1],d=Math.hypot(dx,dy)||1;norms.push([-dy/d,dx/d])}
13637
+ ctx.save();ctx.globalCompositeOperation='lighter'
13638
+ // Smooth unified quadratic-bezier polygon tapered cleanly at BOTH tail (0) and razor tip (1)
13639
+ const drawRibbon=(wScale,col,alpha,blur)=>{
13640
+ const left=[],right=[]
13641
+ for(let i=0;i<L;i++){
13642
+ const q=i/(L-1),taper=Math.sin(Math.pow(q,.72)*Math.PI),w=22*k*wScale*taper
13643
+ left.push([pts[i][0]+norms[i][0]*w,pts[i][1]+norms[i][1]*w])
13644
+ right.push([pts[i][0]-norms[i][0]*w,pts[i][1]-norms[i][1]*w])
13645
+ }
13646
+ ctx.save();if(blur*gl>0){ctx.shadowColor=p.color;ctx.shadowBlur=blur*gl}
13647
+ ctx.beginPath();ctx.moveTo(left[0][0],left[0][1])
13648
+ for(let i=1;i<L-1;i++){const mx=(left[i][0]+left[i+1][0])/2,my=(left[i][1]+left[i+1][1])/2;ctx.quadraticCurveTo(left[i][0],left[i][1],mx,my)}
13649
+ ctx.lineTo(pts[L-1][0],pts[L-1][1])
13650
+ for(let i=L-2;i>0;i--){const mx=(right[i][0]+right[i-1][0])/2,my=(right[i][1]+right[i-1][1])/2;ctx.quadraticCurveTo(right[i][0],right[i][1],mx,my)}
13651
+ ctx.lineTo(right[0][0],right[0][1]);ctx.closePath()
13652
+ const grad=ctx.createLinearGradient(pts[0][0],pts[0][1],pts[L-1][0],pts[L-1][1])
13653
+ grad.addColorStop(0,M.rgba(col,0));grad.addColorStop(.35,M.rgba(col,alpha*.65));grad.addColorStop(.85,M.rgba(col,alpha));grad.addColorStop(1,M.rgba(p.core,alpha))
13654
+ ctx.fillStyle=grad;ctx.fill();ctx.restore()
13655
+ }
13656
+ drawRibbon(2.55,p.color,.16*Math.min(1.6,gl),40*k)
13657
+ drawRibbon(1.8,p.color,.36*Math.min(1.5,gl),26*k)
13658
+ drawRibbon(1.02,p.color,.86,12*k)
13659
+ drawRibbon(.40,p.core,.98,3*k)
13660
+ // Silky curled plasma wisps trailing along the ribbon
13661
+ ctx.lineCap='round'
13662
+ for(let s=0;s<4;s++){ctx.beginPath()
13663
+ for(let i=0;i<L;i++){const q=i/(L-1),w=Math.sin(q*Math.PI*3-t*10+s*1.7)*22*k*Math.sin(q*Math.PI);const px=pts[i][0]+norms[i][0]*w,py=pts[i][1]+norms[i][1]*w;i?ctx.lineTo(px,py):ctx.moveTo(px,py)}
13664
+ ctx.strokeStyle=M.rgba(s%2?p.core:p.color,.16*Math.min(1.5,gl));ctx.lineWidth=(5+s*3)*k;ctx.stroke()}
13665
+ // Head glow + trailing micro-sparks
13666
+ if(gl>.05){const hd=pts[L-1],hr=44*k*(.6+.4*gl)
13667
+ const g=ctx.createRadialGradient(hd[0],hd[1],0,hd[0],hd[1],hr);g.addColorStop(0,M.rgba(p.core,.95));g.addColorStop(.4,M.rgba(p.color,.55));g.addColorStop(1,M.rgba(p.color,0))
13668
+ ctx.fillStyle=g;ctx.fillRect(hd[0]-hr,hd[1]-hr,hr*2,hr*2)}
13669
+ if(p.sparks){const fr=Math.floor(t*(F||30)),rnd=M.rand(fr*173+19);ctx.fillStyle=M.rgba(p.core,.9);ctx.shadowColor=p.color;ctx.shadowBlur=8*k*gl
13670
+ for(let i=0;i<14;i++){const idx=Math.max(1,Math.floor(rnd()*(L-1))),pt=pts[idx],nm=norms[idx],off=(rnd()-.5)*36*k,r=(1.4+rnd()*2.6)*k
13671
+ ctx.beginPath();ctx.arc(pt[0]+nm[0]*off,pt[1]+nm[1]*off,r,0,Math.PI*2);ctx.fill()}}
13672
+ ctx.restore()
13673
+ }`}),Yc=[{id:"aurora-bg",name:"Nền aurora",category:"Nền",duration:6,params:{colorA:"#0b1026",colorB:"#6a3cff",colorC:"#00e0c6",speed:1},code:`function render(ctx,t,env){
13454
13674
  const {width:W,height:H,params:p}=env
13455
13675
  ctx.fillStyle=p.colorA;ctx.fillRect(0,0,W,H)
13456
13676
  ctx.globalCompositeOperation='lighter'
@@ -13738,4 +13958,4 @@ function render(ctx,t,env){
13738
13958
  const s=ctx.createLinearGradient(0,-size*.5,0,size*.15);s.addColorStop(0,'rgba(255,255,255,.4)');s.addColorStop(1,'rgba(255,255,255,0)')
13739
13959
  ctx.fillStyle=s;ctx.fillText(text,0,0)
13740
13960
  ctx.restore()
13741
- }`}];ca.push(...Wi),ca.push(...Bi),ca.push(...qo),ca.push(zx),ca.push(Bx),ca.push(Wx,Hx),ca.push(Lx,Dx),ca.push(...To);const Go={"lower-third":{text:"name",subText:"role",color:"accent"},"kinetic-title":{text:"text",subText:"sub",color:"accent"},"keyword-pop":{text:"text",color:"accent",placement:"position"},"progress-ring":{text:"label",color:"accent",numberValue:"to"},"particle-burst":{color:"color"},"aurora-bg":{color:"colorB"},vignette:{color:"color"},"film-grain":{},"light-leak":{color:"color"},letterbox:{color:"color"},vhs:{},"3d-coin-spin":{text:"text",subText:"sub",color:"color"},"3d-bar-chart":{text:"title",color:"color"},"3d-phone-cards":{text:"title",color:"color"},"m3d-extrude-title":{text:"text",color:"color",numberValue:"depth",booleanValue:"stand",angle:"tilt"},"3d-sparkle-star":{text:"text",color:"color"},"3d-bounce-ball-title":{text:"title",color:"color"},"3d-shape-morph":{text:"text",color:"color"},"3d-target-dart":{text:"text",color:"color"},"3d-gradient-bars":{text:"title",subText:"value",color:"color"},"3d-counter-orb":{text:"label",numberValue:"to",color:"color"},"c3d-monitor-pedestal":{text:"title",color:"color"},"c3d-phone-feed":{text:"text",subText:"big",color:"color"},"c3d-floating-chaos":{text:"title",color:"color"},"c3d-channel-hub":{text:"title",items:"items",color:"color"},"c3d-dashboard-live":{text:"label",subText:"value",color:"color"},"c3d-window-assemble":{text:"title",color:"color"},"c3d-orbit-shapes":{color:"color"},"c3d-plane-logo":{text:"url",subText:"name",color:"color"}};for(const t of Bi){const e=a=>a in t.params,c={text:"text",color:"accent",placement:"position",style:"style"};e("sub")&&(c.subText="sub"),e("number")&&(c.numberValue="number"),e("items")&&(c.items="items"),e("posX")&&(c.posX="posX",c.posY="posY"),e("icon")&&(c.icon="icon"),e("glyph")&&(c.icon="glyph"),Go[t.id]=c}for(const t of To)Go[t.id]=t.id==="particles"||t.params.emitter==="text"?{color:"color",text:"text"}:{color:"color"};for(const t of Wi)Go[t.id]="color"in t.params?{color:"color"}:{};Object.freeze(["heart","star","fire","bolt","cart","check","bell","play",...Wl.filter(t=>!["heart","star","fire","cart","check"].includes(t))]),Object.freeze([{id:"clean",name:"Lọc tạp âm",en:"Clean Voice",hint:"Bớt tiếng ồn nền, ù quạt, xì"},{id:"dereverb",name:"Giảm vang",en:"De-Reverb",hint:"Bớt tiếng vang phòng (mức nhẹ)"},{id:"enhance",name:"Giọng rõ hơn",en:"Enhance",hint:"Giọng sáng, rõ, đều hơn"},{id:"level",name:"Cân âm lượng",en:"Auto Level",hint:"Đưa về độ lớn chuẩn -16 LUFS"},{id:"master",name:"Hoàn thiện",en:"Master",hint:"Nén nhẹ, -14 LUFS, chống vỡ tiếng"}]).map(t=>t.id),Object.freeze([{id:"phone-row",label:"Dàn điện thoại",type:"phone"},{id:"phone-toss",label:"Điện thoại tung bay",type:"phone"},{id:"laptop-turn",label:"Laptop xoay",type:"laptop"}]).map(t=>t.id);const Ex={person:["person","personPending","colorPerson","depthMap","matteFix","shocks","impacts","trail","hands","hud","face","smoothSlow","vfx","vfxShot","vfxFinish","vfxGlow","sceneTrack","objectTracks","pendingPin","join","freeze"],layer:["title","shape","card","motion","lottie","geo","element","solid","adjust","nullLayer","device","deviceScreen","bend","bendStrip","gen","clientJobs","mapAnno","modelAnim","modelRotation","modelSpin","modelGround","modelLook","modelLaunch","modelDepth"],sound:["audioFx","audioTools","muffle"]};new Map(Object.entries(Ex).flatMap(([t,e])=>e.map(c=>[c,t])));const qx=["display","position","top","right","bottom","left","width","height","minWidth","minHeight","maxWidth","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","flex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyContent","gap","rowGap","columnGap","overflow","color","opacity","background","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","backgroundClip","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderColor","borderStyle","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","boxShadow","boxSizing","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign","textTransform","textDecoration","textShadow","whiteSpace","wordBreak","textOverflow","lineClamp","transform","transformOrigin","objectFit","objectPosition"];new Set(qx);const ka=Object.freeze({work:480,focals:[.45,.55,.7,.85,1,1.25],maxFrames:900,keyTolPx:.05,points:400,smooth:.3,smoothFrames:4,smoothTolPx:.25,dense:{cols:40,rows:22,keep:700,minFrames:8,max:1500},slide:.01}),xe=t=>Math.round(t*1e6)/1e6,Oc=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],qi=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],Sa=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],Le=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],Gx=(t,e)=>[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]],io=t=>{const e=Math.hypot(...t)||1;return Sa(t,1/e)},lo=(t,e)=>[Le(t[0],e),Le(t[1],e),Le(t[2],e)],Gi=t=>[0,1,2].map(e=>[t[0][e],t[1][e],t[2][e]]);function Ox(t,e,c,a=Ta(29)){const o=t;if(o.length<20)return null;const s=o.map(i=>Math.hypot(...Oc(i,c))).sort((i,l)=>i-l)[o.length>>1];for(const i of[.015,.03,.05]){const l=s*i;let p=null;for(let g=0;g<2e3;g++){const u=o[Math.floor(a()*o.length)],v=o[Math.floor(a()*o.length)],b=o[Math.floor(a()*o.length)];let S=Gx(Oc(v,u),Oc(b,u));const T=Math.hypot(...S);if(T<1e-9||(S=Sa(S,1/T),Le(S,e)<0&&(S=Sa(S,-1)),Le(S,e)<Math.cos(35*Math.PI/180)))continue;const D=-Le(S,u);if(Le(S,c)+D<=l)continue;let P=0;for(const K of o)Math.abs(Le(S,K)+D)<l&&P++;(!p||P>p.k)&&(p={n:S,d:D,k:P})}if(!p||p.k<o.length*.2)continue;const x=o.filter(g=>Math.abs(Le(p.n,g)+p.d)<l),f=Sa(x.reduce((g,u)=>qi(g,u),[0,0,0]),1/x.length),d=[[0,0,0],[0,0,0],[0,0,0]];for(const g of x){const u=Oc(g,f);for(let v=0;v<3;v++)for(let b=0;b<3;b++)d[v][b]+=u[v]*u[b]}let r=Nx(d);return Le(r,e)<0&&(r=Sa(r,-1)),{n:r,d:-Le(r,f),count:x.length}}return null}function Nx(t){const e=t.map(o=>[...o]),c=[[1,0,0],[0,1,0],[0,0,1]];for(let o=0;o<30;o++){let s=0;for(let i=0;i<3;i++)for(let l=i+1;l<3;l++)s+=e[i][l]**2;if(s<1e-24)break;for(let i=0;i<3;i++)for(let l=i+1;l<3;l++){if(Math.abs(e[i][l])<1e-30)continue;const p=(e[l][l]-e[i][i])/(2*e[i][l]),x=Math.sign(p||1)/(Math.abs(p)+Math.sqrt(p*p+1)),f=1/Math.sqrt(x*x+1),d=x*f;for(let r=0;r<3;r++){const g=e[r][i],u=e[r][l];e[r][i]=f*g-d*u,e[r][l]=d*g+f*u}for(let r=0;r<3;r++){const g=e[i][r],u=e[l][r];e[i][r]=f*g-d*u,e[l][r]=d*g+f*u}for(let r=0;r<3;r++){const g=c[r][i],u=c[r][l];c[r][i]=f*g-d*u,c[r][l]=d*g+f*u}}}const a=[0,1,2].reduce((o,s)=>e[s][s]<e[o][o]?s:o,0);return io([c[0][a],c[1][a],c[2][a]])}function ro(t,e,c,a){const o=new Map;t.poses.forEach((s,i)=>{if(!(!s||s.lost))for(const[l,p]of t.obs[i]){const x=t.points.get(l);if(!x)continue;const f=lo(s.R,Oc(x,s.C)),d=f[2]>-1e-6?50:Math.hypot(c+e*f[0]/-f[2]-p[0],a-e*f[1]/-f[2]-p[1]),r=o.get(l)??[0,0,0];r[0]+=d,r[1]++,r[2]=Math.max(r[2],d),o.set(l,r)}});for(const s of o.values())s[0]/=s[1];return o}function xo(t,e,c,a){const o=[...ro(t,e,c,a).values()].map(i=>i[0]).sort((i,l)=>i-l),s=Math.floor(o.length*.8);return s>30?o.slice(0,s).reduce((i,l)=>i+l,0)/s:1/0}function Oi(t,e,c,a){const{solved:o,keyframes:s}=Ni(t);for(let i=0;i<3;i++){const l=ro(t,e,c,a),p=[...l.values()].map(d=>d[2]).sort((d,r)=>d-r),x=Math.max(1.2,2*(p[p.length>>1]??1));let f=0;for(const[d,r]of l)r[2]>x&&(t.points.delete(d),f++);if(!f)break;ia(t.poses,t.points,t.obs,s,e,c,a,8),Ii(t,s,o,e,c,a)}}function Ni(t){const e=t.poses.map((a,o)=>a&&!a.lost?o:-1).filter(a=>a>=0),c=Math.max(1,Math.ceil(e.length/60));return{solved:e,keyframes:[t.pair[0],...e.filter((a,o)=>a!==t.pair[0]&&(o%c===0||o===e.length-1))]}}function Ii(t,e,c,a,o,s){const i=Math.hypot(...Oc(t.poses[t.pair[1]].C,t.poses[t.pair[0]].C))||1,l=new Set(e);for(const p of c){if(l.has(p))continue;const x=[];for(const[f,d]of t.obs[p])t.points.has(f)&&x.push({X:t.points.get(f),px:d});x.length>=10&&(t.poses[p]=yo(x,t.poses[p],a,o,s,i).pose)}}function Ix(t,e,c,a){const{solved:o,keyframes:s}=Ni(t),i={poses:t.poses.map(x=>x&&{...x,R:x.R.map(f=>[...f]),C:[...x.C]}),points:new Map([...t.points].map(([x,f])=>[x,[...f]]))},l=xo(t,e,c,a),p=ia(t.poses,t.points,t.obs,s,e,c,a,12,{focal:!0});return Math.abs(p/e-1)<1e-4?e:(Ii(t,s,o,p,c,a),Math.abs(p/e-1)<.15&&xo(t,p,c,a)<l?p:(t.poses=i.poses,t.points=i.points,e))}function Ux(t,e,{w:c,h:a,mw:o,mh:s,focals:i=ka.focals,focal:l=null,onProgress:p=null}={}){const x=c/2,f=a/2;let d=l,r=0;const g=l?1:i.length+9;if(!d){const m=new Map,B=Math.max(c,a)/c;let Y=t;const lt=X=>{if(X=Math.round(X*1e3)/1e3,!(X>.2&&X<3)||m.has(X))return;const at=Zo(null,X*c,{obs:Y,w:c,h:a});at.mode==="free"&&Oi(at,X*c,x,f),m.set(X,{s:at,e:at.mode==="free"?xo(at,X*c,x,f):1/0}),p?.(++r/g)};let et=[];for(let X=Math.max(1,Math.round(t.length/25));;X=Math.max(1,X>>1)){Y=t.filter((at,Ce)=>Ce%X===0),m.clear(),r=0;for(const at of i)lt(at*B);if(et=[...m.entries()].filter(([,at])=>Number.isFinite(at.e)).sort((at,Ce)=>at[0]-Ce[0]),et.length||X===1)break}if(!et.length)return p?.(1),null;const C=et.reduce((X,at,Ce)=>at[1].e<et[X][1].e?Ce:X,0),G=et[C][1].s,E=C>0?et[C-1][0]:et[C][0]*.8,j=C<et.length-1?et[C+1][0]:et[C][0]*1.25,ct=G.poses.map((X,at)=>X&&!X.lost?at:-1).filter(X=>X>=0),wt=G.pair[0],bt=X=>{const at={...G,poses:G.poses.map(Yt=>Yt&&{...Yt,R:Yt.R.map(_t=>[..._t]),C:[...Yt.C]}),points:new Map([...G.points].map(([Yt,_t])=>[Yt,[..._t]]))};ia(at.poses,at.points,at.obs,[wt,...ct.filter(Yt=>Yt!==wt)],X*c,x,f,8),p?.(++r/g);let Ce=0,Sc=0;for(const[Yt,_t]of ro(at,X*c,x,f).values())Ce+=Yt*_t,Sc+=_t;return Sc?Ce/Sc:1/0},I=(Math.sqrt(5)-1)/2;let $=E,J=j,Mt=J-I*(J-$),N=$+I*(J-$),Q=bt(Mt),mt=bt(N);for(let X=0;X<7;X++)Q<mt?(J=N,N=Mt,mt=Q,Mt=J-I*(J-$),Q=bt(Mt)):($=Mt,Mt=N,Q=mt,N=$+I*(J-$),mt=bt(N));d=($+J)/2}const u=Zo(null,d*c,{obs:t,w:c,h:a});if(p?.(1),u.mode!=="free")return null;let v=d*c;const b=u.poses[u.pair[0]].C,S=u.poses[u.pair[0]].R;if(Oi(u,v,x,f),!l)for(let m=0;m<3;m++){const B=Ix(u,v,x,f),Y=Math.abs(B/v-1)<5e-4;if(v=B,Y)break}const T=ro(u,v,x,f),D=[...T.values()].map(m=>m[0]).sort((m,B)=>m-B),P=Math.max(1.5,3*(D[D.length>>1]??1)),K=[...T.entries()].filter(([m,B])=>u.points.has(m)&&B[0]<=P&&B[1]>=2),n=m=>t.flatMap((B,Y)=>B.has(m)?[e[Y]]:[]);let M=0,y=0;for(const[,m]of K)M+=m[0]*m[1],y+=m[1];const z=lo(Gi(S),[0,1,0]),h=Ox([...u.points.values()],z,b)??ll(u.points,z,b)??sl(u.points,z,b),w={v:1,w:c,h:a,mw:o||c,mh:s||a,mode:"free",f:xe(v),err:xe(y?M/y:xo(u,v,x,f)),frames:u.poses.map((m,B)=>[xe(e[B]),...Zi(m.R).map(xe),...m.C.map(xe)]),floor:h?[...h.n.map(xe),xe(h.d)]:null},k=[];for(const[m]of K.sort((B,Y)=>Y[1][1]-B[1][1])){if(k.length>=ka.points)break;const B=u.points.get(m),Y=n(m);Ui(w,B,Y)<=ka.slide*c&&k.push([B.map(xe),[xe(Y[0]),xe(Y.at(-1))]])}return{...w,points:k.map(m=>m[0]),seen:k.map(m=>m[1])}}function Ui(t,e,c){if(!c.length)return 1/0;const o=(c.length>24?c.filter((r,g)=>g%Math.ceil(c.length/24)===0||g===c.length-1):c).map(r=>io(Oc(e,ho(t,r).C)));let s=0;for(const r of[o[0],o.at(-1)])for(const g of o)s=Math.max(s,Math.acos(Math.min(1,Le(r,g))));const i=ho(t,c[c.length>>1]).C,l=Math.hypot(...Oc(e,i)),p=qi(e,Sa(io(Oc(e,i)),l*(.5/t.f)/Math.max(.001,Math.sin(s)))),x=t.frames,f=Math.max(1,Math.floor(x.length/40));let d=0;for(let r=0;r<x.length;r+=f){const g=Oo(t,e,x[r][0]),u=Oo(t,p,x[r][0]);g&&u&&(d=Math.max(d,Math.hypot(g[0]-u[0],g[1]-u[1])))}return d}function Kx(t,e,{mw:c,mh:a,focals:o=ka.focals,focal:s=null,onProgress:i=null,dense:l=!0}={}){if(t.length<3)throw Error("FLAT");const p=t[0].w,x=t[0].h,f=bo(t,{anchor:!0,onProgress:i&&(g=>i(g*.35))}),d=Ux(f,e,{w:p,h:x,mw:c,mh:a,focals:o,focal:s,onProgress:i&&(g=>i(.35+g*.57))});if(d){const g=l?jx(d,t,e,i&&(u=>i(.92+u*.08))):d;return i?.(1),g}const r=_i(t,(s??.7)*p);if(r.filter(g=>!g.lost).length<t.length*.5)throw Error("FLAT");return{v:1,w:p,h:x,mw:c||p,mh:a||x,mode:"tripod",frames:r.map((g,u)=>[xe(e[u]),...g.q.map(xe),xe(g.f)])}}function jx(t,e,c,a=null,o=ka.dense){const s=bo(e,{anchor:!0,keep:o.keep,cols:o.cols,rows:o.rows,onProgress:a&&(g=>a(g*.8))}),i=new Map;s.forEach((g,u)=>{for(const[v,b]of g){let S=i.get(v);S||i.set(v,S=[]),S.push([c[u],b[0],b[1]])}});const l=[...i.values()].filter(g=>g.length>=o.minFrames),p=t.points??[],x=g=>p.some(u=>Math.abs(u[0]-g[0])+Math.abs(u[1]-g[1])+Math.abs(u[2]-g[2])<1e-6),f=t.seen??p.map(()=>[t.frames[0][0],t.frames.at(-1)[0]]),d=[...p],r=[...f];for(const g of l){if(d.length>=o.max)break;const u=Xx(t,g);!u||x(u)||Ui(t,u,g.map(v=>v[0]))>ka.slide*t.w||(d.push(u.map(xe)),r.push([xe(g[0][0]),xe(g.at(-1)[0])]))}return a?.(1),{...t,points:d,seen:r}}function ho(t,e){const c=t.frames,a=c.length;let o=0,s=Math.max(0,a-2);for(;o<s;){const g=o+s+1>>1;c[g][0]<=e?o=g:s=g-1}const i=c[o],l=c[Math.min(a-1,o+1)],p=l[0]>i[0]?Math.max(0,Math.min(1,(e-i[0])/(l[0]-i[0]))):0;let x=i.slice(1,5),f=l.slice(1,5);Ki(x,f)<0&&(f=f.map(g=>-g));const d=Vx(x,f,p),r=Ji(d);return t.mode==="tripod"?{R:r,C:[0,0,0],f:i[5]+(l[5]-i[5])*p}:{R:r,C:[0,1,2].map(g=>i[5+g]+(l[5+g]-i[5+g])*p),f:t.f}}const Ki=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3];function Vx(t,e,c){const a=Math.min(1,Math.max(-1,Ki(t,e)));if(a>.9995){const p=t.map((f,d)=>f+(e[d]-f)*c),x=Math.hypot(...p);return p.map(f=>f/x)}const o=Math.acos(a),s=Math.sin(o),i=Math.sin((1-c)*o)/s,l=Math.sin(c*o)/s;return t.map((p,x)=>p*i+e[x]*l)}function Oo(t,e,c){const a=ho(t,c),o=lo(a.R,t.mode==="tripod"?e:Oc(e,a.C));return o[2]>-1e-6?null:[t.w/2+a.f*o[0]/-o[2],t.h/2-a.f*o[1]/-o[2]]}function $x(t,e,c,a){const o=ho(t,a),s=io([(e-t.w/2)/o.f,-(c-t.h/2)/o.f,-1]);return{o:o.C,d:lo(Gi(o.R),s),pose:o}}function Xx(t,e){if(t.mode!=="free"||e.length<4)return null;const c=e.map(([l,p,x])=>$x(t,p,x,l));let a=0;for(const l of c)a=Math.max(a,Math.acos(Math.min(1,Le(l.d,c[0].d))));if(a<.5*Math.PI/180)return null;const o=[[0,0,0],[0,0,0],[0,0,0]],s=[0,0,0];for(const{o:l,d:p}of c)for(let x=0;x<3;x++)for(let f=0;f<3;f++){const d=(x===f?1:0)-p[x]*p[f];o[x][f]+=d,s[x]+=d*l[f]}const i=Fx(o,s);return i&&e.every(([l,p,x])=>{const f=Oo(t,i,l);return f&&Math.hypot(f[0]-p,f[1]-x)<1.5})?i:null}function Fx(t,e){const c=o=>o[0][0]*(o[1][1]*o[2][2]-o[1][2]*o[2][1])-o[0][1]*(o[1][0]*o[2][2]-o[1][2]*o[2][0])+o[0][2]*(o[1][0]*o[2][1]-o[1][1]*o[2][0]),a=c(t);return Math.abs(a)<1e-12?null:[0,1,2].map(o=>c(t.map((s,i)=>s.map((l,p)=>p===o?e[i]:l)))/a)}self.onmessage=t=>{let e=-1;const c=a=>{(a-e>=.02||a>=1)&&(e=a,self.postMessage({type:"progress",u:a}))};try{self.postMessage({type:"done",result:Kx(t.data.frames,t.data.times,{mw:t.data.mw,mh:t.data.mh,focal:t.data.focal??null,onProgress:c})})}catch(a){self.postMessage({type:"error",message:a.message||String(a)})}}})();
13961
+ }`}];Yc.push(...Wi),Yc.push(...Bi),Yc.push(...qo),Yc.push(zx),Yc.push(Bx),Yc.push(Wx,Hx),Yc.push(Lx,Dx),Yc.push(Ex,qx,Gx,Ox),Yc.push(...To);const Go={"lower-third":{text:"name",subText:"role",color:"accent"},"kinetic-title":{text:"text",subText:"sub",color:"accent"},"keyword-pop":{text:"text",color:"accent",placement:"position"},"progress-ring":{text:"label",color:"accent",numberValue:"to"},"particle-burst":{color:"color"},"aurora-bg":{color:"colorB"},vignette:{color:"color"},"film-grain":{},"light-leak":{color:"color"},letterbox:{color:"color"},vhs:{},"3d-coin-spin":{text:"text",subText:"sub",color:"color"},"3d-bar-chart":{text:"title",color:"color"},"3d-phone-cards":{text:"title",color:"color"},"m3d-extrude-title":{text:"text",color:"color",numberValue:"depth",booleanValue:"stand",angle:"tilt"},"3d-sparkle-star":{text:"text",color:"color"},"3d-bounce-ball-title":{text:"title",color:"color"},"3d-shape-morph":{text:"text",color:"color"},"3d-target-dart":{text:"text",color:"color"},"3d-gradient-bars":{text:"title",subText:"value",color:"color"},"3d-counter-orb":{text:"label",numberValue:"to",color:"color"},"c3d-monitor-pedestal":{text:"title",color:"color"},"c3d-phone-feed":{text:"text",subText:"big",color:"color"},"c3d-floating-chaos":{text:"title",color:"color"},"c3d-channel-hub":{text:"title",items:"items",color:"color"},"c3d-dashboard-live":{text:"label",subText:"value",color:"color"},"c3d-window-assemble":{text:"title",color:"color"},"c3d-orbit-shapes":{color:"color"},"c3d-plane-logo":{text:"url",subText:"name",color:"color"}};for(const t of Bi){const e=a=>a in t.params,c={text:"text",color:"accent",placement:"position",style:"style"};e("sub")&&(c.subText="sub"),e("number")&&(c.numberValue="number"),e("items")&&(c.items="items"),e("posX")&&(c.posX="posX",c.posY="posY"),e("icon")&&(c.icon="icon"),e("glyph")&&(c.icon="glyph"),Go[t.id]=c}for(const t of To)Go[t.id]=t.id==="particles"||t.params.emitter==="text"?{color:"color",text:"text"}:{color:"color"};for(const t of Wi)Go[t.id]="color"in t.params?{color:"color"}:{};Object.freeze(["heart","star","fire","bolt","cart","check","bell","play",...Wl.filter(t=>!["heart","star","fire","cart","check"].includes(t))]),Object.freeze([{id:"clean",name:"Lọc tạp âm",en:"Clean Voice",hint:"Bớt tiếng ồn nền, ù quạt, xì"},{id:"dereverb",name:"Giảm vang",en:"De-Reverb",hint:"Bớt tiếng vang phòng (mức nhẹ)"},{id:"enhance",name:"Giọng rõ hơn",en:"Enhance",hint:"Giọng sáng, rõ, đều hơn"},{id:"level",name:"Cân âm lượng",en:"Auto Level",hint:"Đưa về độ lớn chuẩn -16 LUFS"},{id:"master",name:"Hoàn thiện",en:"Master",hint:"Nén nhẹ, -14 LUFS, chống vỡ tiếng"}]).map(t=>t.id),Object.freeze([{id:"phone-row",label:"Dàn điện thoại",type:"phone"},{id:"phone-toss",label:"Điện thoại tung bay",type:"phone"},{id:"laptop-turn",label:"Laptop xoay",type:"laptop"}]).map(t=>t.id);const Nx={person:["person","personPending","colorPerson","depthMap","matteFix","shocks","impacts","trail","hands","hud","face","smoothSlow","vfx","vfxShot","vfxFinish","vfxGlow","sceneTrack","objectTracks","pendingPin","join","freeze"],layer:["title","shape","card","motion","lottie","geo","element","solid","adjust","nullLayer","device","deviceScreen","bend","bendStrip","gen","clientJobs","mapAnno","modelAnim","modelRotation","modelSpin","modelGround","modelLook","modelLaunch","modelDepth"],sound:["audioFx","audioTools","muffle"]};new Map(Object.entries(Nx).flatMap(([t,e])=>e.map(c=>[c,t])));const Ix=["display","position","top","right","bottom","left","width","height","minWidth","minHeight","maxWidth","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","flex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyContent","gap","rowGap","columnGap","overflow","color","opacity","background","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","backgroundClip","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderColor","borderStyle","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","boxShadow","boxSizing","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign","textTransform","textDecoration","textShadow","whiteSpace","wordBreak","textOverflow","lineClamp","transform","transformOrigin","objectFit","objectPosition"];new Set(Ix);const ka=Object.freeze({work:480,focals:[.45,.55,.7,.85,1,1.25],maxFrames:900,keyTolPx:.05,points:400,smooth:.3,smoothFrames:4,smoothTolPx:.25,dense:{cols:40,rows:22,keep:700,minFrames:8,max:1500},slide:.01}),fe=t=>Math.round(t*1e6)/1e6,Oc=(t,e)=>[t[0]-e[0],t[1]-e[1],t[2]-e[2]],qi=(t,e)=>[t[0]+e[0],t[1]+e[1],t[2]+e[2]],Sa=(t,e)=>[t[0]*e,t[1]*e,t[2]*e],Le=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],Ux=(t,e)=>[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]],io=t=>{const e=Math.hypot(...t)||1;return Sa(t,1/e)},lo=(t,e)=>[Le(t[0],e),Le(t[1],e),Le(t[2],e)],Gi=t=>[0,1,2].map(e=>[t[0][e],t[1][e],t[2][e]]);function Kx(t,e,c,a=Ta(29)){const o=t;if(o.length<20)return null;const s=o.map(i=>Math.hypot(...Oc(i,c))).sort((i,l)=>i-l)[o.length>>1];for(const i of[.015,.03,.05]){const l=s*i;let p=null;for(let g=0;g<2e3;g++){const u=o[Math.floor(a()*o.length)],v=o[Math.floor(a()*o.length)],b=o[Math.floor(a()*o.length)];let S=Ux(Oc(v,u),Oc(b,u));const T=Math.hypot(...S);if(T<1e-9||(S=Sa(S,1/T),Le(S,e)<0&&(S=Sa(S,-1)),Le(S,e)<Math.cos(35*Math.PI/180)))continue;const D=-Le(S,u);if(Le(S,c)+D<=l)continue;let P=0;for(const K of o)Math.abs(Le(S,K)+D)<l&&P++;(!p||P>p.k)&&(p={n:S,d:D,k:P})}if(!p||p.k<o.length*.2)continue;const x=o.filter(g=>Math.abs(Le(p.n,g)+p.d)<l),f=Sa(x.reduce((g,u)=>qi(g,u),[0,0,0]),1/x.length),d=[[0,0,0],[0,0,0],[0,0,0]];for(const g of x){const u=Oc(g,f);for(let v=0;v<3;v++)for(let b=0;b<3;b++)d[v][b]+=u[v]*u[b]}let r=jx(d);return Le(r,e)<0&&(r=Sa(r,-1)),{n:r,d:-Le(r,f),count:x.length}}return null}function jx(t){const e=t.map(o=>[...o]),c=[[1,0,0],[0,1,0],[0,0,1]];for(let o=0;o<30;o++){let s=0;for(let i=0;i<3;i++)for(let l=i+1;l<3;l++)s+=e[i][l]**2;if(s<1e-24)break;for(let i=0;i<3;i++)for(let l=i+1;l<3;l++){if(Math.abs(e[i][l])<1e-30)continue;const p=(e[l][l]-e[i][i])/(2*e[i][l]),x=Math.sign(p||1)/(Math.abs(p)+Math.sqrt(p*p+1)),f=1/Math.sqrt(x*x+1),d=x*f;for(let r=0;r<3;r++){const g=e[r][i],u=e[r][l];e[r][i]=f*g-d*u,e[r][l]=d*g+f*u}for(let r=0;r<3;r++){const g=e[i][r],u=e[l][r];e[i][r]=f*g-d*u,e[l][r]=d*g+f*u}for(let r=0;r<3;r++){const g=c[r][i],u=c[r][l];c[r][i]=f*g-d*u,c[r][l]=d*g+f*u}}}const a=[0,1,2].reduce((o,s)=>e[s][s]<e[o][o]?s:o,0);return io([c[0][a],c[1][a],c[2][a]])}function ro(t,e,c,a){const o=new Map;t.poses.forEach((s,i)=>{if(!(!s||s.lost))for(const[l,p]of t.obs[i]){const x=t.points.get(l);if(!x)continue;const f=lo(s.R,Oc(x,s.C)),d=f[2]>-1e-6?50:Math.hypot(c+e*f[0]/-f[2]-p[0],a-e*f[1]/-f[2]-p[1]),r=o.get(l)??[0,0,0];r[0]+=d,r[1]++,r[2]=Math.max(r[2],d),o.set(l,r)}});for(const s of o.values())s[0]/=s[1];return o}function xo(t,e,c,a){const o=[...ro(t,e,c,a).values()].map(i=>i[0]).sort((i,l)=>i-l),s=Math.floor(o.length*.8);return s>30?o.slice(0,s).reduce((i,l)=>i+l,0)/s:1/0}function Oi(t,e,c,a){const{solved:o,keyframes:s}=Ni(t);for(let i=0;i<3;i++){const l=ro(t,e,c,a),p=[...l.values()].map(d=>d[2]).sort((d,r)=>d-r),x=Math.max(1.2,2*(p[p.length>>1]??1));let f=0;for(const[d,r]of l)r[2]>x&&(t.points.delete(d),f++);if(!f)break;ia(t.poses,t.points,t.obs,s,e,c,a,8),Ii(t,s,o,e,c,a)}}function Ni(t){const e=t.poses.map((a,o)=>a&&!a.lost?o:-1).filter(a=>a>=0),c=Math.max(1,Math.ceil(e.length/60));return{solved:e,keyframes:[t.pair[0],...e.filter((a,o)=>a!==t.pair[0]&&(o%c===0||o===e.length-1))]}}function Ii(t,e,c,a,o,s){const i=Math.hypot(...Oc(t.poses[t.pair[1]].C,t.poses[t.pair[0]].C))||1,l=new Set(e);for(const p of c){if(l.has(p))continue;const x=[];for(const[f,d]of t.obs[p])t.points.has(f)&&x.push({X:t.points.get(f),px:d});x.length>=10&&(t.poses[p]=yo(x,t.poses[p],a,o,s,i).pose)}}function Vx(t,e,c,a){const{solved:o,keyframes:s}=Ni(t),i={poses:t.poses.map(x=>x&&{...x,R:x.R.map(f=>[...f]),C:[...x.C]}),points:new Map([...t.points].map(([x,f])=>[x,[...f]]))},l=xo(t,e,c,a),p=ia(t.poses,t.points,t.obs,s,e,c,a,12,{focal:!0});return Math.abs(p/e-1)<1e-4?e:(Ii(t,s,o,p,c,a),Math.abs(p/e-1)<.15&&xo(t,p,c,a)<l?p:(t.poses=i.poses,t.points=i.points,e))}function $x(t,e,{w:c,h:a,mw:o,mh:s,focals:i=ka.focals,focal:l=null,onProgress:p=null}={}){const x=c/2,f=a/2;let d=l,r=0;const g=l?1:i.length+9;if(!d){const m=new Map,B=Math.max(c,a)/c;let Y=t;const lt=X=>{if(X=Math.round(X*1e3)/1e3,!(X>.2&&X<3)||m.has(X))return;const at=Zo(null,X*c,{obs:Y,w:c,h:a});at.mode==="free"&&Oi(at,X*c,x,f),m.set(X,{s:at,e:at.mode==="free"?xo(at,X*c,x,f):1/0}),p?.(++r/g)};let et=[];for(let X=Math.max(1,Math.round(t.length/25));;X=Math.max(1,X>>1)){Y=t.filter((at,Ce)=>Ce%X===0),m.clear(),r=0;for(const at of i)lt(at*B);if(et=[...m.entries()].filter(([,at])=>Number.isFinite(at.e)).sort((at,Ce)=>at[0]-Ce[0]),et.length||X===1)break}if(!et.length)return p?.(1),null;const C=et.reduce((X,at,Ce)=>at[1].e<et[X][1].e?Ce:X,0),G=et[C][1].s,E=C>0?et[C-1][0]:et[C][0]*.8,j=C<et.length-1?et[C+1][0]:et[C][0]*1.25,ct=G.poses.map((X,at)=>X&&!X.lost?at:-1).filter(X=>X>=0),wt=G.pair[0],bt=X=>{const at={...G,poses:G.poses.map(Qt=>Qt&&{...Qt,R:Qt.R.map(Zt=>[...Zt]),C:[...Qt.C]}),points:new Map([...G.points].map(([Qt,Zt])=>[Qt,[...Zt]]))};ia(at.poses,at.points,at.obs,[wt,...ct.filter(Qt=>Qt!==wt)],X*c,x,f,8),p?.(++r/g);let Ce=0,Sc=0;for(const[Qt,Zt]of ro(at,X*c,x,f).values())Ce+=Qt*Zt,Sc+=Zt;return Sc?Ce/Sc:1/0},I=(Math.sqrt(5)-1)/2;let $=E,J=j,Mt=J-I*(J-$),N=$+I*(J-$),Q=bt(Mt),mt=bt(N);for(let X=0;X<7;X++)Q<mt?(J=N,N=Mt,mt=Q,Mt=J-I*(J-$),Q=bt(Mt)):($=Mt,Mt=N,Q=mt,N=$+I*(J-$),mt=bt(N));d=($+J)/2}const u=Zo(null,d*c,{obs:t,w:c,h:a});if(p?.(1),u.mode!=="free")return null;let v=d*c;const b=u.poses[u.pair[0]].C,S=u.poses[u.pair[0]].R;if(Oi(u,v,x,f),!l)for(let m=0;m<3;m++){const B=Vx(u,v,x,f),Y=Math.abs(B/v-1)<5e-4;if(v=B,Y)break}const T=ro(u,v,x,f),D=[...T.values()].map(m=>m[0]).sort((m,B)=>m-B),P=Math.max(1.5,3*(D[D.length>>1]??1)),K=[...T.entries()].filter(([m,B])=>u.points.has(m)&&B[0]<=P&&B[1]>=2),n=m=>t.flatMap((B,Y)=>B.has(m)?[e[Y]]:[]);let M=0,y=0;for(const[,m]of K)M+=m[0]*m[1],y+=m[1];const z=lo(Gi(S),[0,1,0]),h=Kx([...u.points.values()],z,b)??ll(u.points,z,b)??sl(u.points,z,b),w={v:1,w:c,h:a,mw:o||c,mh:s||a,mode:"free",f:fe(v),err:fe(y?M/y:xo(u,v,x,f)),frames:u.poses.map((m,B)=>[fe(e[B]),...Zi(m.R).map(fe),...m.C.map(fe)]),floor:h?[...h.n.map(fe),fe(h.d)]:null},k=[];for(const[m]of K.sort((B,Y)=>Y[1][1]-B[1][1])){if(k.length>=ka.points)break;const B=u.points.get(m),Y=n(m);Ui(w,B,Y)<=ka.slide*c&&k.push([B.map(fe),[fe(Y[0]),fe(Y.at(-1))]])}return{...w,points:k.map(m=>m[0]),seen:k.map(m=>m[1])}}function Ui(t,e,c){if(!c.length)return 1/0;const o=(c.length>24?c.filter((r,g)=>g%Math.ceil(c.length/24)===0||g===c.length-1):c).map(r=>io(Oc(e,ho(t,r).C)));let s=0;for(const r of[o[0],o.at(-1)])for(const g of o)s=Math.max(s,Math.acos(Math.min(1,Le(r,g))));const i=ho(t,c[c.length>>1]).C,l=Math.hypot(...Oc(e,i)),p=qi(e,Sa(io(Oc(e,i)),l*(.5/t.f)/Math.max(.001,Math.sin(s)))),x=t.frames,f=Math.max(1,Math.floor(x.length/40));let d=0;for(let r=0;r<x.length;r+=f){const g=Oo(t,e,x[r][0]),u=Oo(t,p,x[r][0]);g&&u&&(d=Math.max(d,Math.hypot(g[0]-u[0],g[1]-u[1])))}return d}function Xx(t,e,{mw:c,mh:a,focals:o=ka.focals,focal:s=null,onProgress:i=null,dense:l=!0}={}){if(t.length<3)throw Error("FLAT");const p=t[0].w,x=t[0].h,f=bo(t,{anchor:!0,onProgress:i&&(g=>i(g*.35))}),d=$x(f,e,{w:p,h:x,mw:c,mh:a,focals:o,focal:s,onProgress:i&&(g=>i(.35+g*.57))});if(d){const g=l?Fx(d,t,e,i&&(u=>i(.92+u*.08))):d;return i?.(1),g}const r=_i(t,(s??.7)*p);if(r.filter(g=>!g.lost).length<t.length*.5)throw Error("FLAT");return{v:1,w:p,h:x,mw:c||p,mh:a||x,mode:"tripod",frames:r.map((g,u)=>[fe(e[u]),...g.q.map(fe),fe(g.f)])}}function Fx(t,e,c,a=null,o=ka.dense){const s=bo(e,{anchor:!0,keep:o.keep,cols:o.cols,rows:o.rows,onProgress:a&&(g=>a(g*.8))}),i=new Map;s.forEach((g,u)=>{for(const[v,b]of g){let S=i.get(v);S||i.set(v,S=[]),S.push([c[u],b[0],b[1]])}});const l=[...i.values()].filter(g=>g.length>=o.minFrames),p=t.points??[],x=g=>p.some(u=>Math.abs(u[0]-g[0])+Math.abs(u[1]-g[1])+Math.abs(u[2]-g[2])<1e-6),f=t.seen??p.map(()=>[t.frames[0][0],t.frames.at(-1)[0]]),d=[...p],r=[...f];for(const g of l){if(d.length>=o.max)break;const u=Qx(t,g);!u||x(u)||Ui(t,u,g.map(v=>v[0]))>ka.slide*t.w||(d.push(u.map(fe)),r.push([fe(g[0][0]),fe(g.at(-1)[0])]))}return a?.(1),{...t,points:d,seen:r}}function ho(t,e){const c=t.frames,a=c.length;let o=0,s=Math.max(0,a-2);for(;o<s;){const g=o+s+1>>1;c[g][0]<=e?o=g:s=g-1}const i=c[o],l=c[Math.min(a-1,o+1)],p=l[0]>i[0]?Math.max(0,Math.min(1,(e-i[0])/(l[0]-i[0]))):0;let x=i.slice(1,5),f=l.slice(1,5);Ki(x,f)<0&&(f=f.map(g=>-g));const d=Yx(x,f,p),r=Ji(d);return t.mode==="tripod"?{R:r,C:[0,0,0],f:i[5]+(l[5]-i[5])*p}:{R:r,C:[0,1,2].map(g=>i[5+g]+(l[5+g]-i[5+g])*p),f:t.f}}const Ki=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3];function Yx(t,e,c){const a=Math.min(1,Math.max(-1,Ki(t,e)));if(a>.9995){const p=t.map((f,d)=>f+(e[d]-f)*c),x=Math.hypot(...p);return p.map(f=>f/x)}const o=Math.acos(a),s=Math.sin(o),i=Math.sin((1-c)*o)/s,l=Math.sin(c*o)/s;return t.map((p,x)=>p*i+e[x]*l)}function Oo(t,e,c){const a=ho(t,c),o=lo(a.R,t.mode==="tripod"?e:Oc(e,a.C));return o[2]>-1e-6?null:[t.w/2+a.f*o[0]/-o[2],t.h/2-a.f*o[1]/-o[2]]}function _x(t,e,c,a){const o=ho(t,a),s=io([(e-t.w/2)/o.f,-(c-t.h/2)/o.f,-1]);return{o:o.C,d:lo(Gi(o.R),s),pose:o}}function Qx(t,e){if(t.mode!=="free"||e.length<4)return null;const c=e.map(([l,p,x])=>_x(t,p,x,l));let a=0;for(const l of c)a=Math.max(a,Math.acos(Math.min(1,Le(l.d,c[0].d))));if(a<.5*Math.PI/180)return null;const o=[[0,0,0],[0,0,0],[0,0,0]],s=[0,0,0];for(const{o:l,d:p}of c)for(let x=0;x<3;x++)for(let f=0;f<3;f++){const d=(x===f?1:0)-p[x]*p[f];o[x][f]+=d,s[x]+=d*l[f]}const i=Zx(o,s);return i&&e.every(([l,p,x])=>{const f=Oo(t,i,l);return f&&Math.hypot(f[0]-p,f[1]-x)<1.5})?i:null}function Zx(t,e){const c=o=>o[0][0]*(o[1][1]*o[2][2]-o[1][2]*o[2][1])-o[0][1]*(o[1][0]*o[2][2]-o[1][2]*o[2][0])+o[0][2]*(o[1][0]*o[2][1]-o[1][1]*o[2][0]),a=c(t);return Math.abs(a)<1e-12?null:[0,1,2].map(o=>c(t.map((s,i)=>s.map((l,p)=>p===o?e[i]:l)))/a)}self.onmessage=t=>{let e=-1;const c=a=>{(a-e>=.02||a>=1)&&(e=a,self.postMessage({type:"progress",u:a}))};try{self.postMessage({type:"done",result:Xx(t.data.frames,t.data.times,{mw:t.data.mw,mh:t.data.mh,focal:t.data.focal??null,onProgress:c})})}catch(a){self.postMessage({type:"error",message:a.message||String(a)})}}})();