proofofwork_templ.go 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. // Code generated by templ - DO NOT EDIT.
  2. // templ: version: v0.3.960
  3. package proofofwork
  4. //lint:file-ignore SA4006 This context is only used if a nested component is present.
  5. import "github.com/a-h/templ"
  6. import templruntime "github.com/a-h/templ/runtime"
  7. import (
  8. "github.com/TecharoHQ/anubis"
  9. "github.com/TecharoHQ/anubis/lib/localization"
  10. )
  11. func page(localizer *localization.SimpleLocalizer) templ.Component {
  12. return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
  13. templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
  14. if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
  15. return templ_7745c5c3_CtxErr
  16. }
  17. templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
  18. if !templ_7745c5c3_IsBuffer {
  19. defer func() {
  20. templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
  21. if templ_7745c5c3_Err == nil {
  22. templ_7745c5c3_Err = templ_7745c5c3_BufErr
  23. }
  24. }()
  25. }
  26. ctx = templ.InitializeContext(ctx)
  27. templ_7745c5c3_Var1 := templ.GetChildren(ctx)
  28. if templ_7745c5c3_Var1 == nil {
  29. templ_7745c5c3_Var1 = templ.NopComponent
  30. }
  31. ctx = templ.ClearChildren(ctx)
  32. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"centered-div\"><img id=\"image\" style=\"width:100%;max-width:256px;\" src=\"")
  33. if templ_7745c5c3_Err != nil {
  34. return templ_7745c5c3_Err
  35. }
  36. var templ_7745c5c3_Var2 string
  37. templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" + anubis.Version)
  38. if templ_7745c5c3_Err != nil {
  39. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 10, Col: 165}
  40. }
  41. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
  42. if templ_7745c5c3_Err != nil {
  43. return templ_7745c5c3_Err
  44. }
  45. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\"> <img style=\"display:none;\" style=\"width:100%;max-width:256px;\" src=\"")
  46. if templ_7745c5c3_Err != nil {
  47. return templ_7745c5c3_Err
  48. }
  49. var templ_7745c5c3_Var3 string
  50. templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/img/happy.webp?cacheBuster=" + anubis.Version)
  51. if templ_7745c5c3_Err != nil {
  52. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 11, Col: 174}
  53. }
  54. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
  55. if templ_7745c5c3_Err != nil {
  56. return templ_7745c5c3_Err
  57. }
  58. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"><p id=\"status\">")
  59. if templ_7745c5c3_Err != nil {
  60. return templ_7745c5c3_Err
  61. }
  62. var templ_7745c5c3_Var4 string
  63. templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(localizer.T("loading"))
  64. if templ_7745c5c3_Err != nil {
  65. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 12, Col: 41}
  66. }
  67. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
  68. if templ_7745c5c3_Err != nil {
  69. return templ_7745c5c3_Err
  70. }
  71. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</p><script async type=\"module\" src=\"")
  72. if templ_7745c5c3_Err != nil {
  73. return templ_7745c5c3_Err
  74. }
  75. var templ_7745c5c3_Var5 string
  76. templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(anubis.BasePrefix + "/.within.website/x/cmd/anubis/static/js/main.mjs?cacheBuster=" + anubis.Version)
  77. if templ_7745c5c3_Err != nil {
  78. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 13, Col: 136}
  79. }
  80. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
  81. if templ_7745c5c3_Err != nil {
  82. return templ_7745c5c3_Err
  83. }
  84. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\"></script><div id=\"progress\" role=\"progressbar\" aria-labelledby=\"status\"><div class=\"bar-inner\"></div></div><details>")
  85. if templ_7745c5c3_Err != nil {
  86. return templ_7745c5c3_Err
  87. }
  88. if anubis.UseSimplifiedExplanation {
  89. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<p>")
  90. if templ_7745c5c3_Err != nil {
  91. return templ_7745c5c3_Err
  92. }
  93. var templ_7745c5c3_Var6 string
  94. templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(localizer.T("simplified_explanation"))
  95. if templ_7745c5c3_Err != nil {
  96. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 20, Col: 44}
  97. }
  98. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
  99. if templ_7745c5c3_Err != nil {
  100. return templ_7745c5c3_Err
  101. }
  102. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</p>")
  103. if templ_7745c5c3_Err != nil {
  104. return templ_7745c5c3_Err
  105. }
  106. } else {
  107. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<p>")
  108. if templ_7745c5c3_Err != nil {
  109. return templ_7745c5c3_Err
  110. }
  111. var templ_7745c5c3_Var7 string
  112. templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(localizer.T("ai_companies_explanation"))
  113. if templ_7745c5c3_Err != nil {
  114. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 24, Col: 46}
  115. }
  116. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
  117. if templ_7745c5c3_Err != nil {
  118. return templ_7745c5c3_Err
  119. }
  120. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</p><p>")
  121. if templ_7745c5c3_Err != nil {
  122. return templ_7745c5c3_Err
  123. }
  124. var templ_7745c5c3_Var8 string
  125. templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(localizer.T("anubis_compromise"))
  126. if templ_7745c5c3_Err != nil {
  127. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 27, Col: 39}
  128. }
  129. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
  130. if templ_7745c5c3_Err != nil {
  131. return templ_7745c5c3_Err
  132. }
  133. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</p><p>")
  134. if templ_7745c5c3_Err != nil {
  135. return templ_7745c5c3_Err
  136. }
  137. var templ_7745c5c3_Var9 string
  138. templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(localizer.T("hack_purpose"))
  139. if templ_7745c5c3_Err != nil {
  140. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 30, Col: 34}
  141. }
  142. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
  143. if templ_7745c5c3_Err != nil {
  144. return templ_7745c5c3_Err
  145. }
  146. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</p><p>")
  147. if templ_7745c5c3_Err != nil {
  148. return templ_7745c5c3_Err
  149. }
  150. var templ_7745c5c3_Var10 string
  151. templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(localizer.T("jshelter_note"))
  152. if templ_7745c5c3_Err != nil {
  153. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 33, Col: 35}
  154. }
  155. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
  156. if templ_7745c5c3_Err != nil {
  157. return templ_7745c5c3_Err
  158. }
  159. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</p>")
  160. if templ_7745c5c3_Err != nil {
  161. return templ_7745c5c3_Err
  162. }
  163. }
  164. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</details><noscript><p>")
  165. if templ_7745c5c3_Err != nil {
  166. return templ_7745c5c3_Err
  167. }
  168. var templ_7745c5c3_Var11 string
  169. templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(localizer.T("javascript_required"))
  170. if templ_7745c5c3_Err != nil {
  171. return templ.Error{Err: templ_7745c5c3_Err, FileName: `proofofwork.templ`, Line: 39, Col: 40}
  172. }
  173. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
  174. if templ_7745c5c3_Err != nil {
  175. return templ_7745c5c3_Err
  176. }
  177. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</p></noscript><div id=\"testarea\"></div></div>")
  178. if templ_7745c5c3_Err != nil {
  179. return templ_7745c5c3_Err
  180. }
  181. return nil
  182. })
  183. }
  184. var _ = templruntime.GeneratedTemplate