express-sweet 1.0.21 → 1.0.23

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 (490) hide show
  1. package/CHANGELOG.md +85 -22
  2. package/README.md +149 -12
  3. package/dist/build.common.js +3 -3
  4. package/dist/build.esm.js +3 -3
  5. package/docs/{templates → download/templates}/cjs/authentication.js +3 -3
  6. package/docs/{templates → download/templates}/cjs/config.js +0 -0
  7. package/docs/{templates → download/templates}/cjs/database.js +3 -3
  8. package/docs/{templates → download/templates}/cjs/view.js +0 -0
  9. package/docs/{templates → download/templates}/esm/authentication.js +3 -3
  10. package/docs/{templates → download/templates}/esm/config.js +0 -0
  11. package/docs/{templates → download/templates}/esm/database.js +3 -3
  12. package/docs/{templates → download/templates}/esm/view.js +0 -0
  13. package/docs/img/belongs-to-many.png +0 -0
  14. package/docs/img/belongs-to.png +0 -0
  15. package/docs/img/has-many.png +0 -0
  16. package/docs/img/has-one.png +0 -0
  17. package/docs/img/screencaps/login.png +0 -0
  18. package/docs/img/screencaps/personal-editing.png +0 -0
  19. package/docs/img/screencaps/personal.png +0 -0
  20. package/docs/img/screencaps/user-editing.png +0 -0
  21. package/docs/img/screencaps/users.png +0 -0
  22. package/docs/index.html +5660 -3093
  23. package/docs/theme/css/style.bundle.css +48542 -0
  24. package/docs/theme/js/scripts.bundle.js +7882 -0
  25. package/docs/theme/js/widgets.bundle.js +17949 -0
  26. package/docs/theme/media/svg/avatars/001-boy.svg +94 -0
  27. package/docs/theme/media/svg/avatars/002-girl.svg +139 -0
  28. package/docs/theme/media/svg/avatars/003-girl-1.svg +109 -0
  29. package/docs/theme/media/svg/avatars/004-boy-1.svg +109 -0
  30. package/docs/theme/media/svg/avatars/005-girl-2.svg +153 -0
  31. package/docs/theme/media/svg/avatars/006-girl-3.svg +120 -0
  32. package/docs/theme/media/svg/avatars/007-boy-2.svg +128 -0
  33. package/docs/theme/media/svg/avatars/008-boy-3.svg +106 -0
  34. package/docs/theme/media/svg/avatars/009-boy-4.svg +81 -0
  35. package/docs/theme/media/svg/avatars/010-girl-4.svg +107 -0
  36. package/docs/theme/media/svg/avatars/011-boy-5.svg +94 -0
  37. package/docs/theme/media/svg/avatars/012-girl-5.svg +114 -0
  38. package/docs/theme/media/svg/avatars/013-girl-6.svg +112 -0
  39. package/docs/theme/media/svg/avatars/014-girl-7.svg +89 -0
  40. package/docs/theme/media/svg/avatars/015-boy-6.svg +98 -0
  41. package/docs/theme/media/svg/avatars/016-boy-7.svg +109 -0
  42. package/docs/theme/media/svg/avatars/017-girl-8.svg +99 -0
  43. package/docs/theme/media/svg/avatars/018-girl-9.svg +92 -0
  44. package/docs/theme/media/svg/avatars/019-girl-10.svg +75 -0
  45. package/docs/theme/media/svg/avatars/020-girl-11.svg +89 -0
  46. package/docs/theme/media/svg/avatars/021-boy-8.svg +110 -0
  47. package/docs/theme/media/svg/avatars/022-girl-12.svg +91 -0
  48. package/docs/theme/media/svg/avatars/023-girl-13.svg +90 -0
  49. package/docs/theme/media/svg/avatars/024-boy-9.svg +123 -0
  50. package/docs/theme/media/svg/avatars/025-girl-14.svg +138 -0
  51. package/docs/theme/media/svg/avatars/026-boy-10.svg +110 -0
  52. package/docs/theme/media/svg/avatars/027-girl-15.svg +152 -0
  53. package/docs/theme/media/svg/avatars/028-girl-16.svg +97 -0
  54. package/docs/theme/media/svg/avatars/029-boy-11.svg +121 -0
  55. package/docs/theme/media/svg/avatars/030-girl-17.svg +115 -0
  56. package/docs/theme/media/svg/avatars/031-boy-12.svg +105 -0
  57. package/docs/theme/media/svg/avatars/032-boy-13.svg +101 -0
  58. package/docs/theme/media/svg/avatars/033-girl-18.svg +95 -0
  59. package/docs/theme/media/svg/avatars/034-boy-14.svg +84 -0
  60. package/docs/theme/media/svg/avatars/035-boy-15.svg +123 -0
  61. package/docs/theme/media/svg/avatars/036-girl-19.svg +119 -0
  62. package/docs/theme/media/svg/avatars/037-girl-20.svg +82 -0
  63. package/docs/theme/media/svg/avatars/038-boy-16.svg +78 -0
  64. package/docs/theme/media/svg/avatars/039-girl-21.svg +101 -0
  65. package/docs/theme/media/svg/avatars/040-boy-17.svg +83 -0
  66. package/docs/theme/media/svg/avatars/041-girl-22.svg +83 -0
  67. package/docs/theme/media/svg/avatars/042-girl-23.svg +86 -0
  68. package/docs/theme/media/svg/avatars/043-boy-18.svg +147 -0
  69. package/docs/theme/media/svg/avatars/044-boy-19.svg +116 -0
  70. package/docs/theme/media/svg/avatars/045-boy-20.svg +92 -0
  71. package/docs/theme/media/svg/avatars/046-girl-24.svg +114 -0
  72. package/docs/theme/media/svg/avatars/047-girl-25.svg +94 -0
  73. package/docs/theme/media/svg/avatars/048-boy-21.svg +91 -0
  74. package/docs/theme/media/svg/avatars/049-boy-22.svg +85 -0
  75. package/docs/theme/media/svg/avatars/050-girl-26.svg +87 -0
  76. package/docs/theme/media/svg/avatars/blank-dark.svg +5 -0
  77. package/docs/theme/media/svg/avatars/blank.svg +5 -0
  78. package/docs/theme/media/svg/brand-logos/adidas-9.svg +1 -0
  79. package/docs/theme/media/svg/brand-logos/adidas.svg +1 -0
  80. package/docs/theme/media/svg/brand-logos/airbnb-2.svg +1 -0
  81. package/docs/theme/media/svg/brand-logos/alcatel-mobile-3.svg +1 -0
  82. package/docs/theme/media/svg/brand-logos/amazon-dark.svg +13 -0
  83. package/docs/theme/media/svg/brand-logos/amazon.svg +1 -0
  84. package/docs/theme/media/svg/brand-logos/android-wordmark.svg +1 -0
  85. package/docs/theme/media/svg/brand-logos/angular-3.svg +1 -0
  86. package/docs/theme/media/svg/brand-logos/angular-icon-1.svg +1 -0
  87. package/docs/theme/media/svg/brand-logos/angular-icon.svg +1 -0
  88. package/docs/theme/media/svg/brand-logos/angular.svg +1 -0
  89. package/docs/theme/media/svg/brand-logos/aon.svg +18 -0
  90. package/docs/theme/media/svg/brand-logos/apigee.svg +1 -0
  91. package/docs/theme/media/svg/brand-logos/apple-black-dark.svg +10 -0
  92. package/docs/theme/media/svg/brand-logos/apple-black.svg +1 -0
  93. package/docs/theme/media/svg/brand-logos/apple-itunes.svg +1 -0
  94. package/docs/theme/media/svg/brand-logos/aries-2.svg +1 -0
  95. package/docs/theme/media/svg/brand-logos/asml-1.svg +1 -0
  96. package/docs/theme/media/svg/brand-logos/aspnetzero.svg +17 -0
  97. package/docs/theme/media/svg/brand-logos/atica.svg +16 -0
  98. package/docs/theme/media/svg/brand-logos/audi-11.svg +1 -0
  99. package/docs/theme/media/svg/brand-logos/aven.svg +20 -0
  100. package/docs/theme/media/svg/brand-logos/avis-1.svg +1 -0
  101. package/docs/theme/media/svg/brand-logos/avocode-inc.svg +1 -0
  102. package/docs/theme/media/svg/brand-logos/balloon.svg +1 -0
  103. package/docs/theme/media/svg/brand-logos/banco-santander-logo.svg +1 -0
  104. package/docs/theme/media/svg/brand-logos/beats-electronics.svg +1 -0
  105. package/docs/theme/media/svg/brand-logos/bebo.svg +42 -0
  106. package/docs/theme/media/svg/brand-logos/behance.svg +10 -0
  107. package/docs/theme/media/svg/brand-logos/biman-airlines-classic-logo.svg +1 -0
  108. package/docs/theme/media/svg/brand-logos/bookingcom-1.svg +1 -0
  109. package/docs/theme/media/svg/brand-logos/bootstrap-4.svg +1 -0
  110. package/docs/theme/media/svg/brand-logos/bootstrap-5.svg +1 -0
  111. package/docs/theme/media/svg/brand-logos/bootstrap5.svg +10 -0
  112. package/docs/theme/media/svg/brand-logos/bose.svg +1 -0
  113. package/docs/theme/media/svg/brand-logos/bp-2.svg +6 -0
  114. package/docs/theme/media/svg/brand-logos/bp-3.svg +1 -0
  115. package/docs/theme/media/svg/brand-logos/brantano.svg +1 -0
  116. package/docs/theme/media/svg/brand-logos/bride.svg +1 -0
  117. package/docs/theme/media/svg/brand-logos/british-council-1.svg +1 -0
  118. package/docs/theme/media/svg/brand-logos/brondi.svg +1 -0
  119. package/docs/theme/media/svg/brand-logos/campingaz-1.svg +1 -0
  120. package/docs/theme/media/svg/brand-logos/canon-logo.svg +1 -0
  121. package/docs/theme/media/svg/brand-logos/carrols.svg +1 -0
  122. package/docs/theme/media/svg/brand-logos/casio.svg +1 -0
  123. package/docs/theme/media/svg/brand-logos/caterpillar-2.svg +1 -0
  124. package/docs/theme/media/svg/brand-logos/citrix-6002.svg +1 -0
  125. package/docs/theme/media/svg/brand-logos/code-lab.svg +23 -0
  126. package/docs/theme/media/svg/brand-logos/codeigniter.svg +1 -0
  127. package/docs/theme/media/svg/brand-logos/comcast.svg +1 -0
  128. package/docs/theme/media/svg/brand-logos/conair.svg +1 -0
  129. package/docs/theme/media/svg/brand-logos/costa-2.svg +1 -0
  130. package/docs/theme/media/svg/brand-logos/costco-wholesale-logo.svg +1 -0
  131. package/docs/theme/media/svg/brand-logos/css-5.svg +1 -0
  132. package/docs/theme/media/svg/brand-logos/decathlon-logo.svg +1 -0
  133. package/docs/theme/media/svg/brand-logos/deloitte-1.svg +1 -0
  134. package/docs/theme/media/svg/brand-logos/depend.svg +1 -0
  135. package/docs/theme/media/svg/brand-logos/diesel-5.svg +1 -0
  136. package/docs/theme/media/svg/brand-logos/disqus.svg +49 -0
  137. package/docs/theme/media/svg/brand-logos/django-community.svg +1 -0
  138. package/docs/theme/media/svg/brand-logos/dribbble-icon-1.svg +1 -0
  139. package/docs/theme/media/svg/brand-logos/dribbble-pink.svg +1 -0
  140. package/docs/theme/media/svg/brand-logos/duolingo.svg +3 -0
  141. package/docs/theme/media/svg/brand-logos/dynamac.svg +1 -0
  142. package/docs/theme/media/svg/brand-logos/ebay.svg +1 -0
  143. package/docs/theme/media/svg/brand-logos/ember.svg +1 -0
  144. package/docs/theme/media/svg/brand-logos/envato.svg +1 -0
  145. package/docs/theme/media/svg/brand-logos/espacio-urbano.svg +1 -0
  146. package/docs/theme/media/svg/brand-logos/etoys-com.svg +1 -0
  147. package/docs/theme/media/svg/brand-logos/facebook-1.svg +1 -0
  148. package/docs/theme/media/svg/brand-logos/facebook-2.svg +1 -0
  149. package/docs/theme/media/svg/brand-logos/facebook-3.svg +1 -0
  150. package/docs/theme/media/svg/brand-logos/facebook-4.svg +4 -0
  151. package/docs/theme/media/svg/brand-logos/farmers-insurance-3.svg +1 -0
  152. package/docs/theme/media/svg/brand-logos/figma-1.svg +1 -0
  153. package/docs/theme/media/svg/brand-logos/foursquare.svg +1 -0
  154. package/docs/theme/media/svg/brand-logos/fox-hub.svg +6 -0
  155. package/docs/theme/media/svg/brand-logos/friday-s.svg +1 -0
  156. package/docs/theme/media/svg/brand-logos/fujifilm.svg +18 -0
  157. package/docs/theme/media/svg/brand-logos/funding-circle.svg +1 -0
  158. package/docs/theme/media/svg/brand-logos/garmin-1.svg +1 -0
  159. package/docs/theme/media/svg/brand-logos/general-electric.svg +1 -0
  160. package/docs/theme/media/svg/brand-logos/github-1.svg +12 -0
  161. package/docs/theme/media/svg/brand-logos/github-2.svg +1 -0
  162. package/docs/theme/media/svg/brand-logos/github-icon.svg +1 -0
  163. package/docs/theme/media/svg/brand-logos/github.svg +3 -0
  164. package/docs/theme/media/svg/brand-logos/gitlab.svg +1 -0
  165. package/docs/theme/media/svg/brand-logos/google-icon.svg +6 -0
  166. package/docs/theme/media/svg/brand-logos/google-photos.svg +1 -0
  167. package/docs/theme/media/svg/brand-logos/google-play-store.svg +1 -0
  168. package/docs/theme/media/svg/brand-logos/google-podcasts.svg +1 -0
  169. package/docs/theme/media/svg/brand-logos/google-tag-manager.svg +18 -0
  170. package/docs/theme/media/svg/brand-logos/gradiente-2.svg +1 -0
  171. package/docs/theme/media/svg/brand-logos/gulp-1.svg +1 -0
  172. package/docs/theme/media/svg/brand-logos/gulp.svg +1 -0
  173. package/docs/theme/media/svg/brand-logos/hbo.svg +1 -0
  174. package/docs/theme/media/svg/brand-logos/heavylift.svg +1 -0
  175. package/docs/theme/media/svg/brand-logos/hilton-buenos-aires.svg +1 -0
  176. package/docs/theme/media/svg/brand-logos/himel.svg +1 -0
  177. package/docs/theme/media/svg/brand-logos/honda-7.svg +1 -0
  178. package/docs/theme/media/svg/brand-logos/hp-2.svg +1 -0
  179. package/docs/theme/media/svg/brand-logos/hp-3.svg +4 -0
  180. package/docs/theme/media/svg/brand-logos/hp-hewlett-packard.svg +1 -0
  181. package/docs/theme/media/svg/brand-logos/html5.svg +1 -0
  182. package/docs/theme/media/svg/brand-logos/huggies-2.svg +1 -0
  183. package/docs/theme/media/svg/brand-logos/ikon-1.svg +1 -0
  184. package/docs/theme/media/svg/brand-logos/infography.svg +1 -0
  185. package/docs/theme/media/svg/brand-logos/instagram-2-1.svg +1 -0
  186. package/docs/theme/media/svg/brand-logos/instagram-2016.svg +1 -0
  187. package/docs/theme/media/svg/brand-logos/intermarche-2.svg +53 -0
  188. package/docs/theme/media/svg/brand-logos/invision.svg +1 -0
  189. package/docs/theme/media/svg/brand-logos/javascript-2.svg +1 -0
  190. package/docs/theme/media/svg/brand-logos/javascript-4.svg +1 -0
  191. package/docs/theme/media/svg/brand-logos/javascript.svg +1 -0
  192. package/docs/theme/media/svg/brand-logos/jelcz.svg +1 -0
  193. package/docs/theme/media/svg/brand-logos/jfits.svg +1 -0
  194. package/docs/theme/media/svg/brand-logos/jquery-2.svg +1 -0
  195. package/docs/theme/media/svg/brand-logos/jquery.svg +1 -0
  196. package/docs/theme/media/svg/brand-logos/kanba.svg +25 -0
  197. package/docs/theme/media/svg/brand-logos/keysight-logo.svg +1 -0
  198. package/docs/theme/media/svg/brand-logos/kickstarter.svg +23 -0
  199. package/docs/theme/media/svg/brand-logos/komatsu-3.svg +38 -0
  200. package/docs/theme/media/svg/brand-logos/koni-special.svg +1 -0
  201. package/docs/theme/media/svg/brand-logos/kpmg.svg +14 -0
  202. package/docs/theme/media/svg/brand-logos/laravel-2.svg +10 -0
  203. package/docs/theme/media/svg/brand-logos/last-fm-1.svg +1 -0
  204. package/docs/theme/media/svg/brand-logos/leaf.svg +24 -0
  205. package/docs/theme/media/svg/brand-logos/leclerc-1.svg +1 -0
  206. package/docs/theme/media/svg/brand-logos/legrand.svg +1 -0
  207. package/docs/theme/media/svg/brand-logos/leica-2.svg +1 -0
  208. package/docs/theme/media/svg/brand-logos/levis.svg +1 -0
  209. package/docs/theme/media/svg/brand-logos/lg-electronics.svg +1 -0
  210. package/docs/theme/media/svg/brand-logos/lidl-supermarkets.svg +1 -0
  211. package/docs/theme/media/svg/brand-logos/linkedin-1.svg +14 -0
  212. package/docs/theme/media/svg/brand-logos/linkedin-2.svg +11 -0
  213. package/docs/theme/media/svg/brand-logos/linkedin.svg +1 -0
  214. package/docs/theme/media/svg/brand-logos/lloyds-of-london-logo.svg +1 -0
  215. package/docs/theme/media/svg/brand-logos/mastercard-icon.svg +13 -0
  216. package/docs/theme/media/svg/brand-logos/maxis-communications-logo.svg +1 -0
  217. package/docs/theme/media/svg/brand-logos/metro-1.svg +1 -0
  218. package/docs/theme/media/svg/brand-logos/metro-4.svg +1 -0
  219. package/docs/theme/media/svg/brand-logos/metro-by-t-mobile.svg +1 -0
  220. package/docs/theme/media/svg/brand-logos/microsoft-5.svg +1 -0
  221. package/docs/theme/media/svg/brand-logos/miller-6.svg +1 -0
  222. package/docs/theme/media/svg/brand-logos/minol.svg +1 -0
  223. package/docs/theme/media/svg/brand-logos/mnd.svg +1 -0
  224. package/docs/theme/media/svg/brand-logos/msn.svg +1 -0
  225. package/docs/theme/media/svg/brand-logos/mysql-2.svg +1 -0
  226. package/docs/theme/media/svg/brand-logos/nasa.svg +21 -0
  227. package/docs/theme/media/svg/brand-logos/nestle-4.svg +1 -0
  228. package/docs/theme/media/svg/brand-logos/new-beko-logo.svg +1 -0
  229. package/docs/theme/media/svg/brand-logos/nike-4.svg +1 -0
  230. package/docs/theme/media/svg/brand-logos/node-sass.svg +1 -0
  231. package/docs/theme/media/svg/brand-logos/noht.svg +1 -0
  232. package/docs/theme/media/svg/brand-logos/npm.svg +1 -0
  233. package/docs/theme/media/svg/brand-logos/ocaml.svg +1 -0
  234. package/docs/theme/media/svg/brand-logos/oger-tours.svg +1 -0
  235. package/docs/theme/media/svg/brand-logos/origin-4.svg +1 -0
  236. package/docs/theme/media/svg/brand-logos/paypie.svg +1 -0
  237. package/docs/theme/media/svg/brand-logos/pinterest-p.svg +10 -0
  238. package/docs/theme/media/svg/brand-logos/pinterest.svg +1 -0
  239. package/docs/theme/media/svg/brand-logos/plurk.svg +47 -0
  240. package/docs/theme/media/svg/brand-logos/puma-logo.svg +1 -0
  241. package/docs/theme/media/svg/brand-logos/python-5.svg +1 -0
  242. package/docs/theme/media/svg/brand-logos/quilosa.svg +5 -0
  243. package/docs/theme/media/svg/brand-logos/react-native-firebase-1.svg +1 -0
  244. package/docs/theme/media/svg/brand-logos/react-router.svg +1 -0
  245. package/docs/theme/media/svg/brand-logos/react.svg +1 -0
  246. package/docs/theme/media/svg/brand-logos/redbull.svg +1 -0
  247. package/docs/theme/media/svg/brand-logos/reddit.svg +9 -0
  248. package/docs/theme/media/svg/brand-logos/rgb.svg +59 -0
  249. package/docs/theme/media/svg/brand-logos/sass-1.svg +1 -0
  250. package/docs/theme/media/svg/brand-logos/seat-pg.svg +1 -0
  251. package/docs/theme/media/svg/brand-logos/sentry-3.svg +1 -0
  252. package/docs/theme/media/svg/brand-logos/shell.svg +1 -0
  253. package/docs/theme/media/svg/brand-logos/siplast.svg +1 -0
  254. package/docs/theme/media/svg/brand-logos/slack-icon.svg +6 -0
  255. package/docs/theme/media/svg/brand-logos/slack-new-logo.svg +1 -0
  256. package/docs/theme/media/svg/brand-logos/slack.svg +1 -0
  257. package/docs/theme/media/svg/brand-logos/smartphone.svg +5 -0
  258. package/docs/theme/media/svg/brand-logos/snowbird.svg +1 -0
  259. package/docs/theme/media/svg/brand-logos/soriana-logo-1.svg +1 -0
  260. package/docs/theme/media/svg/brand-logos/sparkpost.svg +1 -0
  261. package/docs/theme/media/svg/brand-logos/spotify-2.svg +1 -0
  262. package/docs/theme/media/svg/brand-logos/spotify-logo.svg +1 -0
  263. package/docs/theme/media/svg/brand-logos/spotify.svg +13 -0
  264. package/docs/theme/media/svg/brand-logos/spring-3.svg +10 -0
  265. package/docs/theme/media/svg/brand-logos/sprint-nextel.svg +1 -0
  266. package/docs/theme/media/svg/brand-logos/stabilo.svg +1 -0
  267. package/docs/theme/media/svg/brand-logos/strava-wordmark-1.svg +1 -0
  268. package/docs/theme/media/svg/brand-logos/stream-1.svg +1 -0
  269. package/docs/theme/media/svg/brand-logos/super-cuts.svg +1 -0
  270. package/docs/theme/media/svg/brand-logos/suzuki-motor-corporation-logo.svg +1 -0
  271. package/docs/theme/media/svg/brand-logos/suzuki.svg +1 -0
  272. package/docs/theme/media/svg/brand-logos/swarm.svg +1 -0
  273. package/docs/theme/media/svg/brand-logos/syngenta.svg +1 -0
  274. package/docs/theme/media/svg/brand-logos/telegram-2.svg +24 -0
  275. package/docs/theme/media/svg/brand-logos/telegram.svg +4 -0
  276. package/docs/theme/media/svg/brand-logos/tempstar.svg +1 -0
  277. package/docs/theme/media/svg/brand-logos/the-blockchain-group-tbg.svg +1 -0
  278. package/docs/theme/media/svg/brand-logos/thomas-1.svg +1 -0
  279. package/docs/theme/media/svg/brand-logos/thuisbezorgd.svg +1 -0
  280. package/docs/theme/media/svg/brand-logos/thule-2.svg +1 -0
  281. package/docs/theme/media/svg/brand-logos/ticketmaster-5.svg +1 -0
  282. package/docs/theme/media/svg/brand-logos/tofas-logo.svg +1 -0
  283. package/docs/theme/media/svg/brand-logos/tower.svg +4 -0
  284. package/docs/theme/media/svg/brand-logos/treva.svg +11 -0
  285. package/docs/theme/media/svg/brand-logos/trimble-2.svg +55 -0
  286. package/docs/theme/media/svg/brand-logos/trivago.svg +1 -0
  287. package/docs/theme/media/svg/brand-logos/truman.svg +58 -0
  288. package/docs/theme/media/svg/brand-logos/tvit.svg +11 -0
  289. package/docs/theme/media/svg/brand-logos/twitch.svg +5 -0
  290. package/docs/theme/media/svg/brand-logos/twitter-2.svg +4 -0
  291. package/docs/theme/media/svg/brand-logos/twitter.svg +10 -0
  292. package/docs/theme/media/svg/brand-logos/typescript-1.svg +6 -0
  293. package/docs/theme/media/svg/brand-logos/unilever-2.svg +1 -0
  294. package/docs/theme/media/svg/brand-logos/university-of-cambridge.svg +1 -0
  295. package/docs/theme/media/svg/brand-logos/urw-software.svg +1 -0
  296. package/docs/theme/media/svg/brand-logos/verizon-2015.svg +1 -0
  297. package/docs/theme/media/svg/brand-logos/vimeo-icon.svg +1 -0
  298. package/docs/theme/media/svg/brand-logos/vimeo.svg +1 -0
  299. package/docs/theme/media/svg/brand-logos/visa-icon.svg +5 -0
  300. package/docs/theme/media/svg/brand-logos/visa.svg +1 -0
  301. package/docs/theme/media/svg/brand-logos/vodafone.svg +3 -0
  302. package/docs/theme/media/svg/brand-logos/volicity-9.svg +10 -0
  303. package/docs/theme/media/svg/brand-logos/vue-9.svg +1 -0
  304. package/docs/theme/media/svg/brand-logos/vype.svg +1 -0
  305. package/docs/theme/media/svg/brand-logos/webasto-logo.svg +1 -0
  306. package/docs/theme/media/svg/brand-logos/webpack-icon.svg +1 -0
  307. package/docs/theme/media/svg/brand-logos/webpack.svg +1 -0
  308. package/docs/theme/media/svg/brand-logos/west-marine.svg +1 -0
  309. package/docs/theme/media/svg/brand-logos/worth.svg +1 -0
  310. package/docs/theme/media/svg/brand-logos/xing-icon.svg +1 -0
  311. package/docs/theme/media/svg/brand-logos/youtube-3.svg +1 -0
  312. package/docs/theme/media/svg/brand-logos/youtube-play.svg +4 -0
  313. package/docs/theme/media/svg/brand-logos/youtube.svg +1 -0
  314. package/docs/theme/media/svg/brand-logos/ziprecruiter-blacktext.svg +1 -0
  315. package/docs/theme/media/svg/brand-logos/zurich-logo.svg +1 -0
  316. package/docs/theme/media/svg/card-logos/american-express-dark.svg +25 -0
  317. package/docs/theme/media/svg/card-logos/american-express.svg +32 -0
  318. package/docs/theme/media/svg/card-logos/bitcoin 1.svg +7 -0
  319. package/docs/theme/media/svg/card-logos/dark/american-express.svg +25 -0
  320. package/docs/theme/media/svg/card-logos/dark/mastercard.svg +6 -0
  321. package/docs/theme/media/svg/card-logos/dark/visa.svg +5 -0
  322. package/docs/theme/media/svg/card-logos/mastercard-dark.svg +6 -0
  323. package/docs/theme/media/svg/card-logos/mastercard.svg +13 -0
  324. package/docs/theme/media/svg/card-logos/visa-dark.svg +5 -0
  325. package/docs/theme/media/svg/card-logos/visa.svg +5 -0
  326. package/docs/theme/media/svg/coins/binance.svg +1 -0
  327. package/docs/theme/media/svg/coins/bitcoin.svg +2 -0
  328. package/docs/theme/media/svg/coins/chainlink.svg +1 -0
  329. package/docs/theme/media/svg/coins/coin.svg +1 -0
  330. package/docs/theme/media/svg/coins/ethereum.svg +1 -0
  331. package/docs/theme/media/svg/coins/filecoin.svg +1 -0
  332. package/docs/theme/media/svg/files/ai-dark.svg +9 -0
  333. package/docs/theme/media/svg/files/ai.svg +9 -0
  334. package/docs/theme/media/svg/files/blank-image-dark.svg +13 -0
  335. package/docs/theme/media/svg/files/blank-image.svg +13 -0
  336. package/docs/theme/media/svg/files/css-dark.svg +10 -0
  337. package/docs/theme/media/svg/files/css.svg +10 -0
  338. package/docs/theme/media/svg/files/dark/ai.svg +9 -0
  339. package/docs/theme/media/svg/files/dark/css.svg +10 -0
  340. package/docs/theme/media/svg/files/dark/doc.svg +10 -0
  341. package/docs/theme/media/svg/files/dark/folder-document.svg +10 -0
  342. package/docs/theme/media/svg/files/dark/pdf.svg +10 -0
  343. package/docs/theme/media/svg/files/dark/sql.svg +10 -0
  344. package/docs/theme/media/svg/files/dark/tif.svg +10 -0
  345. package/docs/theme/media/svg/files/dark/upload.svg +5 -0
  346. package/docs/theme/media/svg/files/dark/xml.svg +10 -0
  347. package/docs/theme/media/svg/files/doc-dark.svg +10 -0
  348. package/docs/theme/media/svg/files/doc.svg +10 -0
  349. package/docs/theme/media/svg/files/folder-document-dark.svg +10 -0
  350. package/docs/theme/media/svg/files/folder-document.svg +3 -0
  351. package/docs/theme/media/svg/files/pdf-dark.svg +10 -0
  352. package/docs/theme/media/svg/files/pdf.svg +10 -0
  353. package/docs/theme/media/svg/files/sql-dark.svg +10 -0
  354. package/docs/theme/media/svg/files/sql.svg +10 -0
  355. package/docs/theme/media/svg/files/tif-dark.svg +10 -0
  356. package/docs/theme/media/svg/files/tif.svg +10 -0
  357. package/docs/theme/media/svg/files/upload-dark.svg +5 -0
  358. package/docs/theme/media/svg/files/upload.svg +5 -0
  359. package/docs/theme/media/svg/files/xml-dark.svg +10 -0
  360. package/docs/theme/media/svg/files/xml.svg +10 -0
  361. package/docs/theme/media/svg/food-icons/cheeseburger.svg +42 -0
  362. package/docs/theme/media/svg/food-icons/cheesecake.svg +39 -0
  363. package/docs/theme/media/svg/food-icons/coffee.svg +25 -0
  364. package/docs/theme/media/svg/food-icons/salad.svg +27 -0
  365. package/docs/theme/media/svg/food-icons/spaghetti.svg +37 -0
  366. package/docs/theme/media/svg/general/rhone.svg +32 -0
  367. package/docs/theme/media/svg/humans/custom-1.svg +10 -0
  368. package/docs/theme/media/svg/illustrations/easy/1-dark.svg +9 -0
  369. package/docs/theme/media/svg/illustrations/easy/1.svg +9 -0
  370. package/docs/theme/media/svg/illustrations/easy/2-dark.svg +9 -0
  371. package/docs/theme/media/svg/illustrations/easy/2.svg +9 -0
  372. package/docs/theme/media/svg/illustrations/easy/3-dark.svg +11 -0
  373. package/docs/theme/media/svg/illustrations/easy/3.svg +11 -0
  374. package/docs/theme/media/svg/illustrations/easy/4.svg +8 -0
  375. package/docs/theme/media/svg/illustrations/easy/5.svg +8 -0
  376. package/docs/theme/media/svg/illustrations/easy/6.svg +9 -0
  377. package/docs/theme/media/svg/illustrations/easy/7.svg +8 -0
  378. package/docs/theme/media/svg/illustrations/landing.svg +50 -0
  379. package/docs/theme/media/svg/illustrations/sigma/illustration-realestate.svg +100 -0
  380. package/docs/theme/media/svg/illustrations/sigma/question.svg +87 -0
  381. package/docs/theme/media/svg/illustrations/sigma/volume-1-dark.svg +140 -0
  382. package/docs/theme/media/svg/illustrations/sigma/volume-1.svg +146 -0
  383. package/docs/theme/media/svg/misc/eolic-energy.svg +51 -0
  384. package/docs/theme/media/svg/misc/hot-air-balloon.svg +1 -0
  385. package/docs/theme/media/svg/misc/infography.svg +1 -0
  386. package/docs/theme/media/svg/misc/octagon.svg +3 -0
  387. package/docs/theme/media/svg/misc/puzzle.svg +1 -0
  388. package/docs/theme/media/svg/misc/recycling.svg +56 -0
  389. package/docs/theme/media/svg/misc/retweet.svg +55 -0
  390. package/docs/theme/media/svg/misc/smartphone-2-dark.svg +5 -0
  391. package/docs/theme/media/svg/misc/smartphone-2.svg +5 -0
  392. package/docs/theme/media/svg/misc/smartphone-dark.svg +5 -0
  393. package/docs/theme/media/svg/misc/smartphone.svg +5 -0
  394. package/docs/theme/media/svg/misc/taieri.svg +13 -0
  395. package/docs/theme/media/svg/misc/video-play.svg +17 -0
  396. package/docs/theme/media/svg/payment-methods/americanexpress.svg +14 -0
  397. package/docs/theme/media/svg/payment-methods/mastercard.svg +20 -0
  398. package/docs/theme/media/svg/payment-methods/paypal.svg +7 -0
  399. package/docs/theme/media/svg/payment-methods/visa.svg +4 -0
  400. package/docs/theme/media/svg/products-categories/gaming.svg +39 -0
  401. package/docs/theme/media/svg/products-categories/gloves.svg +17 -0
  402. package/docs/theme/media/svg/products-categories/shoes.svg +14 -0
  403. package/docs/theme/media/svg/products-categories/t-shirt.svg +15 -0
  404. package/docs/theme/media/svg/products-categories/watch.svg +16 -0
  405. package/docs/theme/media/svg/shapes/abstract-1-dark.svg +16 -0
  406. package/docs/theme/media/svg/shapes/abstract-1.svg +16 -0
  407. package/docs/theme/media/svg/shapes/abstract-10.svg +9 -0
  408. package/docs/theme/media/svg/shapes/abstract-2-dark.svg +12 -0
  409. package/docs/theme/media/svg/shapes/abstract-2.svg +5 -0
  410. package/docs/theme/media/svg/shapes/abstract-3-dark.svg +13 -0
  411. package/docs/theme/media/svg/shapes/abstract-3.svg +13 -0
  412. package/docs/theme/media/svg/shapes/abstract-4-dark.svg +11 -0
  413. package/docs/theme/media/svg/shapes/abstract-4.svg +11 -0
  414. package/docs/theme/media/svg/shapes/abstract-5-dark.svg +14 -0
  415. package/docs/theme/media/svg/shapes/abstract-5.svg +14 -0
  416. package/docs/theme/media/svg/shapes/abstract-6.svg +3 -0
  417. package/docs/theme/media/svg/shapes/abstract-7.svg +9 -0
  418. package/docs/theme/media/svg/shapes/abstract-8.svg +16 -0
  419. package/docs/theme/media/svg/shapes/abstract-9.svg +9 -0
  420. package/docs/theme/media/svg/shapes/bitcoin.svg +9 -0
  421. package/docs/theme/media/svg/shapes/dogecoin.svg +10 -0
  422. package/docs/theme/media/svg/shapes/ethereum.svg +8 -0
  423. package/docs/theme/media/svg/shapes/man-head.svg +0 -0
  424. package/docs/theme/media/svg/shapes/top-green.png +0 -0
  425. package/docs/theme/media/svg/shapes/wave-bg-dark.svg +14 -0
  426. package/docs/theme/media/svg/shapes/wave-bg-purple.svg +14 -0
  427. package/docs/theme/media/svg/shapes/wave-bg-red.svg +14 -0
  428. package/docs/theme/media/svg/shapes/widget-bg-1.png +0 -0
  429. package/docs/theme/media/svg/shapes/widget-bg-2.png +0 -0
  430. package/docs/theme/media/svg/social-logos/dribbble.svg +4 -0
  431. package/docs/theme/media/svg/social-logos/facebook.svg +4 -0
  432. package/docs/theme/media/svg/social-logos/github.svg +3 -0
  433. package/docs/theme/media/svg/social-logos/google.svg +6 -0
  434. package/docs/theme/media/svg/social-logos/instagram.svg +22 -0
  435. package/docs/theme/media/svg/social-logos/twitter.svg +10 -0
  436. package/docs/theme/media/svg/social-logos/youtube.svg +4 -0
  437. package/docs/theme/plugins/custom/prismjs/prismjs.bundle.css +192 -0
  438. package/docs/theme/plugins/custom/prismjs/prismjs.bundle.js +3485 -0
  439. package/docs/theme/plugins/global/fonts/@fortawesome/fa-brands-400.ttf +0 -0
  440. package/docs/theme/plugins/global/fonts/@fortawesome/fa-brands-400.woff2 +0 -0
  441. package/docs/theme/plugins/global/fonts/@fortawesome/fa-regular-400.ttf +0 -0
  442. package/docs/theme/plugins/global/fonts/@fortawesome/fa-regular-400.woff2 +0 -0
  443. package/docs/theme/plugins/global/fonts/@fortawesome/fa-solid-900.ttf +0 -0
  444. package/docs/theme/plugins/global/fonts/@fortawesome/fa-solid-900.woff2 +0 -0
  445. package/docs/theme/plugins/global/fonts/@fortawesome/fa-v4compatibility.ttf +0 -0
  446. package/docs/theme/plugins/global/fonts/@fortawesome/fa-v4compatibility.woff2 +0 -0
  447. package/docs/theme/plugins/global/fonts/bootstrap-icons/bootstrap-icons.woff +0 -0
  448. package/docs/theme/plugins/global/fonts/bootstrap-icons/bootstrap-icons.woff2 +0 -0
  449. package/docs/theme/plugins/global/fonts/fonticon/fonticon.css +235 -0
  450. package/docs/theme/plugins/global/fonts/fonticon/fonticon.eot +0 -0
  451. package/docs/theme/plugins/global/fonts/fonticon/fonticon.svg +225 -0
  452. package/docs/theme/plugins/global/fonts/fonticon/fonticon.ttf +0 -0
  453. package/docs/theme/plugins/global/fonts/fonticon/fonticon.woff +0 -0
  454. package/docs/theme/plugins/global/fonts/fonticon/fonticon.woff2 +0 -0
  455. package/docs/theme/plugins/global/fonts/line-awesome/la-brands-400.eot +0 -0
  456. package/docs/theme/plugins/global/fonts/line-awesome/la-brands-400.svg +1313 -0
  457. package/docs/theme/plugins/global/fonts/line-awesome/la-brands-400.ttf +0 -0
  458. package/docs/theme/plugins/global/fonts/line-awesome/la-brands-400.woff +0 -0
  459. package/docs/theme/plugins/global/fonts/line-awesome/la-brands-400.woff2 +0 -0
  460. package/docs/theme/plugins/global/fonts/line-awesome/la-regular-400.eot +0 -0
  461. package/docs/theme/plugins/global/fonts/line-awesome/la-regular-400.svg +467 -0
  462. package/docs/theme/plugins/global/fonts/line-awesome/la-regular-400.ttf +0 -0
  463. package/docs/theme/plugins/global/fonts/line-awesome/la-regular-400.woff +0 -0
  464. package/docs/theme/plugins/global/fonts/line-awesome/la-regular-400.woff2 +0 -0
  465. package/docs/theme/plugins/global/fonts/line-awesome/la-solid-900.eot +0 -0
  466. package/docs/theme/plugins/global/fonts/line-awesome/la-solid-900.svg +2894 -0
  467. package/docs/theme/plugins/global/fonts/line-awesome/la-solid-900.ttf +0 -0
  468. package/docs/theme/plugins/global/fonts/line-awesome/la-solid-900.woff +0 -0
  469. package/docs/theme/plugins/global/fonts/line-awesome/la-solid-900.woff2 +0 -0
  470. package/docs/theme/plugins/global/plugins.bundle.css +34622 -0
  471. package/docs/theme/plugins/global/plugins.bundle.js +71788 -0
  472. package/hero.svg +1 -0
  473. package/package.json +4 -2
  474. package/screencaps/login.png +0 -0
  475. package/screencaps/personal-editing.png +0 -0
  476. package/screencaps/personal.png +0 -0
  477. package/screencaps/user-editing.png +0 -0
  478. package/screencaps/users.png +0 -0
  479. package/types/interfaces/AuthenticationOptions.d.ts +5 -5
  480. package/types/interfaces/ViewOptions.d.ts +14 -0
  481. package/types/middlewares/Authentication.d.ts +8 -0
  482. package/docs/docs.css +0 -284
  483. package/docs/docs.js +0 -41
  484. package/docs/img/associations/belongs-to-many.png +0 -0
  485. package/docs/img/associations/belongs-to.png +0 -0
  486. package/docs/img/associations/has-many.png +0 -0
  487. package/docs/img/associations/has-one.png +0 -0
  488. package/docs/img/demos/login&users.jfif +0 -0
  489. package/docs/img/hero.svg +0 -1
  490. package/docs/img/logo.svg +0 -12
@@ -0,0 +1,3485 @@
1
+
2
+ /* **********************************************
3
+ Begin prism-core.js
4
+ ********************************************** */
5
+
6
+ /// <reference lib="WebWorker"/>
7
+
8
+ var _self = (typeof window !== 'undefined')
9
+ ? window // if in browser
10
+ : (
11
+ (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
12
+ ? self // if in worker
13
+ : {} // if in node js
14
+ );
15
+
16
+ /**
17
+ * Prism: Lightweight, robust, elegant syntax highlighting
18
+ *
19
+ * @license MIT <https://opensource.org/licenses/MIT>
20
+ * @author Lea Verou <https://lea.verou.me>
21
+ * @namespace
22
+ * @public
23
+ */
24
+ var Prism = (function (_self) {
25
+
26
+ // Private helper vars
27
+ var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
28
+ var uniqueId = 0;
29
+
30
+ // The grammar object for plaintext
31
+ var plainTextGrammar = {};
32
+
33
+
34
+ var _ = {
35
+ /**
36
+ * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
37
+ * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
38
+ * additional languages or plugins yourself.
39
+ *
40
+ * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
41
+ *
42
+ * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
43
+ * empty Prism object into the global scope before loading the Prism script like this:
44
+ *
45
+ * ```js
46
+ * window.Prism = window.Prism || {};
47
+ * Prism.manual = true;
48
+ * // add a new <script> to load Prism's script
49
+ * ```
50
+ *
51
+ * @default false
52
+ * @type {boolean}
53
+ * @memberof Prism
54
+ * @public
55
+ */
56
+ manual: _self.Prism && _self.Prism.manual,
57
+ /**
58
+ * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
59
+ * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
60
+ * own worker, you don't want it to do this.
61
+ *
62
+ * By setting this value to `true`, Prism will not add its own listeners to the worker.
63
+ *
64
+ * You obviously have to change this value before Prism executes. To do this, you can add an
65
+ * empty Prism object into the global scope before loading the Prism script like this:
66
+ *
67
+ * ```js
68
+ * window.Prism = window.Prism || {};
69
+ * Prism.disableWorkerMessageHandler = true;
70
+ * // Load Prism's script
71
+ * ```
72
+ *
73
+ * @default false
74
+ * @type {boolean}
75
+ * @memberof Prism
76
+ * @public
77
+ */
78
+ disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
79
+
80
+ /**
81
+ * A namespace for utility methods.
82
+ *
83
+ * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
84
+ * change or disappear at any time.
85
+ *
86
+ * @namespace
87
+ * @memberof Prism
88
+ */
89
+ util: {
90
+ encode: function encode(tokens) {
91
+ if (tokens instanceof Token) {
92
+ return new Token(tokens.type, encode(tokens.content), tokens.alias);
93
+ } else if (Array.isArray(tokens)) {
94
+ return tokens.map(encode);
95
+ } else {
96
+ return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
97
+ }
98
+ },
99
+
100
+ /**
101
+ * Returns the name of the type of the given value.
102
+ *
103
+ * @param {any} o
104
+ * @returns {string}
105
+ * @example
106
+ * type(null) === 'Null'
107
+ * type(undefined) === 'Undefined'
108
+ * type(123) === 'Number'
109
+ * type('foo') === 'String'
110
+ * type(true) === 'Boolean'
111
+ * type([1, 2]) === 'Array'
112
+ * type({}) === 'Object'
113
+ * type(String) === 'Function'
114
+ * type(/abc+/) === 'RegExp'
115
+ */
116
+ type: function (o) {
117
+ return Object.prototype.toString.call(o).slice(8, -1);
118
+ },
119
+
120
+ /**
121
+ * Returns a unique number for the given object. Later calls will still return the same number.
122
+ *
123
+ * @param {Object} obj
124
+ * @returns {number}
125
+ */
126
+ objId: function (obj) {
127
+ if (!obj['__id']) {
128
+ Object.defineProperty(obj, '__id', { value: ++uniqueId });
129
+ }
130
+ return obj['__id'];
131
+ },
132
+
133
+ /**
134
+ * Creates a deep clone of the given object.
135
+ *
136
+ * The main intended use of this function is to clone language definitions.
137
+ *
138
+ * @param {T} o
139
+ * @param {Record<number, any>} [visited]
140
+ * @returns {T}
141
+ * @template T
142
+ */
143
+ clone: function deepClone(o, visited) {
144
+ visited = visited || {};
145
+
146
+ var clone; var id;
147
+ switch (_.util.type(o)) {
148
+ case 'Object':
149
+ id = _.util.objId(o);
150
+ if (visited[id]) {
151
+ return visited[id];
152
+ }
153
+ clone = /** @type {Record<string, any>} */ ({});
154
+ visited[id] = clone;
155
+
156
+ for (var key in o) {
157
+ if (o.hasOwnProperty(key)) {
158
+ clone[key] = deepClone(o[key], visited);
159
+ }
160
+ }
161
+
162
+ return /** @type {any} */ (clone);
163
+
164
+ case 'Array':
165
+ id = _.util.objId(o);
166
+ if (visited[id]) {
167
+ return visited[id];
168
+ }
169
+ clone = [];
170
+ visited[id] = clone;
171
+
172
+ (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
173
+ clone[i] = deepClone(v, visited);
174
+ });
175
+
176
+ return /** @type {any} */ (clone);
177
+
178
+ default:
179
+ return o;
180
+ }
181
+ },
182
+
183
+ /**
184
+ * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
185
+ *
186
+ * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
187
+ *
188
+ * @param {Element} element
189
+ * @returns {string}
190
+ */
191
+ getLanguage: function (element) {
192
+ while (element) {
193
+ var m = lang.exec(element.className);
194
+ if (m) {
195
+ return m[1].toLowerCase();
196
+ }
197
+ element = element.parentElement;
198
+ }
199
+ return 'none';
200
+ },
201
+
202
+ /**
203
+ * Sets the Prism `language-xxxx` class of the given element.
204
+ *
205
+ * @param {Element} element
206
+ * @param {string} language
207
+ * @returns {void}
208
+ */
209
+ setLanguage: function (element, language) {
210
+ // remove all `language-xxxx` classes
211
+ // (this might leave behind a leading space)
212
+ element.className = element.className.replace(RegExp(lang, 'gi'), '');
213
+
214
+ // add the new `language-xxxx` class
215
+ // (using `classList` will automatically clean up spaces for us)
216
+ element.classList.add('language-' + language);
217
+ },
218
+
219
+ /**
220
+ * Returns the script element that is currently executing.
221
+ *
222
+ * This does __not__ work for line script element.
223
+ *
224
+ * @returns {HTMLScriptElement | null}
225
+ */
226
+ currentScript: function () {
227
+ if (typeof document === 'undefined') {
228
+ return null;
229
+ }
230
+ if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
231
+ return /** @type {any} */ (document.currentScript);
232
+ }
233
+
234
+ // IE11 workaround
235
+ // we'll get the src of the current script by parsing IE11's error stack trace
236
+ // this will not work for inline scripts
237
+
238
+ try {
239
+ throw new Error();
240
+ } catch (err) {
241
+ // Get file src url from stack. Specifically works with the format of stack traces in IE.
242
+ // A stack will look like this:
243
+ //
244
+ // Error
245
+ // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
246
+ // at Global code (http://localhost/components/prism-core.js:606:1)
247
+
248
+ var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
249
+ if (src) {
250
+ var scripts = document.getElementsByTagName('script');
251
+ for (var i in scripts) {
252
+ if (scripts[i].src == src) {
253
+ return scripts[i];
254
+ }
255
+ }
256
+ }
257
+ return null;
258
+ }
259
+ },
260
+
261
+ /**
262
+ * Returns whether a given class is active for `element`.
263
+ *
264
+ * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
265
+ * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
266
+ * given class is just the given class with a `no-` prefix.
267
+ *
268
+ * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
269
+ * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
270
+ * ancestors have the given class or the negated version of it, then the default activation will be returned.
271
+ *
272
+ * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
273
+ * version of it, the class is considered active.
274
+ *
275
+ * @param {Element} element
276
+ * @param {string} className
277
+ * @param {boolean} [defaultActivation=false]
278
+ * @returns {boolean}
279
+ */
280
+ isActive: function (element, className, defaultActivation) {
281
+ var no = 'no-' + className;
282
+
283
+ while (element) {
284
+ var classList = element.classList;
285
+ if (classList.contains(className)) {
286
+ return true;
287
+ }
288
+ if (classList.contains(no)) {
289
+ return false;
290
+ }
291
+ element = element.parentElement;
292
+ }
293
+ return !!defaultActivation;
294
+ }
295
+ },
296
+
297
+ /**
298
+ * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
299
+ *
300
+ * @namespace
301
+ * @memberof Prism
302
+ * @public
303
+ */
304
+ languages: {
305
+ /**
306
+ * The grammar for plain, unformatted text.
307
+ */
308
+ plain: plainTextGrammar,
309
+ plaintext: plainTextGrammar,
310
+ text: plainTextGrammar,
311
+ txt: plainTextGrammar,
312
+
313
+ /**
314
+ * Creates a deep copy of the language with the given id and appends the given tokens.
315
+ *
316
+ * If a token in `redef` also appears in the copied language, then the existing token in the copied language
317
+ * will be overwritten at its original position.
318
+ *
319
+ * ## Best practices
320
+ *
321
+ * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
322
+ * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
323
+ * understand the language definition because, normally, the order of tokens matters in Prism grammars.
324
+ *
325
+ * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
326
+ * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
327
+ *
328
+ * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
329
+ * @param {Grammar} redef The new tokens to append.
330
+ * @returns {Grammar} The new language created.
331
+ * @public
332
+ * @example
333
+ * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
334
+ * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
335
+ * // at its original position
336
+ * 'comment': { ... },
337
+ * // CSS doesn't have a 'color' token, so this token will be appended
338
+ * 'color': /\b(?:red|green|blue)\b/
339
+ * });
340
+ */
341
+ extend: function (id, redef) {
342
+ var lang = _.util.clone(_.languages[id]);
343
+
344
+ for (var key in redef) {
345
+ lang[key] = redef[key];
346
+ }
347
+
348
+ return lang;
349
+ },
350
+
351
+ /**
352
+ * Inserts tokens _before_ another token in a language definition or any other grammar.
353
+ *
354
+ * ## Usage
355
+ *
356
+ * This helper method makes it easy to modify existing languages. For example, the CSS language definition
357
+ * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
358
+ * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
359
+ * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
360
+ * this:
361
+ *
362
+ * ```js
363
+ * Prism.languages.markup.style = {
364
+ * // token
365
+ * };
366
+ * ```
367
+ *
368
+ * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
369
+ * before existing tokens. For the CSS example above, you would use it like this:
370
+ *
371
+ * ```js
372
+ * Prism.languages.insertBefore('markup', 'cdata', {
373
+ * 'style': {
374
+ * // token
375
+ * }
376
+ * });
377
+ * ```
378
+ *
379
+ * ## Special cases
380
+ *
381
+ * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
382
+ * will be ignored.
383
+ *
384
+ * This behavior can be used to insert tokens after `before`:
385
+ *
386
+ * ```js
387
+ * Prism.languages.insertBefore('markup', 'comment', {
388
+ * 'comment': Prism.languages.markup.comment,
389
+ * // tokens after 'comment'
390
+ * });
391
+ * ```
392
+ *
393
+ * ## Limitations
394
+ *
395
+ * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
396
+ * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
397
+ * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
398
+ * deleting properties which is necessary to insert at arbitrary positions.
399
+ *
400
+ * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
401
+ * Instead, it will create a new object and replace all references to the target object with the new one. This
402
+ * can be done without temporarily deleting properties, so the iteration order is well-defined.
403
+ *
404
+ * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
405
+ * you hold the target object in a variable, then the value of the variable will not change.
406
+ *
407
+ * ```js
408
+ * var oldMarkup = Prism.languages.markup;
409
+ * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
410
+ *
411
+ * assert(oldMarkup !== Prism.languages.markup);
412
+ * assert(newMarkup === Prism.languages.markup);
413
+ * ```
414
+ *
415
+ * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
416
+ * object to be modified.
417
+ * @param {string} before The key to insert before.
418
+ * @param {Grammar} insert An object containing the key-value pairs to be inserted.
419
+ * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
420
+ * object to be modified.
421
+ *
422
+ * Defaults to `Prism.languages`.
423
+ * @returns {Grammar} The new grammar object.
424
+ * @public
425
+ */
426
+ insertBefore: function (inside, before, insert, root) {
427
+ root = root || /** @type {any} */ (_.languages);
428
+ var grammar = root[inside];
429
+ /** @type {Grammar} */
430
+ var ret = {};
431
+
432
+ for (var token in grammar) {
433
+ if (grammar.hasOwnProperty(token)) {
434
+
435
+ if (token == before) {
436
+ for (var newToken in insert) {
437
+ if (insert.hasOwnProperty(newToken)) {
438
+ ret[newToken] = insert[newToken];
439
+ }
440
+ }
441
+ }
442
+
443
+ // Do not insert token which also occur in insert. See #1525
444
+ if (!insert.hasOwnProperty(token)) {
445
+ ret[token] = grammar[token];
446
+ }
447
+ }
448
+ }
449
+
450
+ var old = root[inside];
451
+ root[inside] = ret;
452
+
453
+ // Update references in other language definitions
454
+ _.languages.DFS(_.languages, function (key, value) {
455
+ if (value === old && key != inside) {
456
+ this[key] = ret;
457
+ }
458
+ });
459
+
460
+ return ret;
461
+ },
462
+
463
+ // Traverse a language definition with Depth First Search
464
+ DFS: function DFS(o, callback, type, visited) {
465
+ visited = visited || {};
466
+
467
+ var objId = _.util.objId;
468
+
469
+ for (var i in o) {
470
+ if (o.hasOwnProperty(i)) {
471
+ callback.call(o, i, o[i], type || i);
472
+
473
+ var property = o[i];
474
+ var propertyType = _.util.type(property);
475
+
476
+ if (propertyType === 'Object' && !visited[objId(property)]) {
477
+ visited[objId(property)] = true;
478
+ DFS(property, callback, null, visited);
479
+ } else if (propertyType === 'Array' && !visited[objId(property)]) {
480
+ visited[objId(property)] = true;
481
+ DFS(property, callback, i, visited);
482
+ }
483
+ }
484
+ }
485
+ }
486
+ },
487
+
488
+ plugins: {},
489
+
490
+ /**
491
+ * This is the most high-level function in Prism’s API.
492
+ * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
493
+ * each one of them.
494
+ *
495
+ * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
496
+ *
497
+ * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
498
+ * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
499
+ * @memberof Prism
500
+ * @public
501
+ */
502
+ highlightAll: function (async, callback) {
503
+ _.highlightAllUnder(document, async, callback);
504
+ },
505
+
506
+ /**
507
+ * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
508
+ * {@link Prism.highlightElement} on each one of them.
509
+ *
510
+ * The following hooks will be run:
511
+ * 1. `before-highlightall`
512
+ * 2. `before-all-elements-highlight`
513
+ * 3. All hooks of {@link Prism.highlightElement} for each element.
514
+ *
515
+ * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
516
+ * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
517
+ * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
518
+ * @memberof Prism
519
+ * @public
520
+ */
521
+ highlightAllUnder: function (container, async, callback) {
522
+ var env = {
523
+ callback: callback,
524
+ container: container,
525
+ selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
526
+ };
527
+
528
+ _.hooks.run('before-highlightall', env);
529
+
530
+ env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
531
+
532
+ _.hooks.run('before-all-elements-highlight', env);
533
+
534
+ for (var i = 0, element; (element = env.elements[i++]);) {
535
+ _.highlightElement(element, async === true, env.callback);
536
+ }
537
+ },
538
+
539
+ /**
540
+ * Highlights the code inside a single element.
541
+ *
542
+ * The following hooks will be run:
543
+ * 1. `before-sanity-check`
544
+ * 2. `before-highlight`
545
+ * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
546
+ * 4. `before-insert`
547
+ * 5. `after-highlight`
548
+ * 6. `complete`
549
+ *
550
+ * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
551
+ * the element's language.
552
+ *
553
+ * @param {Element} element The element containing the code.
554
+ * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
555
+ * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
556
+ * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
557
+ * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
558
+ *
559
+ * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
560
+ * asynchronous highlighting to work. You can build your own bundle on the
561
+ * [Download page](https://prismjs.com/download.html).
562
+ * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
563
+ * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
564
+ * @memberof Prism
565
+ * @public
566
+ */
567
+ highlightElement: function (element, async, callback) {
568
+ // Find language
569
+ var language = _.util.getLanguage(element);
570
+ var grammar = _.languages[language];
571
+
572
+ // Set language on the element, if not present
573
+ _.util.setLanguage(element, language);
574
+
575
+ // Set language on the parent, for styling
576
+ var parent = element.parentElement;
577
+ if (parent && parent.nodeName.toLowerCase() === 'pre') {
578
+ _.util.setLanguage(parent, language);
579
+ }
580
+
581
+ var code = element.textContent;
582
+
583
+ var env = {
584
+ element: element,
585
+ language: language,
586
+ grammar: grammar,
587
+ code: code
588
+ };
589
+
590
+ function insertHighlightedCode(highlightedCode) {
591
+ env.highlightedCode = highlightedCode;
592
+
593
+ _.hooks.run('before-insert', env);
594
+
595
+ env.element.innerHTML = env.highlightedCode;
596
+
597
+ _.hooks.run('after-highlight', env);
598
+ _.hooks.run('complete', env);
599
+ callback && callback.call(env.element);
600
+ }
601
+
602
+ _.hooks.run('before-sanity-check', env);
603
+
604
+ // plugins may change/add the parent/element
605
+ parent = env.element.parentElement;
606
+ if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
607
+ parent.setAttribute('tabindex', '0');
608
+ }
609
+
610
+ if (!env.code) {
611
+ _.hooks.run('complete', env);
612
+ callback && callback.call(env.element);
613
+ return;
614
+ }
615
+
616
+ _.hooks.run('before-highlight', env);
617
+
618
+ if (!env.grammar) {
619
+ insertHighlightedCode(_.util.encode(env.code));
620
+ return;
621
+ }
622
+
623
+ if (async && _self.Worker) {
624
+ var worker = new Worker(_.filename);
625
+
626
+ worker.onmessage = function (evt) {
627
+ insertHighlightedCode(evt.data);
628
+ };
629
+
630
+ worker.postMessage(JSON.stringify({
631
+ language: env.language,
632
+ code: env.code,
633
+ immediateClose: true
634
+ }));
635
+ } else {
636
+ insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
637
+ }
638
+ },
639
+
640
+ /**
641
+ * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
642
+ * and the language definitions to use, and returns a string with the HTML produced.
643
+ *
644
+ * The following hooks will be run:
645
+ * 1. `before-tokenize`
646
+ * 2. `after-tokenize`
647
+ * 3. `wrap`: On each {@link Token}.
648
+ *
649
+ * @param {string} text A string with the code to be highlighted.
650
+ * @param {Grammar} grammar An object containing the tokens to use.
651
+ *
652
+ * Usually a language definition like `Prism.languages.markup`.
653
+ * @param {string} language The name of the language definition passed to `grammar`.
654
+ * @returns {string} The highlighted HTML.
655
+ * @memberof Prism
656
+ * @public
657
+ * @example
658
+ * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
659
+ */
660
+ highlight: function (text, grammar, language) {
661
+ var env = {
662
+ code: text,
663
+ grammar: grammar,
664
+ language: language
665
+ };
666
+ _.hooks.run('before-tokenize', env);
667
+ if (!env.grammar) {
668
+ throw new Error('The language "' + env.language + '" has no grammar.');
669
+ }
670
+ env.tokens = _.tokenize(env.code, env.grammar);
671
+ _.hooks.run('after-tokenize', env);
672
+ return Token.stringify(_.util.encode(env.tokens), env.language);
673
+ },
674
+
675
+ /**
676
+ * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
677
+ * and the language definitions to use, and returns an array with the tokenized code.
678
+ *
679
+ * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
680
+ *
681
+ * This method could be useful in other contexts as well, as a very crude parser.
682
+ *
683
+ * @param {string} text A string with the code to be highlighted.
684
+ * @param {Grammar} grammar An object containing the tokens to use.
685
+ *
686
+ * Usually a language definition like `Prism.languages.markup`.
687
+ * @returns {TokenStream} An array of strings and tokens, a token stream.
688
+ * @memberof Prism
689
+ * @public
690
+ * @example
691
+ * let code = `var foo = 0;`;
692
+ * let tokens = Prism.tokenize(code, Prism.languages.javascript);
693
+ * tokens.forEach(token => {
694
+ * if (token instanceof Prism.Token && token.type === 'number') {
695
+ * console.log(`Found numeric literal: ${token.content}`);
696
+ * }
697
+ * });
698
+ */
699
+ tokenize: function (text, grammar) {
700
+ var rest = grammar.rest;
701
+ if (rest) {
702
+ for (var token in rest) {
703
+ grammar[token] = rest[token];
704
+ }
705
+
706
+ delete grammar.rest;
707
+ }
708
+
709
+ var tokenList = new LinkedList();
710
+ addAfter(tokenList, tokenList.head, text);
711
+
712
+ matchGrammar(text, tokenList, grammar, tokenList.head, 0);
713
+
714
+ return toArray(tokenList);
715
+ },
716
+
717
+ /**
718
+ * @namespace
719
+ * @memberof Prism
720
+ * @public
721
+ */
722
+ hooks: {
723
+ all: {},
724
+
725
+ /**
726
+ * Adds the given callback to the list of callbacks for the given hook.
727
+ *
728
+ * The callback will be invoked when the hook it is registered for is run.
729
+ * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
730
+ *
731
+ * One callback function can be registered to multiple hooks and the same hook multiple times.
732
+ *
733
+ * @param {string} name The name of the hook.
734
+ * @param {HookCallback} callback The callback function which is given environment variables.
735
+ * @public
736
+ */
737
+ add: function (name, callback) {
738
+ var hooks = _.hooks.all;
739
+
740
+ hooks[name] = hooks[name] || [];
741
+
742
+ hooks[name].push(callback);
743
+ },
744
+
745
+ /**
746
+ * Runs a hook invoking all registered callbacks with the given environment variables.
747
+ *
748
+ * Callbacks will be invoked synchronously and in the order in which they were registered.
749
+ *
750
+ * @param {string} name The name of the hook.
751
+ * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
752
+ * @public
753
+ */
754
+ run: function (name, env) {
755
+ var callbacks = _.hooks.all[name];
756
+
757
+ if (!callbacks || !callbacks.length) {
758
+ return;
759
+ }
760
+
761
+ for (var i = 0, callback; (callback = callbacks[i++]);) {
762
+ callback(env);
763
+ }
764
+ }
765
+ },
766
+
767
+ Token: Token
768
+ };
769
+ _self.Prism = _;
770
+
771
+
772
+ // Typescript note:
773
+ // The following can be used to import the Token type in JSDoc:
774
+ //
775
+ // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
776
+
777
+ /**
778
+ * Creates a new token.
779
+ *
780
+ * @param {string} type See {@link Token#type type}
781
+ * @param {string | TokenStream} content See {@link Token#content content}
782
+ * @param {string|string[]} [alias] The alias(es) of the token.
783
+ * @param {string} [matchedStr=""] A copy of the full string this token was created from.
784
+ * @class
785
+ * @global
786
+ * @public
787
+ */
788
+ function Token(type, content, alias, matchedStr) {
789
+ /**
790
+ * The type of the token.
791
+ *
792
+ * This is usually the key of a pattern in a {@link Grammar}.
793
+ *
794
+ * @type {string}
795
+ * @see GrammarToken
796
+ * @public
797
+ */
798
+ this.type = type;
799
+ /**
800
+ * The strings or tokens contained by this token.
801
+ *
802
+ * This will be a token stream if the pattern matched also defined an `inside` grammar.
803
+ *
804
+ * @type {string | TokenStream}
805
+ * @public
806
+ */
807
+ this.content = content;
808
+ /**
809
+ * The alias(es) of the token.
810
+ *
811
+ * @type {string|string[]}
812
+ * @see GrammarToken
813
+ * @public
814
+ */
815
+ this.alias = alias;
816
+ // Copy of the full string this token was created from
817
+ this.length = (matchedStr || '').length | 0;
818
+ }
819
+
820
+ /**
821
+ * A token stream is an array of strings and {@link Token Token} objects.
822
+ *
823
+ * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
824
+ * them.
825
+ *
826
+ * 1. No adjacent strings.
827
+ * 2. No empty strings.
828
+ *
829
+ * The only exception here is the token stream that only contains the empty string and nothing else.
830
+ *
831
+ * @typedef {Array<string | Token>} TokenStream
832
+ * @global
833
+ * @public
834
+ */
835
+
836
+ /**
837
+ * Converts the given token or token stream to an HTML representation.
838
+ *
839
+ * The following hooks will be run:
840
+ * 1. `wrap`: On each {@link Token}.
841
+ *
842
+ * @param {string | Token | TokenStream} o The token or token stream to be converted.
843
+ * @param {string} language The name of current language.
844
+ * @returns {string} The HTML representation of the token or token stream.
845
+ * @memberof Token
846
+ * @static
847
+ */
848
+ Token.stringify = function stringify(o, language) {
849
+ if (typeof o == 'string') {
850
+ return o;
851
+ }
852
+ if (Array.isArray(o)) {
853
+ var s = '';
854
+ o.forEach(function (e) {
855
+ s += stringify(e, language);
856
+ });
857
+ return s;
858
+ }
859
+
860
+ var env = {
861
+ type: o.type,
862
+ content: stringify(o.content, language),
863
+ tag: 'span',
864
+ classes: ['token', o.type],
865
+ attributes: {},
866
+ language: language
867
+ };
868
+
869
+ var aliases = o.alias;
870
+ if (aliases) {
871
+ if (Array.isArray(aliases)) {
872
+ Array.prototype.push.apply(env.classes, aliases);
873
+ } else {
874
+ env.classes.push(aliases);
875
+ }
876
+ }
877
+
878
+ _.hooks.run('wrap', env);
879
+
880
+ var attributes = '';
881
+ for (var name in env.attributes) {
882
+ attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
883
+ }
884
+
885
+ return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
886
+ };
887
+
888
+ /**
889
+ * @param {RegExp} pattern
890
+ * @param {number} pos
891
+ * @param {string} text
892
+ * @param {boolean} lookbehind
893
+ * @returns {RegExpExecArray | null}
894
+ */
895
+ function matchPattern(pattern, pos, text, lookbehind) {
896
+ pattern.lastIndex = pos;
897
+ var match = pattern.exec(text);
898
+ if (match && lookbehind && match[1]) {
899
+ // change the match to remove the text matched by the Prism lookbehind group
900
+ var lookbehindLength = match[1].length;
901
+ match.index += lookbehindLength;
902
+ match[0] = match[0].slice(lookbehindLength);
903
+ }
904
+ return match;
905
+ }
906
+
907
+ /**
908
+ * @param {string} text
909
+ * @param {LinkedList<string | Token>} tokenList
910
+ * @param {any} grammar
911
+ * @param {LinkedListNode<string | Token>} startNode
912
+ * @param {number} startPos
913
+ * @param {RematchOptions} [rematch]
914
+ * @returns {void}
915
+ * @private
916
+ *
917
+ * @typedef RematchOptions
918
+ * @property {string} cause
919
+ * @property {number} reach
920
+ */
921
+ function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
922
+ for (var token in grammar) {
923
+ if (!grammar.hasOwnProperty(token) || !grammar[token]) {
924
+ continue;
925
+ }
926
+
927
+ var patterns = grammar[token];
928
+ patterns = Array.isArray(patterns) ? patterns : [patterns];
929
+
930
+ for (var j = 0; j < patterns.length; ++j) {
931
+ if (rematch && rematch.cause == token + ',' + j) {
932
+ return;
933
+ }
934
+
935
+ var patternObj = patterns[j];
936
+ var inside = patternObj.inside;
937
+ var lookbehind = !!patternObj.lookbehind;
938
+ var greedy = !!patternObj.greedy;
939
+ var alias = patternObj.alias;
940
+
941
+ if (greedy && !patternObj.pattern.global) {
942
+ // Without the global flag, lastIndex won't work
943
+ var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
944
+ patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
945
+ }
946
+
947
+ /** @type {RegExp} */
948
+ var pattern = patternObj.pattern || patternObj;
949
+
950
+ for ( // iterate the token list and keep track of the current token/string position
951
+ var currentNode = startNode.next, pos = startPos;
952
+ currentNode !== tokenList.tail;
953
+ pos += currentNode.value.length, currentNode = currentNode.next
954
+ ) {
955
+
956
+ if (rematch && pos >= rematch.reach) {
957
+ break;
958
+ }
959
+
960
+ var str = currentNode.value;
961
+
962
+ if (tokenList.length > text.length) {
963
+ // Something went terribly wrong, ABORT, ABORT!
964
+ return;
965
+ }
966
+
967
+ if (str instanceof Token) {
968
+ continue;
969
+ }
970
+
971
+ var removeCount = 1; // this is the to parameter of removeBetween
972
+ var match;
973
+
974
+ if (greedy) {
975
+ match = matchPattern(pattern, pos, text, lookbehind);
976
+ if (!match || match.index >= text.length) {
977
+ break;
978
+ }
979
+
980
+ var from = match.index;
981
+ var to = match.index + match[0].length;
982
+ var p = pos;
983
+
984
+ // find the node that contains the match
985
+ p += currentNode.value.length;
986
+ while (from >= p) {
987
+ currentNode = currentNode.next;
988
+ p += currentNode.value.length;
989
+ }
990
+ // adjust pos (and p)
991
+ p -= currentNode.value.length;
992
+ pos = p;
993
+
994
+ // the current node is a Token, then the match starts inside another Token, which is invalid
995
+ if (currentNode.value instanceof Token) {
996
+ continue;
997
+ }
998
+
999
+ // find the last node which is affected by this match
1000
+ for (
1001
+ var k = currentNode;
1002
+ k !== tokenList.tail && (p < to || typeof k.value === 'string');
1003
+ k = k.next
1004
+ ) {
1005
+ removeCount++;
1006
+ p += k.value.length;
1007
+ }
1008
+ removeCount--;
1009
+
1010
+ // replace with the new match
1011
+ str = text.slice(pos, p);
1012
+ match.index -= pos;
1013
+ } else {
1014
+ match = matchPattern(pattern, 0, str, lookbehind);
1015
+ if (!match) {
1016
+ continue;
1017
+ }
1018
+ }
1019
+
1020
+ // eslint-disable-next-line no-redeclare
1021
+ var from = match.index;
1022
+ var matchStr = match[0];
1023
+ var before = str.slice(0, from);
1024
+ var after = str.slice(from + matchStr.length);
1025
+
1026
+ var reach = pos + str.length;
1027
+ if (rematch && reach > rematch.reach) {
1028
+ rematch.reach = reach;
1029
+ }
1030
+
1031
+ var removeFrom = currentNode.prev;
1032
+
1033
+ if (before) {
1034
+ removeFrom = addAfter(tokenList, removeFrom, before);
1035
+ pos += before.length;
1036
+ }
1037
+
1038
+ removeRange(tokenList, removeFrom, removeCount);
1039
+
1040
+ var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
1041
+ currentNode = addAfter(tokenList, removeFrom, wrapped);
1042
+
1043
+ if (after) {
1044
+ addAfter(tokenList, currentNode, after);
1045
+ }
1046
+
1047
+ if (removeCount > 1) {
1048
+ // at least one Token object was removed, so we have to do some rematching
1049
+ // this can only happen if the current pattern is greedy
1050
+
1051
+ /** @type {RematchOptions} */
1052
+ var nestedRematch = {
1053
+ cause: token + ',' + j,
1054
+ reach: reach
1055
+ };
1056
+ matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
1057
+
1058
+ // the reach might have been extended because of the rematching
1059
+ if (rematch && nestedRematch.reach > rematch.reach) {
1060
+ rematch.reach = nestedRematch.reach;
1061
+ }
1062
+ }
1063
+ }
1064
+ }
1065
+ }
1066
+ }
1067
+
1068
+ /**
1069
+ * @typedef LinkedListNode
1070
+ * @property {T} value
1071
+ * @property {LinkedListNode<T> | null} prev The previous node.
1072
+ * @property {LinkedListNode<T> | null} next The next node.
1073
+ * @template T
1074
+ * @private
1075
+ */
1076
+
1077
+ /**
1078
+ * @template T
1079
+ * @private
1080
+ */
1081
+ function LinkedList() {
1082
+ /** @type {LinkedListNode<T>} */
1083
+ var head = { value: null, prev: null, next: null };
1084
+ /** @type {LinkedListNode<T>} */
1085
+ var tail = { value: null, prev: head, next: null };
1086
+ head.next = tail;
1087
+
1088
+ /** @type {LinkedListNode<T>} */
1089
+ this.head = head;
1090
+ /** @type {LinkedListNode<T>} */
1091
+ this.tail = tail;
1092
+ this.length = 0;
1093
+ }
1094
+
1095
+ /**
1096
+ * Adds a new node with the given value to the list.
1097
+ *
1098
+ * @param {LinkedList<T>} list
1099
+ * @param {LinkedListNode<T>} node
1100
+ * @param {T} value
1101
+ * @returns {LinkedListNode<T>} The added node.
1102
+ * @template T
1103
+ */
1104
+ function addAfter(list, node, value) {
1105
+ // assumes that node != list.tail && values.length >= 0
1106
+ var next = node.next;
1107
+
1108
+ var newNode = { value: value, prev: node, next: next };
1109
+ node.next = newNode;
1110
+ next.prev = newNode;
1111
+ list.length++;
1112
+
1113
+ return newNode;
1114
+ }
1115
+ /**
1116
+ * Removes `count` nodes after the given node. The given node will not be removed.
1117
+ *
1118
+ * @param {LinkedList<T>} list
1119
+ * @param {LinkedListNode<T>} node
1120
+ * @param {number} count
1121
+ * @template T
1122
+ */
1123
+ function removeRange(list, node, count) {
1124
+ var next = node.next;
1125
+ for (var i = 0; i < count && next !== list.tail; i++) {
1126
+ next = next.next;
1127
+ }
1128
+ node.next = next;
1129
+ next.prev = node;
1130
+ list.length -= i;
1131
+ }
1132
+ /**
1133
+ * @param {LinkedList<T>} list
1134
+ * @returns {T[]}
1135
+ * @template T
1136
+ */
1137
+ function toArray(list) {
1138
+ var array = [];
1139
+ var node = list.head.next;
1140
+ while (node !== list.tail) {
1141
+ array.push(node.value);
1142
+ node = node.next;
1143
+ }
1144
+ return array;
1145
+ }
1146
+
1147
+
1148
+ if (!_self.document) {
1149
+ if (!_self.addEventListener) {
1150
+ // in Node.js
1151
+ return _;
1152
+ }
1153
+
1154
+ if (!_.disableWorkerMessageHandler) {
1155
+ // In worker
1156
+ _self.addEventListener('message', function (evt) {
1157
+ var message = JSON.parse(evt.data);
1158
+ var lang = message.language;
1159
+ var code = message.code;
1160
+ var immediateClose = message.immediateClose;
1161
+
1162
+ _self.postMessage(_.highlight(code, _.languages[lang], lang));
1163
+ if (immediateClose) {
1164
+ _self.close();
1165
+ }
1166
+ }, false);
1167
+ }
1168
+
1169
+ return _;
1170
+ }
1171
+
1172
+ // Get current script and highlight
1173
+ var script = _.util.currentScript();
1174
+
1175
+ if (script) {
1176
+ _.filename = script.src;
1177
+
1178
+ if (script.hasAttribute('data-manual')) {
1179
+ _.manual = true;
1180
+ }
1181
+ }
1182
+
1183
+ function highlightAutomaticallyCallback() {
1184
+ if (!_.manual) {
1185
+ _.highlightAll();
1186
+ }
1187
+ }
1188
+
1189
+ if (!_.manual) {
1190
+ // If the document state is "loading", then we'll use DOMContentLoaded.
1191
+ // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1192
+ // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
1193
+ // might take longer one animation frame to execute which can create a race condition where only some plugins have
1194
+ // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
1195
+ // See https://github.com/PrismJS/prism/issues/2102
1196
+ var readyState = document.readyState;
1197
+ if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
1198
+ document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
1199
+ } else {
1200
+ if (window.requestAnimationFrame) {
1201
+ window.requestAnimationFrame(highlightAutomaticallyCallback);
1202
+ } else {
1203
+ window.setTimeout(highlightAutomaticallyCallback, 16);
1204
+ }
1205
+ }
1206
+ }
1207
+
1208
+ return _;
1209
+
1210
+ }(_self));
1211
+
1212
+ if (typeof module !== 'undefined' && module.exports) {
1213
+ module.exports = Prism;
1214
+ }
1215
+
1216
+ // hack for components to work correctly in node.js
1217
+ if (typeof global !== 'undefined') {
1218
+ global.Prism = Prism;
1219
+ }
1220
+
1221
+ // some additional documentation/types
1222
+
1223
+ /**
1224
+ * The expansion of a simple `RegExp` literal to support additional properties.
1225
+ *
1226
+ * @typedef GrammarToken
1227
+ * @property {RegExp} pattern The regular expression of the token.
1228
+ * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
1229
+ * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
1230
+ * @property {boolean} [greedy=false] Whether the token is greedy.
1231
+ * @property {string|string[]} [alias] An optional alias or list of aliases.
1232
+ * @property {Grammar} [inside] The nested grammar of this token.
1233
+ *
1234
+ * The `inside` grammar will be used to tokenize the text value of each token of this kind.
1235
+ *
1236
+ * This can be used to make nested and even recursive language definitions.
1237
+ *
1238
+ * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
1239
+ * each another.
1240
+ * @global
1241
+ * @public
1242
+ */
1243
+
1244
+ /**
1245
+ * @typedef Grammar
1246
+ * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
1247
+ * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
1248
+ * @global
1249
+ * @public
1250
+ */
1251
+
1252
+ /**
1253
+ * A function which will invoked after an element was successfully highlighted.
1254
+ *
1255
+ * @callback HighlightCallback
1256
+ * @param {Element} element The element successfully highlighted.
1257
+ * @returns {void}
1258
+ * @global
1259
+ * @public
1260
+ */
1261
+
1262
+ /**
1263
+ * @callback HookCallback
1264
+ * @param {Object<string, any>} env The environment variables of the hook.
1265
+ * @returns {void}
1266
+ * @global
1267
+ * @public
1268
+ */
1269
+
1270
+
1271
+ /* **********************************************
1272
+ Begin prism-markup.js
1273
+ ********************************************** */
1274
+
1275
+ Prism.languages.markup = {
1276
+ 'comment': {
1277
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1278
+ greedy: true
1279
+ },
1280
+ 'prolog': {
1281
+ pattern: /<\?[\s\S]+?\?>/,
1282
+ greedy: true
1283
+ },
1284
+ 'doctype': {
1285
+ // https://www.w3.org/TR/xml/#NT-doctypedecl
1286
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1287
+ greedy: true,
1288
+ inside: {
1289
+ 'internal-subset': {
1290
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1291
+ lookbehind: true,
1292
+ greedy: true,
1293
+ inside: null // see below
1294
+ },
1295
+ 'string': {
1296
+ pattern: /"[^"]*"|'[^']*'/,
1297
+ greedy: true
1298
+ },
1299
+ 'punctuation': /^<!|>$|[[\]]/,
1300
+ 'doctype-tag': /^DOCTYPE/i,
1301
+ 'name': /[^\s<>'"]+/
1302
+ }
1303
+ },
1304
+ 'cdata': {
1305
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1306
+ greedy: true
1307
+ },
1308
+ 'tag': {
1309
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1310
+ greedy: true,
1311
+ inside: {
1312
+ 'tag': {
1313
+ pattern: /^<\/?[^\s>\/]+/,
1314
+ inside: {
1315
+ 'punctuation': /^<\/?/,
1316
+ 'namespace': /^[^\s>\/:]+:/
1317
+ }
1318
+ },
1319
+ 'special-attr': [],
1320
+ 'attr-value': {
1321
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1322
+ inside: {
1323
+ 'punctuation': [
1324
+ {
1325
+ pattern: /^=/,
1326
+ alias: 'attr-equals'
1327
+ },
1328
+ /"|'/
1329
+ ]
1330
+ }
1331
+ },
1332
+ 'punctuation': /\/?>/,
1333
+ 'attr-name': {
1334
+ pattern: /[^\s>\/]+/,
1335
+ inside: {
1336
+ 'namespace': /^[^\s>\/:]+:/
1337
+ }
1338
+ }
1339
+
1340
+ }
1341
+ },
1342
+ 'entity': [
1343
+ {
1344
+ pattern: /&[\da-z]{1,8};/i,
1345
+ alias: 'named-entity'
1346
+ },
1347
+ /&#x?[\da-f]{1,8};/i
1348
+ ]
1349
+ };
1350
+
1351
+ Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
1352
+ Prism.languages.markup['entity'];
1353
+ Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1354
+
1355
+ // Plugin to make entity title show the real entity, idea by Roman Komarov
1356
+ Prism.hooks.add('wrap', function (env) {
1357
+
1358
+ if (env.type === 'entity') {
1359
+ env.attributes['title'] = env.content.replace(/&amp;/, '&');
1360
+ }
1361
+ });
1362
+
1363
+ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1364
+ /**
1365
+ * Adds an inlined language to markup.
1366
+ *
1367
+ * An example of an inlined language is CSS with `<style>` tags.
1368
+ *
1369
+ * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1370
+ * case insensitive.
1371
+ * @param {string} lang The language key.
1372
+ * @example
1373
+ * addInlined('style', 'css');
1374
+ */
1375
+ value: function addInlined(tagName, lang) {
1376
+ var includedCdataInside = {};
1377
+ includedCdataInside['language-' + lang] = {
1378
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1379
+ lookbehind: true,
1380
+ inside: Prism.languages[lang]
1381
+ };
1382
+ includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1383
+
1384
+ var inside = {
1385
+ 'included-cdata': {
1386
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1387
+ inside: includedCdataInside
1388
+ }
1389
+ };
1390
+ inside['language-' + lang] = {
1391
+ pattern: /[\s\S]+/,
1392
+ inside: Prism.languages[lang]
1393
+ };
1394
+
1395
+ var def = {};
1396
+ def[tagName] = {
1397
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
1398
+ lookbehind: true,
1399
+ greedy: true,
1400
+ inside: inside
1401
+ };
1402
+
1403
+ Prism.languages.insertBefore('markup', 'cdata', def);
1404
+ }
1405
+ });
1406
+ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1407
+ /**
1408
+ * Adds an pattern to highlight languages embedded in HTML attributes.
1409
+ *
1410
+ * An example of an inlined language is CSS with `style` attributes.
1411
+ *
1412
+ * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1413
+ * case insensitive.
1414
+ * @param {string} lang The language key.
1415
+ * @example
1416
+ * addAttribute('style', 'css');
1417
+ */
1418
+ value: function (attrName, lang) {
1419
+ Prism.languages.markup.tag.inside['special-attr'].push({
1420
+ pattern: RegExp(
1421
+ /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1422
+ 'i'
1423
+ ),
1424
+ lookbehind: true,
1425
+ inside: {
1426
+ 'attr-name': /^[^\s=]+/,
1427
+ 'attr-value': {
1428
+ pattern: /=[\s\S]+/,
1429
+ inside: {
1430
+ 'value': {
1431
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1432
+ lookbehind: true,
1433
+ alias: [lang, 'language-' + lang],
1434
+ inside: Prism.languages[lang]
1435
+ },
1436
+ 'punctuation': [
1437
+ {
1438
+ pattern: /^=/,
1439
+ alias: 'attr-equals'
1440
+ },
1441
+ /"|'/
1442
+ ]
1443
+ }
1444
+ }
1445
+ }
1446
+ });
1447
+ }
1448
+ });
1449
+
1450
+ Prism.languages.html = Prism.languages.markup;
1451
+ Prism.languages.mathml = Prism.languages.markup;
1452
+ Prism.languages.svg = Prism.languages.markup;
1453
+
1454
+ Prism.languages.xml = Prism.languages.extend('markup', {});
1455
+ Prism.languages.ssml = Prism.languages.xml;
1456
+ Prism.languages.atom = Prism.languages.xml;
1457
+ Prism.languages.rss = Prism.languages.xml;
1458
+
1459
+
1460
+ /* **********************************************
1461
+ Begin prism-css.js
1462
+ ********************************************** */
1463
+
1464
+ (function (Prism) {
1465
+
1466
+ var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1467
+
1468
+ Prism.languages.css = {
1469
+ 'comment': /\/\*[\s\S]*?\*\//,
1470
+ 'atrule': {
1471
+ pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
1472
+ inside: {
1473
+ 'rule': /^@[\w-]+/,
1474
+ 'selector-function-argument': {
1475
+ pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1476
+ lookbehind: true,
1477
+ alias: 'selector'
1478
+ },
1479
+ 'keyword': {
1480
+ pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1481
+ lookbehind: true
1482
+ }
1483
+ // See rest below
1484
+ }
1485
+ },
1486
+ 'url': {
1487
+ // https://drafts.csswg.org/css-values-3/#urls
1488
+ pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1489
+ greedy: true,
1490
+ inside: {
1491
+ 'function': /^url/i,
1492
+ 'punctuation': /^\(|\)$/,
1493
+ 'string': {
1494
+ pattern: RegExp('^' + string.source + '$'),
1495
+ alias: 'url'
1496
+ }
1497
+ }
1498
+ },
1499
+ 'selector': {
1500
+ pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1501
+ lookbehind: true
1502
+ },
1503
+ 'string': {
1504
+ pattern: string,
1505
+ greedy: true
1506
+ },
1507
+ 'property': {
1508
+ pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1509
+ lookbehind: true
1510
+ },
1511
+ 'important': /!important\b/i,
1512
+ 'function': {
1513
+ pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1514
+ lookbehind: true
1515
+ },
1516
+ 'punctuation': /[(){};:,]/
1517
+ };
1518
+
1519
+ Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1520
+
1521
+ var markup = Prism.languages.markup;
1522
+ if (markup) {
1523
+ markup.tag.addInlined('style', 'css');
1524
+ markup.tag.addAttribute('style', 'css');
1525
+ }
1526
+
1527
+ }(Prism));
1528
+
1529
+
1530
+ /* **********************************************
1531
+ Begin prism-clike.js
1532
+ ********************************************** */
1533
+
1534
+ Prism.languages.clike = {
1535
+ 'comment': [
1536
+ {
1537
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1538
+ lookbehind: true,
1539
+ greedy: true
1540
+ },
1541
+ {
1542
+ pattern: /(^|[^\\:])\/\/.*/,
1543
+ lookbehind: true,
1544
+ greedy: true
1545
+ }
1546
+ ],
1547
+ 'string': {
1548
+ pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1549
+ greedy: true
1550
+ },
1551
+ 'class-name': {
1552
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1553
+ lookbehind: true,
1554
+ inside: {
1555
+ 'punctuation': /[.\\]/
1556
+ }
1557
+ },
1558
+ 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1559
+ 'boolean': /\b(?:false|true)\b/,
1560
+ 'function': /\b\w+(?=\()/,
1561
+ 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1562
+ 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1563
+ 'punctuation': /[{}[\];(),.:]/
1564
+ };
1565
+
1566
+
1567
+ /* **********************************************
1568
+ Begin prism-javascript.js
1569
+ ********************************************** */
1570
+
1571
+ Prism.languages.javascript = Prism.languages.extend('clike', {
1572
+ 'class-name': [
1573
+ Prism.languages.clike['class-name'],
1574
+ {
1575
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1576
+ lookbehind: true
1577
+ }
1578
+ ],
1579
+ 'keyword': [
1580
+ {
1581
+ pattern: /((?:^|\})\s*)catch\b/,
1582
+ lookbehind: true
1583
+ },
1584
+ {
1585
+ pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1586
+ lookbehind: true
1587
+ },
1588
+ ],
1589
+ // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1590
+ 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1591
+ 'number': {
1592
+ pattern: RegExp(
1593
+ /(^|[^\w$])/.source +
1594
+ '(?:' +
1595
+ (
1596
+ // constant
1597
+ /NaN|Infinity/.source +
1598
+ '|' +
1599
+ // binary integer
1600
+ /0[bB][01]+(?:_[01]+)*n?/.source +
1601
+ '|' +
1602
+ // octal integer
1603
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
1604
+ '|' +
1605
+ // hexadecimal integer
1606
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
1607
+ '|' +
1608
+ // decimal bigint
1609
+ /\d+(?:_\d+)*n/.source +
1610
+ '|' +
1611
+ // decimal number (integer or float) but no bigint
1612
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
1613
+ ) +
1614
+ ')' +
1615
+ /(?![\w$])/.source
1616
+ ),
1617
+ lookbehind: true
1618
+ },
1619
+ 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1620
+ });
1621
+
1622
+ Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1623
+
1624
+ Prism.languages.insertBefore('javascript', 'keyword', {
1625
+ 'regex': {
1626
+ pattern: RegExp(
1627
+ // lookbehind
1628
+ // eslint-disable-next-line regexp/no-dupe-characters-character-class
1629
+ /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
1630
+ // Regex pattern:
1631
+ // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1632
+ // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1633
+ // with the only syntax, so we have to define 2 different regex patterns.
1634
+ /\//.source +
1635
+ '(?:' +
1636
+ /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
1637
+ '|' +
1638
+ // `v` flag syntax. This supports 3 levels of nested character classes.
1639
+ /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
1640
+ ')' +
1641
+ // lookahead
1642
+ /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1643
+ ),
1644
+ lookbehind: true,
1645
+ greedy: true,
1646
+ inside: {
1647
+ 'regex-source': {
1648
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1649
+ lookbehind: true,
1650
+ alias: 'language-regex',
1651
+ inside: Prism.languages.regex
1652
+ },
1653
+ 'regex-delimiter': /^\/|\/$/,
1654
+ 'regex-flags': /^[a-z]+$/,
1655
+ }
1656
+ },
1657
+ // This must be declared before keyword because we use "function" inside the look-forward
1658
+ 'function-variable': {
1659
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1660
+ alias: 'function'
1661
+ },
1662
+ 'parameter': [
1663
+ {
1664
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1665
+ lookbehind: true,
1666
+ inside: Prism.languages.javascript
1667
+ },
1668
+ {
1669
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1670
+ lookbehind: true,
1671
+ inside: Prism.languages.javascript
1672
+ },
1673
+ {
1674
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1675
+ lookbehind: true,
1676
+ inside: Prism.languages.javascript
1677
+ },
1678
+ {
1679
+ pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1680
+ lookbehind: true,
1681
+ inside: Prism.languages.javascript
1682
+ }
1683
+ ],
1684
+ 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1685
+ });
1686
+
1687
+ Prism.languages.insertBefore('javascript', 'string', {
1688
+ 'hashbang': {
1689
+ pattern: /^#!.*/,
1690
+ greedy: true,
1691
+ alias: 'comment'
1692
+ },
1693
+ 'template-string': {
1694
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1695
+ greedy: true,
1696
+ inside: {
1697
+ 'template-punctuation': {
1698
+ pattern: /^`|`$/,
1699
+ alias: 'string'
1700
+ },
1701
+ 'interpolation': {
1702
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1703
+ lookbehind: true,
1704
+ inside: {
1705
+ 'interpolation-punctuation': {
1706
+ pattern: /^\$\{|\}$/,
1707
+ alias: 'punctuation'
1708
+ },
1709
+ rest: Prism.languages.javascript
1710
+ }
1711
+ },
1712
+ 'string': /[\s\S]+/
1713
+ }
1714
+ },
1715
+ 'string-property': {
1716
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1717
+ lookbehind: true,
1718
+ greedy: true,
1719
+ alias: 'property'
1720
+ }
1721
+ });
1722
+
1723
+ Prism.languages.insertBefore('javascript', 'operator', {
1724
+ 'literal-property': {
1725
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1726
+ lookbehind: true,
1727
+ alias: 'property'
1728
+ },
1729
+ });
1730
+
1731
+ if (Prism.languages.markup) {
1732
+ Prism.languages.markup.tag.addInlined('script', 'javascript');
1733
+
1734
+ // add attribute support for all DOM events.
1735
+ // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
1736
+ Prism.languages.markup.tag.addAttribute(
1737
+ /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
1738
+ 'javascript'
1739
+ );
1740
+ }
1741
+
1742
+ Prism.languages.js = Prism.languages.javascript;
1743
+
1744
+
1745
+ /* **********************************************
1746
+ Begin prism-file-highlight.js
1747
+ ********************************************** */
1748
+
1749
+ (function () {
1750
+
1751
+ if (typeof Prism === 'undefined' || typeof document === 'undefined') {
1752
+ return;
1753
+ }
1754
+
1755
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
1756
+ if (!Element.prototype.matches) {
1757
+ Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
1758
+ }
1759
+
1760
+ var LOADING_MESSAGE = 'Loading…';
1761
+ var FAILURE_MESSAGE = function (status, message) {
1762
+ return '✖ Error ' + status + ' while fetching file: ' + message;
1763
+ };
1764
+ var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
1765
+
1766
+ var EXTENSIONS = {
1767
+ 'js': 'javascript',
1768
+ 'py': 'python',
1769
+ 'rb': 'ruby',
1770
+ 'ps1': 'powershell',
1771
+ 'psm1': 'powershell',
1772
+ 'sh': 'bash',
1773
+ 'bat': 'batch',
1774
+ 'h': 'c',
1775
+ 'tex': 'latex'
1776
+ };
1777
+
1778
+ var STATUS_ATTR = 'data-src-status';
1779
+ var STATUS_LOADING = 'loading';
1780
+ var STATUS_LOADED = 'loaded';
1781
+ var STATUS_FAILED = 'failed';
1782
+
1783
+ var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
1784
+ + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
1785
+
1786
+ /**
1787
+ * Loads the given file.
1788
+ *
1789
+ * @param {string} src The URL or path of the source file to load.
1790
+ * @param {(result: string) => void} success
1791
+ * @param {(reason: string) => void} error
1792
+ */
1793
+ function loadFile(src, success, error) {
1794
+ var xhr = new XMLHttpRequest();
1795
+ xhr.open('GET', src, true);
1796
+ xhr.onreadystatechange = function () {
1797
+ if (xhr.readyState == 4) {
1798
+ if (xhr.status < 400 && xhr.responseText) {
1799
+ success(xhr.responseText);
1800
+ } else {
1801
+ if (xhr.status >= 400) {
1802
+ error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
1803
+ } else {
1804
+ error(FAILURE_EMPTY_MESSAGE);
1805
+ }
1806
+ }
1807
+ }
1808
+ };
1809
+ xhr.send(null);
1810
+ }
1811
+
1812
+ /**
1813
+ * Parses the given range.
1814
+ *
1815
+ * This returns a range with inclusive ends.
1816
+ *
1817
+ * @param {string | null | undefined} range
1818
+ * @returns {[number, number | undefined] | undefined}
1819
+ */
1820
+ function parseRange(range) {
1821
+ var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
1822
+ if (m) {
1823
+ var start = Number(m[1]);
1824
+ var comma = m[2];
1825
+ var end = m[3];
1826
+
1827
+ if (!comma) {
1828
+ return [start, start];
1829
+ }
1830
+ if (!end) {
1831
+ return [start, undefined];
1832
+ }
1833
+ return [start, Number(end)];
1834
+ }
1835
+ return undefined;
1836
+ }
1837
+
1838
+ Prism.hooks.add('before-highlightall', function (env) {
1839
+ env.selector += ', ' + SELECTOR;
1840
+ });
1841
+
1842
+ Prism.hooks.add('before-sanity-check', function (env) {
1843
+ var pre = /** @type {HTMLPreElement} */ (env.element);
1844
+ if (pre.matches(SELECTOR)) {
1845
+ env.code = ''; // fast-path the whole thing and go to complete
1846
+
1847
+ pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading
1848
+
1849
+ // add code element with loading message
1850
+ var code = pre.appendChild(document.createElement('CODE'));
1851
+ code.textContent = LOADING_MESSAGE;
1852
+
1853
+ var src = pre.getAttribute('data-src');
1854
+
1855
+ var language = env.language;
1856
+ if (language === 'none') {
1857
+ // the language might be 'none' because there is no language set;
1858
+ // in this case, we want to use the extension as the language
1859
+ var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
1860
+ language = EXTENSIONS[extension] || extension;
1861
+ }
1862
+
1863
+ // set language classes
1864
+ Prism.util.setLanguage(code, language);
1865
+ Prism.util.setLanguage(pre, language);
1866
+
1867
+ // preload the language
1868
+ var autoloader = Prism.plugins.autoloader;
1869
+ if (autoloader) {
1870
+ autoloader.loadLanguages(language);
1871
+ }
1872
+
1873
+ // load file
1874
+ loadFile(
1875
+ src,
1876
+ function (text) {
1877
+ // mark as loaded
1878
+ pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
1879
+
1880
+ // handle data-range
1881
+ var range = parseRange(pre.getAttribute('data-range'));
1882
+ if (range) {
1883
+ var lines = text.split(/\r\n?|\n/g);
1884
+
1885
+ // the range is one-based and inclusive on both ends
1886
+ var start = range[0];
1887
+ var end = range[1] == null ? lines.length : range[1];
1888
+
1889
+ if (start < 0) { start += lines.length; }
1890
+ start = Math.max(0, Math.min(start - 1, lines.length));
1891
+ if (end < 0) { end += lines.length; }
1892
+ end = Math.max(0, Math.min(end, lines.length));
1893
+
1894
+ text = lines.slice(start, end).join('\n');
1895
+
1896
+ // add data-start for line numbers
1897
+ if (!pre.hasAttribute('data-start')) {
1898
+ pre.setAttribute('data-start', String(start + 1));
1899
+ }
1900
+ }
1901
+
1902
+ // highlight code
1903
+ code.textContent = text;
1904
+ Prism.highlightElement(code);
1905
+ },
1906
+ function (error) {
1907
+ // mark as failed
1908
+ pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
1909
+
1910
+ code.textContent = error;
1911
+ }
1912
+ );
1913
+ }
1914
+ });
1915
+
1916
+ Prism.plugins.fileHighlight = {
1917
+ /**
1918
+ * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1919
+ *
1920
+ * Note: Elements which are already loaded or currently loading will not be touched by this method.
1921
+ *
1922
+ * @param {ParentNode} [container=document]
1923
+ */
1924
+ highlight: function highlight(container) {
1925
+ var elements = (container || document).querySelectorAll(SELECTOR);
1926
+
1927
+ for (var i = 0, element; (element = elements[i++]);) {
1928
+ Prism.highlightElement(element);
1929
+ }
1930
+ }
1931
+ };
1932
+
1933
+ var logged = false;
1934
+ /** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
1935
+ Prism.fileHighlight = function () {
1936
+ if (!logged) {
1937
+ console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
1938
+ logged = true;
1939
+ }
1940
+ Prism.plugins.fileHighlight.highlight.apply(this, arguments);
1941
+ };
1942
+
1943
+ }());
1944
+
1945
+ Prism.languages.markup = {
1946
+ 'comment': {
1947
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1948
+ greedy: true
1949
+ },
1950
+ 'prolog': {
1951
+ pattern: /<\?[\s\S]+?\?>/,
1952
+ greedy: true
1953
+ },
1954
+ 'doctype': {
1955
+ // https://www.w3.org/TR/xml/#NT-doctypedecl
1956
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1957
+ greedy: true,
1958
+ inside: {
1959
+ 'internal-subset': {
1960
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1961
+ lookbehind: true,
1962
+ greedy: true,
1963
+ inside: null // see below
1964
+ },
1965
+ 'string': {
1966
+ pattern: /"[^"]*"|'[^']*'/,
1967
+ greedy: true
1968
+ },
1969
+ 'punctuation': /^<!|>$|[[\]]/,
1970
+ 'doctype-tag': /^DOCTYPE/i,
1971
+ 'name': /[^\s<>'"]+/
1972
+ }
1973
+ },
1974
+ 'cdata': {
1975
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1976
+ greedy: true
1977
+ },
1978
+ 'tag': {
1979
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1980
+ greedy: true,
1981
+ inside: {
1982
+ 'tag': {
1983
+ pattern: /^<\/?[^\s>\/]+/,
1984
+ inside: {
1985
+ 'punctuation': /^<\/?/,
1986
+ 'namespace': /^[^\s>\/:]+:/
1987
+ }
1988
+ },
1989
+ 'special-attr': [],
1990
+ 'attr-value': {
1991
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1992
+ inside: {
1993
+ 'punctuation': [
1994
+ {
1995
+ pattern: /^=/,
1996
+ alias: 'attr-equals'
1997
+ },
1998
+ /"|'/
1999
+ ]
2000
+ }
2001
+ },
2002
+ 'punctuation': /\/?>/,
2003
+ 'attr-name': {
2004
+ pattern: /[^\s>\/]+/,
2005
+ inside: {
2006
+ 'namespace': /^[^\s>\/:]+:/
2007
+ }
2008
+ }
2009
+
2010
+ }
2011
+ },
2012
+ 'entity': [
2013
+ {
2014
+ pattern: /&[\da-z]{1,8};/i,
2015
+ alias: 'named-entity'
2016
+ },
2017
+ /&#x?[\da-f]{1,8};/i
2018
+ ]
2019
+ };
2020
+
2021
+ Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
2022
+ Prism.languages.markup['entity'];
2023
+ Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
2024
+
2025
+ // Plugin to make entity title show the real entity, idea by Roman Komarov
2026
+ Prism.hooks.add('wrap', function (env) {
2027
+
2028
+ if (env.type === 'entity') {
2029
+ env.attributes['title'] = env.content.replace(/&amp;/, '&');
2030
+ }
2031
+ });
2032
+
2033
+ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
2034
+ /**
2035
+ * Adds an inlined language to markup.
2036
+ *
2037
+ * An example of an inlined language is CSS with `<style>` tags.
2038
+ *
2039
+ * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
2040
+ * case insensitive.
2041
+ * @param {string} lang The language key.
2042
+ * @example
2043
+ * addInlined('style', 'css');
2044
+ */
2045
+ value: function addInlined(tagName, lang) {
2046
+ var includedCdataInside = {};
2047
+ includedCdataInside['language-' + lang] = {
2048
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
2049
+ lookbehind: true,
2050
+ inside: Prism.languages[lang]
2051
+ };
2052
+ includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
2053
+
2054
+ var inside = {
2055
+ 'included-cdata': {
2056
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
2057
+ inside: includedCdataInside
2058
+ }
2059
+ };
2060
+ inside['language-' + lang] = {
2061
+ pattern: /[\s\S]+/,
2062
+ inside: Prism.languages[lang]
2063
+ };
2064
+
2065
+ var def = {};
2066
+ def[tagName] = {
2067
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
2068
+ lookbehind: true,
2069
+ greedy: true,
2070
+ inside: inside
2071
+ };
2072
+
2073
+ Prism.languages.insertBefore('markup', 'cdata', def);
2074
+ }
2075
+ });
2076
+ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
2077
+ /**
2078
+ * Adds an pattern to highlight languages embedded in HTML attributes.
2079
+ *
2080
+ * An example of an inlined language is CSS with `style` attributes.
2081
+ *
2082
+ * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
2083
+ * case insensitive.
2084
+ * @param {string} lang The language key.
2085
+ * @example
2086
+ * addAttribute('style', 'css');
2087
+ */
2088
+ value: function (attrName, lang) {
2089
+ Prism.languages.markup.tag.inside['special-attr'].push({
2090
+ pattern: RegExp(
2091
+ /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
2092
+ 'i'
2093
+ ),
2094
+ lookbehind: true,
2095
+ inside: {
2096
+ 'attr-name': /^[^\s=]+/,
2097
+ 'attr-value': {
2098
+ pattern: /=[\s\S]+/,
2099
+ inside: {
2100
+ 'value': {
2101
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
2102
+ lookbehind: true,
2103
+ alias: [lang, 'language-' + lang],
2104
+ inside: Prism.languages[lang]
2105
+ },
2106
+ 'punctuation': [
2107
+ {
2108
+ pattern: /^=/,
2109
+ alias: 'attr-equals'
2110
+ },
2111
+ /"|'/
2112
+ ]
2113
+ }
2114
+ }
2115
+ }
2116
+ });
2117
+ }
2118
+ });
2119
+
2120
+ Prism.languages.html = Prism.languages.markup;
2121
+ Prism.languages.mathml = Prism.languages.markup;
2122
+ Prism.languages.svg = Prism.languages.markup;
2123
+
2124
+ Prism.languages.xml = Prism.languages.extend('markup', {});
2125
+ Prism.languages.ssml = Prism.languages.xml;
2126
+ Prism.languages.atom = Prism.languages.xml;
2127
+ Prism.languages.rss = Prism.languages.xml;
2128
+
2129
+ (function (Prism) {
2130
+
2131
+ /**
2132
+ * Returns the placeholder for the given language id and index.
2133
+ *
2134
+ * @param {string} language
2135
+ * @param {string|number} index
2136
+ * @returns {string}
2137
+ */
2138
+ function getPlaceholder(language, index) {
2139
+ return '___' + language.toUpperCase() + index + '___';
2140
+ }
2141
+
2142
+ Object.defineProperties(Prism.languages['markup-templating'] = {}, {
2143
+ buildPlaceholders: {
2144
+ /**
2145
+ * Tokenize all inline templating expressions matching `placeholderPattern`.
2146
+ *
2147
+ * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns
2148
+ * `true` will be replaced.
2149
+ *
2150
+ * @param {object} env The environment of the `before-tokenize` hook.
2151
+ * @param {string} language The language id.
2152
+ * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.
2153
+ * @param {(match: string) => boolean} [replaceFilter]
2154
+ */
2155
+ value: function (env, language, placeholderPattern, replaceFilter) {
2156
+ if (env.language !== language) {
2157
+ return;
2158
+ }
2159
+
2160
+ var tokenStack = env.tokenStack = [];
2161
+
2162
+ env.code = env.code.replace(placeholderPattern, function (match) {
2163
+ if (typeof replaceFilter === 'function' && !replaceFilter(match)) {
2164
+ return match;
2165
+ }
2166
+ var i = tokenStack.length;
2167
+ var placeholder;
2168
+
2169
+ // Check for existing strings
2170
+ while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {
2171
+ ++i;
2172
+ }
2173
+
2174
+ // Create a sparse array
2175
+ tokenStack[i] = match;
2176
+
2177
+ return placeholder;
2178
+ });
2179
+
2180
+ // Switch the grammar to markup
2181
+ env.grammar = Prism.languages.markup;
2182
+ }
2183
+ },
2184
+ tokenizePlaceholders: {
2185
+ /**
2186
+ * Replace placeholders with proper tokens after tokenizing.
2187
+ *
2188
+ * @param {object} env The environment of the `after-tokenize` hook.
2189
+ * @param {string} language The language id.
2190
+ */
2191
+ value: function (env, language) {
2192
+ if (env.language !== language || !env.tokenStack) {
2193
+ return;
2194
+ }
2195
+
2196
+ // Switch the grammar back
2197
+ env.grammar = Prism.languages[language];
2198
+
2199
+ var j = 0;
2200
+ var keys = Object.keys(env.tokenStack);
2201
+
2202
+ function walkTokens(tokens) {
2203
+ for (var i = 0; i < tokens.length; i++) {
2204
+ // all placeholders are replaced already
2205
+ if (j >= keys.length) {
2206
+ break;
2207
+ }
2208
+
2209
+ var token = tokens[i];
2210
+ if (typeof token === 'string' || (token.content && typeof token.content === 'string')) {
2211
+ var k = keys[j];
2212
+ var t = env.tokenStack[k];
2213
+ var s = typeof token === 'string' ? token : token.content;
2214
+ var placeholder = getPlaceholder(language, k);
2215
+
2216
+ var index = s.indexOf(placeholder);
2217
+ if (index > -1) {
2218
+ ++j;
2219
+
2220
+ var before = s.substring(0, index);
2221
+ var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);
2222
+ var after = s.substring(index + placeholder.length);
2223
+
2224
+ var replacement = [];
2225
+ if (before) {
2226
+ replacement.push.apply(replacement, walkTokens([before]));
2227
+ }
2228
+ replacement.push(middle);
2229
+ if (after) {
2230
+ replacement.push.apply(replacement, walkTokens([after]));
2231
+ }
2232
+
2233
+ if (typeof token === 'string') {
2234
+ tokens.splice.apply(tokens, [i, 1].concat(replacement));
2235
+ } else {
2236
+ token.content = replacement;
2237
+ }
2238
+ }
2239
+ } else if (token.content /* && typeof token.content !== 'string' */) {
2240
+ walkTokens(token.content);
2241
+ }
2242
+ }
2243
+
2244
+ return tokens;
2245
+ }
2246
+
2247
+ walkTokens(env.tokens);
2248
+ }
2249
+ }
2250
+ });
2251
+
2252
+ }(Prism));
2253
+
2254
+ (function (Prism) {
2255
+ // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
2256
+ // + LC_ALL, RANDOM, REPLY, SECONDS.
2257
+ // + make sure PS1..4 are here as they are not always set,
2258
+ // - some useless things.
2259
+ var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b';
2260
+
2261
+ var commandAfterHeredoc = {
2262
+ pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
2263
+ lookbehind: true,
2264
+ alias: 'punctuation', // this looks reasonably well in all themes
2265
+ inside: null // see below
2266
+ };
2267
+
2268
+ var insideString = {
2269
+ 'bash': commandAfterHeredoc,
2270
+ 'environment': {
2271
+ pattern: RegExp('\\$' + envVars),
2272
+ alias: 'constant'
2273
+ },
2274
+ 'variable': [
2275
+ // [0]: Arithmetic Environment
2276
+ {
2277
+ pattern: /\$?\(\([\s\S]+?\)\)/,
2278
+ greedy: true,
2279
+ inside: {
2280
+ // If there is a $ sign at the beginning highlight $(( and )) as variable
2281
+ 'variable': [
2282
+ {
2283
+ pattern: /(^\$\(\([\s\S]+)\)\)/,
2284
+ lookbehind: true
2285
+ },
2286
+ /^\$\(\(/
2287
+ ],
2288
+ 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
2289
+ // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
2290
+ 'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
2291
+ // If there is no $ sign at the beginning highlight (( and )) as punctuation
2292
+ 'punctuation': /\(\(?|\)\)?|,|;/
2293
+ }
2294
+ },
2295
+ // [1]: Command Substitution
2296
+ {
2297
+ pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
2298
+ greedy: true,
2299
+ inside: {
2300
+ 'variable': /^\$\(|^`|\)$|`$/
2301
+ }
2302
+ },
2303
+ // [2]: Brace expansion
2304
+ {
2305
+ pattern: /\$\{[^}]+\}/,
2306
+ greedy: true,
2307
+ inside: {
2308
+ 'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2309
+ 'punctuation': /[\[\]]/,
2310
+ 'environment': {
2311
+ pattern: RegExp('(\\{)' + envVars),
2312
+ lookbehind: true,
2313
+ alias: 'constant'
2314
+ }
2315
+ }
2316
+ },
2317
+ /\$(?:\w+|[#?*!@$])/
2318
+ ],
2319
+ // Escape sequences from echo and printf's manuals, and escaped quotes.
2320
+ 'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
2321
+ };
2322
+
2323
+ Prism.languages.bash = {
2324
+ 'shebang': {
2325
+ pattern: /^#!\s*\/.*/,
2326
+ alias: 'important'
2327
+ },
2328
+ 'comment': {
2329
+ pattern: /(^|[^"{\\$])#.*/,
2330
+ lookbehind: true
2331
+ },
2332
+ 'function-name': [
2333
+ // a) function foo {
2334
+ // b) foo() {
2335
+ // c) function foo() {
2336
+ // but not “foo {”
2337
+ {
2338
+ // a) and c)
2339
+ pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
2340
+ lookbehind: true,
2341
+ alias: 'function'
2342
+ },
2343
+ {
2344
+ // b)
2345
+ pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
2346
+ alias: 'function'
2347
+ }
2348
+ ],
2349
+ // Highlight variable names as variables in for and select beginnings.
2350
+ 'for-or-select': {
2351
+ pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
2352
+ alias: 'variable',
2353
+ lookbehind: true
2354
+ },
2355
+ // Highlight variable names as variables in the left-hand part
2356
+ // of assignments (“=” and “+=”).
2357
+ 'assign-left': {
2358
+ pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,
2359
+ inside: {
2360
+ 'environment': {
2361
+ pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
2362
+ lookbehind: true,
2363
+ alias: 'constant'
2364
+ }
2365
+ },
2366
+ alias: 'variable',
2367
+ lookbehind: true
2368
+ },
2369
+ 'string': [
2370
+ // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
2371
+ {
2372
+ pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
2373
+ lookbehind: true,
2374
+ greedy: true,
2375
+ inside: insideString
2376
+ },
2377
+ // Here-document with quotes around the tag
2378
+ // → No expansion (so no “inside”).
2379
+ {
2380
+ pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
2381
+ lookbehind: true,
2382
+ greedy: true,
2383
+ inside: {
2384
+ 'bash': commandAfterHeredoc
2385
+ }
2386
+ },
2387
+ // “Normal” string
2388
+ {
2389
+ // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
2390
+ pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
2391
+ lookbehind: true,
2392
+ greedy: true,
2393
+ inside: insideString
2394
+ },
2395
+ {
2396
+ // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
2397
+ pattern: /(^|[^$\\])'[^']*'/,
2398
+ lookbehind: true,
2399
+ greedy: true
2400
+ },
2401
+ {
2402
+ // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
2403
+ pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
2404
+ greedy: true,
2405
+ inside: {
2406
+ 'entity': insideString.entity
2407
+ }
2408
+ }
2409
+ ],
2410
+ 'environment': {
2411
+ pattern: RegExp('\\$?' + envVars),
2412
+ alias: 'constant'
2413
+ },
2414
+ 'variable': insideString.variable,
2415
+ 'function': {
2416
+ pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
2417
+ lookbehind: true
2418
+ },
2419
+ 'keyword': {
2420
+ pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
2421
+ lookbehind: true
2422
+ },
2423
+ // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
2424
+ 'builtin': {
2425
+ pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
2426
+ lookbehind: true,
2427
+ // Alias added to make those easier to distinguish from strings.
2428
+ alias: 'class-name'
2429
+ },
2430
+ 'boolean': {
2431
+ pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
2432
+ lookbehind: true
2433
+ },
2434
+ 'file-descriptor': {
2435
+ pattern: /\B&\d\b/,
2436
+ alias: 'important'
2437
+ },
2438
+ 'operator': {
2439
+ // Lots of redirections here, but not just that.
2440
+ pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
2441
+ inside: {
2442
+ 'file-descriptor': {
2443
+ pattern: /^\d/,
2444
+ alias: 'important'
2445
+ }
2446
+ }
2447
+ },
2448
+ 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
2449
+ 'number': {
2450
+ pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
2451
+ lookbehind: true
2452
+ }
2453
+ };
2454
+
2455
+ commandAfterHeredoc.inside = Prism.languages.bash;
2456
+
2457
+ /* Patterns in command substitution. */
2458
+ var toBeCopied = [
2459
+ 'comment',
2460
+ 'function-name',
2461
+ 'for-or-select',
2462
+ 'assign-left',
2463
+ 'string',
2464
+ 'environment',
2465
+ 'function',
2466
+ 'keyword',
2467
+ 'builtin',
2468
+ 'boolean',
2469
+ 'file-descriptor',
2470
+ 'operator',
2471
+ 'punctuation',
2472
+ 'number'
2473
+ ];
2474
+ var inside = insideString.variable[1].inside;
2475
+ for (var i = 0; i < toBeCopied.length; i++) {
2476
+ inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
2477
+ }
2478
+
2479
+ Prism.languages.shell = Prism.languages.bash;
2480
+ }(Prism));
2481
+
2482
+ Prism.languages.javascript = Prism.languages.extend('clike', {
2483
+ 'class-name': [
2484
+ Prism.languages.clike['class-name'],
2485
+ {
2486
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
2487
+ lookbehind: true
2488
+ }
2489
+ ],
2490
+ 'keyword': [
2491
+ {
2492
+ pattern: /((?:^|\})\s*)catch\b/,
2493
+ lookbehind: true
2494
+ },
2495
+ {
2496
+ pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
2497
+ lookbehind: true
2498
+ },
2499
+ ],
2500
+ // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
2501
+ 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
2502
+ 'number': {
2503
+ pattern: RegExp(
2504
+ /(^|[^\w$])/.source +
2505
+ '(?:' +
2506
+ (
2507
+ // constant
2508
+ /NaN|Infinity/.source +
2509
+ '|' +
2510
+ // binary integer
2511
+ /0[bB][01]+(?:_[01]+)*n?/.source +
2512
+ '|' +
2513
+ // octal integer
2514
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
2515
+ '|' +
2516
+ // hexadecimal integer
2517
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
2518
+ '|' +
2519
+ // decimal bigint
2520
+ /\d+(?:_\d+)*n/.source +
2521
+ '|' +
2522
+ // decimal number (integer or float) but no bigint
2523
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
2524
+ ) +
2525
+ ')' +
2526
+ /(?![\w$])/.source
2527
+ ),
2528
+ lookbehind: true
2529
+ },
2530
+ 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
2531
+ });
2532
+
2533
+ Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
2534
+
2535
+ Prism.languages.insertBefore('javascript', 'keyword', {
2536
+ 'regex': {
2537
+ pattern: RegExp(
2538
+ // lookbehind
2539
+ // eslint-disable-next-line regexp/no-dupe-characters-character-class
2540
+ /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
2541
+ // Regex pattern:
2542
+ // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
2543
+ // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
2544
+ // with the only syntax, so we have to define 2 different regex patterns.
2545
+ /\//.source +
2546
+ '(?:' +
2547
+ /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
2548
+ '|' +
2549
+ // `v` flag syntax. This supports 3 levels of nested character classes.
2550
+ /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
2551
+ ')' +
2552
+ // lookahead
2553
+ /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
2554
+ ),
2555
+ lookbehind: true,
2556
+ greedy: true,
2557
+ inside: {
2558
+ 'regex-source': {
2559
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
2560
+ lookbehind: true,
2561
+ alias: 'language-regex',
2562
+ inside: Prism.languages.regex
2563
+ },
2564
+ 'regex-delimiter': /^\/|\/$/,
2565
+ 'regex-flags': /^[a-z]+$/,
2566
+ }
2567
+ },
2568
+ // This must be declared before keyword because we use "function" inside the look-forward
2569
+ 'function-variable': {
2570
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
2571
+ alias: 'function'
2572
+ },
2573
+ 'parameter': [
2574
+ {
2575
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
2576
+ lookbehind: true,
2577
+ inside: Prism.languages.javascript
2578
+ },
2579
+ {
2580
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
2581
+ lookbehind: true,
2582
+ inside: Prism.languages.javascript
2583
+ },
2584
+ {
2585
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
2586
+ lookbehind: true,
2587
+ inside: Prism.languages.javascript
2588
+ },
2589
+ {
2590
+ pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
2591
+ lookbehind: true,
2592
+ inside: Prism.languages.javascript
2593
+ }
2594
+ ],
2595
+ 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
2596
+ });
2597
+
2598
+ Prism.languages.insertBefore('javascript', 'string', {
2599
+ 'hashbang': {
2600
+ pattern: /^#!.*/,
2601
+ greedy: true,
2602
+ alias: 'comment'
2603
+ },
2604
+ 'template-string': {
2605
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
2606
+ greedy: true,
2607
+ inside: {
2608
+ 'template-punctuation': {
2609
+ pattern: /^`|`$/,
2610
+ alias: 'string'
2611
+ },
2612
+ 'interpolation': {
2613
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
2614
+ lookbehind: true,
2615
+ inside: {
2616
+ 'interpolation-punctuation': {
2617
+ pattern: /^\$\{|\}$/,
2618
+ alias: 'punctuation'
2619
+ },
2620
+ rest: Prism.languages.javascript
2621
+ }
2622
+ },
2623
+ 'string': /[\s\S]+/
2624
+ }
2625
+ },
2626
+ 'string-property': {
2627
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
2628
+ lookbehind: true,
2629
+ greedy: true,
2630
+ alias: 'property'
2631
+ }
2632
+ });
2633
+
2634
+ Prism.languages.insertBefore('javascript', 'operator', {
2635
+ 'literal-property': {
2636
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
2637
+ lookbehind: true,
2638
+ alias: 'property'
2639
+ },
2640
+ });
2641
+
2642
+ if (Prism.languages.markup) {
2643
+ Prism.languages.markup.tag.addInlined('script', 'javascript');
2644
+
2645
+ // add attribute support for all DOM events.
2646
+ // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
2647
+ Prism.languages.markup.tag.addAttribute(
2648
+ /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
2649
+ 'javascript'
2650
+ );
2651
+ }
2652
+
2653
+ Prism.languages.js = Prism.languages.javascript;
2654
+
2655
+ Prism.languages.scss = Prism.languages.extend('css', {
2656
+ 'comment': {
2657
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
2658
+ lookbehind: true
2659
+ },
2660
+ 'atrule': {
2661
+ pattern: /@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,
2662
+ inside: {
2663
+ 'rule': /@[\w-]+/
2664
+ // See rest below
2665
+ }
2666
+ },
2667
+ // url, compassified
2668
+ 'url': /(?:[-a-z]+-)?url(?=\()/i,
2669
+ // CSS selector regex is not appropriate for Sass
2670
+ // since there can be lot more things (var, @ directive, nesting..)
2671
+ // a selector must start at the end of a property or after a brace (end of other rules or nesting)
2672
+ // it can contain some characters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable
2673
+ // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var
2674
+ // can "pass" as a selector- e.g: proper#{$erty})
2675
+ // this one was hard to do, so please be careful if you edit this one :)
2676
+ 'selector': {
2677
+ // Initial look-ahead is used to prevent matching of blank selectors
2678
+ pattern: /(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,
2679
+ inside: {
2680
+ 'parent': {
2681
+ pattern: /&/,
2682
+ alias: 'important'
2683
+ },
2684
+ 'placeholder': /%[-\w]+/,
2685
+ 'variable': /\$[-\w]+|#\{\$[-\w]+\}/
2686
+ }
2687
+ },
2688
+ 'property': {
2689
+ pattern: /(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,
2690
+ inside: {
2691
+ 'variable': /\$[-\w]+|#\{\$[-\w]+\}/
2692
+ }
2693
+ }
2694
+ });
2695
+
2696
+ Prism.languages.insertBefore('scss', 'atrule', {
2697
+ 'keyword': [
2698
+ /@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,
2699
+ {
2700
+ pattern: /( )(?:from|through)(?= )/,
2701
+ lookbehind: true
2702
+ }
2703
+ ]
2704
+ });
2705
+
2706
+ Prism.languages.insertBefore('scss', 'important', {
2707
+ // var and interpolated vars
2708
+ 'variable': /\$[-\w]+|#\{\$[-\w]+\}/
2709
+ });
2710
+
2711
+ Prism.languages.insertBefore('scss', 'function', {
2712
+ 'module-modifier': {
2713
+ pattern: /\b(?:as|hide|show|with)\b/i,
2714
+ alias: 'keyword'
2715
+ },
2716
+ 'placeholder': {
2717
+ pattern: /%[-\w]+/,
2718
+ alias: 'selector'
2719
+ },
2720
+ 'statement': {
2721
+ pattern: /\B!(?:default|optional)\b/i,
2722
+ alias: 'keyword'
2723
+ },
2724
+ 'boolean': /\b(?:false|true)\b/,
2725
+ 'null': {
2726
+ pattern: /\bnull\b/,
2727
+ alias: 'keyword'
2728
+ },
2729
+ 'operator': {
2730
+ pattern: /(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,
2731
+ lookbehind: true
2732
+ }
2733
+ });
2734
+
2735
+ Prism.languages.scss['atrule'].inside.rest = Prism.languages.scss;
2736
+
2737
+ (function (Prism) {
2738
+
2739
+ var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
2740
+
2741
+ Prism.languages.css = {
2742
+ 'comment': /\/\*[\s\S]*?\*\//,
2743
+ 'atrule': {
2744
+ pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
2745
+ inside: {
2746
+ 'rule': /^@[\w-]+/,
2747
+ 'selector-function-argument': {
2748
+ pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
2749
+ lookbehind: true,
2750
+ alias: 'selector'
2751
+ },
2752
+ 'keyword': {
2753
+ pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
2754
+ lookbehind: true
2755
+ }
2756
+ // See rest below
2757
+ }
2758
+ },
2759
+ 'url': {
2760
+ // https://drafts.csswg.org/css-values-3/#urls
2761
+ pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
2762
+ greedy: true,
2763
+ inside: {
2764
+ 'function': /^url/i,
2765
+ 'punctuation': /^\(|\)$/,
2766
+ 'string': {
2767
+ pattern: RegExp('^' + string.source + '$'),
2768
+ alias: 'url'
2769
+ }
2770
+ }
2771
+ },
2772
+ 'selector': {
2773
+ pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
2774
+ lookbehind: true
2775
+ },
2776
+ 'string': {
2777
+ pattern: string,
2778
+ greedy: true
2779
+ },
2780
+ 'property': {
2781
+ pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
2782
+ lookbehind: true
2783
+ },
2784
+ 'important': /!important\b/i,
2785
+ 'function': {
2786
+ pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
2787
+ lookbehind: true
2788
+ },
2789
+ 'punctuation': /[(){};:,]/
2790
+ };
2791
+
2792
+ Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
2793
+
2794
+ var markup = Prism.languages.markup;
2795
+ if (markup) {
2796
+ markup.tag.addInlined('style', 'css');
2797
+ markup.tag.addAttribute('style', 'css');
2798
+ }
2799
+
2800
+ }(Prism));
2801
+
2802
+ /**
2803
+ * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/
2804
+ * Modified by Miles Johnson: http://milesj.me
2805
+ * Rewritten by Tom Pavelec
2806
+ *
2807
+ * Supports PHP 5.3 - 8.0
2808
+ */
2809
+ (function (Prism) {
2810
+ var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/;
2811
+ var constant = [
2812
+ {
2813
+ pattern: /\b(?:false|true)\b/i,
2814
+ alias: 'boolean'
2815
+ },
2816
+ {
2817
+ pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
2818
+ greedy: true,
2819
+ lookbehind: true,
2820
+ },
2821
+ {
2822
+ pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
2823
+ greedy: true,
2824
+ lookbehind: true,
2825
+ },
2826
+ /\b(?:null)\b/i,
2827
+ /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,
2828
+ ];
2829
+ var number = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i;
2830
+ var operator = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;
2831
+ var punctuation = /[{}\[\](),:;]/;
2832
+
2833
+ Prism.languages.php = {
2834
+ 'delimiter': {
2835
+ pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
2836
+ alias: 'important'
2837
+ },
2838
+ 'comment': comment,
2839
+ 'variable': /\$+(?:\w+\b|(?=\{))/,
2840
+ 'package': {
2841
+ pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
2842
+ lookbehind: true,
2843
+ inside: {
2844
+ 'punctuation': /\\/
2845
+ }
2846
+ },
2847
+ 'class-name-definition': {
2848
+ pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
2849
+ lookbehind: true,
2850
+ alias: 'class-name'
2851
+ },
2852
+ 'function-definition': {
2853
+ pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
2854
+ lookbehind: true,
2855
+ alias: 'function'
2856
+ },
2857
+ 'keyword': [
2858
+ {
2859
+ pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
2860
+ alias: 'type-casting',
2861
+ greedy: true,
2862
+ lookbehind: true
2863
+ },
2864
+ {
2865
+ pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
2866
+ alias: 'type-hint',
2867
+ greedy: true,
2868
+ lookbehind: true
2869
+ },
2870
+ {
2871
+ pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
2872
+ alias: 'return-type',
2873
+ greedy: true,
2874
+ lookbehind: true
2875
+ },
2876
+ {
2877
+ pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
2878
+ alias: 'type-declaration',
2879
+ greedy: true
2880
+ },
2881
+ {
2882
+ pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
2883
+ alias: 'type-declaration',
2884
+ greedy: true,
2885
+ lookbehind: true
2886
+ },
2887
+ {
2888
+ pattern: /\b(?:parent|self|static)(?=\s*::)/i,
2889
+ alias: 'static-context',
2890
+ greedy: true
2891
+ },
2892
+ {
2893
+ // yield from
2894
+ pattern: /(\byield\s+)from\b/i,
2895
+ lookbehind: true
2896
+ },
2897
+ // `class` is always a keyword unlike other keywords
2898
+ /\bclass\b/i,
2899
+ {
2900
+ // https://www.php.net/manual/en/reserved.keywords.php
2901
+ //
2902
+ // keywords cannot be preceded by "->"
2903
+ // the complex lookbehind means `(?<!(?:->|::)\s*)`
2904
+ pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
2905
+ lookbehind: true
2906
+ }
2907
+ ],
2908
+ 'argument-name': {
2909
+ pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
2910
+ lookbehind: true
2911
+ },
2912
+ 'class-name': [
2913
+ {
2914
+ pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
2915
+ greedy: true,
2916
+ lookbehind: true
2917
+ },
2918
+ {
2919
+ pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
2920
+ greedy: true,
2921
+ lookbehind: true
2922
+ },
2923
+ {
2924
+ pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
2925
+ greedy: true
2926
+ },
2927
+ {
2928
+ pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
2929
+ alias: 'class-name-fully-qualified',
2930
+ greedy: true,
2931
+ lookbehind: true,
2932
+ inside: {
2933
+ 'punctuation': /\\/
2934
+ }
2935
+ },
2936
+ {
2937
+ pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
2938
+ alias: 'class-name-fully-qualified',
2939
+ greedy: true,
2940
+ inside: {
2941
+ 'punctuation': /\\/
2942
+ }
2943
+ },
2944
+ {
2945
+ pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
2946
+ alias: 'class-name-fully-qualified',
2947
+ greedy: true,
2948
+ lookbehind: true,
2949
+ inside: {
2950
+ 'punctuation': /\\/
2951
+ }
2952
+ },
2953
+ {
2954
+ pattern: /\b[a-z_]\w*(?=\s*\$)/i,
2955
+ alias: 'type-declaration',
2956
+ greedy: true
2957
+ },
2958
+ {
2959
+ pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
2960
+ alias: ['class-name-fully-qualified', 'type-declaration'],
2961
+ greedy: true,
2962
+ inside: {
2963
+ 'punctuation': /\\/
2964
+ }
2965
+ },
2966
+ {
2967
+ pattern: /\b[a-z_]\w*(?=\s*::)/i,
2968
+ alias: 'static-context',
2969
+ greedy: true
2970
+ },
2971
+ {
2972
+ pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
2973
+ alias: ['class-name-fully-qualified', 'static-context'],
2974
+ greedy: true,
2975
+ inside: {
2976
+ 'punctuation': /\\/
2977
+ }
2978
+ },
2979
+ {
2980
+ pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
2981
+ alias: 'type-hint',
2982
+ greedy: true,
2983
+ lookbehind: true
2984
+ },
2985
+ {
2986
+ pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
2987
+ alias: ['class-name-fully-qualified', 'type-hint'],
2988
+ greedy: true,
2989
+ lookbehind: true,
2990
+ inside: {
2991
+ 'punctuation': /\\/
2992
+ }
2993
+ },
2994
+ {
2995
+ pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
2996
+ alias: 'return-type',
2997
+ greedy: true,
2998
+ lookbehind: true
2999
+ },
3000
+ {
3001
+ pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
3002
+ alias: ['class-name-fully-qualified', 'return-type'],
3003
+ greedy: true,
3004
+ lookbehind: true,
3005
+ inside: {
3006
+ 'punctuation': /\\/
3007
+ }
3008
+ }
3009
+ ],
3010
+ 'constant': constant,
3011
+ 'function': {
3012
+ pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
3013
+ lookbehind: true,
3014
+ inside: {
3015
+ 'punctuation': /\\/
3016
+ }
3017
+ },
3018
+ 'property': {
3019
+ pattern: /(->\s*)\w+/,
3020
+ lookbehind: true
3021
+ },
3022
+ 'number': number,
3023
+ 'operator': operator,
3024
+ 'punctuation': punctuation
3025
+ };
3026
+
3027
+ var string_interpolation = {
3028
+ pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
3029
+ lookbehind: true,
3030
+ inside: Prism.languages.php
3031
+ };
3032
+
3033
+ var string = [
3034
+ {
3035
+ pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
3036
+ alias: 'nowdoc-string',
3037
+ greedy: true,
3038
+ inside: {
3039
+ 'delimiter': {
3040
+ pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
3041
+ alias: 'symbol',
3042
+ inside: {
3043
+ 'punctuation': /^<<<'?|[';]$/
3044
+ }
3045
+ }
3046
+ }
3047
+ },
3048
+ {
3049
+ pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
3050
+ alias: 'heredoc-string',
3051
+ greedy: true,
3052
+ inside: {
3053
+ 'delimiter': {
3054
+ pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
3055
+ alias: 'symbol',
3056
+ inside: {
3057
+ 'punctuation': /^<<<"?|[";]$/
3058
+ }
3059
+ },
3060
+ 'interpolation': string_interpolation
3061
+ }
3062
+ },
3063
+ {
3064
+ pattern: /`(?:\\[\s\S]|[^\\`])*`/,
3065
+ alias: 'backtick-quoted-string',
3066
+ greedy: true
3067
+ },
3068
+ {
3069
+ pattern: /'(?:\\[\s\S]|[^\\'])*'/,
3070
+ alias: 'single-quoted-string',
3071
+ greedy: true
3072
+ },
3073
+ {
3074
+ pattern: /"(?:\\[\s\S]|[^\\"])*"/,
3075
+ alias: 'double-quoted-string',
3076
+ greedy: true,
3077
+ inside: {
3078
+ 'interpolation': string_interpolation
3079
+ }
3080
+ }
3081
+ ];
3082
+
3083
+ Prism.languages.insertBefore('php', 'variable', {
3084
+ 'string': string,
3085
+ 'attribute': {
3086
+ pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
3087
+ greedy: true,
3088
+ inside: {
3089
+ 'attribute-content': {
3090
+ pattern: /^(#\[)[\s\S]+(?=\]$)/,
3091
+ lookbehind: true,
3092
+ // inside can appear subset of php
3093
+ inside: {
3094
+ 'comment': comment,
3095
+ 'string': string,
3096
+ 'attribute-class-name': [
3097
+ {
3098
+ pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
3099
+ alias: 'class-name',
3100
+ greedy: true,
3101
+ lookbehind: true
3102
+ },
3103
+ {
3104
+ pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
3105
+ alias: [
3106
+ 'class-name',
3107
+ 'class-name-fully-qualified'
3108
+ ],
3109
+ greedy: true,
3110
+ lookbehind: true,
3111
+ inside: {
3112
+ 'punctuation': /\\/
3113
+ }
3114
+ }
3115
+ ],
3116
+ 'constant': constant,
3117
+ 'number': number,
3118
+ 'operator': operator,
3119
+ 'punctuation': punctuation
3120
+ }
3121
+ },
3122
+ 'delimiter': {
3123
+ pattern: /^#\[|\]$/,
3124
+ alias: 'punctuation'
3125
+ }
3126
+ }
3127
+ },
3128
+ });
3129
+
3130
+ Prism.hooks.add('before-tokenize', function (env) {
3131
+ if (!/<\?/.test(env.code)) {
3132
+ return;
3133
+ }
3134
+
3135
+ var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;
3136
+ Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
3137
+ });
3138
+
3139
+ Prism.hooks.add('after-tokenize', function (env) {
3140
+ Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php');
3141
+ });
3142
+
3143
+ }(Prism));
3144
+
3145
+ Prism.languages.insertBefore('php', 'variable', {
3146
+ 'this': {
3147
+ pattern: /\$this\b/,
3148
+ alias: 'keyword'
3149
+ },
3150
+ 'global': /\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,
3151
+ 'scope': {
3152
+ pattern: /\b[\w\\]+::/,
3153
+ inside: {
3154
+ 'keyword': /\b(?:parent|self|static)\b/,
3155
+ 'punctuation': /::|\\/
3156
+ }
3157
+ }
3158
+ });
3159
+
3160
+ Prism.languages.python = {
3161
+ 'comment': {
3162
+ pattern: /(^|[^\\])#.*/,
3163
+ lookbehind: true,
3164
+ greedy: true
3165
+ },
3166
+ 'string-interpolation': {
3167
+ pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
3168
+ greedy: true,
3169
+ inside: {
3170
+ 'interpolation': {
3171
+ // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
3172
+ pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
3173
+ lookbehind: true,
3174
+ inside: {
3175
+ 'format-spec': {
3176
+ pattern: /(:)[^:(){}]+(?=\}$)/,
3177
+ lookbehind: true
3178
+ },
3179
+ 'conversion-option': {
3180
+ pattern: /![sra](?=[:}]$)/,
3181
+ alias: 'punctuation'
3182
+ },
3183
+ rest: null
3184
+ }
3185
+ },
3186
+ 'string': /[\s\S]+/
3187
+ }
3188
+ },
3189
+ 'triple-quoted-string': {
3190
+ pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
3191
+ greedy: true,
3192
+ alias: 'string'
3193
+ },
3194
+ 'string': {
3195
+ pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
3196
+ greedy: true
3197
+ },
3198
+ 'function': {
3199
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
3200
+ lookbehind: true
3201
+ },
3202
+ 'class-name': {
3203
+ pattern: /(\bclass\s+)\w+/i,
3204
+ lookbehind: true
3205
+ },
3206
+ 'decorator': {
3207
+ pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
3208
+ lookbehind: true,
3209
+ alias: ['annotation', 'punctuation'],
3210
+ inside: {
3211
+ 'punctuation': /\./
3212
+ }
3213
+ },
3214
+ 'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
3215
+ 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
3216
+ 'boolean': /\b(?:False|None|True)\b/,
3217
+ 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
3218
+ 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
3219
+ 'punctuation': /[{}[\];(),.:]/
3220
+ };
3221
+
3222
+ Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
3223
+
3224
+ Prism.languages.py = Prism.languages.python;
3225
+
3226
+ Prism.languages.aspnet = Prism.languages.extend('markup', {
3227
+ 'page-directive': {
3228
+ pattern: /<%\s*@.*%>/,
3229
+ alias: 'tag',
3230
+ inside: {
3231
+ 'page-directive': {
3232
+ pattern: /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
3233
+ alias: 'tag'
3234
+ },
3235
+ rest: Prism.languages.markup.tag.inside
3236
+ }
3237
+ },
3238
+ 'directive': {
3239
+ pattern: /<%.*%>/,
3240
+ alias: 'tag',
3241
+ inside: {
3242
+ 'directive': {
3243
+ pattern: /<%\s*?[$=%#:]{0,2}|%>/,
3244
+ alias: 'tag'
3245
+ },
3246
+ rest: Prism.languages.csharp
3247
+ }
3248
+ }
3249
+ });
3250
+ // Regexp copied from prism-markup, with a negative look-ahead added
3251
+ Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/;
3252
+
3253
+ // match directives of attribute value foo="<% Bar %>"
3254
+ Prism.languages.insertBefore('inside', 'punctuation', {
3255
+ 'directive': Prism.languages.aspnet['directive']
3256
+ }, Prism.languages.aspnet.tag.inside['attr-value']);
3257
+
3258
+ Prism.languages.insertBefore('aspnet', 'comment', {
3259
+ 'asp-comment': {
3260
+ pattern: /<%--[\s\S]*?--%>/,
3261
+ alias: ['asp', 'comment']
3262
+ }
3263
+ });
3264
+
3265
+ // script runat="server" contains csharp, not javascript
3266
+ Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', {
3267
+ 'asp-script': {
3268
+ pattern: /(<script(?=.*runat=['"]?server\b)[^>]*>)[\s\S]*?(?=<\/script>)/i,
3269
+ lookbehind: true,
3270
+ alias: ['asp', 'script'],
3271
+ inside: Prism.languages.csharp || {}
3272
+ }
3273
+ });
3274
+
3275
+ (function () {
3276
+
3277
+ if (typeof Prism === 'undefined') {
3278
+ return;
3279
+ }
3280
+
3281
+ var assign = Object.assign || function (obj1, obj2) {
3282
+ for (var name in obj2) {
3283
+ if (obj2.hasOwnProperty(name)) {
3284
+ obj1[name] = obj2[name];
3285
+ }
3286
+ }
3287
+ return obj1;
3288
+ };
3289
+
3290
+ function NormalizeWhitespace(defaults) {
3291
+ this.defaults = assign({}, defaults);
3292
+ }
3293
+
3294
+ function toCamelCase(value) {
3295
+ return value.replace(/-(\w)/g, function (match, firstChar) {
3296
+ return firstChar.toUpperCase();
3297
+ });
3298
+ }
3299
+
3300
+ function tabLen(str) {
3301
+ var res = 0;
3302
+ for (var i = 0; i < str.length; ++i) {
3303
+ if (str.charCodeAt(i) == '\t'.charCodeAt(0)) {
3304
+ res += 3;
3305
+ }
3306
+ }
3307
+ return str.length + res;
3308
+ }
3309
+
3310
+ NormalizeWhitespace.prototype = {
3311
+ setDefaults: function (defaults) {
3312
+ this.defaults = assign(this.defaults, defaults);
3313
+ },
3314
+ normalize: function (input, settings) {
3315
+ settings = assign(this.defaults, settings);
3316
+
3317
+ for (var name in settings) {
3318
+ var methodName = toCamelCase(name);
3319
+ if (name !== 'normalize' && methodName !== 'setDefaults' &&
3320
+ settings[name] && this[methodName]) {
3321
+ input = this[methodName].call(this, input, settings[name]);
3322
+ }
3323
+ }
3324
+
3325
+ return input;
3326
+ },
3327
+
3328
+ /*
3329
+ * Normalization methods
3330
+ */
3331
+ leftTrim: function (input) {
3332
+ return input.replace(/^\s+/, '');
3333
+ },
3334
+ rightTrim: function (input) {
3335
+ return input.replace(/\s+$/, '');
3336
+ },
3337
+ tabsToSpaces: function (input, spaces) {
3338
+ spaces = spaces|0 || 4;
3339
+ return input.replace(/\t/g, new Array(++spaces).join(' '));
3340
+ },
3341
+ spacesToTabs: function (input, spaces) {
3342
+ spaces = spaces|0 || 4;
3343
+ return input.replace(RegExp(' {' + spaces + '}', 'g'), '\t');
3344
+ },
3345
+ removeTrailing: function (input) {
3346
+ return input.replace(/\s*?$/gm, '');
3347
+ },
3348
+ // Support for deprecated plugin remove-initial-line-feed
3349
+ removeInitialLineFeed: function (input) {
3350
+ return input.replace(/^(?:\r?\n|\r)/, '');
3351
+ },
3352
+ removeIndent: function (input) {
3353
+ var indents = input.match(/^[^\S\n\r]*(?=\S)/gm);
3354
+
3355
+ if (!indents || !indents[0].length) {
3356
+ return input;
3357
+ }
3358
+
3359
+ indents.sort(function (a, b) { return a.length - b.length; });
3360
+
3361
+ if (!indents[0].length) {
3362
+ return input;
3363
+ }
3364
+
3365
+ return input.replace(RegExp('^' + indents[0], 'gm'), '');
3366
+ },
3367
+ indent: function (input, tabs) {
3368
+ return input.replace(/^[^\S\n\r]*(?=\S)/gm, new Array(++tabs).join('\t') + '$&');
3369
+ },
3370
+ breakLines: function (input, characters) {
3371
+ characters = (characters === true) ? 80 : characters|0 || 80;
3372
+
3373
+ var lines = input.split('\n');
3374
+ for (var i = 0; i < lines.length; ++i) {
3375
+ if (tabLen(lines[i]) <= characters) {
3376
+ continue;
3377
+ }
3378
+
3379
+ var line = lines[i].split(/(\s+)/g);
3380
+ var len = 0;
3381
+
3382
+ for (var j = 0; j < line.length; ++j) {
3383
+ var tl = tabLen(line[j]);
3384
+ len += tl;
3385
+ if (len > characters) {
3386
+ line[j] = '\n' + line[j];
3387
+ len = tl;
3388
+ }
3389
+ }
3390
+ lines[i] = line.join('');
3391
+ }
3392
+ return lines.join('\n');
3393
+ }
3394
+ };
3395
+
3396
+ // Support node modules
3397
+ if (typeof module !== 'undefined' && module.exports) {
3398
+ module.exports = NormalizeWhitespace;
3399
+ }
3400
+
3401
+ Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({
3402
+ 'remove-trailing': true,
3403
+ 'remove-indent': true,
3404
+ 'left-trim': true,
3405
+ 'right-trim': true,
3406
+ /*'break-lines': 80,
3407
+ 'indent': 2,
3408
+ 'remove-initial-line-feed': false,
3409
+ 'tabs-to-spaces': 4,
3410
+ 'spaces-to-tabs': 4*/
3411
+ });
3412
+
3413
+ Prism.hooks.add('before-sanity-check', function (env) {
3414
+ var Normalizer = Prism.plugins.NormalizeWhitespace;
3415
+
3416
+ // Check settings
3417
+ if (env.settings && env.settings['whitespace-normalization'] === false) {
3418
+ return;
3419
+ }
3420
+
3421
+ // Check classes
3422
+ if (!Prism.util.isActive(env.element, 'whitespace-normalization', true)) {
3423
+ return;
3424
+ }
3425
+
3426
+ // Simple mode if there is no env.element
3427
+ if ((!env.element || !env.element.parentNode) && env.code) {
3428
+ env.code = Normalizer.normalize(env.code, env.settings);
3429
+ return;
3430
+ }
3431
+
3432
+ // Normal mode
3433
+ var pre = env.element.parentNode;
3434
+ if (!env.code || !pre || pre.nodeName.toLowerCase() !== 'pre') {
3435
+ return;
3436
+ }
3437
+
3438
+ var children = pre.childNodes;
3439
+ var before = '';
3440
+ var after = '';
3441
+ var codeFound = false;
3442
+
3443
+ // Move surrounding whitespace from the <pre> tag into the <code> tag
3444
+ for (var i = 0; i < children.length; ++i) {
3445
+ var node = children[i];
3446
+
3447
+ if (node == env.element) {
3448
+ codeFound = true;
3449
+ } else if (node.nodeName === '#text') {
3450
+ if (codeFound) {
3451
+ after += node.nodeValue;
3452
+ } else {
3453
+ before += node.nodeValue;
3454
+ }
3455
+
3456
+ pre.removeChild(node);
3457
+ --i;
3458
+ }
3459
+ }
3460
+
3461
+ if (!env.element.children.length || !Prism.plugins.KeepMarkup) {
3462
+ env.code = before + env.code + after;
3463
+ env.code = Normalizer.normalize(env.code, env.settings);
3464
+ } else {
3465
+ // Preserve markup for keep-markup plugin
3466
+ var html = before + env.element.innerHTML + after;
3467
+ env.element.innerHTML = Normalizer.normalize(html, env.settings);
3468
+ env.code = env.element.textContent;
3469
+ }
3470
+ });
3471
+
3472
+ }());
3473
+
3474
+ "use strict";
3475
+
3476
+ //
3477
+ // Prism Initialization
3478
+ //
3479
+
3480
+ Prism.plugins.NormalizeWhitespace.setDefaults({
3481
+ 'remove-trailing': true,
3482
+ 'remove-indent': true,
3483
+ 'left-trim': true,
3484
+ 'right-trim': true
3485
+ });