bedrock_sass 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (534) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -5
  3. data/assets/_vendor/ace/ace.js +21635 -0
  4. data/assets/_vendor/ace/ext-beautify.js +318 -0
  5. data/assets/_vendor/ace/ext-elastic_tabstops_lite.js +277 -0
  6. data/assets/_vendor/ace/ext-emmet.js +1226 -0
  7. data/assets/_vendor/ace/ext-error_marker.js +10 -0
  8. data/assets/_vendor/ace/ext-keybinding_menu.js +189 -0
  9. data/assets/_vendor/ace/ext-language_tools.js +1997 -0
  10. data/assets/_vendor/ace/ext-linking.js +65 -0
  11. data/assets/_vendor/ace/ext-modelist.js +228 -0
  12. data/assets/_vendor/ace/ext-options.js +750 -0
  13. data/assets/_vendor/ace/ext-rtl.js +110 -0
  14. data/assets/_vendor/ace/ext-searchbox.js +512 -0
  15. data/assets/_vendor/ace/ext-settings_menu.js +771 -0
  16. data/assets/_vendor/ace/ext-spellcheck.js +75 -0
  17. data/assets/_vendor/ace/ext-split.js +208 -0
  18. data/assets/_vendor/ace/ext-static_highlight.js +226 -0
  19. data/assets/_vendor/ace/ext-statusbar.js +57 -0
  20. data/assets/_vendor/ace/ext-textarea.js +567 -0
  21. data/assets/_vendor/ace/ext-themelist.js +67 -0
  22. data/assets/_vendor/ace/ext-whitespace.js +210 -0
  23. data/assets/_vendor/ace/keybinding-emacs.js +1165 -0
  24. data/assets/_vendor/ace/keybinding-vim.js +5673 -0
  25. data/assets/_vendor/ace/mode-abap.js +222 -0
  26. data/assets/_vendor/ace/mode-abc.js +267 -0
  27. data/assets/_vendor/ace/mode-actionscript.js +274 -0
  28. data/assets/_vendor/ace/mode-ada.js +138 -0
  29. data/assets/_vendor/ace/mode-apache_conf.js +363 -0
  30. data/assets/_vendor/ace/mode-applescript.js +279 -0
  31. data/assets/_vendor/ace/mode-asciidoc.js +349 -0
  32. data/assets/_vendor/ace/mode-asl.js +422 -0
  33. data/assets/_vendor/ace/mode-assembly_x86.js +193 -0
  34. data/assets/_vendor/ace/mode-autohotkey.js +243 -0
  35. data/assets/_vendor/ace/mode-batchfile.js +230 -0
  36. data/assets/_vendor/ace/mode-bro.js +334 -0
  37. data/assets/_vendor/ace/mode-c9search.js +294 -0
  38. data/assets/_vendor/ace/mode-c_cpp.js +502 -0
  39. data/assets/_vendor/ace/mode-cirru.js +211 -0
  40. data/assets/_vendor/ace/mode-clojure.js +314 -0
  41. data/assets/_vendor/ace/mode-cobol.js +102 -0
  42. data/assets/_vendor/ace/mode-coffee.js +400 -0
  43. data/assets/_vendor/ace/mode-coldfusion.js +2596 -0
  44. data/assets/_vendor/ace/mode-csharp.js +502 -0
  45. data/assets/_vendor/ace/mode-csound_document.js +3749 -0
  46. data/assets/_vendor/ace/mode-csound_orchestra.js +2687 -0
  47. data/assets/_vendor/ace/mode-csound_score.js +454 -0
  48. data/assets/_vendor/ace/mode-csp.js +60 -0
  49. data/assets/_vendor/ace/mode-css.js +723 -0
  50. data/assets/_vendor/ace/mode-curly.js +2564 -0
  51. data/assets/_vendor/ace/mode-d.js +520 -0
  52. data/assets/_vendor/ace/mode-dart.js +703 -0
  53. data/assets/_vendor/ace/mode-diff.js +146 -0
  54. data/assets/_vendor/ace/mode-django.js +2594 -0
  55. data/assets/_vendor/ace/mode-dockerfile.js +498 -0
  56. data/assets/_vendor/ace/mode-dot.js +418 -0
  57. data/assets/_vendor/ace/mode-drools.js +496 -0
  58. data/assets/_vendor/ace/mode-edifact.js +165 -0
  59. data/assets/_vendor/ace/mode-eiffel.js +136 -0
  60. data/assets/_vendor/ace/mode-ejs.js +3026 -0
  61. data/assets/_vendor/ace/mode-elixir.js +501 -0
  62. data/assets/_vendor/ace/mode-elm.js +307 -0
  63. data/assets/_vendor/ace/mode-erlang.js +1009 -0
  64. data/assets/_vendor/ace/mode-forth.js +297 -0
  65. data/assets/_vendor/ace/mode-fortran.js +431 -0
  66. data/assets/_vendor/ace/mode-fsharp.js +314 -0
  67. data/assets/_vendor/ace/mode-ftl.js +1192 -0
  68. data/assets/_vendor/ace/mode-gcode.js +94 -0
  69. data/assets/_vendor/ace/mode-gherkin.js +172 -0
  70. data/assets/_vendor/ace/mode-gitignore.js +60 -0
  71. data/assets/_vendor/ace/mode-glsl.js +579 -0
  72. data/assets/_vendor/ace/mode-gobstones.js +929 -0
  73. data/assets/_vendor/ace/mode-golang.js +414 -0
  74. data/assets/_vendor/ace/mode-graphqlschema.js +214 -0
  75. data/assets/_vendor/ace/mode-groovy.js +986 -0
  76. data/assets/_vendor/ace/mode-haml.js +1555 -0
  77. data/assets/_vendor/ace/mode-handlebars.js +2622 -0
  78. data/assets/_vendor/ace/mode-haskell.js +379 -0
  79. data/assets/_vendor/ace/mode-haskell_cabal.js +142 -0
  80. data/assets/_vendor/ace/mode-haxe.js +386 -0
  81. data/assets/_vendor/ace/mode-hjson.js +353 -0
  82. data/assets/_vendor/ace/mode-html.js +2509 -0
  83. data/assets/_vendor/ace/mode-html_elixir.js +3087 -0
  84. data/assets/_vendor/ace/mode-html_ruby.js +3043 -0
  85. data/assets/_vendor/ace/mode-ini.js +163 -0
  86. data/assets/_vendor/ace/mode-io.js +253 -0
  87. data/assets/_vendor/ace/mode-jack.js +347 -0
  88. data/assets/_vendor/ace/mode-jade.js +2126 -0
  89. data/assets/_vendor/ace/mode-java.js +975 -0
  90. data/assets/_vendor/ace/mode-javascript.js +797 -0
  91. data/assets/_vendor/ace/mode-json.js +327 -0
  92. data/assets/_vendor/ace/mode-jsoniq.js +4940 -0
  93. data/assets/_vendor/ace/mode-jsp.js +1430 -0
  94. data/assets/_vendor/ace/mode-jssm.js +325 -0
  95. data/assets/_vendor/ace/mode-jsx.js +412 -0
  96. data/assets/_vendor/ace/mode-julia.js +303 -0
  97. data/assets/_vendor/ace/mode-kotlin.js +795 -0
  98. data/assets/_vendor/ace/mode-latex.js +297 -0
  99. data/assets/_vendor/ace/mode-less.js +841 -0
  100. data/assets/_vendor/ace/mode-liquid.js +1193 -0
  101. data/assets/_vendor/ace/mode-lisp.js +112 -0
  102. data/assets/_vendor/ace/mode-livescript.js +280 -0
  103. data/assets/_vendor/ace/mode-logiql.js +317 -0
  104. data/assets/_vendor/ace/mode-lsl.js +343 -0
  105. data/assets/_vendor/ace/mode-lua.js +432 -0
  106. data/assets/_vendor/ace/mode-luapage.js +3007 -0
  107. data/assets/_vendor/ace/mode-lucene.js +87 -0
  108. data/assets/_vendor/ace/mode-makefile.js +410 -0
  109. data/assets/_vendor/ace/mode-markdown.js +3189 -0
  110. data/assets/_vendor/ace/mode-mask.js +1802 -0
  111. data/assets/_vendor/ace/mode-matlab.js +264 -0
  112. data/assets/_vendor/ace/mode-maze.js +291 -0
  113. data/assets/_vendor/ace/mode-mel.js +263 -0
  114. data/assets/_vendor/ace/mode-mixal.js +123 -0
  115. data/assets/_vendor/ace/mode-mushcode.js +681 -0
  116. data/assets/_vendor/ace/mode-mysql.js +168 -0
  117. data/assets/_vendor/ace/mode-nix.js +646 -0
  118. data/assets/_vendor/ace/mode-nsis.js +312 -0
  119. data/assets/_vendor/ace/mode-objectivec.js +739 -0
  120. data/assets/_vendor/ace/mode-ocaml.js +422 -0
  121. data/assets/_vendor/ace/mode-pascal.js +205 -0
  122. data/assets/_vendor/ace/mode-perl.js +380 -0
  123. data/assets/_vendor/ace/mode-pgsql.js +1508 -0
  124. data/assets/_vendor/ace/mode-php.js +13088 -0
  125. data/assets/_vendor/ace/mode-php_laravel_blade.js +13289 -0
  126. data/assets/_vendor/ace/mode-pig.js +310 -0
  127. data/assets/_vendor/ace/mode-plain_text.js +33 -0
  128. data/assets/_vendor/ace/mode-powershell.js +418 -0
  129. data/assets/_vendor/ace/mode-praat.js +478 -0
  130. data/assets/_vendor/ace/mode-prolog.js +371 -0
  131. data/assets/_vendor/ace/mode-properties.js +81 -0
  132. data/assets/_vendor/ace/mode-protobuf.js +592 -0
  133. data/assets/_vendor/ace/mode-puppet.js +370 -0
  134. data/assets/_vendor/ace/mode-python.js +273 -0
  135. data/assets/_vendor/ace/mode-r.js +310 -0
  136. data/assets/_vendor/ace/mode-razor.js +2869 -0
  137. data/assets/_vendor/ace/mode-rdoc.js +243 -0
  138. data/assets/_vendor/ace/mode-red.js +450 -0
  139. data/assets/_vendor/ace/mode-redshift.js +361 -0
  140. data/assets/_vendor/ace/mode-rhtml.js +2806 -0
  141. data/assets/_vendor/ace/mode-rst.js +257 -0
  142. data/assets/_vendor/ace/mode-ruby.js +497 -0
  143. data/assets/_vendor/ace/mode-rust.js +279 -0
  144. data/assets/_vendor/ace/mode-sass.js +441 -0
  145. data/assets/_vendor/ace/mode-scad.js +414 -0
  146. data/assets/_vendor/ace/mode-scala.js +982 -0
  147. data/assets/_vendor/ace/mode-scheme.js +232 -0
  148. data/assets/_vendor/ace/mode-scss.js +606 -0
  149. data/assets/_vendor/ace/mode-sh.js +447 -0
  150. data/assets/_vendor/ace/mode-sjs.js +1014 -0
  151. data/assets/_vendor/ace/mode-slim.js +4736 -0
  152. data/assets/_vendor/ace/mode-smarty.js +2635 -0
  153. data/assets/_vendor/ace/mode-snippets.js +207 -0
  154. data/assets/_vendor/ace/mode-soy_template.js +2847 -0
  155. data/assets/_vendor/ace/mode-space.js +168 -0
  156. data/assets/_vendor/ace/mode-sparql.js +320 -0
  157. data/assets/_vendor/ace/mode-sql.js +111 -0
  158. data/assets/_vendor/ace/mode-sqlserver.js +444 -0
  159. data/assets/_vendor/ace/mode-stylus.js +471 -0
  160. data/assets/_vendor/ace/mode-svg.js +1581 -0
  161. data/assets/_vendor/ace/mode-swift.js +390 -0
  162. data/assets/_vendor/ace/mode-tcl.js +383 -0
  163. data/assets/_vendor/ace/mode-terraform.js +398 -0
  164. data/assets/_vendor/ace/mode-tex.js +159 -0
  165. data/assets/_vendor/ace/mode-text.js +10 -0
  166. data/assets/_vendor/ace/mode-textile.js +150 -0
  167. data/assets/_vendor/ace/mode-toml.js +154 -0
  168. data/assets/_vendor/ace/mode-tsx.js +887 -0
  169. data/assets/_vendor/ace/mode-turtle.js +296 -0
  170. data/assets/_vendor/ace/mode-twig.js +2693 -0
  171. data/assets/_vendor/ace/mode-typescript.js +868 -0
  172. data/assets/_vendor/ace/mode-vala.js +676 -0
  173. data/assets/_vendor/ace/mode-vbscript.js +207 -0
  174. data/assets/_vendor/ace/mode-velocity.js +2790 -0
  175. data/assets/_vendor/ace/mode-verilog.js +119 -0
  176. data/assets/_vendor/ace/mode-vhdl.js +118 -0
  177. data/assets/_vendor/ace/mode-wollok.js +911 -0
  178. data/assets/_vendor/ace/mode-xml.js +677 -0
  179. data/assets/_vendor/ace/mode-xquery.js +4922 -0
  180. data/assets/_vendor/ace/mode-yaml.js +300 -0
  181. data/assets/_vendor/ace/snippets/abap.js +15 -0
  182. data/assets/_vendor/ace/snippets/abc.js +46 -0
  183. data/assets/_vendor/ace/snippets/actionscript.js +172 -0
  184. data/assets/_vendor/ace/snippets/ada.js +15 -0
  185. data/assets/_vendor/ace/snippets/apache_conf.js +15 -0
  186. data/assets/_vendor/ace/snippets/applescript.js +15 -0
  187. data/assets/_vendor/ace/snippets/asciidoc.js +15 -0
  188. data/assets/_vendor/ace/snippets/asl.js +14 -0
  189. data/assets/_vendor/ace/snippets/assembly_x86.js +15 -0
  190. data/assets/_vendor/ace/snippets/autohotkey.js +15 -0
  191. data/assets/_vendor/ace/snippets/batchfile.js +15 -0
  192. data/assets/_vendor/ace/snippets/bro.js +15 -0
  193. data/assets/_vendor/ace/snippets/c9search.js +15 -0
  194. data/assets/_vendor/ace/snippets/c_cpp.js +146 -0
  195. data/assets/_vendor/ace/snippets/cirru.js +15 -0
  196. data/assets/_vendor/ace/snippets/clojure.js +105 -0
  197. data/assets/_vendor/ace/snippets/cobol.js +15 -0
  198. data/assets/_vendor/ace/snippets/coffee.js +110 -0
  199. data/assets/_vendor/ace/snippets/coldfusion.js +15 -0
  200. data/assets/_vendor/ace/snippets/csharp.js +15 -0
  201. data/assets/_vendor/ace/snippets/csound_document.js +25 -0
  202. data/assets/_vendor/ace/snippets/csound_orchestra.js +62 -0
  203. data/assets/_vendor/ace/snippets/csound_score.js +15 -0
  204. data/assets/_vendor/ace/snippets/csp.js +15 -0
  205. data/assets/_vendor/ace/snippets/css.js +982 -0
  206. data/assets/_vendor/ace/snippets/curly.js +15 -0
  207. data/assets/_vendor/ace/snippets/d.js +15 -0
  208. data/assets/_vendor/ace/snippets/dart.js +98 -0
  209. data/assets/_vendor/ace/snippets/diff.js +26 -0
  210. data/assets/_vendor/ace/snippets/django.js +123 -0
  211. data/assets/_vendor/ace/snippets/dockerfile.js +15 -0
  212. data/assets/_vendor/ace/snippets/dot.js +15 -0
  213. data/assets/_vendor/ace/snippets/drools.js +34 -0
  214. data/assets/_vendor/ace/snippets/edifact.js +255 -0
  215. data/assets/_vendor/ace/snippets/eiffel.js +15 -0
  216. data/assets/_vendor/ace/snippets/ejs.js +15 -0
  217. data/assets/_vendor/ace/snippets/elixir.js +15 -0
  218. data/assets/_vendor/ace/snippets/elm.js +15 -0
  219. data/assets/_vendor/ace/snippets/erlang.js +175 -0
  220. data/assets/_vendor/ace/snippets/forth.js +15 -0
  221. data/assets/_vendor/ace/snippets/fortran.js +15 -0
  222. data/assets/_vendor/ace/snippets/fsharp.js +15 -0
  223. data/assets/_vendor/ace/snippets/ftl.js +15 -0
  224. data/assets/_vendor/ace/snippets/gcode.js +15 -0
  225. data/assets/_vendor/ace/snippets/gherkin.js +15 -0
  226. data/assets/_vendor/ace/snippets/gitignore.js +15 -0
  227. data/assets/_vendor/ace/snippets/glsl.js +15 -0
  228. data/assets/_vendor/ace/snippets/gobstones.js +49 -0
  229. data/assets/_vendor/ace/snippets/golang.js +15 -0
  230. data/assets/_vendor/ace/snippets/graphqlschema.js +47 -0
  231. data/assets/_vendor/ace/snippets/groovy.js +15 -0
  232. data/assets/_vendor/ace/snippets/haml.js +35 -0
  233. data/assets/_vendor/ace/snippets/handlebars.js +15 -0
  234. data/assets/_vendor/ace/snippets/haskell.js +97 -0
  235. data/assets/_vendor/ace/snippets/haskell_cabal.js +15 -0
  236. data/assets/_vendor/ace/snippets/haxe.js +15 -0
  237. data/assets/_vendor/ace/snippets/hjson.js +15 -0
  238. data/assets/_vendor/ace/snippets/html.js +870 -0
  239. data/assets/_vendor/ace/snippets/html_elixir.js +15 -0
  240. data/assets/_vendor/ace/snippets/html_ruby.js +15 -0
  241. data/assets/_vendor/ace/snippets/ini.js +15 -0
  242. data/assets/_vendor/ace/snippets/io.js +77 -0
  243. data/assets/_vendor/ace/snippets/jack.js +15 -0
  244. data/assets/_vendor/ace/snippets/jade.js +15 -0
  245. data/assets/_vendor/ace/snippets/java.js +255 -0
  246. data/assets/_vendor/ace/snippets/javascript.js +210 -0
  247. data/assets/_vendor/ace/snippets/json.js +15 -0
  248. data/assets/_vendor/ace/snippets/jsoniq.js +76 -0
  249. data/assets/_vendor/ace/snippets/jsp.js +114 -0
  250. data/assets/_vendor/ace/snippets/jssm.js +15 -0
  251. data/assets/_vendor/ace/snippets/jsx.js +15 -0
  252. data/assets/_vendor/ace/snippets/julia.js +15 -0
  253. data/assets/_vendor/ace/snippets/kotlin.js +15 -0
  254. data/assets/_vendor/ace/snippets/latex.js +15 -0
  255. data/assets/_vendor/ace/snippets/less.js +15 -0
  256. data/assets/_vendor/ace/snippets/liquid.js +15 -0
  257. data/assets/_vendor/ace/snippets/lisp.js +15 -0
  258. data/assets/_vendor/ace/snippets/livescript.js +15 -0
  259. data/assets/_vendor/ace/snippets/logiql.js +15 -0
  260. data/assets/_vendor/ace/snippets/lsl.js +1247 -0
  261. data/assets/_vendor/ace/snippets/lua.js +36 -0
  262. data/assets/_vendor/ace/snippets/luapage.js +15 -0
  263. data/assets/_vendor/ace/snippets/lucene.js +15 -0
  264. data/assets/_vendor/ace/snippets/makefile.js +19 -0
  265. data/assets/_vendor/ace/snippets/markdown.js +103 -0
  266. data/assets/_vendor/ace/snippets/mask.js +15 -0
  267. data/assets/_vendor/ace/snippets/matlab.js +15 -0
  268. data/assets/_vendor/ace/snippets/maze.js +24 -0
  269. data/assets/_vendor/ace/snippets/mel.js +15 -0
  270. data/assets/_vendor/ace/snippets/mixal.js +15 -0
  271. data/assets/_vendor/ace/snippets/mushcode.js +15 -0
  272. data/assets/_vendor/ace/snippets/mysql.js +15 -0
  273. data/assets/_vendor/ace/snippets/nix.js +15 -0
  274. data/assets/_vendor/ace/snippets/nsis.js +15 -0
  275. data/assets/_vendor/ace/snippets/objectivec.js +15 -0
  276. data/assets/_vendor/ace/snippets/ocaml.js +15 -0
  277. data/assets/_vendor/ace/snippets/pascal.js +15 -0
  278. data/assets/_vendor/ace/snippets/perl.js +362 -0
  279. data/assets/_vendor/ace/snippets/pgsql.js +15 -0
  280. data/assets/_vendor/ace/snippets/php.js +398 -0
  281. data/assets/_vendor/ace/snippets/php_laravel_blade.js +15 -0
  282. data/assets/_vendor/ace/snippets/pig.js +15 -0
  283. data/assets/_vendor/ace/snippets/plain_text.js +15 -0
  284. data/assets/_vendor/ace/snippets/powershell.js +15 -0
  285. data/assets/_vendor/ace/snippets/praat.js +15 -0
  286. data/assets/_vendor/ace/snippets/prolog.js +15 -0
  287. data/assets/_vendor/ace/snippets/properties.js +15 -0
  288. data/assets/_vendor/ace/snippets/protobuf.js +15 -0
  289. data/assets/_vendor/ace/snippets/puppet.js +15 -0
  290. data/assets/_vendor/ace/snippets/python.js +173 -0
  291. data/assets/_vendor/ace/snippets/r.js +136 -0
  292. data/assets/_vendor/ace/snippets/razor.js +18 -0
  293. data/assets/_vendor/ace/snippets/rdoc.js +15 -0
  294. data/assets/_vendor/ace/snippets/red.js +15 -0
  295. data/assets/_vendor/ace/snippets/redshift.js +15 -0
  296. data/assets/_vendor/ace/snippets/rhtml.js +15 -0
  297. data/assets/_vendor/ace/snippets/rst.js +37 -0
  298. data/assets/_vendor/ace/snippets/ruby.js +943 -0
  299. data/assets/_vendor/ace/snippets/rust.js +15 -0
  300. data/assets/_vendor/ace/snippets/sass.js +15 -0
  301. data/assets/_vendor/ace/snippets/scad.js +15 -0
  302. data/assets/_vendor/ace/snippets/scala.js +15 -0
  303. data/assets/_vendor/ace/snippets/scheme.js +15 -0
  304. data/assets/_vendor/ace/snippets/scss.js +15 -0
  305. data/assets/_vendor/ace/snippets/sh.js +98 -0
  306. data/assets/_vendor/ace/snippets/sjs.js +15 -0
  307. data/assets/_vendor/ace/snippets/slim.js +15 -0
  308. data/assets/_vendor/ace/snippets/smarty.js +15 -0
  309. data/assets/_vendor/ace/snippets/snippets.js +24 -0
  310. data/assets/_vendor/ace/snippets/soy_template.js +15 -0
  311. data/assets/_vendor/ace/snippets/space.js +15 -0
  312. data/assets/_vendor/ace/snippets/sparql.js +15 -0
  313. data/assets/_vendor/ace/snippets/sql.js +41 -0
  314. data/assets/_vendor/ace/snippets/sqlserver.js +84 -0
  315. data/assets/_vendor/ace/snippets/stylus.js +15 -0
  316. data/assets/_vendor/ace/snippets/svg.js +15 -0
  317. data/assets/_vendor/ace/snippets/swift.js +15 -0
  318. data/assets/_vendor/ace/snippets/tcl.js +107 -0
  319. data/assets/_vendor/ace/snippets/terraform.js +15 -0
  320. data/assets/_vendor/ace/snippets/tex.js +205 -0
  321. data/assets/_vendor/ace/snippets/text.js +15 -0
  322. data/assets/_vendor/ace/snippets/textile.js +45 -0
  323. data/assets/_vendor/ace/snippets/toml.js +15 -0
  324. data/assets/_vendor/ace/snippets/tsx.js +15 -0
  325. data/assets/_vendor/ace/snippets/turtle.js +15 -0
  326. data/assets/_vendor/ace/snippets/twig.js +15 -0
  327. data/assets/_vendor/ace/snippets/typescript.js +15 -0
  328. data/assets/_vendor/ace/snippets/vala.js +201 -0
  329. data/assets/_vendor/ace/snippets/vbscript.js +15 -0
  330. data/assets/_vendor/ace/snippets/velocity.js +44 -0
  331. data/assets/_vendor/ace/snippets/verilog.js +15 -0
  332. data/assets/_vendor/ace/snippets/vhdl.js +15 -0
  333. data/assets/_vendor/ace/snippets/wollok.js +99 -0
  334. data/assets/_vendor/ace/snippets/xml.js +15 -0
  335. data/assets/_vendor/ace/snippets/xquery.js +76 -0
  336. data/assets/_vendor/ace/snippets/yaml.js +15 -0
  337. data/assets/_vendor/ace/theme-ambiance.js +185 -0
  338. data/assets/_vendor/ace/theme-chaos.js +164 -0
  339. data/assets/_vendor/ace/theme-chrome.js +136 -0
  340. data/assets/_vendor/ace/theme-clouds.js +103 -0
  341. data/assets/_vendor/ace/theme-clouds_midnight.js +104 -0
  342. data/assets/_vendor/ace/theme-cobalt.js +121 -0
  343. data/assets/_vendor/ace/theme-crimson_editor.js +126 -0
  344. data/assets/_vendor/ace/theme-dawn.js +116 -0
  345. data/assets/_vendor/ace/theme-dracula.js +136 -0
  346. data/assets/_vendor/ace/theme-dreamweaver.js +149 -0
  347. data/assets/_vendor/ace/theme-eclipse.js +106 -0
  348. data/assets/_vendor/ace/theme-github.js +110 -0
  349. data/assets/_vendor/ace/theme-gob.js +120 -0
  350. data/assets/_vendor/ace/theme-gruvbox.js +90 -0
  351. data/assets/_vendor/ace/theme-idle_fingers.js +104 -0
  352. data/assets/_vendor/ace/theme-iplastic.js +129 -0
  353. data/assets/_vendor/ace/theme-katzenmilch.js +129 -0
  354. data/assets/_vendor/ace/theme-kr_theme.js +112 -0
  355. data/assets/_vendor/ace/theme-kuroir.js +69 -0
  356. data/assets/_vendor/ace/theme-merbivore.js +103 -0
  357. data/assets/_vendor/ace/theme-merbivore_soft.js +104 -0
  358. data/assets/_vendor/ace/theme-mono_industrial.js +115 -0
  359. data/assets/_vendor/ace/theme-monokai.js +113 -0
  360. data/assets/_vendor/ace/theme-pastel_on_dark.js +116 -0
  361. data/assets/_vendor/ace/theme-solarized_dark.js +96 -0
  362. data/assets/_vendor/ace/theme-solarized_light.js +99 -0
  363. data/assets/_vendor/ace/theme-sqlserver.js +146 -0
  364. data/assets/_vendor/ace/theme-terminal.js +122 -0
  365. data/assets/_vendor/ace/theme-textmate.js +138 -0
  366. data/assets/_vendor/ace/theme-tomorrow.js +116 -0
  367. data/assets/_vendor/ace/theme-tomorrow_night.js +116 -0
  368. data/assets/_vendor/ace/theme-tomorrow_night_blue.js +114 -0
  369. data/assets/_vendor/ace/theme-tomorrow_night_bright.js +129 -0
  370. data/assets/_vendor/ace/theme-tomorrow_night_eighties.js +116 -0
  371. data/assets/_vendor/ace/theme-twilight.js +117 -0
  372. data/assets/_vendor/ace/theme-vibrant_ink.js +102 -0
  373. data/assets/_vendor/ace/theme-xcode.js +96 -0
  374. data/assets/_vendor/ace/worker-coffee.js +2165 -0
  375. data/assets/_vendor/ace/worker-css.js +8764 -0
  376. data/assets/_vendor/ace/worker-html.js +11614 -0
  377. data/assets/_vendor/ace/worker-javascript.js +12491 -0
  378. data/assets/_vendor/ace/worker-json.js +2396 -0
  379. data/assets/_vendor/ace/worker-lua.js +3637 -0
  380. data/assets/_vendor/ace/worker-php.js +4313 -0
  381. data/assets/_vendor/ace/worker-xml.js +3899 -0
  382. data/assets/_vendor/ace/worker-xquery.js +70688 -0
  383. data/assets/_vendor/motion-ui/_settings.scss +1 -0
  384. data/assets/_vendor/motion-ui/effects/_fade.scss +1 -4
  385. data/assets/_vendor/motion-ui/effects/_hinge.scss +4 -3
  386. data/assets/_vendor/motion-ui/effects/_shake.scss +1 -1
  387. data/assets/_vendor/motion-ui/effects/_slide.scss +4 -3
  388. data/assets/_vendor/motion-ui/effects/_spin.scss +4 -3
  389. data/assets/_vendor/motion-ui/effects/_wiggle.scss +1 -1
  390. data/assets/_vendor/motion-ui/effects/_zoom.scss +2 -2
  391. data/assets/_vendor/motion-ui/motion-ui.scss +2 -0
  392. data/assets/_vendor/motion-ui/transitions/_fade.scss +6 -4
  393. data/assets/_vendor/motion-ui/transitions/_hinge.scss +3 -2
  394. data/assets/_vendor/motion-ui/transitions/_slide.scss +3 -2
  395. data/assets/_vendor/motion-ui/transitions/_spin.scss +2 -1
  396. data/assets/_vendor/motion-ui/transitions/_zoom.scss +6 -4
  397. data/assets/_vendor/motion-ui/util/_animation.scss +1 -1
  398. data/assets/_vendor/motion-ui/util/_args.scss +2 -2
  399. data/assets/_vendor/motion-ui/util/_function.scss +94 -0
  400. data/assets/_vendor/motion-ui/util/_keyframe.scss +5 -5
  401. data/assets/_vendor/motion-ui/util/_series.scss +20 -17
  402. data/assets/_vendor/motion-ui/util/_string.scss +36 -0
  403. data/assets/_vendor/tinymce/plugins/advlist/plugin.js +136 -404
  404. data/assets/_vendor/tinymce/plugins/advlist/plugin.min.js +1 -1
  405. data/assets/_vendor/tinymce/plugins/anchor/plugin.js +103 -323
  406. data/assets/_vendor/tinymce/plugins/anchor/plugin.min.js +1 -1
  407. data/assets/_vendor/tinymce/plugins/autolink/plugin.js +153 -377
  408. data/assets/_vendor/tinymce/plugins/autolink/plugin.min.js +1 -1
  409. data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +145 -427
  410. data/assets/_vendor/tinymce/plugins/autoresize/plugin.min.js +1 -1
  411. data/assets/_vendor/tinymce/plugins/autosave/plugin.js +197 -579
  412. data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -1
  413. data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +88 -251
  414. data/assets/_vendor/tinymce/plugins/bbcode/plugin.min.js +1 -1
  415. data/assets/_vendor/tinymce/plugins/charmap/plugin.js +1243 -818
  416. data/assets/_vendor/tinymce/plugins/charmap/plugin.min.js +1 -1
  417. data/assets/_vendor/tinymce/plugins/code/plugin.js +82 -326
  418. data/assets/_vendor/tinymce/plugins/code/plugin.min.js +1 -1
  419. data/assets/_vendor/tinymce/plugins/codesample/plugin.js +829 -1444
  420. data/assets/_vendor/tinymce/plugins/codesample/plugin.min.js +1 -1
  421. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +111 -257
  422. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.min.js +1 -1
  423. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +141 -469
  424. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.min.js +1 -1
  425. data/assets/_vendor/tinymce/plugins/directionality/plugin.js +57 -261
  426. data/assets/_vendor/tinymce/plugins/directionality/plugin.min.js +1 -1
  427. data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +78 -247
  428. data/assets/_vendor/tinymce/plugins/emoticons/plugin.min.js +1 -1
  429. data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +463 -906
  430. data/assets/_vendor/tinymce/plugins/fullpage/plugin.min.js +1 -1
  431. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +149 -427
  432. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.min.js +1 -1
  433. data/assets/_vendor/tinymce/plugins/help/plugin.js +634 -1434
  434. data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -1
  435. data/assets/_vendor/tinymce/plugins/hr/plugin.js +29 -185
  436. data/assets/_vendor/tinymce/plugins/hr/plugin.min.js +1 -1
  437. data/assets/_vendor/tinymce/plugins/image/plugin.js +1147 -1508
  438. data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -1
  439. data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +3319 -4079
  440. data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +1 -2
  441. data/assets/_vendor/tinymce/plugins/importcss/plugin.js +230 -543
  442. data/assets/_vendor/tinymce/plugins/importcss/plugin.min.js +1 -1
  443. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +151 -460
  444. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
  445. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +204 -379
  446. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.min.js +1 -1
  447. data/assets/_vendor/tinymce/plugins/link/plugin.js +644 -1162
  448. data/assets/_vendor/tinymce/plugins/link/plugin.min.js +1 -1
  449. data/assets/_vendor/tinymce/plugins/lists/plugin.js +1005 -1875
  450. data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -1
  451. data/assets/_vendor/tinymce/plugins/media/plugin.js +1066 -1926
  452. data/assets/_vendor/tinymce/plugins/media/plugin.min.js +1 -1
  453. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +70 -298
  454. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
  455. data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +96 -294
  456. data/assets/_vendor/tinymce/plugins/noneditable/plugin.min.js +1 -1
  457. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +92 -337
  458. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.min.js +1 -1
  459. data/assets/_vendor/tinymce/plugins/paste/plugin.js +1363 -2801
  460. data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -1
  461. data/assets/_vendor/tinymce/plugins/preview/plugin.js +106 -393
  462. data/assets/_vendor/tinymce/plugins/preview/plugin.min.js +1 -1
  463. data/assets/_vendor/tinymce/plugins/print/plugin.js +29 -185
  464. data/assets/_vendor/tinymce/plugins/print/plugin.min.js +1 -1
  465. data/assets/_vendor/tinymce/plugins/save/plugin.js +100 -350
  466. data/assets/_vendor/tinymce/plugins/save/plugin.min.js +1 -1
  467. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +491 -865
  468. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -1
  469. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +630 -1292
  470. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -1
  471. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +96 -391
  472. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.min.js +1 -1
  473. data/assets/_vendor/tinymce/plugins/table/plugin.js +9537 -14920
  474. data/assets/_vendor/tinymce/plugins/table/plugin.min.js +1 -5
  475. data/assets/_vendor/tinymce/plugins/template/plugin.js +309 -771
  476. data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -1
  477. data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +319 -592
  478. data/assets/_vendor/tinymce/plugins/textcolor/plugin.min.js +1 -1
  479. data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +326 -674
  480. data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -1
  481. data/assets/_vendor/tinymce/plugins/toc/plugin.js +199 -530
  482. data/assets/_vendor/tinymce/plugins/toc/plugin.min.js +1 -1
  483. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +112 -436
  484. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.min.js +1 -1
  485. data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +428 -1248
  486. data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -1
  487. data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +307 -699
  488. data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -1
  489. data/assets/_vendor/tinymce/skins/lightgray/content.inline.min.css +1 -1
  490. data/assets/_vendor/tinymce/skins/lightgray/content.min.css +1 -1
  491. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  492. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +1 -1
  493. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  494. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  495. data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -1
  496. data/assets/_vendor/tinymce/skins/lightgray/skin.mobile.min.css +1 -1
  497. data/assets/_vendor/tinymce/themes/inlite/theme.js +9693 -18245
  498. data/assets/_vendor/tinymce/themes/inlite/theme.min.js +1 -5
  499. data/assets/_vendor/tinymce/themes/mobile/theme.js +12629 -22467
  500. data/assets/_vendor/tinymce/themes/mobile/theme.min.js +1 -8
  501. data/assets/_vendor/tinymce/themes/modern/theme.js +9510 -17780
  502. data/assets/_vendor/tinymce/themes/modern/theme.min.js +1 -5
  503. data/assets/_vendor/tinymce/tinymce.js +25087 -42606
  504. data/assets/_vendor/yoastseo/css/_icons.scss +7 -7
  505. data/assets/_vendor/yoastseo/css/_snippet-editor.scss +1 -1
  506. data/assets/bedrock/js/bedrock.js +1 -71697
  507. data/assets/bedrock/scss/_bedrock-components.scss +20 -0
  508. data/assets/bedrock/scss/_bedrock-settings.scss +12 -4
  509. data/assets/bedrock/scss/_foundation-settings.scss +4 -2
  510. data/assets/bedrock/scss/components/ace-editor.scss +21 -0
  511. data/assets/bedrock/scss/components/attachments-grid.scss +18 -15
  512. data/assets/bedrock/scss/components/date-picker.scss +146 -0
  513. data/assets/bedrock/scss/components/dropzone-upload.scss +7 -0
  514. data/assets/bedrock/scss/components/file-input.scss +7 -0
  515. data/assets/bedrock/scss/components/file-preview.scss +36 -0
  516. data/assets/bedrock/scss/components/frame-embed.scss +23 -0
  517. data/assets/bedrock/scss/components/global.scss +27 -0
  518. data/assets/bedrock/scss/components/helper-classes.scss +1 -0
  519. data/assets/bedrock/scss/components/icon-box.scss +38 -0
  520. data/assets/bedrock/scss/components/item-list.scss +66 -0
  521. data/assets/bedrock/scss/components/lists.scss +58 -0
  522. data/assets/bedrock/scss/components/off-canvas-menu.scss +27 -15
  523. data/assets/bedrock/scss/components/place-autocomplete.scss +90 -0
  524. data/assets/bedrock/scss/components/rrule-generator.scss +102 -0
  525. data/assets/bedrock/scss/components/rrule-reveal.scss +14 -0
  526. data/assets/bedrock/scss/components/select-box.scss +1 -0
  527. data/assets/bedrock/scss/components/seo-analysis.scss +5 -0
  528. data/assets/bedrock/scss/components/textarea.scss +14 -2
  529. data/assets/bedrock/scss/components/tiny-mce-editor.scss +5 -16
  530. data/lib/bedrock_sass.rb +5 -0
  531. data/lib/bedrock_sass/version.rb +1 -1
  532. data/lib/tasks/before_assets_precompile.rake +1 -0
  533. metadata +395 -4
  534. data/CODE_OF_CONDUCT.md +0 -74
@@ -0,0 +1,2396 @@
1
+ "no use strict";
2
+ !(function(window) {
3
+ if (typeof window.window != "undefined" && window.document)
4
+ return;
5
+ if (window.require && window.define)
6
+ return;
7
+
8
+ if (!window.console) {
9
+ window.console = function() {
10
+ var msgs = Array.prototype.slice.call(arguments, 0);
11
+ postMessage({type: "log", data: msgs});
12
+ };
13
+ window.console.error =
14
+ window.console.warn =
15
+ window.console.log =
16
+ window.console.trace = window.console;
17
+ }
18
+ window.window = window;
19
+ window.ace = window;
20
+
21
+ window.onerror = function(message, file, line, col, err) {
22
+ postMessage({type: "error", data: {
23
+ message: message,
24
+ data: err.data,
25
+ file: file,
26
+ line: line,
27
+ col: col,
28
+ stack: err.stack
29
+ }});
30
+ };
31
+
32
+ window.normalizeModule = function(parentId, moduleName) {
33
+ // normalize plugin requires
34
+ if (moduleName.indexOf("!") !== -1) {
35
+ var chunks = moduleName.split("!");
36
+ return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]);
37
+ }
38
+ // normalize relative requires
39
+ if (moduleName.charAt(0) == ".") {
40
+ var base = parentId.split("/").slice(0, -1).join("/");
41
+ moduleName = (base ? base + "/" : "") + moduleName;
42
+
43
+ while (moduleName.indexOf(".") !== -1 && previous != moduleName) {
44
+ var previous = moduleName;
45
+ moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
46
+ }
47
+ }
48
+
49
+ return moduleName;
50
+ };
51
+
52
+ window.require = function require(parentId, id) {
53
+ if (!id) {
54
+ id = parentId;
55
+ parentId = null;
56
+ }
57
+ if (!id.charAt)
58
+ throw new Error("worker.js require() accepts only (parentId, id) as arguments");
59
+
60
+ id = window.normalizeModule(parentId, id);
61
+
62
+ var module = window.require.modules[id];
63
+ if (module) {
64
+ if (!module.initialized) {
65
+ module.initialized = true;
66
+ module.exports = module.factory().exports;
67
+ }
68
+ return module.exports;
69
+ }
70
+
71
+ if (!window.require.tlns)
72
+ return console.log("unable to load " + id);
73
+
74
+ var path = resolveModuleId(id, window.require.tlns);
75
+ if (path.slice(-3) != ".js") path += ".js";
76
+
77
+ window.require.id = id;
78
+ window.require.modules[id] = {}; // prevent infinite loop on broken modules
79
+ importScripts(path);
80
+ return window.require(parentId, id);
81
+ };
82
+ function resolveModuleId(id, paths) {
83
+ var testPath = id, tail = "";
84
+ while (testPath) {
85
+ var alias = paths[testPath];
86
+ if (typeof alias == "string") {
87
+ return alias + tail;
88
+ } else if (alias) {
89
+ return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name);
90
+ } else if (alias === false) {
91
+ return "";
92
+ }
93
+ var i = testPath.lastIndexOf("/");
94
+ if (i === -1) break;
95
+ tail = testPath.substr(i) + tail;
96
+ testPath = testPath.slice(0, i);
97
+ }
98
+ return id;
99
+ }
100
+ window.require.modules = {};
101
+ window.require.tlns = {};
102
+
103
+ window.define = function(id, deps, factory) {
104
+ if (arguments.length == 2) {
105
+ factory = deps;
106
+ if (typeof id != "string") {
107
+ deps = id;
108
+ id = window.require.id;
109
+ }
110
+ } else if (arguments.length == 1) {
111
+ factory = id;
112
+ deps = [];
113
+ id = window.require.id;
114
+ }
115
+
116
+ if (typeof factory != "function") {
117
+ window.require.modules[id] = {
118
+ exports: factory,
119
+ initialized: true
120
+ };
121
+ return;
122
+ }
123
+
124
+ if (!deps.length)
125
+ // If there is no dependencies, we inject "require", "exports" and
126
+ // "module" as dependencies, to provide CommonJS compatibility.
127
+ deps = ["require", "exports", "module"];
128
+
129
+ var req = function(childId) {
130
+ return window.require(id, childId);
131
+ };
132
+
133
+ window.require.modules[id] = {
134
+ exports: {},
135
+ factory: function() {
136
+ var module = this;
137
+ var returnExports = factory.apply(this, deps.slice(0, factory.length).map(function(dep) {
138
+ switch (dep) {
139
+ // Because "require", "exports" and "module" aren't actual
140
+ // dependencies, we must handle them seperately.
141
+ case "require": return req;
142
+ case "exports": return module.exports;
143
+ case "module": return module;
144
+ // But for all other dependencies, we can just go ahead and
145
+ // require them.
146
+ default: return req(dep);
147
+ }
148
+ }));
149
+ if (returnExports)
150
+ module.exports = returnExports;
151
+ return module;
152
+ }
153
+ };
154
+ };
155
+ window.define.amd = {};
156
+ require.tlns = {};
157
+ window.initBaseUrls = function initBaseUrls(topLevelNamespaces) {
158
+ for (var i in topLevelNamespaces)
159
+ require.tlns[i] = topLevelNamespaces[i];
160
+ };
161
+
162
+ window.initSender = function initSender() {
163
+
164
+ var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter;
165
+ var oop = window.require("ace/lib/oop");
166
+
167
+ var Sender = function() {};
168
+
169
+ (function() {
170
+
171
+ oop.implement(this, EventEmitter);
172
+
173
+ this.callback = function(data, callbackId) {
174
+ postMessage({
175
+ type: "call",
176
+ id: callbackId,
177
+ data: data
178
+ });
179
+ };
180
+
181
+ this.emit = function(name, data) {
182
+ postMessage({
183
+ type: "event",
184
+ name: name,
185
+ data: data
186
+ });
187
+ };
188
+
189
+ }).call(Sender.prototype);
190
+
191
+ return new Sender();
192
+ };
193
+
194
+ var main = window.main = null;
195
+ var sender = window.sender = null;
196
+
197
+ window.onmessage = function(e) {
198
+ var msg = e.data;
199
+ if (msg.event && sender) {
200
+ sender._signal(msg.event, msg.data);
201
+ }
202
+ else if (msg.command) {
203
+ if (main[msg.command])
204
+ main[msg.command].apply(main, msg.args);
205
+ else if (window[msg.command])
206
+ window[msg.command].apply(window, msg.args);
207
+ else
208
+ throw new Error("Unknown command:" + msg.command);
209
+ }
210
+ else if (msg.init) {
211
+ window.initBaseUrls(msg.tlns);
212
+ require("ace/lib/es5-shim");
213
+ sender = window.sender = window.initSender();
214
+ var clazz = require(msg.module)[msg.classname];
215
+ main = window.main = new clazz(sender);
216
+ }
217
+ };
218
+ })(this);
219
+
220
+ define("ace/lib/oop",[], function(require, exports, module) {
221
+ "use strict";
222
+
223
+ exports.inherits = function(ctor, superCtor) {
224
+ ctor.super_ = superCtor;
225
+ ctor.prototype = Object.create(superCtor.prototype, {
226
+ constructor: {
227
+ value: ctor,
228
+ enumerable: false,
229
+ writable: true,
230
+ configurable: true
231
+ }
232
+ });
233
+ };
234
+
235
+ exports.mixin = function(obj, mixin) {
236
+ for (var key in mixin) {
237
+ obj[key] = mixin[key];
238
+ }
239
+ return obj;
240
+ };
241
+
242
+ exports.implement = function(proto, mixin) {
243
+ exports.mixin(proto, mixin);
244
+ };
245
+
246
+ });
247
+
248
+ define("ace/range",[], function(require, exports, module) {
249
+ "use strict";
250
+ var comparePoints = function(p1, p2) {
251
+ return p1.row - p2.row || p1.column - p2.column;
252
+ };
253
+ var Range = function(startRow, startColumn, endRow, endColumn) {
254
+ this.start = {
255
+ row: startRow,
256
+ column: startColumn
257
+ };
258
+
259
+ this.end = {
260
+ row: endRow,
261
+ column: endColumn
262
+ };
263
+ };
264
+
265
+ (function() {
266
+ this.isEqual = function(range) {
267
+ return this.start.row === range.start.row &&
268
+ this.end.row === range.end.row &&
269
+ this.start.column === range.start.column &&
270
+ this.end.column === range.end.column;
271
+ };
272
+ this.toString = function() {
273
+ return ("Range: [" + this.start.row + "/" + this.start.column +
274
+ "] -> [" + this.end.row + "/" + this.end.column + "]");
275
+ };
276
+
277
+ this.contains = function(row, column) {
278
+ return this.compare(row, column) == 0;
279
+ };
280
+ this.compareRange = function(range) {
281
+ var cmp,
282
+ end = range.end,
283
+ start = range.start;
284
+
285
+ cmp = this.compare(end.row, end.column);
286
+ if (cmp == 1) {
287
+ cmp = this.compare(start.row, start.column);
288
+ if (cmp == 1) {
289
+ return 2;
290
+ } else if (cmp == 0) {
291
+ return 1;
292
+ } else {
293
+ return 0;
294
+ }
295
+ } else if (cmp == -1) {
296
+ return -2;
297
+ } else {
298
+ cmp = this.compare(start.row, start.column);
299
+ if (cmp == -1) {
300
+ return -1;
301
+ } else if (cmp == 1) {
302
+ return 42;
303
+ } else {
304
+ return 0;
305
+ }
306
+ }
307
+ };
308
+ this.comparePoint = function(p) {
309
+ return this.compare(p.row, p.column);
310
+ };
311
+ this.containsRange = function(range) {
312
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
313
+ };
314
+ this.intersects = function(range) {
315
+ var cmp = this.compareRange(range);
316
+ return (cmp == -1 || cmp == 0 || cmp == 1);
317
+ };
318
+ this.isEnd = function(row, column) {
319
+ return this.end.row == row && this.end.column == column;
320
+ };
321
+ this.isStart = function(row, column) {
322
+ return this.start.row == row && this.start.column == column;
323
+ };
324
+ this.setStart = function(row, column) {
325
+ if (typeof row == "object") {
326
+ this.start.column = row.column;
327
+ this.start.row = row.row;
328
+ } else {
329
+ this.start.row = row;
330
+ this.start.column = column;
331
+ }
332
+ };
333
+ this.setEnd = function(row, column) {
334
+ if (typeof row == "object") {
335
+ this.end.column = row.column;
336
+ this.end.row = row.row;
337
+ } else {
338
+ this.end.row = row;
339
+ this.end.column = column;
340
+ }
341
+ };
342
+ this.inside = function(row, column) {
343
+ if (this.compare(row, column) == 0) {
344
+ if (this.isEnd(row, column) || this.isStart(row, column)) {
345
+ return false;
346
+ } else {
347
+ return true;
348
+ }
349
+ }
350
+ return false;
351
+ };
352
+ this.insideStart = function(row, column) {
353
+ if (this.compare(row, column) == 0) {
354
+ if (this.isEnd(row, column)) {
355
+ return false;
356
+ } else {
357
+ return true;
358
+ }
359
+ }
360
+ return false;
361
+ };
362
+ this.insideEnd = function(row, column) {
363
+ if (this.compare(row, column) == 0) {
364
+ if (this.isStart(row, column)) {
365
+ return false;
366
+ } else {
367
+ return true;
368
+ }
369
+ }
370
+ return false;
371
+ };
372
+ this.compare = function(row, column) {
373
+ if (!this.isMultiLine()) {
374
+ if (row === this.start.row) {
375
+ return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
376
+ }
377
+ }
378
+
379
+ if (row < this.start.row)
380
+ return -1;
381
+
382
+ if (row > this.end.row)
383
+ return 1;
384
+
385
+ if (this.start.row === row)
386
+ return column >= this.start.column ? 0 : -1;
387
+
388
+ if (this.end.row === row)
389
+ return column <= this.end.column ? 0 : 1;
390
+
391
+ return 0;
392
+ };
393
+ this.compareStart = function(row, column) {
394
+ if (this.start.row == row && this.start.column == column) {
395
+ return -1;
396
+ } else {
397
+ return this.compare(row, column);
398
+ }
399
+ };
400
+ this.compareEnd = function(row, column) {
401
+ if (this.end.row == row && this.end.column == column) {
402
+ return 1;
403
+ } else {
404
+ return this.compare(row, column);
405
+ }
406
+ };
407
+ this.compareInside = function(row, column) {
408
+ if (this.end.row == row && this.end.column == column) {
409
+ return 1;
410
+ } else if (this.start.row == row && this.start.column == column) {
411
+ return -1;
412
+ } else {
413
+ return this.compare(row, column);
414
+ }
415
+ };
416
+ this.clipRows = function(firstRow, lastRow) {
417
+ if (this.end.row > lastRow)
418
+ var end = {row: lastRow + 1, column: 0};
419
+ else if (this.end.row < firstRow)
420
+ var end = {row: firstRow, column: 0};
421
+
422
+ if (this.start.row > lastRow)
423
+ var start = {row: lastRow + 1, column: 0};
424
+ else if (this.start.row < firstRow)
425
+ var start = {row: firstRow, column: 0};
426
+
427
+ return Range.fromPoints(start || this.start, end || this.end);
428
+ };
429
+ this.extend = function(row, column) {
430
+ var cmp = this.compare(row, column);
431
+
432
+ if (cmp == 0)
433
+ return this;
434
+ else if (cmp == -1)
435
+ var start = {row: row, column: column};
436
+ else
437
+ var end = {row: row, column: column};
438
+
439
+ return Range.fromPoints(start || this.start, end || this.end);
440
+ };
441
+
442
+ this.isEmpty = function() {
443
+ return (this.start.row === this.end.row && this.start.column === this.end.column);
444
+ };
445
+ this.isMultiLine = function() {
446
+ return (this.start.row !== this.end.row);
447
+ };
448
+ this.clone = function() {
449
+ return Range.fromPoints(this.start, this.end);
450
+ };
451
+ this.collapseRows = function() {
452
+ if (this.end.column == 0)
453
+ return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0);
454
+ else
455
+ return new Range(this.start.row, 0, this.end.row, 0);
456
+ };
457
+ this.toScreenRange = function(session) {
458
+ var screenPosStart = session.documentToScreenPosition(this.start);
459
+ var screenPosEnd = session.documentToScreenPosition(this.end);
460
+
461
+ return new Range(
462
+ screenPosStart.row, screenPosStart.column,
463
+ screenPosEnd.row, screenPosEnd.column
464
+ );
465
+ };
466
+ this.moveBy = function(row, column) {
467
+ this.start.row += row;
468
+ this.start.column += column;
469
+ this.end.row += row;
470
+ this.end.column += column;
471
+ };
472
+
473
+ }).call(Range.prototype);
474
+ Range.fromPoints = function(start, end) {
475
+ return new Range(start.row, start.column, end.row, end.column);
476
+ };
477
+ Range.comparePoints = comparePoints;
478
+
479
+ Range.comparePoints = function(p1, p2) {
480
+ return p1.row - p2.row || p1.column - p2.column;
481
+ };
482
+
483
+
484
+ exports.Range = Range;
485
+ });
486
+
487
+ define("ace/apply_delta",[], function(require, exports, module) {
488
+ "use strict";
489
+
490
+ function throwDeltaError(delta, errorText){
491
+ console.log("Invalid Delta:", delta);
492
+ throw "Invalid Delta: " + errorText;
493
+ }
494
+
495
+ function positionInDocument(docLines, position) {
496
+ return position.row >= 0 && position.row < docLines.length &&
497
+ position.column >= 0 && position.column <= docLines[position.row].length;
498
+ }
499
+
500
+ function validateDelta(docLines, delta) {
501
+ if (delta.action != "insert" && delta.action != "remove")
502
+ throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
503
+ if (!(delta.lines instanceof Array))
504
+ throwDeltaError(delta, "delta.lines must be an Array");
505
+ if (!delta.start || !delta.end)
506
+ throwDeltaError(delta, "delta.start/end must be an present");
507
+ var start = delta.start;
508
+ if (!positionInDocument(docLines, delta.start))
509
+ throwDeltaError(delta, "delta.start must be contained in document");
510
+ var end = delta.end;
511
+ if (delta.action == "remove" && !positionInDocument(docLines, end))
512
+ throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
513
+ var numRangeRows = end.row - start.row;
514
+ var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
515
+ if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
516
+ throwDeltaError(delta, "delta.range must match delta lines");
517
+ }
518
+
519
+ exports.applyDelta = function(docLines, delta, doNotValidate) {
520
+ var row = delta.start.row;
521
+ var startColumn = delta.start.column;
522
+ var line = docLines[row] || "";
523
+ switch (delta.action) {
524
+ case "insert":
525
+ var lines = delta.lines;
526
+ if (lines.length === 1) {
527
+ docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
528
+ } else {
529
+ var args = [row, 1].concat(delta.lines);
530
+ docLines.splice.apply(docLines, args);
531
+ docLines[row] = line.substring(0, startColumn) + docLines[row];
532
+ docLines[row + delta.lines.length - 1] += line.substring(startColumn);
533
+ }
534
+ break;
535
+ case "remove":
536
+ var endColumn = delta.end.column;
537
+ var endRow = delta.end.row;
538
+ if (row === endRow) {
539
+ docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
540
+ } else {
541
+ docLines.splice(
542
+ row, endRow - row + 1,
543
+ line.substring(0, startColumn) + docLines[endRow].substring(endColumn)
544
+ );
545
+ }
546
+ break;
547
+ }
548
+ };
549
+ });
550
+
551
+ define("ace/lib/event_emitter",[], function(require, exports, module) {
552
+ "use strict";
553
+
554
+ var EventEmitter = {};
555
+ var stopPropagation = function() { this.propagationStopped = true; };
556
+ var preventDefault = function() { this.defaultPrevented = true; };
557
+
558
+ EventEmitter._emit =
559
+ EventEmitter._dispatchEvent = function(eventName, e) {
560
+ this._eventRegistry || (this._eventRegistry = {});
561
+ this._defaultHandlers || (this._defaultHandlers = {});
562
+
563
+ var listeners = this._eventRegistry[eventName] || [];
564
+ var defaultHandler = this._defaultHandlers[eventName];
565
+ if (!listeners.length && !defaultHandler)
566
+ return;
567
+
568
+ if (typeof e != "object" || !e)
569
+ e = {};
570
+
571
+ if (!e.type)
572
+ e.type = eventName;
573
+ if (!e.stopPropagation)
574
+ e.stopPropagation = stopPropagation;
575
+ if (!e.preventDefault)
576
+ e.preventDefault = preventDefault;
577
+
578
+ listeners = listeners.slice();
579
+ for (var i=0; i<listeners.length; i++) {
580
+ listeners[i](e, this);
581
+ if (e.propagationStopped)
582
+ break;
583
+ }
584
+
585
+ if (defaultHandler && !e.defaultPrevented)
586
+ return defaultHandler(e, this);
587
+ };
588
+
589
+
590
+ EventEmitter._signal = function(eventName, e) {
591
+ var listeners = (this._eventRegistry || {})[eventName];
592
+ if (!listeners)
593
+ return;
594
+ listeners = listeners.slice();
595
+ for (var i=0; i<listeners.length; i++)
596
+ listeners[i](e, this);
597
+ };
598
+
599
+ EventEmitter.once = function(eventName, callback) {
600
+ var _self = this;
601
+ callback && this.addEventListener(eventName, function newCallback() {
602
+ _self.removeEventListener(eventName, newCallback);
603
+ callback.apply(null, arguments);
604
+ });
605
+ };
606
+
607
+
608
+ EventEmitter.setDefaultHandler = function(eventName, callback) {
609
+ var handlers = this._defaultHandlers;
610
+ if (!handlers)
611
+ handlers = this._defaultHandlers = {_disabled_: {}};
612
+
613
+ if (handlers[eventName]) {
614
+ var old = handlers[eventName];
615
+ var disabled = handlers._disabled_[eventName];
616
+ if (!disabled)
617
+ handlers._disabled_[eventName] = disabled = [];
618
+ disabled.push(old);
619
+ var i = disabled.indexOf(callback);
620
+ if (i != -1)
621
+ disabled.splice(i, 1);
622
+ }
623
+ handlers[eventName] = callback;
624
+ };
625
+ EventEmitter.removeDefaultHandler = function(eventName, callback) {
626
+ var handlers = this._defaultHandlers;
627
+ if (!handlers)
628
+ return;
629
+ var disabled = handlers._disabled_[eventName];
630
+
631
+ if (handlers[eventName] == callback) {
632
+ if (disabled)
633
+ this.setDefaultHandler(eventName, disabled.pop());
634
+ } else if (disabled) {
635
+ var i = disabled.indexOf(callback);
636
+ if (i != -1)
637
+ disabled.splice(i, 1);
638
+ }
639
+ };
640
+
641
+ EventEmitter.on =
642
+ EventEmitter.addEventListener = function(eventName, callback, capturing) {
643
+ this._eventRegistry = this._eventRegistry || {};
644
+
645
+ var listeners = this._eventRegistry[eventName];
646
+ if (!listeners)
647
+ listeners = this._eventRegistry[eventName] = [];
648
+
649
+ if (listeners.indexOf(callback) == -1)
650
+ listeners[capturing ? "unshift" : "push"](callback);
651
+ return callback;
652
+ };
653
+
654
+ EventEmitter.off =
655
+ EventEmitter.removeListener =
656
+ EventEmitter.removeEventListener = function(eventName, callback) {
657
+ this._eventRegistry = this._eventRegistry || {};
658
+
659
+ var listeners = this._eventRegistry[eventName];
660
+ if (!listeners)
661
+ return;
662
+
663
+ var index = listeners.indexOf(callback);
664
+ if (index !== -1)
665
+ listeners.splice(index, 1);
666
+ };
667
+
668
+ EventEmitter.removeAllListeners = function(eventName) {
669
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
670
+ };
671
+
672
+ exports.EventEmitter = EventEmitter;
673
+
674
+ });
675
+
676
+ define("ace/anchor",[], function(require, exports, module) {
677
+ "use strict";
678
+
679
+ var oop = require("./lib/oop");
680
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
681
+
682
+ var Anchor = exports.Anchor = function(doc, row, column) {
683
+ this.$onChange = this.onChange.bind(this);
684
+ this.attach(doc);
685
+
686
+ if (typeof column == "undefined")
687
+ this.setPosition(row.row, row.column);
688
+ else
689
+ this.setPosition(row, column);
690
+ };
691
+
692
+ (function() {
693
+
694
+ oop.implement(this, EventEmitter);
695
+ this.getPosition = function() {
696
+ return this.$clipPositionToDocument(this.row, this.column);
697
+ };
698
+ this.getDocument = function() {
699
+ return this.document;
700
+ };
701
+ this.$insertRight = false;
702
+ this.onChange = function(delta) {
703
+ if (delta.start.row == delta.end.row && delta.start.row != this.row)
704
+ return;
705
+
706
+ if (delta.start.row > this.row)
707
+ return;
708
+
709
+ var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight);
710
+ this.setPosition(point.row, point.column, true);
711
+ };
712
+
713
+ function $pointsInOrder(point1, point2, equalPointsInOrder) {
714
+ var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
715
+ return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
716
+ }
717
+
718
+ function $getTransformedPoint(delta, point, moveIfEqual) {
719
+ var deltaIsInsert = delta.action == "insert";
720
+ var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
721
+ var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
722
+ var deltaStart = delta.start;
723
+ var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
724
+ if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
725
+ return {
726
+ row: point.row,
727
+ column: point.column
728
+ };
729
+ }
730
+ if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
731
+ return {
732
+ row: point.row + deltaRowShift,
733
+ column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
734
+ };
735
+ }
736
+ return {
737
+ row: deltaStart.row,
738
+ column: deltaStart.column
739
+ };
740
+ }
741
+ this.setPosition = function(row, column, noClip) {
742
+ var pos;
743
+ if (noClip) {
744
+ pos = {
745
+ row: row,
746
+ column: column
747
+ };
748
+ } else {
749
+ pos = this.$clipPositionToDocument(row, column);
750
+ }
751
+
752
+ if (this.row == pos.row && this.column == pos.column)
753
+ return;
754
+
755
+ var old = {
756
+ row: this.row,
757
+ column: this.column
758
+ };
759
+
760
+ this.row = pos.row;
761
+ this.column = pos.column;
762
+ this._signal("change", {
763
+ old: old,
764
+ value: pos
765
+ });
766
+ };
767
+ this.detach = function() {
768
+ this.document.removeEventListener("change", this.$onChange);
769
+ };
770
+ this.attach = function(doc) {
771
+ this.document = doc || this.document;
772
+ this.document.on("change", this.$onChange);
773
+ };
774
+ this.$clipPositionToDocument = function(row, column) {
775
+ var pos = {};
776
+
777
+ if (row >= this.document.getLength()) {
778
+ pos.row = Math.max(0, this.document.getLength() - 1);
779
+ pos.column = this.document.getLine(pos.row).length;
780
+ }
781
+ else if (row < 0) {
782
+ pos.row = 0;
783
+ pos.column = 0;
784
+ }
785
+ else {
786
+ pos.row = row;
787
+ pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
788
+ }
789
+
790
+ if (column < 0)
791
+ pos.column = 0;
792
+
793
+ return pos;
794
+ };
795
+
796
+ }).call(Anchor.prototype);
797
+
798
+ });
799
+
800
+ define("ace/document",[], function(require, exports, module) {
801
+ "use strict";
802
+
803
+ var oop = require("./lib/oop");
804
+ var applyDelta = require("./apply_delta").applyDelta;
805
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
806
+ var Range = require("./range").Range;
807
+ var Anchor = require("./anchor").Anchor;
808
+
809
+ var Document = function(textOrLines) {
810
+ this.$lines = [""];
811
+ if (textOrLines.length === 0) {
812
+ this.$lines = [""];
813
+ } else if (Array.isArray(textOrLines)) {
814
+ this.insertMergedLines({row: 0, column: 0}, textOrLines);
815
+ } else {
816
+ this.insert({row: 0, column:0}, textOrLines);
817
+ }
818
+ };
819
+
820
+ (function() {
821
+
822
+ oop.implement(this, EventEmitter);
823
+ this.setValue = function(text) {
824
+ var len = this.getLength() - 1;
825
+ this.remove(new Range(0, 0, len, this.getLine(len).length));
826
+ this.insert({row: 0, column: 0}, text);
827
+ };
828
+ this.getValue = function() {
829
+ return this.getAllLines().join(this.getNewLineCharacter());
830
+ };
831
+ this.createAnchor = function(row, column) {
832
+ return new Anchor(this, row, column);
833
+ };
834
+ if ("aaa".split(/a/).length === 0) {
835
+ this.$split = function(text) {
836
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
837
+ };
838
+ } else {
839
+ this.$split = function(text) {
840
+ return text.split(/\r\n|\r|\n/);
841
+ };
842
+ }
843
+
844
+
845
+ this.$detectNewLine = function(text) {
846
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
847
+ this.$autoNewLine = match ? match[1] : "\n";
848
+ this._signal("changeNewLineMode");
849
+ };
850
+ this.getNewLineCharacter = function() {
851
+ switch (this.$newLineMode) {
852
+ case "windows":
853
+ return "\r\n";
854
+ case "unix":
855
+ return "\n";
856
+ default:
857
+ return this.$autoNewLine || "\n";
858
+ }
859
+ };
860
+
861
+ this.$autoNewLine = "";
862
+ this.$newLineMode = "auto";
863
+ this.setNewLineMode = function(newLineMode) {
864
+ if (this.$newLineMode === newLineMode)
865
+ return;
866
+
867
+ this.$newLineMode = newLineMode;
868
+ this._signal("changeNewLineMode");
869
+ };
870
+ this.getNewLineMode = function() {
871
+ return this.$newLineMode;
872
+ };
873
+ this.isNewLine = function(text) {
874
+ return (text == "\r\n" || text == "\r" || text == "\n");
875
+ };
876
+ this.getLine = function(row) {
877
+ return this.$lines[row] || "";
878
+ };
879
+ this.getLines = function(firstRow, lastRow) {
880
+ return this.$lines.slice(firstRow, lastRow + 1);
881
+ };
882
+ this.getAllLines = function() {
883
+ return this.getLines(0, this.getLength());
884
+ };
885
+ this.getLength = function() {
886
+ return this.$lines.length;
887
+ };
888
+ this.getTextRange = function(range) {
889
+ return this.getLinesForRange(range).join(this.getNewLineCharacter());
890
+ };
891
+ this.getLinesForRange = function(range) {
892
+ var lines;
893
+ if (range.start.row === range.end.row) {
894
+ lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
895
+ } else {
896
+ lines = this.getLines(range.start.row, range.end.row);
897
+ lines[0] = (lines[0] || "").substring(range.start.column);
898
+ var l = lines.length - 1;
899
+ if (range.end.row - range.start.row == l)
900
+ lines[l] = lines[l].substring(0, range.end.column);
901
+ }
902
+ return lines;
903
+ };
904
+ this.insertLines = function(row, lines) {
905
+ console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
906
+ return this.insertFullLines(row, lines);
907
+ };
908
+ this.removeLines = function(firstRow, lastRow) {
909
+ console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
910
+ return this.removeFullLines(firstRow, lastRow);
911
+ };
912
+ this.insertNewLine = function(position) {
913
+ console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
914
+ return this.insertMergedLines(position, ["", ""]);
915
+ };
916
+ this.insert = function(position, text) {
917
+ if (this.getLength() <= 1)
918
+ this.$detectNewLine(text);
919
+
920
+ return this.insertMergedLines(position, this.$split(text));
921
+ };
922
+ this.insertInLine = function(position, text) {
923
+ var start = this.clippedPos(position.row, position.column);
924
+ var end = this.pos(position.row, position.column + text.length);
925
+
926
+ this.applyDelta({
927
+ start: start,
928
+ end: end,
929
+ action: "insert",
930
+ lines: [text]
931
+ }, true);
932
+
933
+ return this.clonePos(end);
934
+ };
935
+
936
+ this.clippedPos = function(row, column) {
937
+ var length = this.getLength();
938
+ if (row === undefined) {
939
+ row = length;
940
+ } else if (row < 0) {
941
+ row = 0;
942
+ } else if (row >= length) {
943
+ row = length - 1;
944
+ column = undefined;
945
+ }
946
+ var line = this.getLine(row);
947
+ if (column == undefined)
948
+ column = line.length;
949
+ column = Math.min(Math.max(column, 0), line.length);
950
+ return {row: row, column: column};
951
+ };
952
+
953
+ this.clonePos = function(pos) {
954
+ return {row: pos.row, column: pos.column};
955
+ };
956
+
957
+ this.pos = function(row, column) {
958
+ return {row: row, column: column};
959
+ };
960
+
961
+ this.$clipPosition = function(position) {
962
+ var length = this.getLength();
963
+ if (position.row >= length) {
964
+ position.row = Math.max(0, length - 1);
965
+ position.column = this.getLine(length - 1).length;
966
+ } else {
967
+ position.row = Math.max(0, position.row);
968
+ position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
969
+ }
970
+ return position;
971
+ };
972
+ this.insertFullLines = function(row, lines) {
973
+ row = Math.min(Math.max(row, 0), this.getLength());
974
+ var column = 0;
975
+ if (row < this.getLength()) {
976
+ lines = lines.concat([""]);
977
+ column = 0;
978
+ } else {
979
+ lines = [""].concat(lines);
980
+ row--;
981
+ column = this.$lines[row].length;
982
+ }
983
+ this.insertMergedLines({row: row, column: column}, lines);
984
+ };
985
+ this.insertMergedLines = function(position, lines) {
986
+ var start = this.clippedPos(position.row, position.column);
987
+ var end = {
988
+ row: start.row + lines.length - 1,
989
+ column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
990
+ };
991
+
992
+ this.applyDelta({
993
+ start: start,
994
+ end: end,
995
+ action: "insert",
996
+ lines: lines
997
+ });
998
+
999
+ return this.clonePos(end);
1000
+ };
1001
+ this.remove = function(range) {
1002
+ var start = this.clippedPos(range.start.row, range.start.column);
1003
+ var end = this.clippedPos(range.end.row, range.end.column);
1004
+ this.applyDelta({
1005
+ start: start,
1006
+ end: end,
1007
+ action: "remove",
1008
+ lines: this.getLinesForRange({start: start, end: end})
1009
+ });
1010
+ return this.clonePos(start);
1011
+ };
1012
+ this.removeInLine = function(row, startColumn, endColumn) {
1013
+ var start = this.clippedPos(row, startColumn);
1014
+ var end = this.clippedPos(row, endColumn);
1015
+
1016
+ this.applyDelta({
1017
+ start: start,
1018
+ end: end,
1019
+ action: "remove",
1020
+ lines: this.getLinesForRange({start: start, end: end})
1021
+ }, true);
1022
+
1023
+ return this.clonePos(start);
1024
+ };
1025
+ this.removeFullLines = function(firstRow, lastRow) {
1026
+ firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
1027
+ lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1);
1028
+ var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
1029
+ var deleteLastNewLine = lastRow < this.getLength() - 1;
1030
+ var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow );
1031
+ var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 );
1032
+ var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow );
1033
+ var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length );
1034
+ var range = new Range(startRow, startCol, endRow, endCol);
1035
+ var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
1036
+
1037
+ this.applyDelta({
1038
+ start: range.start,
1039
+ end: range.end,
1040
+ action: "remove",
1041
+ lines: this.getLinesForRange(range)
1042
+ });
1043
+ return deletedLines;
1044
+ };
1045
+ this.removeNewLine = function(row) {
1046
+ if (row < this.getLength() - 1 && row >= 0) {
1047
+ this.applyDelta({
1048
+ start: this.pos(row, this.getLine(row).length),
1049
+ end: this.pos(row + 1, 0),
1050
+ action: "remove",
1051
+ lines: ["", ""]
1052
+ });
1053
+ }
1054
+ };
1055
+ this.replace = function(range, text) {
1056
+ if (!(range instanceof Range))
1057
+ range = Range.fromPoints(range.start, range.end);
1058
+ if (text.length === 0 && range.isEmpty())
1059
+ return range.start;
1060
+ if (text == this.getTextRange(range))
1061
+ return range.end;
1062
+
1063
+ this.remove(range);
1064
+ var end;
1065
+ if (text) {
1066
+ end = this.insert(range.start, text);
1067
+ }
1068
+ else {
1069
+ end = range.start;
1070
+ }
1071
+
1072
+ return end;
1073
+ };
1074
+ this.applyDeltas = function(deltas) {
1075
+ for (var i=0; i<deltas.length; i++) {
1076
+ this.applyDelta(deltas[i]);
1077
+ }
1078
+ };
1079
+ this.revertDeltas = function(deltas) {
1080
+ for (var i=deltas.length-1; i>=0; i--) {
1081
+ this.revertDelta(deltas[i]);
1082
+ }
1083
+ };
1084
+ this.applyDelta = function(delta, doNotValidate) {
1085
+ var isInsert = delta.action == "insert";
1086
+ if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
1087
+ : !Range.comparePoints(delta.start, delta.end)) {
1088
+ return;
1089
+ }
1090
+
1091
+ if (isInsert && delta.lines.length > 20000) {
1092
+ this.$splitAndapplyLargeDelta(delta, 20000);
1093
+ }
1094
+ else {
1095
+ applyDelta(this.$lines, delta, doNotValidate);
1096
+ this._signal("change", delta);
1097
+ }
1098
+ };
1099
+
1100
+ this.$splitAndapplyLargeDelta = function(delta, MAX) {
1101
+ var lines = delta.lines;
1102
+ var l = lines.length - MAX + 1;
1103
+ var row = delta.start.row;
1104
+ var column = delta.start.column;
1105
+ for (var from = 0, to = 0; from < l; from = to) {
1106
+ to += MAX - 1;
1107
+ var chunk = lines.slice(from, to);
1108
+ chunk.push("");
1109
+ this.applyDelta({
1110
+ start: this.pos(row + from, column),
1111
+ end: this.pos(row + to, column = 0),
1112
+ action: delta.action,
1113
+ lines: chunk
1114
+ }, true);
1115
+ }
1116
+ delta.lines = lines.slice(from);
1117
+ delta.start.row = row + from;
1118
+ delta.start.column = column;
1119
+ this.applyDelta(delta, true);
1120
+ };
1121
+ this.revertDelta = function(delta) {
1122
+ this.applyDelta({
1123
+ start: this.clonePos(delta.start),
1124
+ end: this.clonePos(delta.end),
1125
+ action: (delta.action == "insert" ? "remove" : "insert"),
1126
+ lines: delta.lines.slice()
1127
+ });
1128
+ };
1129
+ this.indexToPosition = function(index, startRow) {
1130
+ var lines = this.$lines || this.getAllLines();
1131
+ var newlineLength = this.getNewLineCharacter().length;
1132
+ for (var i = startRow || 0, l = lines.length; i < l; i++) {
1133
+ index -= lines[i].length + newlineLength;
1134
+ if (index < 0)
1135
+ return {row: i, column: index + lines[i].length + newlineLength};
1136
+ }
1137
+ return {row: l-1, column: index + lines[l-1].length + newlineLength};
1138
+ };
1139
+ this.positionToIndex = function(pos, startRow) {
1140
+ var lines = this.$lines || this.getAllLines();
1141
+ var newlineLength = this.getNewLineCharacter().length;
1142
+ var index = 0;
1143
+ var row = Math.min(pos.row, lines.length);
1144
+ for (var i = startRow || 0; i < row; ++i)
1145
+ index += lines[i].length + newlineLength;
1146
+
1147
+ return index + pos.column;
1148
+ };
1149
+
1150
+ }).call(Document.prototype);
1151
+
1152
+ exports.Document = Document;
1153
+ });
1154
+
1155
+ define("ace/lib/lang",[], function(require, exports, module) {
1156
+ "use strict";
1157
+
1158
+ exports.last = function(a) {
1159
+ return a[a.length - 1];
1160
+ };
1161
+
1162
+ exports.stringReverse = function(string) {
1163
+ return string.split("").reverse().join("");
1164
+ };
1165
+
1166
+ exports.stringRepeat = function (string, count) {
1167
+ var result = '';
1168
+ while (count > 0) {
1169
+ if (count & 1)
1170
+ result += string;
1171
+
1172
+ if (count >>= 1)
1173
+ string += string;
1174
+ }
1175
+ return result;
1176
+ };
1177
+
1178
+ var trimBeginRegexp = /^\s\s*/;
1179
+ var trimEndRegexp = /\s\s*$/;
1180
+
1181
+ exports.stringTrimLeft = function (string) {
1182
+ return string.replace(trimBeginRegexp, '');
1183
+ };
1184
+
1185
+ exports.stringTrimRight = function (string) {
1186
+ return string.replace(trimEndRegexp, '');
1187
+ };
1188
+
1189
+ exports.copyObject = function(obj) {
1190
+ var copy = {};
1191
+ for (var key in obj) {
1192
+ copy[key] = obj[key];
1193
+ }
1194
+ return copy;
1195
+ };
1196
+
1197
+ exports.copyArray = function(array){
1198
+ var copy = [];
1199
+ for (var i=0, l=array.length; i<l; i++) {
1200
+ if (array[i] && typeof array[i] == "object")
1201
+ copy[i] = this.copyObject(array[i]);
1202
+ else
1203
+ copy[i] = array[i];
1204
+ }
1205
+ return copy;
1206
+ };
1207
+
1208
+ exports.deepCopy = function deepCopy(obj) {
1209
+ if (typeof obj !== "object" || !obj)
1210
+ return obj;
1211
+ var copy;
1212
+ if (Array.isArray(obj)) {
1213
+ copy = [];
1214
+ for (var key = 0; key < obj.length; key++) {
1215
+ copy[key] = deepCopy(obj[key]);
1216
+ }
1217
+ return copy;
1218
+ }
1219
+ if (Object.prototype.toString.call(obj) !== "[object Object]")
1220
+ return obj;
1221
+
1222
+ copy = {};
1223
+ for (var key in obj)
1224
+ copy[key] = deepCopy(obj[key]);
1225
+ return copy;
1226
+ };
1227
+
1228
+ exports.arrayToMap = function(arr) {
1229
+ var map = {};
1230
+ for (var i=0; i<arr.length; i++) {
1231
+ map[arr[i]] = 1;
1232
+ }
1233
+ return map;
1234
+
1235
+ };
1236
+
1237
+ exports.createMap = function(props) {
1238
+ var map = Object.create(null);
1239
+ for (var i in props) {
1240
+ map[i] = props[i];
1241
+ }
1242
+ return map;
1243
+ };
1244
+ exports.arrayRemove = function(array, value) {
1245
+ for (var i = 0; i <= array.length; i++) {
1246
+ if (value === array[i]) {
1247
+ array.splice(i, 1);
1248
+ }
1249
+ }
1250
+ };
1251
+
1252
+ exports.escapeRegExp = function(str) {
1253
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
1254
+ };
1255
+
1256
+ exports.escapeHTML = function(str) {
1257
+ return ("" + str).replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
1258
+ };
1259
+
1260
+ exports.getMatchOffsets = function(string, regExp) {
1261
+ var matches = [];
1262
+
1263
+ string.replace(regExp, function(str) {
1264
+ matches.push({
1265
+ offset: arguments[arguments.length-2],
1266
+ length: str.length
1267
+ });
1268
+ });
1269
+
1270
+ return matches;
1271
+ };
1272
+ exports.deferredCall = function(fcn) {
1273
+ var timer = null;
1274
+ var callback = function() {
1275
+ timer = null;
1276
+ fcn();
1277
+ };
1278
+
1279
+ var deferred = function(timeout) {
1280
+ deferred.cancel();
1281
+ timer = setTimeout(callback, timeout || 0);
1282
+ return deferred;
1283
+ };
1284
+
1285
+ deferred.schedule = deferred;
1286
+
1287
+ deferred.call = function() {
1288
+ this.cancel();
1289
+ fcn();
1290
+ return deferred;
1291
+ };
1292
+
1293
+ deferred.cancel = function() {
1294
+ clearTimeout(timer);
1295
+ timer = null;
1296
+ return deferred;
1297
+ };
1298
+
1299
+ deferred.isPending = function() {
1300
+ return timer;
1301
+ };
1302
+
1303
+ return deferred;
1304
+ };
1305
+
1306
+
1307
+ exports.delayedCall = function(fcn, defaultTimeout) {
1308
+ var timer = null;
1309
+ var callback = function() {
1310
+ timer = null;
1311
+ fcn();
1312
+ };
1313
+
1314
+ var _self = function(timeout) {
1315
+ if (timer == null)
1316
+ timer = setTimeout(callback, timeout || defaultTimeout);
1317
+ };
1318
+
1319
+ _self.delay = function(timeout) {
1320
+ timer && clearTimeout(timer);
1321
+ timer = setTimeout(callback, timeout || defaultTimeout);
1322
+ };
1323
+ _self.schedule = _self;
1324
+
1325
+ _self.call = function() {
1326
+ this.cancel();
1327
+ fcn();
1328
+ };
1329
+
1330
+ _self.cancel = function() {
1331
+ timer && clearTimeout(timer);
1332
+ timer = null;
1333
+ };
1334
+
1335
+ _self.isPending = function() {
1336
+ return timer;
1337
+ };
1338
+
1339
+ return _self;
1340
+ };
1341
+ });
1342
+
1343
+ define("ace/worker/mirror",[], function(require, exports, module) {
1344
+ "use strict";
1345
+
1346
+ var Range = require("../range").Range;
1347
+ var Document = require("../document").Document;
1348
+ var lang = require("../lib/lang");
1349
+
1350
+ var Mirror = exports.Mirror = function(sender) {
1351
+ this.sender = sender;
1352
+ var doc = this.doc = new Document("");
1353
+
1354
+ var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this));
1355
+
1356
+ var _self = this;
1357
+ sender.on("change", function(e) {
1358
+ var data = e.data;
1359
+ if (data[0].start) {
1360
+ doc.applyDeltas(data);
1361
+ } else {
1362
+ for (var i = 0; i < data.length; i += 2) {
1363
+ if (Array.isArray(data[i+1])) {
1364
+ var d = {action: "insert", start: data[i], lines: data[i+1]};
1365
+ } else {
1366
+ var d = {action: "remove", start: data[i], end: data[i+1]};
1367
+ }
1368
+ doc.applyDelta(d, true);
1369
+ }
1370
+ }
1371
+ if (_self.$timeout)
1372
+ return deferredUpdate.schedule(_self.$timeout);
1373
+ _self.onUpdate();
1374
+ });
1375
+ };
1376
+
1377
+ (function() {
1378
+
1379
+ this.$timeout = 500;
1380
+
1381
+ this.setTimeout = function(timeout) {
1382
+ this.$timeout = timeout;
1383
+ };
1384
+
1385
+ this.setValue = function(value) {
1386
+ this.doc.setValue(value);
1387
+ this.deferredUpdate.schedule(this.$timeout);
1388
+ };
1389
+
1390
+ this.getValue = function(callbackId) {
1391
+ this.sender.callback(this.doc.getValue(), callbackId);
1392
+ };
1393
+
1394
+ this.onUpdate = function() {
1395
+ };
1396
+
1397
+ this.isPending = function() {
1398
+ return this.deferredUpdate.isPending();
1399
+ };
1400
+
1401
+ }).call(Mirror.prototype);
1402
+
1403
+ });
1404
+
1405
+ define("ace/mode/json/json_parse",[], function(require, exports, module) {
1406
+ "use strict";
1407
+ var at, // The index of the current character
1408
+ ch, // The current character
1409
+ escapee = {
1410
+ '"': '"',
1411
+ '\\': '\\',
1412
+ '/': '/',
1413
+ b: '\b',
1414
+ f: '\f',
1415
+ n: '\n',
1416
+ r: '\r',
1417
+ t: '\t'
1418
+ },
1419
+ text,
1420
+
1421
+ error = function (m) {
1422
+ throw {
1423
+ name: 'SyntaxError',
1424
+ message: m,
1425
+ at: at,
1426
+ text: text
1427
+ };
1428
+ },
1429
+
1430
+ next = function (c) {
1431
+ if (c && c !== ch) {
1432
+ error("Expected '" + c + "' instead of '" + ch + "'");
1433
+ }
1434
+ ch = text.charAt(at);
1435
+ at += 1;
1436
+ return ch;
1437
+ },
1438
+
1439
+ number = function () {
1440
+ var number,
1441
+ string = '';
1442
+
1443
+ if (ch === '-') {
1444
+ string = '-';
1445
+ next('-');
1446
+ }
1447
+ while (ch >= '0' && ch <= '9') {
1448
+ string += ch;
1449
+ next();
1450
+ }
1451
+ if (ch === '.') {
1452
+ string += '.';
1453
+ while (next() && ch >= '0' && ch <= '9') {
1454
+ string += ch;
1455
+ }
1456
+ }
1457
+ if (ch === 'e' || ch === 'E') {
1458
+ string += ch;
1459
+ next();
1460
+ if (ch === '-' || ch === '+') {
1461
+ string += ch;
1462
+ next();
1463
+ }
1464
+ while (ch >= '0' && ch <= '9') {
1465
+ string += ch;
1466
+ next();
1467
+ }
1468
+ }
1469
+ number = +string;
1470
+ if (isNaN(number)) {
1471
+ error("Bad number");
1472
+ } else {
1473
+ return number;
1474
+ }
1475
+ },
1476
+
1477
+ string = function () {
1478
+ var hex,
1479
+ i,
1480
+ string = '',
1481
+ uffff;
1482
+ if (ch === '"') {
1483
+ while (next()) {
1484
+ if (ch === '"') {
1485
+ next();
1486
+ return string;
1487
+ } else if (ch === '\\') {
1488
+ next();
1489
+ if (ch === 'u') {
1490
+ uffff = 0;
1491
+ for (i = 0; i < 4; i += 1) {
1492
+ hex = parseInt(next(), 16);
1493
+ if (!isFinite(hex)) {
1494
+ break;
1495
+ }
1496
+ uffff = uffff * 16 + hex;
1497
+ }
1498
+ string += String.fromCharCode(uffff);
1499
+ } else if (typeof escapee[ch] === 'string') {
1500
+ string += escapee[ch];
1501
+ } else {
1502
+ break;
1503
+ }
1504
+ } else if (ch == "\n" || ch == "\r") {
1505
+ break;
1506
+ } else {
1507
+ string += ch;
1508
+ }
1509
+ }
1510
+ }
1511
+ error("Bad string");
1512
+ },
1513
+
1514
+ white = function () {
1515
+ while (ch && ch <= ' ') {
1516
+ next();
1517
+ }
1518
+ },
1519
+
1520
+ word = function () {
1521
+ switch (ch) {
1522
+ case 't':
1523
+ next('t');
1524
+ next('r');
1525
+ next('u');
1526
+ next('e');
1527
+ return true;
1528
+ case 'f':
1529
+ next('f');
1530
+ next('a');
1531
+ next('l');
1532
+ next('s');
1533
+ next('e');
1534
+ return false;
1535
+ case 'n':
1536
+ next('n');
1537
+ next('u');
1538
+ next('l');
1539
+ next('l');
1540
+ return null;
1541
+ }
1542
+ error("Unexpected '" + ch + "'");
1543
+ },
1544
+
1545
+ value, // Place holder for the value function.
1546
+
1547
+ array = function () {
1548
+ var array = [];
1549
+
1550
+ if (ch === '[') {
1551
+ next('[');
1552
+ white();
1553
+ if (ch === ']') {
1554
+ next(']');
1555
+ return array; // empty array
1556
+ }
1557
+ while (ch) {
1558
+ array.push(value());
1559
+ white();
1560
+ if (ch === ']') {
1561
+ next(']');
1562
+ return array;
1563
+ }
1564
+ next(',');
1565
+ white();
1566
+ }
1567
+ }
1568
+ error("Bad array");
1569
+ },
1570
+
1571
+ object = function () {
1572
+ var key,
1573
+ object = {};
1574
+
1575
+ if (ch === '{') {
1576
+ next('{');
1577
+ white();
1578
+ if (ch === '}') {
1579
+ next('}');
1580
+ return object; // empty object
1581
+ }
1582
+ while (ch) {
1583
+ key = string();
1584
+ white();
1585
+ next(':');
1586
+ if (Object.hasOwnProperty.call(object, key)) {
1587
+ error('Duplicate key "' + key + '"');
1588
+ }
1589
+ object[key] = value();
1590
+ white();
1591
+ if (ch === '}') {
1592
+ next('}');
1593
+ return object;
1594
+ }
1595
+ next(',');
1596
+ white();
1597
+ }
1598
+ }
1599
+ error("Bad object");
1600
+ };
1601
+
1602
+ value = function () {
1603
+ white();
1604
+ switch (ch) {
1605
+ case '{':
1606
+ return object();
1607
+ case '[':
1608
+ return array();
1609
+ case '"':
1610
+ return string();
1611
+ case '-':
1612
+ return number();
1613
+ default:
1614
+ return ch >= '0' && ch <= '9' ? number() : word();
1615
+ }
1616
+ };
1617
+ return function (source, reviver) {
1618
+ var result;
1619
+
1620
+ text = source;
1621
+ at = 0;
1622
+ ch = ' ';
1623
+ result = value();
1624
+ white();
1625
+ if (ch) {
1626
+ error("Syntax error");
1627
+ }
1628
+ return typeof reviver === 'function' ? function walk(holder, key) {
1629
+ var k, v, value = holder[key];
1630
+ if (value && typeof value === 'object') {
1631
+ for (k in value) {
1632
+ if (Object.hasOwnProperty.call(value, k)) {
1633
+ v = walk(value, k);
1634
+ if (v !== undefined) {
1635
+ value[k] = v;
1636
+ } else {
1637
+ delete value[k];
1638
+ }
1639
+ }
1640
+ }
1641
+ }
1642
+ return reviver.call(holder, key, value);
1643
+ }({'': result}, '') : result;
1644
+ };
1645
+ });
1646
+
1647
+ define("ace/mode/json_worker",[], function(require, exports, module) {
1648
+ "use strict";
1649
+
1650
+ var oop = require("../lib/oop");
1651
+ var Mirror = require("../worker/mirror").Mirror;
1652
+ var parse = require("./json/json_parse");
1653
+
1654
+ var JsonWorker = exports.JsonWorker = function(sender) {
1655
+ Mirror.call(this, sender);
1656
+ this.setTimeout(200);
1657
+ };
1658
+
1659
+ oop.inherits(JsonWorker, Mirror);
1660
+
1661
+ (function() {
1662
+
1663
+ this.onUpdate = function() {
1664
+ var value = this.doc.getValue();
1665
+ var errors = [];
1666
+ try {
1667
+ if (value)
1668
+ parse(value);
1669
+ } catch (e) {
1670
+ var pos = this.doc.indexToPosition(e.at-1);
1671
+ errors.push({
1672
+ row: pos.row,
1673
+ column: pos.column,
1674
+ text: e.message,
1675
+ type: "error"
1676
+ });
1677
+ }
1678
+ this.sender.emit("annotate", errors);
1679
+ };
1680
+
1681
+ }).call(JsonWorker.prototype);
1682
+
1683
+ });
1684
+
1685
+ define("ace/lib/es5-shim",[], function(require, exports, module) {
1686
+
1687
+ //
1688
+ //
1689
+ function Empty() {}
1690
+
1691
+ if (!Function.prototype.bind) {
1692
+ Function.prototype.bind = function bind(that) { // .length is 1
1693
+ var target = this;
1694
+ if (typeof target != "function") {
1695
+ throw new TypeError("Function.prototype.bind called on incompatible " + target);
1696
+ }
1697
+ var args = slice.call(arguments, 1); // for normal call
1698
+ var bound = function () {
1699
+
1700
+ if (this instanceof bound) {
1701
+ var result = target.apply(
1702
+ this,
1703
+ args.concat(slice.call(arguments))
1704
+ );
1705
+ if (Object(result) === result) {
1706
+ return result;
1707
+ }
1708
+ return this;
1709
+
1710
+ } else {
1711
+ return target.apply(
1712
+ that,
1713
+ args.concat(slice.call(arguments))
1714
+ );
1715
+
1716
+ }
1717
+
1718
+ };
1719
+ if(target.prototype) {
1720
+ Empty.prototype = target.prototype;
1721
+ bound.prototype = new Empty();
1722
+ Empty.prototype = null;
1723
+ }
1724
+ //
1725
+ return bound;
1726
+ };
1727
+ }
1728
+ var call = Function.prototype.call;
1729
+ var prototypeOfArray = Array.prototype;
1730
+ var prototypeOfObject = Object.prototype;
1731
+ var slice = prototypeOfArray.slice;
1732
+ var _toString = call.bind(prototypeOfObject.toString);
1733
+ var owns = call.bind(prototypeOfObject.hasOwnProperty);
1734
+ var defineGetter;
1735
+ var defineSetter;
1736
+ var lookupGetter;
1737
+ var lookupSetter;
1738
+ var supportsAccessors;
1739
+ if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
1740
+ defineGetter = call.bind(prototypeOfObject.__defineGetter__);
1741
+ defineSetter = call.bind(prototypeOfObject.__defineSetter__);
1742
+ lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
1743
+ lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
1744
+ }
1745
+
1746
+ //
1747
+ //
1748
+ if ([1,2].splice(0).length != 2) {
1749
+ if(function() { // test IE < 9 to splice bug - see issue #138
1750
+ function makeArray(l) {
1751
+ var a = new Array(l+2);
1752
+ a[0] = a[1] = 0;
1753
+ return a;
1754
+ }
1755
+ var array = [], lengthBefore;
1756
+
1757
+ array.splice.apply(array, makeArray(20));
1758
+ array.splice.apply(array, makeArray(26));
1759
+
1760
+ lengthBefore = array.length; //46
1761
+ array.splice(5, 0, "XXX"); // add one element
1762
+
1763
+ lengthBefore + 1 == array.length
1764
+
1765
+ if (lengthBefore + 1 == array.length) {
1766
+ return true;// has right splice implementation without bugs
1767
+ }
1768
+ }()) {//IE 6/7
1769
+ var array_splice = Array.prototype.splice;
1770
+ Array.prototype.splice = function(start, deleteCount) {
1771
+ if (!arguments.length) {
1772
+ return [];
1773
+ } else {
1774
+ return array_splice.apply(this, [
1775
+ start === void 0 ? 0 : start,
1776
+ deleteCount === void 0 ? (this.length - start) : deleteCount
1777
+ ].concat(slice.call(arguments, 2)))
1778
+ }
1779
+ };
1780
+ } else {//IE8
1781
+ Array.prototype.splice = function(pos, removeCount){
1782
+ var length = this.length;
1783
+ if (pos > 0) {
1784
+ if (pos > length)
1785
+ pos = length;
1786
+ } else if (pos == void 0) {
1787
+ pos = 0;
1788
+ } else if (pos < 0) {
1789
+ pos = Math.max(length + pos, 0);
1790
+ }
1791
+
1792
+ if (!(pos+removeCount < length))
1793
+ removeCount = length - pos;
1794
+
1795
+ var removed = this.slice(pos, pos+removeCount);
1796
+ var insert = slice.call(arguments, 2);
1797
+ var add = insert.length;
1798
+ if (pos === length) {
1799
+ if (add) {
1800
+ this.push.apply(this, insert);
1801
+ }
1802
+ } else {
1803
+ var remove = Math.min(removeCount, length - pos);
1804
+ var tailOldPos = pos + remove;
1805
+ var tailNewPos = tailOldPos + add - remove;
1806
+ var tailCount = length - tailOldPos;
1807
+ var lengthAfterRemove = length - remove;
1808
+
1809
+ if (tailNewPos < tailOldPos) { // case A
1810
+ for (var i = 0; i < tailCount; ++i) {
1811
+ this[tailNewPos+i] = this[tailOldPos+i];
1812
+ }
1813
+ } else if (tailNewPos > tailOldPos) { // case B
1814
+ for (i = tailCount; i--; ) {
1815
+ this[tailNewPos+i] = this[tailOldPos+i];
1816
+ }
1817
+ } // else, add == remove (nothing to do)
1818
+
1819
+ if (add && pos === lengthAfterRemove) {
1820
+ this.length = lengthAfterRemove; // truncate array
1821
+ this.push.apply(this, insert);
1822
+ } else {
1823
+ this.length = lengthAfterRemove + add; // reserves space
1824
+ for (i = 0; i < add; ++i) {
1825
+ this[pos+i] = insert[i];
1826
+ }
1827
+ }
1828
+ }
1829
+ return removed;
1830
+ };
1831
+ }
1832
+ }
1833
+ if (!Array.isArray) {
1834
+ Array.isArray = function isArray(obj) {
1835
+ return _toString(obj) == "[object Array]";
1836
+ };
1837
+ }
1838
+ var boxedString = Object("a"),
1839
+ splitString = boxedString[0] != "a" || !(0 in boxedString);
1840
+
1841
+ if (!Array.prototype.forEach) {
1842
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
1843
+ var object = toObject(this),
1844
+ self = splitString && _toString(this) == "[object String]" ?
1845
+ this.split("") :
1846
+ object,
1847
+ thisp = arguments[1],
1848
+ i = -1,
1849
+ length = self.length >>> 0;
1850
+ if (_toString(fun) != "[object Function]") {
1851
+ throw new TypeError(); // TODO message
1852
+ }
1853
+
1854
+ while (++i < length) {
1855
+ if (i in self) {
1856
+ fun.call(thisp, self[i], i, object);
1857
+ }
1858
+ }
1859
+ };
1860
+ }
1861
+ if (!Array.prototype.map) {
1862
+ Array.prototype.map = function map(fun /*, thisp*/) {
1863
+ var object = toObject(this),
1864
+ self = splitString && _toString(this) == "[object String]" ?
1865
+ this.split("") :
1866
+ object,
1867
+ length = self.length >>> 0,
1868
+ result = Array(length),
1869
+ thisp = arguments[1];
1870
+ if (_toString(fun) != "[object Function]") {
1871
+ throw new TypeError(fun + " is not a function");
1872
+ }
1873
+
1874
+ for (var i = 0; i < length; i++) {
1875
+ if (i in self)
1876
+ result[i] = fun.call(thisp, self[i], i, object);
1877
+ }
1878
+ return result;
1879
+ };
1880
+ }
1881
+ if (!Array.prototype.filter) {
1882
+ Array.prototype.filter = function filter(fun /*, thisp */) {
1883
+ var object = toObject(this),
1884
+ self = splitString && _toString(this) == "[object String]" ?
1885
+ this.split("") :
1886
+ object,
1887
+ length = self.length >>> 0,
1888
+ result = [],
1889
+ value,
1890
+ thisp = arguments[1];
1891
+ if (_toString(fun) != "[object Function]") {
1892
+ throw new TypeError(fun + " is not a function");
1893
+ }
1894
+
1895
+ for (var i = 0; i < length; i++) {
1896
+ if (i in self) {
1897
+ value = self[i];
1898
+ if (fun.call(thisp, value, i, object)) {
1899
+ result.push(value);
1900
+ }
1901
+ }
1902
+ }
1903
+ return result;
1904
+ };
1905
+ }
1906
+ if (!Array.prototype.every) {
1907
+ Array.prototype.every = function every(fun /*, thisp */) {
1908
+ var object = toObject(this),
1909
+ self = splitString && _toString(this) == "[object String]" ?
1910
+ this.split("") :
1911
+ object,
1912
+ length = self.length >>> 0,
1913
+ thisp = arguments[1];
1914
+ if (_toString(fun) != "[object Function]") {
1915
+ throw new TypeError(fun + " is not a function");
1916
+ }
1917
+
1918
+ for (var i = 0; i < length; i++) {
1919
+ if (i in self && !fun.call(thisp, self[i], i, object)) {
1920
+ return false;
1921
+ }
1922
+ }
1923
+ return true;
1924
+ };
1925
+ }
1926
+ if (!Array.prototype.some) {
1927
+ Array.prototype.some = function some(fun /*, thisp */) {
1928
+ var object = toObject(this),
1929
+ self = splitString && _toString(this) == "[object String]" ?
1930
+ this.split("") :
1931
+ object,
1932
+ length = self.length >>> 0,
1933
+ thisp = arguments[1];
1934
+ if (_toString(fun) != "[object Function]") {
1935
+ throw new TypeError(fun + " is not a function");
1936
+ }
1937
+
1938
+ for (var i = 0; i < length; i++) {
1939
+ if (i in self && fun.call(thisp, self[i], i, object)) {
1940
+ return true;
1941
+ }
1942
+ }
1943
+ return false;
1944
+ };
1945
+ }
1946
+ if (!Array.prototype.reduce) {
1947
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
1948
+ var object = toObject(this),
1949
+ self = splitString && _toString(this) == "[object String]" ?
1950
+ this.split("") :
1951
+ object,
1952
+ length = self.length >>> 0;
1953
+ if (_toString(fun) != "[object Function]") {
1954
+ throw new TypeError(fun + " is not a function");
1955
+ }
1956
+ if (!length && arguments.length == 1) {
1957
+ throw new TypeError("reduce of empty array with no initial value");
1958
+ }
1959
+
1960
+ var i = 0;
1961
+ var result;
1962
+ if (arguments.length >= 2) {
1963
+ result = arguments[1];
1964
+ } else {
1965
+ do {
1966
+ if (i in self) {
1967
+ result = self[i++];
1968
+ break;
1969
+ }
1970
+ if (++i >= length) {
1971
+ throw new TypeError("reduce of empty array with no initial value");
1972
+ }
1973
+ } while (true);
1974
+ }
1975
+
1976
+ for (; i < length; i++) {
1977
+ if (i in self) {
1978
+ result = fun.call(void 0, result, self[i], i, object);
1979
+ }
1980
+ }
1981
+
1982
+ return result;
1983
+ };
1984
+ }
1985
+ if (!Array.prototype.reduceRight) {
1986
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
1987
+ var object = toObject(this),
1988
+ self = splitString && _toString(this) == "[object String]" ?
1989
+ this.split("") :
1990
+ object,
1991
+ length = self.length >>> 0;
1992
+ if (_toString(fun) != "[object Function]") {
1993
+ throw new TypeError(fun + " is not a function");
1994
+ }
1995
+ if (!length && arguments.length == 1) {
1996
+ throw new TypeError("reduceRight of empty array with no initial value");
1997
+ }
1998
+
1999
+ var result, i = length - 1;
2000
+ if (arguments.length >= 2) {
2001
+ result = arguments[1];
2002
+ } else {
2003
+ do {
2004
+ if (i in self) {
2005
+ result = self[i--];
2006
+ break;
2007
+ }
2008
+ if (--i < 0) {
2009
+ throw new TypeError("reduceRight of empty array with no initial value");
2010
+ }
2011
+ } while (true);
2012
+ }
2013
+
2014
+ do {
2015
+ if (i in this) {
2016
+ result = fun.call(void 0, result, self[i], i, object);
2017
+ }
2018
+ } while (i--);
2019
+
2020
+ return result;
2021
+ };
2022
+ }
2023
+ if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
2024
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
2025
+ var self = splitString && _toString(this) == "[object String]" ?
2026
+ this.split("") :
2027
+ toObject(this),
2028
+ length = self.length >>> 0;
2029
+
2030
+ if (!length) {
2031
+ return -1;
2032
+ }
2033
+
2034
+ var i = 0;
2035
+ if (arguments.length > 1) {
2036
+ i = toInteger(arguments[1]);
2037
+ }
2038
+ i = i >= 0 ? i : Math.max(0, length + i);
2039
+ for (; i < length; i++) {
2040
+ if (i in self && self[i] === sought) {
2041
+ return i;
2042
+ }
2043
+ }
2044
+ return -1;
2045
+ };
2046
+ }
2047
+ if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
2048
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
2049
+ var self = splitString && _toString(this) == "[object String]" ?
2050
+ this.split("") :
2051
+ toObject(this),
2052
+ length = self.length >>> 0;
2053
+
2054
+ if (!length) {
2055
+ return -1;
2056
+ }
2057
+ var i = length - 1;
2058
+ if (arguments.length > 1) {
2059
+ i = Math.min(i, toInteger(arguments[1]));
2060
+ }
2061
+ i = i >= 0 ? i : length - Math.abs(i);
2062
+ for (; i >= 0; i--) {
2063
+ if (i in self && sought === self[i]) {
2064
+ return i;
2065
+ }
2066
+ }
2067
+ return -1;
2068
+ };
2069
+ }
2070
+
2071
+ //
2072
+ //
2073
+ if (!Object.getPrototypeOf) {
2074
+ Object.getPrototypeOf = function getPrototypeOf(object) {
2075
+ return object.__proto__ || (
2076
+ object.constructor ?
2077
+ object.constructor.prototype :
2078
+ prototypeOfObject
2079
+ );
2080
+ };
2081
+ }
2082
+ if (!Object.getOwnPropertyDescriptor) {
2083
+ var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " +
2084
+ "non-object: ";
2085
+ Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
2086
+ if ((typeof object != "object" && typeof object != "function") || object === null)
2087
+ throw new TypeError(ERR_NON_OBJECT + object);
2088
+ if (!owns(object, property))
2089
+ return;
2090
+
2091
+ var descriptor, getter, setter;
2092
+ descriptor = { enumerable: true, configurable: true };
2093
+ if (supportsAccessors) {
2094
+ var prototype = object.__proto__;
2095
+ object.__proto__ = prototypeOfObject;
2096
+
2097
+ var getter = lookupGetter(object, property);
2098
+ var setter = lookupSetter(object, property);
2099
+ object.__proto__ = prototype;
2100
+
2101
+ if (getter || setter) {
2102
+ if (getter) descriptor.get = getter;
2103
+ if (setter) descriptor.set = setter;
2104
+ return descriptor;
2105
+ }
2106
+ }
2107
+ descriptor.value = object[property];
2108
+ return descriptor;
2109
+ };
2110
+ }
2111
+ if (!Object.getOwnPropertyNames) {
2112
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
2113
+ return Object.keys(object);
2114
+ };
2115
+ }
2116
+ if (!Object.create) {
2117
+ var createEmpty;
2118
+ if (Object.prototype.__proto__ === null) {
2119
+ createEmpty = function () {
2120
+ return { "__proto__": null };
2121
+ };
2122
+ } else {
2123
+ createEmpty = function () {
2124
+ var empty = {};
2125
+ for (var i in empty)
2126
+ empty[i] = null;
2127
+ empty.constructor =
2128
+ empty.hasOwnProperty =
2129
+ empty.propertyIsEnumerable =
2130
+ empty.isPrototypeOf =
2131
+ empty.toLocaleString =
2132
+ empty.toString =
2133
+ empty.valueOf =
2134
+ empty.__proto__ = null;
2135
+ return empty;
2136
+ }
2137
+ }
2138
+
2139
+ Object.create = function create(prototype, properties) {
2140
+ var object;
2141
+ if (prototype === null) {
2142
+ object = createEmpty();
2143
+ } else {
2144
+ if (typeof prototype != "object")
2145
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
2146
+ var Type = function () {};
2147
+ Type.prototype = prototype;
2148
+ object = new Type();
2149
+ object.__proto__ = prototype;
2150
+ }
2151
+ if (properties !== void 0)
2152
+ Object.defineProperties(object, properties);
2153
+ return object;
2154
+ };
2155
+ }
2156
+ function doesDefinePropertyWork(object) {
2157
+ try {
2158
+ Object.defineProperty(object, "sentinel", {});
2159
+ return "sentinel" in object;
2160
+ } catch (exception) {
2161
+ }
2162
+ }
2163
+ if (Object.defineProperty) {
2164
+ var definePropertyWorksOnObject = doesDefinePropertyWork({});
2165
+ var definePropertyWorksOnDom = typeof document == "undefined" ||
2166
+ doesDefinePropertyWork(document.createElement("div"));
2167
+ if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
2168
+ var definePropertyFallback = Object.defineProperty;
2169
+ }
2170
+ }
2171
+
2172
+ if (!Object.defineProperty || definePropertyFallback) {
2173
+ var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ";
2174
+ var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: "
2175
+ var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " +
2176
+ "on this javascript engine";
2177
+
2178
+ Object.defineProperty = function defineProperty(object, property, descriptor) {
2179
+ if ((typeof object != "object" && typeof object != "function") || object === null)
2180
+ throw new TypeError(ERR_NON_OBJECT_TARGET + object);
2181
+ if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null)
2182
+ throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
2183
+ if (definePropertyFallback) {
2184
+ try {
2185
+ return definePropertyFallback.call(Object, object, property, descriptor);
2186
+ } catch (exception) {
2187
+ }
2188
+ }
2189
+ if (owns(descriptor, "value")) {
2190
+
2191
+ if (supportsAccessors && (lookupGetter(object, property) ||
2192
+ lookupSetter(object, property)))
2193
+ {
2194
+ var prototype = object.__proto__;
2195
+ object.__proto__ = prototypeOfObject;
2196
+ delete object[property];
2197
+ object[property] = descriptor.value;
2198
+ object.__proto__ = prototype;
2199
+ } else {
2200
+ object[property] = descriptor.value;
2201
+ }
2202
+ } else {
2203
+ if (!supportsAccessors)
2204
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
2205
+ if (owns(descriptor, "get"))
2206
+ defineGetter(object, property, descriptor.get);
2207
+ if (owns(descriptor, "set"))
2208
+ defineSetter(object, property, descriptor.set);
2209
+ }
2210
+
2211
+ return object;
2212
+ };
2213
+ }
2214
+ if (!Object.defineProperties) {
2215
+ Object.defineProperties = function defineProperties(object, properties) {
2216
+ for (var property in properties) {
2217
+ if (owns(properties, property))
2218
+ Object.defineProperty(object, property, properties[property]);
2219
+ }
2220
+ return object;
2221
+ };
2222
+ }
2223
+ if (!Object.seal) {
2224
+ Object.seal = function seal(object) {
2225
+ return object;
2226
+ };
2227
+ }
2228
+ if (!Object.freeze) {
2229
+ Object.freeze = function freeze(object) {
2230
+ return object;
2231
+ };
2232
+ }
2233
+ try {
2234
+ Object.freeze(function () {});
2235
+ } catch (exception) {
2236
+ Object.freeze = (function freeze(freezeObject) {
2237
+ return function freeze(object) {
2238
+ if (typeof object == "function") {
2239
+ return object;
2240
+ } else {
2241
+ return freezeObject(object);
2242
+ }
2243
+ };
2244
+ })(Object.freeze);
2245
+ }
2246
+ if (!Object.preventExtensions) {
2247
+ Object.preventExtensions = function preventExtensions(object) {
2248
+ return object;
2249
+ };
2250
+ }
2251
+ if (!Object.isSealed) {
2252
+ Object.isSealed = function isSealed(object) {
2253
+ return false;
2254
+ };
2255
+ }
2256
+ if (!Object.isFrozen) {
2257
+ Object.isFrozen = function isFrozen(object) {
2258
+ return false;
2259
+ };
2260
+ }
2261
+ if (!Object.isExtensible) {
2262
+ Object.isExtensible = function isExtensible(object) {
2263
+ if (Object(object) === object) {
2264
+ throw new TypeError(); // TODO message
2265
+ }
2266
+ var name = '';
2267
+ while (owns(object, name)) {
2268
+ name += '?';
2269
+ }
2270
+ object[name] = true;
2271
+ var returnValue = owns(object, name);
2272
+ delete object[name];
2273
+ return returnValue;
2274
+ };
2275
+ }
2276
+ if (!Object.keys) {
2277
+ var hasDontEnumBug = true,
2278
+ dontEnums = [
2279
+ "toString",
2280
+ "toLocaleString",
2281
+ "valueOf",
2282
+ "hasOwnProperty",
2283
+ "isPrototypeOf",
2284
+ "propertyIsEnumerable",
2285
+ "constructor"
2286
+ ],
2287
+ dontEnumsLength = dontEnums.length;
2288
+
2289
+ for (var key in {"toString": null}) {
2290
+ hasDontEnumBug = false;
2291
+ }
2292
+
2293
+ Object.keys = function keys(object) {
2294
+
2295
+ if (
2296
+ (typeof object != "object" && typeof object != "function") ||
2297
+ object === null
2298
+ ) {
2299
+ throw new TypeError("Object.keys called on a non-object");
2300
+ }
2301
+
2302
+ var keys = [];
2303
+ for (var name in object) {
2304
+ if (owns(object, name)) {
2305
+ keys.push(name);
2306
+ }
2307
+ }
2308
+
2309
+ if (hasDontEnumBug) {
2310
+ for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
2311
+ var dontEnum = dontEnums[i];
2312
+ if (owns(object, dontEnum)) {
2313
+ keys.push(dontEnum);
2314
+ }
2315
+ }
2316
+ }
2317
+ return keys;
2318
+ };
2319
+
2320
+ }
2321
+
2322
+ //
2323
+ //
2324
+ if (!Date.now) {
2325
+ Date.now = function now() {
2326
+ return new Date().getTime();
2327
+ };
2328
+ }
2329
+
2330
+
2331
+ //
2332
+ //
2333
+ var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
2334
+ "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
2335
+ "\u2029\uFEFF";
2336
+ if (!String.prototype.trim || ws.trim()) {
2337
+ ws = "[" + ws + "]";
2338
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
2339
+ trimEndRegexp = new RegExp(ws + ws + "*$");
2340
+ String.prototype.trim = function trim() {
2341
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
2342
+ };
2343
+ }
2344
+
2345
+ //
2346
+ //
2347
+ function toInteger(n) {
2348
+ n = +n;
2349
+ if (n !== n) { // isNaN
2350
+ n = 0;
2351
+ } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
2352
+ n = (n > 0 || -1) * Math.floor(Math.abs(n));
2353
+ }
2354
+ return n;
2355
+ }
2356
+
2357
+ function isPrimitive(input) {
2358
+ var type = typeof input;
2359
+ return (
2360
+ input === null ||
2361
+ type === "undefined" ||
2362
+ type === "boolean" ||
2363
+ type === "number" ||
2364
+ type === "string"
2365
+ );
2366
+ }
2367
+
2368
+ function toPrimitive(input) {
2369
+ var val, valueOf, toString;
2370
+ if (isPrimitive(input)) {
2371
+ return input;
2372
+ }
2373
+ valueOf = input.valueOf;
2374
+ if (typeof valueOf === "function") {
2375
+ val = valueOf.call(input);
2376
+ if (isPrimitive(val)) {
2377
+ return val;
2378
+ }
2379
+ }
2380
+ toString = input.toString;
2381
+ if (typeof toString === "function") {
2382
+ val = toString.call(input);
2383
+ if (isPrimitive(val)) {
2384
+ return val;
2385
+ }
2386
+ }
2387
+ throw new TypeError();
2388
+ }
2389
+ var toObject = function (o) {
2390
+ if (o == null) { // this matches both null and undefined
2391
+ throw new TypeError("can't convert "+o+" to object");
2392
+ }
2393
+ return Object(o);
2394
+ };
2395
+
2396
+ });