@kumologica/sdk 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (540) hide show
  1. package/README.md +1 -0
  2. package/bin/kl.js +3 -0
  3. package/cli/cli.js +6 -0
  4. package/cli/commands/build-commands/aws.js +49 -0
  5. package/cli/commands/build-commands/azure.js +43 -0
  6. package/cli/commands/build-commands/kumohub.js +7 -0
  7. package/cli/commands/build.js +6 -0
  8. package/cli/commands/create.js +32 -0
  9. package/cli/commands/deploy-commands/kumohub.js +114 -0
  10. package/cli/commands/deploy.js +6 -0
  11. package/cli/commands/doc-commands/html.js +61 -0
  12. package/cli/commands/doc.js +6 -0
  13. package/cli/commands/export-commands/cloudformation.js +338 -0
  14. package/cli/commands/export-commands/serverless.js +164 -0
  15. package/cli/commands/export-commands/terraform-commands/aws.js +193 -0
  16. package/cli/commands/export-commands/terraform-commands/azure.js +148 -0
  17. package/cli/commands/export-commands/terraform.js +6 -0
  18. package/cli/commands/export-commands/utils/validator.js +152 -0
  19. package/cli/commands/export.js +6 -0
  20. package/cli/commands/import-commands/mulesoft.js +61 -0
  21. package/cli/commands/import.js +6 -0
  22. package/cli/commands/open.js +46 -0
  23. package/cli/commands/test-utils/TestSuiteController.js +359 -0
  24. package/cli/commands/test-utils/TestSuiteController.test.js +171 -0
  25. package/cli/commands/test-utils/fixtures/example3-flow.json +148 -0
  26. package/cli/commands/test-utils/fixtures/package.json +6 -0
  27. package/cli/commands/test-utils/fixtures/s3-event.js +43 -0
  28. package/cli/commands/test-utils/util/output.js +14 -0
  29. package/cli/commands/test-utils/util/updates/index.js +17 -0
  30. package/cli/commands/test-utils/util/updates/pkg.js +13 -0
  31. package/cli/commands/test-utils/util/updates/templates/default-settings.js +209 -0
  32. package/cli/commands/test.js +66 -0
  33. package/cli/commands/utils.js +14 -0
  34. package/package.json +158 -0
  35. package/src/app/lib/aws/aws-profile.js +43 -0
  36. package/src/app/lib/aws/ca-alexa-api.js +29 -0
  37. package/src/app/lib/aws/ca-apigw-api.js +216 -0
  38. package/src/app/lib/aws/ca-cloudwatch-api.js +78 -0
  39. package/src/app/lib/aws/ca-codecommit-api.js +63 -0
  40. package/src/app/lib/aws/ca-dynamodb-api.js +27 -0
  41. package/src/app/lib/aws/ca-elb-api.js +44 -0
  42. package/src/app/lib/aws/ca-events-api.js +27 -0
  43. package/src/app/lib/aws/ca-iot-api.js +105 -0
  44. package/src/app/lib/aws/ca-s3-api.js +115 -0
  45. package/src/app/lib/aws/ca-sns-api.js +38 -0
  46. package/src/app/lib/aws/ca-sqs-api.js +51 -0
  47. package/src/app/lib/aws/cf.js +439 -0
  48. package/src/app/lib/aws/index.js +970 -0
  49. package/src/app/lib/aws/kl-iam-api.js +27 -0
  50. package/src/app/lib/aws/kl-rekognition-api.js +66 -0
  51. package/src/app/lib/aws/kl-ssm-api.js +24 -0
  52. package/src/app/lib/azure/index.js +80 -0
  53. package/src/app/lib/dependencies.js +50 -0
  54. package/src/app/lib/kumohub/index.js +201 -0
  55. package/src/app/lib/runtime-loader/index.js +42 -0
  56. package/src/app/lib/serverless/index.js +318 -0
  57. package/src/app/lib/stores/aws-cloud-config-store.js +35 -0
  58. package/src/app/lib/stores/azure-config-store.js +24 -0
  59. package/src/app/lib/stores/kumohub-config-store.js +24 -0
  60. package/src/app/lib/stores/project-info-config-store.js +26 -0
  61. package/src/app/lib/stores/settings-cloud-store.js +117 -0
  62. package/src/app/lib/stores/settings-cloud-store.spec.js +26 -0
  63. package/src/app/lib/stores/settings-network-store.js +119 -0
  64. package/src/app/lib/stores/settings-network-store.spec.js +27 -0
  65. package/src/app/lib/stores/store.js +97 -0
  66. package/src/app/lib/stores/test-config-store.js +26 -0
  67. package/src/app/lib/stores/user-preference-store.js +44 -0
  68. package/src/app/lib/utils/editor.js +98 -0
  69. package/src/app/lib/utils/fix-path.js +15 -0
  70. package/src/app/main-process/favicon.ico +0 -0
  71. package/src/app/main-process/main-window.js +209 -0
  72. package/src/app/main-process/menu.js +219 -0
  73. package/src/app/main-process/modal-home.js +118 -0
  74. package/src/app/main-process/modal-newproject.js +119 -0
  75. package/src/app/main-process/modal-nodelibrary.js +90 -0
  76. package/src/app/main-process/modal-welcome.js +114 -0
  77. package/src/app/main-process/runtime-manager.js +141 -0
  78. package/src/app/main.js +590 -0
  79. package/src/app/preload.js +633 -0
  80. package/src/app/ui/editor-api/lib/admin/context.js +42 -0
  81. package/src/app/ui/editor-api/lib/admin/flow.js +55 -0
  82. package/src/app/ui/editor-api/lib/admin/flows.js +53 -0
  83. package/src/app/ui/editor-api/lib/admin/index.js +155 -0
  84. package/src/app/ui/editor-api/lib/admin/nodes.js +164 -0
  85. package/src/app/ui/editor-api/lib/auth/clients.js +17 -0
  86. package/src/app/ui/editor-api/lib/auth/index.js +267 -0
  87. package/src/app/ui/editor-api/lib/auth/permissions.js +51 -0
  88. package/src/app/ui/editor-api/lib/auth/strategies.js +144 -0
  89. package/src/app/ui/editor-api/lib/auth/tokens.js +138 -0
  90. package/src/app/ui/editor-api/lib/auth/users.js +122 -0
  91. package/src/app/ui/editor-api/lib/editor/comms.js +247 -0
  92. package/src/app/ui/editor-api/lib/editor/credentials.js +22 -0
  93. package/src/app/ui/editor-api/lib/editor/index.js +234 -0
  94. package/src/app/ui/editor-api/lib/editor/library.js +69 -0
  95. package/src/app/ui/editor-api/lib/editor/locales.js +37 -0
  96. package/src/app/ui/editor-api/lib/editor/projects.js +497 -0
  97. package/src/app/ui/editor-api/lib/editor/settings.js +118 -0
  98. package/src/app/ui/editor-api/lib/editor/sshkeys.js +87 -0
  99. package/src/app/ui/editor-api/lib/editor/theme.js +184 -0
  100. package/src/app/ui/editor-api/lib/editor/ui.js +149 -0
  101. package/src/app/ui/editor-api/lib/index.js +149 -0
  102. package/src/app/ui/editor-api/lib/runner/index.js +81 -0
  103. package/src/app/ui/editor-api/lib/util.js +51 -0
  104. package/src/app/ui/editor-client/README.md +10 -0
  105. package/src/app/ui/editor-client/constants.js +5 -0
  106. package/src/app/ui/editor-client/index.js +3 -0
  107. package/src/app/ui/editor-client/public/favicon.ico +0 -0
  108. package/src/app/ui/editor-client/public/red/images/bolt.png +0 -0
  109. package/src/app/ui/editor-client/public/red/images/debugger/continue-full.png +0 -0
  110. package/src/app/ui/editor-client/public/red/images/debugger/continue-outline.png +0 -0
  111. package/src/app/ui/editor-client/public/red/images/debugger/pause.png +0 -0
  112. package/src/app/ui/editor-client/public/red/images/debugger/restart.png +0 -0
  113. package/src/app/ui/editor-client/public/red/images/debugger/stepover.png +0 -0
  114. package/src/app/ui/editor-client/public/red/images/debugger/stop.png +0 -0
  115. package/src/app/ui/editor-client/public/red/images/deploy-flows-o.png +0 -0
  116. package/src/app/ui/editor-client/public/red/images/deploy-flows.png +0 -0
  117. package/src/app/ui/editor-client/public/red/images/deploy-full-o.png +0 -0
  118. package/src/app/ui/editor-client/public/red/images/deploy-full.png +0 -0
  119. package/src/app/ui/editor-client/public/red/images/deploy-nodes-o.png +0 -0
  120. package/src/app/ui/editor-client/public/red/images/deploy-nodes.png +0 -0
  121. package/src/app/ui/editor-client/public/red/images/deploy-reload.png +0 -0
  122. package/src/app/ui/editor-client/public/red/images/grip.png +0 -0
  123. package/src/app/ui/editor-client/public/red/images/icons/arrow-in.png +0 -0
  124. package/src/app/ui/editor-client/public/red/images/icons/bolt.png +0 -0
  125. package/src/app/ui/editor-client/public/red/images/icons/node-changed.png +0 -0
  126. package/src/app/ui/editor-client/public/red/images/icons/node-error.png +0 -0
  127. package/src/app/ui/editor-client/public/red/images/icons/node-play.png +0 -0
  128. package/src/app/ui/editor-client/public/red/images/kumologica-app.png +0 -0
  129. package/src/app/ui/editor-client/public/red/images/node-red-256.png +0 -0
  130. package/src/app/ui/editor-client/public/red/images/node-red-icon-black.svg +9 -0
  131. package/src/app/ui/editor-client/public/red/images/node-red-icon.svg +33 -0
  132. package/src/app/ui/editor-client/public/red/images/node-red.png +0 -0
  133. package/src/app/ui/editor-client/public/red/images/pw_maze_white.png +0 -0
  134. package/src/app/ui/editor-client/public/red/images/spin.svg +41 -0
  135. package/src/app/ui/editor-client/public/red/images/spinner.gif +0 -0
  136. package/src/app/ui/editor-client/public/red/images/subflow_tab.png +0 -0
  137. package/src/app/ui/editor-client/public/red/images/test-icon.png +0 -0
  138. package/src/app/ui/editor-client/public/red/images/typedInput/09.png +0 -0
  139. package/src/app/ui/editor-client/public/red/images/typedInput/az.png +0 -0
  140. package/src/app/ui/editor-client/public/red/images/typedInput/bin.png +0 -0
  141. package/src/app/ui/editor-client/public/red/images/typedInput/bool.png +0 -0
  142. package/src/app/ui/editor-client/public/red/images/typedInput/env.png +0 -0
  143. package/src/app/ui/editor-client/public/red/images/typedInput/expr.png +0 -0
  144. package/src/app/ui/editor-client/public/red/images/typedInput/json.png +0 -0
  145. package/src/app/ui/editor-client/public/red/images/typedInput/re.png +0 -0
  146. package/src/app/ui/editor-client/public/red/keymap.json +54 -0
  147. package/src/app/ui/editor-client/public/red/main-modals.js +14 -0
  148. package/src/app/ui/editor-client/public/red/main-modals.min.js +16 -0
  149. package/src/app/ui/editor-client/public/red/main.js +10 -0
  150. package/src/app/ui/editor-client/public/red/main.min.js +16 -0
  151. package/src/app/ui/editor-client/public/red/red.js +44903 -0
  152. package/src/app/ui/editor-client/public/red/red.min.js +16 -0
  153. package/src/app/ui/editor-client/public/red/style.min.css +24 -0
  154. package/src/app/ui/editor-client/public/vendor/ace/LICENSE +24 -0
  155. package/src/app/ui/editor-client/public/vendor/ace/ace.js +17 -0
  156. package/src/app/ui/editor-client/public/vendor/ace/ext-language_tools.js +8 -0
  157. package/src/app/ui/editor-client/public/vendor/ace/ext-searchbox.js +8 -0
  158. package/src/app/ui/editor-client/public/vendor/ace/mode-css.js +8 -0
  159. package/src/app/ui/editor-client/public/vendor/ace/mode-handlebars.js +8 -0
  160. package/src/app/ui/editor-client/public/vendor/ace/mode-html.js +8 -0
  161. package/src/app/ui/editor-client/public/vendor/ace/mode-javascript.js +8 -0
  162. package/src/app/ui/editor-client/public/vendor/ace/mode-json.js +8 -0
  163. package/src/app/ui/editor-client/public/vendor/ace/mode-jsonata.js +1 -0
  164. package/src/app/ui/editor-client/public/vendor/ace/mode-markdown.js +8 -0
  165. package/src/app/ui/editor-client/public/vendor/ace/mode-properties.js +8 -0
  166. package/src/app/ui/editor-client/public/vendor/ace/mode-python.js +8 -0
  167. package/src/app/ui/editor-client/public/vendor/ace/mode-sql.js +8 -0
  168. package/src/app/ui/editor-client/public/vendor/ace/mode-swift.js +8 -0
  169. package/src/app/ui/editor-client/public/vendor/ace/mode-text.js +8 -0
  170. package/src/app/ui/editor-client/public/vendor/ace/mode-xml.js +8 -0
  171. package/src/app/ui/editor-client/public/vendor/ace/mode-yaml.js +8 -0
  172. package/src/app/ui/editor-client/public/vendor/ace/snippets/css.js +8 -0
  173. package/src/app/ui/editor-client/public/vendor/ace/snippets/handlebars.js +8 -0
  174. package/src/app/ui/editor-client/public/vendor/ace/snippets/html.js +8 -0
  175. package/src/app/ui/editor-client/public/vendor/ace/snippets/javascript.js +8 -0
  176. package/src/app/ui/editor-client/public/vendor/ace/snippets/json.js +8 -0
  177. package/src/app/ui/editor-client/public/vendor/ace/snippets/jsonata.js +1 -0
  178. package/src/app/ui/editor-client/public/vendor/ace/snippets/markdown.js +8 -0
  179. package/src/app/ui/editor-client/public/vendor/ace/snippets/properties.js +8 -0
  180. package/src/app/ui/editor-client/public/vendor/ace/snippets/python.js +8 -0
  181. package/src/app/ui/editor-client/public/vendor/ace/snippets/sql.js +8 -0
  182. package/src/app/ui/editor-client/public/vendor/ace/snippets/swift.js +8 -0
  183. package/src/app/ui/editor-client/public/vendor/ace/snippets/text.js +8 -0
  184. package/src/app/ui/editor-client/public/vendor/ace/snippets/xml.js +8 -0
  185. package/src/app/ui/editor-client/public/vendor/ace/snippets/yaml.js +8 -0
  186. package/src/app/ui/editor-client/public/vendor/ace/theme-chrome.js +8 -0
  187. package/src/app/ui/editor-client/public/vendor/ace/theme-tomorrow.js +8 -0
  188. package/src/app/ui/editor-client/public/vendor/ace/worker-css.js +1 -0
  189. package/src/app/ui/editor-client/public/vendor/ace/worker-html.js +1 -0
  190. package/src/app/ui/editor-client/public/vendor/ace/worker-javascript.js +1 -0
  191. package/src/app/ui/editor-client/public/vendor/ace/worker-json.js +1 -0
  192. package/src/app/ui/editor-client/public/vendor/ace/worker-jsonata.js +2140 -0
  193. package/src/app/ui/editor-client/public/vendor/ace/worker-xml.js +1 -0
  194. package/src/app/ui/editor-client/public/vendor/beautifyjs/beautify.min.js +1 -0
  195. package/src/app/ui/editor-client/public/vendor/bootstrap/css/bootstrap.min.css +9 -0
  196. package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
  197. package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
  198. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/active-line.js +72 -0
  199. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/coffeescript-lint.js +47 -0
  200. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-hint.js +157 -0
  201. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-lint.js +63 -0
  202. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/jshint.js +29591 -0
  203. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.css +73 -0
  204. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.js +252 -0
  205. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.css +36 -0
  206. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.js +460 -0
  207. package/src/app/ui/editor-client/public/vendor/code-mirror/addon/sql-hint.js +304 -0
  208. package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.css +350 -0
  209. package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.js +9800 -0
  210. package/src/app/ui/editor-client/public/vendor/code-mirror/mode/javascript.js +927 -0
  211. package/src/app/ui/editor-client/public/vendor/code-mirror/mode/sql.js +494 -0
  212. package/src/app/ui/editor-client/public/vendor/code-mirror/theme/base16-dark.css +38 -0
  213. package/src/app/ui/editor-client/public/vendor/code-mirror/theme/monokai.css +42 -0
  214. package/src/app/ui/editor-client/public/vendor/code-mirror/theme/solarized.css +168 -0
  215. package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.css +43 -0
  216. package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.js +87 -0
  217. package/src/app/ui/editor-client/public/vendor/easy-json-schema/index.js +88 -0
  218. package/src/app/ui/editor-client/public/vendor/font-awesome/css/font-awesome.min.css +4 -0
  219. package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
  220. package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  221. package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
  222. package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  223. package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  224. package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  225. package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.eot +0 -0
  226. package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.svg +2105 -0
  227. package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.ttf +0 -0
  228. package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff +0 -0
  229. package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff2 +0 -0
  230. package/src/app/ui/editor-client/public/vendor/icofont/icofont.min.css +7 -0
  231. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
  232. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  233. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  234. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  235. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  236. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  237. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  238. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  239. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  240. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  241. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  242. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  243. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  244. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  245. package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +5 -0
  246. package/src/app/ui/editor-client/public/vendor/jsonata/jsonata.min.js +183 -0
  247. package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.css +181 -0
  248. package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.js +48 -0
  249. package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.css +7 -0
  250. package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.js +15 -0
  251. package/src/app/ui/editor-client/public/vendor/vendor.css +0 -0
  252. package/src/app/ui/editor-client/public/vendor/vendor.js +125 -0
  253. package/src/app/ui/editor-client/public/vendor/xterm/lib/xterm.js +2 -0
  254. package/src/app/ui/editor-client/src/ace/README.md +50 -0
  255. package/src/app/ui/editor-client/src/ace/mode/nrjavascript.js +35 -0
  256. package/src/app/ui/editor-client/src/ace/mode/nrjavascript_worker.js +189 -0
  257. package/src/app/ui/editor-client/src/favicon.ico +0 -0
  258. package/src/app/ui/editor-client/src/images/bolt.png +0 -0
  259. package/src/app/ui/editor-client/src/images/debugger/continue-full.png +0 -0
  260. package/src/app/ui/editor-client/src/images/debugger/continue-outline.png +0 -0
  261. package/src/app/ui/editor-client/src/images/debugger/pause.png +0 -0
  262. package/src/app/ui/editor-client/src/images/debugger/restart.png +0 -0
  263. package/src/app/ui/editor-client/src/images/debugger/stepover.png +0 -0
  264. package/src/app/ui/editor-client/src/images/debugger/stop.png +0 -0
  265. package/src/app/ui/editor-client/src/images/deploy-flows-o.png +0 -0
  266. package/src/app/ui/editor-client/src/images/deploy-flows.png +0 -0
  267. package/src/app/ui/editor-client/src/images/deploy-full-o.png +0 -0
  268. package/src/app/ui/editor-client/src/images/deploy-full.png +0 -0
  269. package/src/app/ui/editor-client/src/images/deploy-nodes-o.png +0 -0
  270. package/src/app/ui/editor-client/src/images/deploy-nodes.png +0 -0
  271. package/src/app/ui/editor-client/src/images/deploy-reload.png +0 -0
  272. package/src/app/ui/editor-client/src/images/grip.png +0 -0
  273. package/src/app/ui/editor-client/src/images/icons/arrow-in.png +0 -0
  274. package/src/app/ui/editor-client/src/images/icons/bolt.png +0 -0
  275. package/src/app/ui/editor-client/src/images/icons/node-changed.png +0 -0
  276. package/src/app/ui/editor-client/src/images/icons/node-error.png +0 -0
  277. package/src/app/ui/editor-client/src/images/icons/node-play.png +0 -0
  278. package/src/app/ui/editor-client/src/images/kumologica-app.png +0 -0
  279. package/src/app/ui/editor-client/src/images/node-red-256.png +0 -0
  280. package/src/app/ui/editor-client/src/images/node-red-icon-black.svg +9 -0
  281. package/src/app/ui/editor-client/src/images/node-red-icon.svg +33 -0
  282. package/src/app/ui/editor-client/src/images/node-red.png +0 -0
  283. package/src/app/ui/editor-client/src/images/pw_maze_white.png +0 -0
  284. package/src/app/ui/editor-client/src/images/spin.svg +41 -0
  285. package/src/app/ui/editor-client/src/images/spinner.gif +0 -0
  286. package/src/app/ui/editor-client/src/images/subflow_tab.png +0 -0
  287. package/src/app/ui/editor-client/src/images/test-icon.png +0 -0
  288. package/src/app/ui/editor-client/src/images/typedInput/09.png +0 -0
  289. package/src/app/ui/editor-client/src/images/typedInput/az.png +0 -0
  290. package/src/app/ui/editor-client/src/images/typedInput/bin.png +0 -0
  291. package/src/app/ui/editor-client/src/images/typedInput/bool.png +0 -0
  292. package/src/app/ui/editor-client/src/images/typedInput/env.png +0 -0
  293. package/src/app/ui/editor-client/src/images/typedInput/expr.png +0 -0
  294. package/src/app/ui/editor-client/src/images/typedInput/json.png +0 -0
  295. package/src/app/ui/editor-client/src/images/typedInput/re.png +0 -0
  296. package/src/app/ui/editor-client/src/js/comms.js +174 -0
  297. package/src/app/ui/editor-client/src/js/events.js +39 -0
  298. package/src/app/ui/editor-client/src/js/font-awesome.js +818 -0
  299. package/src/app/ui/editor-client/src/js/history.js +337 -0
  300. package/src/app/ui/editor-client/src/js/i18n.js +81 -0
  301. package/src/app/ui/editor-client/src/js/jquery-addons.js +21 -0
  302. package/src/app/ui/editor-client/src/js/keymap.json +54 -0
  303. package/src/app/ui/editor-client/src/js/main-modals.js +14 -0
  304. package/src/app/ui/editor-client/src/js/main.js +10 -0
  305. package/src/app/ui/editor-client/src/js/modals/modal-home.js +162 -0
  306. package/src/app/ui/editor-client/src/js/modals/modal-new-project.js +86 -0
  307. package/src/app/ui/editor-client/src/js/modals/modal-node-library.js +255 -0
  308. package/src/app/ui/editor-client/src/js/modals/modal-welcome.js +102 -0
  309. package/src/app/ui/editor-client/src/js/nodes.js +1736 -0
  310. package/src/app/ui/editor-client/src/js/red.js +704 -0
  311. package/src/app/ui/editor-client/src/js/settings.js +275 -0
  312. package/src/app/ui/editor-client/src/js/text/bidi.js +116 -0
  313. package/src/app/ui/editor-client/src/js/text/format.js +1316 -0
  314. package/src/app/ui/editor-client/src/js/ui/actions.js +39 -0
  315. package/src/app/ui/editor-client/src/js/ui/clipboard.js +510 -0
  316. package/src/app/ui/editor-client/src/js/ui/common/checkboxSet.js +117 -0
  317. package/src/app/ui/editor-client/src/js/ui/common/editableList.js +322 -0
  318. package/src/app/ui/editor-client/src/js/ui/common/menu.js +277 -0
  319. package/src/app/ui/editor-client/src/js/ui/common/panels.js +104 -0
  320. package/src/app/ui/editor-client/src/js/ui/common/popover.js +268 -0
  321. package/src/app/ui/editor-client/src/js/ui/common/searchBox.js +98 -0
  322. package/src/app/ui/editor-client/src/js/ui/common/stack.js +184 -0
  323. package/src/app/ui/editor-client/src/js/ui/common/tabs.js +730 -0
  324. package/src/app/ui/editor-client/src/js/ui/common/treeList.js +170 -0
  325. package/src/app/ui/editor-client/src/js/ui/common/typedInput.js +819 -0
  326. package/src/app/ui/editor-client/src/js/ui/common/typedInputLong.js +829 -0
  327. package/src/app/ui/editor-client/src/js/ui/deploy.js +422 -0
  328. package/src/app/ui/editor-client/src/js/ui/diff.js +2225 -0
  329. package/src/app/ui/editor-client/src/js/ui/editor.js +3020 -0
  330. package/src/app/ui/editor-client/src/js/ui/editors/buffer.js +195 -0
  331. package/src/app/ui/editor-client/src/js/ui/editors/expression.js +627 -0
  332. package/src/app/ui/editor-client/src/js/ui/editors/js.js +89 -0
  333. package/src/app/ui/editor-client/src/js/ui/editors/json.js +107 -0
  334. package/src/app/ui/editor-client/src/js/ui/editors/markdown.js +267 -0
  335. package/src/app/ui/editor-client/src/js/ui/editors/string.js +75 -0
  336. package/src/app/ui/editor-client/src/js/ui/event-log.js +107 -0
  337. package/src/app/ui/editor-client/src/js/ui/header.js +372 -0
  338. package/src/app/ui/editor-client/src/js/ui/keyboard.js +565 -0
  339. package/src/app/ui/editor-client/src/js/ui/library.js +570 -0
  340. package/src/app/ui/editor-client/src/js/ui/logviewer.js +116 -0
  341. package/src/app/ui/editor-client/src/js/ui/notifications.js +282 -0
  342. package/src/app/ui/editor-client/src/js/ui/palette-editor.js +1061 -0
  343. package/src/app/ui/editor-client/src/js/ui/palette.js +788 -0
  344. package/src/app/ui/editor-client/src/js/ui/project-info.js +232 -0
  345. package/src/app/ui/editor-client/src/js/ui/projects/projectSettings.js +1651 -0
  346. package/src/app/ui/editor-client/src/js/ui/projects/projectUserSettings.js +404 -0
  347. package/src/app/ui/editor-client/src/js/ui/projects/projects.js +2395 -0
  348. package/src/app/ui/editor-client/src/js/ui/projects/tab-versionControl.js +1383 -0
  349. package/src/app/ui/editor-client/src/js/ui/search.js +366 -0
  350. package/src/app/ui/editor-client/src/js/ui/sidebar.js +409 -0
  351. package/src/app/ui/editor-client/src/js/ui/state.js +14 -0
  352. package/src/app/ui/editor-client/src/js/ui/subflow.js +748 -0
  353. package/src/app/ui/editor-client/src/js/ui/tab-awsDeploy.js +1427 -0
  354. package/src/app/ui/editor-client/src/js/ui/tab-azure.js +852 -0
  355. package/src/app/ui/editor-client/src/js/ui/tab-config.js +452 -0
  356. package/src/app/ui/editor-client/src/js/ui/tab-context.js +406 -0
  357. package/src/app/ui/editor-client/src/js/ui/tab-info.js +661 -0
  358. package/src/app/ui/editor-client/src/js/ui/tab-kumohub.js +800 -0
  359. package/src/app/ui/editor-client/src/js/ui/tab-nodeInfo.js +60 -0
  360. package/src/app/ui/editor-client/src/js/ui/tab-test.js +915 -0
  361. package/src/app/ui/editor-client/src/js/ui/terminal.js +240 -0
  362. package/src/app/ui/editor-client/src/js/ui/touch/radialMenu.js +170 -0
  363. package/src/app/ui/editor-client/src/js/ui/tray.js +411 -0
  364. package/src/app/ui/editor-client/src/js/ui/typeSearch.js +411 -0
  365. package/src/app/ui/editor-client/src/js/ui/ui-settings.js +422 -0
  366. package/src/app/ui/editor-client/src/js/ui/update-panel.js +84 -0
  367. package/src/app/ui/editor-client/src/js/ui/userSettings.js +673 -0
  368. package/src/app/ui/editor-client/src/js/ui/utils.js +1287 -0
  369. package/src/app/ui/editor-client/src/js/ui/view-navigator.js +169 -0
  370. package/src/app/ui/editor-client/src/js/ui/view-tools.js +123 -0
  371. package/src/app/ui/editor-client/src/js/ui/view.js +5333 -0
  372. package/src/app/ui/editor-client/src/js/ui/workspaces.js +498 -0
  373. package/src/app/ui/editor-client/src/js/user.js +282 -0
  374. package/src/app/ui/editor-client/src/js/validators.js +54 -0
  375. package/src/app/ui/editor-client/src/kumologica-app.png +0 -0
  376. package/src/app/ui/editor-client/src/sass/ace.scss +29 -0
  377. package/src/app/ui/editor-client/src/sass/bootstrap.scss +21 -0
  378. package/src/app/ui/editor-client/src/sass/colors.scss +76 -0
  379. package/src/app/ui/editor-client/src/sass/debug.scss +383 -0
  380. package/src/app/ui/editor-client/src/sass/diff.scss +695 -0
  381. package/src/app/ui/editor-client/src/sass/dragdrop.scss +37 -0
  382. package/src/app/ui/editor-client/src/sass/dropdownMenu.scss +93 -0
  383. package/src/app/ui/editor-client/src/sass/editor.scss +683 -0
  384. package/src/app/ui/editor-client/src/sass/flow.scss +330 -0
  385. package/src/app/ui/editor-client/src/sass/forms.scss +1093 -0
  386. package/src/app/ui/editor-client/src/sass/header.scss +502 -0
  387. package/src/app/ui/editor-client/src/sass/jquery.scss +152 -0
  388. package/src/app/ui/editor-client/src/sass/keyboard.scss +136 -0
  389. package/src/app/ui/editor-client/src/sass/library.scss +54 -0
  390. package/src/app/ui/editor-client/src/sass/mixins.scss +283 -0
  391. package/src/app/ui/editor-client/src/sass/modals/modalHome.scss +138 -0
  392. package/src/app/ui/editor-client/src/sass/modals/modalNewProject.scss +96 -0
  393. package/src/app/ui/editor-client/src/sass/modals/modalNodeLibrary.scss +131 -0
  394. package/src/app/ui/editor-client/src/sass/modals/modalWelcome.scss +102 -0
  395. package/src/app/ui/editor-client/src/sass/notifications.scss +118 -0
  396. package/src/app/ui/editor-client/src/sass/palette-editor.scss +275 -0
  397. package/src/app/ui/editor-client/src/sass/palette.scss +279 -0
  398. package/src/app/ui/editor-client/src/sass/panels.scss +61 -0
  399. package/src/app/ui/editor-client/src/sass/popover.scss +166 -0
  400. package/src/app/ui/editor-client/src/sass/project-info.scss +74 -0
  401. package/src/app/ui/editor-client/src/sass/projects.scss +875 -0
  402. package/src/app/ui/editor-client/src/sass/search.scss +201 -0
  403. package/src/app/ui/editor-client/src/sass/sidebar.scss +201 -0
  404. package/src/app/ui/editor-client/src/sass/style.scss +170 -0
  405. package/src/app/ui/editor-client/src/sass/tab-azure.scss +68 -0
  406. package/src/app/ui/editor-client/src/sass/tab-cloud.scss +67 -0
  407. package/src/app/ui/editor-client/src/sass/tab-config.scss +100 -0
  408. package/src/app/ui/editor-client/src/sass/tab-context.scss +54 -0
  409. package/src/app/ui/editor-client/src/sass/tab-info.scss +307 -0
  410. package/src/app/ui/editor-client/src/sass/tab-kumohub.scss +68 -0
  411. package/src/app/ui/editor-client/src/sass/tab-test.scss +257 -0
  412. package/src/app/ui/editor-client/src/sass/tabs.scss +395 -0
  413. package/src/app/ui/editor-client/src/sass/terminal.scss +246 -0
  414. package/src/app/ui/editor-client/src/sass/ui/common/checkboxSet.scss +29 -0
  415. package/src/app/ui/editor-client/src/sass/ui/common/editableList.scss +81 -0
  416. package/src/app/ui/editor-client/src/sass/ui/common/nodeList.scss +65 -0
  417. package/src/app/ui/editor-client/src/sass/ui/common/searchBox.scss +77 -0
  418. package/src/app/ui/editor-client/src/sass/ui/common/stack.scss +26 -0
  419. package/src/app/ui/editor-client/src/sass/ui/common/treeList.scss +108 -0
  420. package/src/app/ui/editor-client/src/sass/ui/common/typedInput.scss +181 -0
  421. package/src/app/ui/editor-client/src/sass/ui/common/typedInputLong.scss +183 -0
  422. package/src/app/ui/editor-client/src/sass/ui-settings.scss +119 -0
  423. package/src/app/ui/editor-client/src/sass/update-panel.scss +18 -0
  424. package/src/app/ui/editor-client/src/sass/userSettings.scss +93 -0
  425. package/src/app/ui/editor-client/src/sass/widgetStyle.scss +23 -0
  426. package/src/app/ui/editor-client/src/sass/workspace.scss +123 -0
  427. package/src/app/ui/editor-client/src/sass/workspaceToolbar.scss +85 -0
  428. package/src/app/ui/editor-client/src/vendor/ace/LICENSE +24 -0
  429. package/src/app/ui/editor-client/src/vendor/ace/ace.js +17 -0
  430. package/src/app/ui/editor-client/src/vendor/ace/ext-language_tools.js +8 -0
  431. package/src/app/ui/editor-client/src/vendor/ace/ext-searchbox.js +8 -0
  432. package/src/app/ui/editor-client/src/vendor/ace/mode-css.js +8 -0
  433. package/src/app/ui/editor-client/src/vendor/ace/mode-handlebars.js +8 -0
  434. package/src/app/ui/editor-client/src/vendor/ace/mode-html.js +8 -0
  435. package/src/app/ui/editor-client/src/vendor/ace/mode-javascript.js +8 -0
  436. package/src/app/ui/editor-client/src/vendor/ace/mode-json.js +8 -0
  437. package/src/app/ui/editor-client/src/vendor/ace/mode-markdown.js +8 -0
  438. package/src/app/ui/editor-client/src/vendor/ace/mode-properties.js +8 -0
  439. package/src/app/ui/editor-client/src/vendor/ace/mode-python.js +8 -0
  440. package/src/app/ui/editor-client/src/vendor/ace/mode-sql.js +8 -0
  441. package/src/app/ui/editor-client/src/vendor/ace/mode-swift.js +8 -0
  442. package/src/app/ui/editor-client/src/vendor/ace/mode-text.js +8 -0
  443. package/src/app/ui/editor-client/src/vendor/ace/mode-xml.js +8 -0
  444. package/src/app/ui/editor-client/src/vendor/ace/mode-yaml.js +8 -0
  445. package/src/app/ui/editor-client/src/vendor/ace/snippets/css.js +8 -0
  446. package/src/app/ui/editor-client/src/vendor/ace/snippets/handlebars.js +8 -0
  447. package/src/app/ui/editor-client/src/vendor/ace/snippets/html.js +8 -0
  448. package/src/app/ui/editor-client/src/vendor/ace/snippets/javascript.js +8 -0
  449. package/src/app/ui/editor-client/src/vendor/ace/snippets/json.js +8 -0
  450. package/src/app/ui/editor-client/src/vendor/ace/snippets/markdown.js +8 -0
  451. package/src/app/ui/editor-client/src/vendor/ace/snippets/properties.js +8 -0
  452. package/src/app/ui/editor-client/src/vendor/ace/snippets/python.js +8 -0
  453. package/src/app/ui/editor-client/src/vendor/ace/snippets/sql.js +8 -0
  454. package/src/app/ui/editor-client/src/vendor/ace/snippets/swift.js +8 -0
  455. package/src/app/ui/editor-client/src/vendor/ace/snippets/text.js +8 -0
  456. package/src/app/ui/editor-client/src/vendor/ace/snippets/xml.js +8 -0
  457. package/src/app/ui/editor-client/src/vendor/ace/snippets/yaml.js +8 -0
  458. package/src/app/ui/editor-client/src/vendor/ace/theme-chrome.js +8 -0
  459. package/src/app/ui/editor-client/src/vendor/ace/theme-tomorrow.js +8 -0
  460. package/src/app/ui/editor-client/src/vendor/ace/worker-css.js +1 -0
  461. package/src/app/ui/editor-client/src/vendor/ace/worker-html.js +1 -0
  462. package/src/app/ui/editor-client/src/vendor/ace/worker-javascript.js +1 -0
  463. package/src/app/ui/editor-client/src/vendor/ace/worker-json.js +1 -0
  464. package/src/app/ui/editor-client/src/vendor/ace/worker-xml.js +1 -0
  465. package/src/app/ui/editor-client/src/vendor/beautifyjs/beautify.min.js +1 -0
  466. package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.css +5406 -0
  467. package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.min.css +9 -0
  468. package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
  469. package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
  470. package/src/app/ui/editor-client/src/vendor/bootstrap/js/bootstrap.min.js +6 -0
  471. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/active-line.js +72 -0
  472. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/coffeescript-lint.js +47 -0
  473. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-hint.js +157 -0
  474. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-lint.js +63 -0
  475. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/jshint.js +29591 -0
  476. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.css +73 -0
  477. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.js +252 -0
  478. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.css +36 -0
  479. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.js +460 -0
  480. package/src/app/ui/editor-client/src/vendor/code-mirror/addon/sql-hint.js +304 -0
  481. package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.css +350 -0
  482. package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.js +9800 -0
  483. package/src/app/ui/editor-client/src/vendor/code-mirror/mode/javascript.js +927 -0
  484. package/src/app/ui/editor-client/src/vendor/code-mirror/mode/sql.js +494 -0
  485. package/src/app/ui/editor-client/src/vendor/code-mirror/theme/base16-dark.css +38 -0
  486. package/src/app/ui/editor-client/src/vendor/code-mirror/theme/monokai.css +42 -0
  487. package/src/app/ui/editor-client/src/vendor/code-mirror/theme/solarized.css +168 -0
  488. package/src/app/ui/editor-client/src/vendor/d3/d3.v3.min.js +4 -0
  489. package/src/app/ui/editor-client/src/vendor/d3/d3.v4.min.js +2 -0
  490. package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.css +43 -0
  491. package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.js +87 -0
  492. package/src/app/ui/editor-client/src/vendor/easy-json-schema/index.js +88 -0
  493. package/src/app/ui/editor-client/src/vendor/font-awesome/css/font-awesome.min.css +4 -0
  494. package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
  495. package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  496. package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
  497. package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  498. package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  499. package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  500. package/src/app/ui/editor-client/src/vendor/i18next/i18next.min.js +5 -0
  501. package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.eot +0 -0
  502. package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.svg +2105 -0
  503. package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.ttf +0 -0
  504. package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff +0 -0
  505. package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff2 +0 -0
  506. package/src/app/ui/editor-client/src/vendor/icofont/icofont.min.css +7 -0
  507. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
  508. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  509. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  510. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  511. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  512. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  513. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  514. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  515. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  516. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  517. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  518. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  519. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  520. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  521. package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +5 -0
  522. package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-1.11.3.min.js +5 -0
  523. package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-ui-1.10.3.custom.min.js +7 -0
  524. package/src/app/ui/editor-client/src/vendor/jquery/js/jquery.ui.touch-punch.min.js +11 -0
  525. package/src/app/ui/editor-client/src/vendor/jsonata/formatter.js +183 -0
  526. package/src/app/ui/editor-client/src/vendor/jsonata/mode-jsonata.js +134 -0
  527. package/src/app/ui/editor-client/src/vendor/jsonata/snippets-jsonata.js +11 -0
  528. package/src/app/ui/editor-client/src/vendor/jsonata/worker-jsonata.js +2140 -0
  529. package/src/app/ui/editor-client/src/vendor/marked/marked.min.js +6 -0
  530. package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.css +181 -0
  531. package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.js +48 -0
  532. package/src/app/ui/editor-client/templates/index.mst +314 -0
  533. package/src/app/ui/editor-client/templates/modals/modalHome.mst +107 -0
  534. package/src/app/ui/editor-client/templates/modals/modalNewProject.mst +104 -0
  535. package/src/app/ui/editor-client/templates/modals/modalNodeLibrary.mst +72 -0
  536. package/src/app/ui/editor-client/templates/modals/modalWelcome.mst +111 -0
  537. package/src/assets/eula.txt +170 -0
  538. package/src/assets/icon.icns +0 -0
  539. package/src/assets/kumologica-app.png +0 -0
  540. package/src/assets/license_en.txt +170 -0
@@ -0,0 +1,1316 @@
1
+
2
+ RED.text.format = (function() {
3
+
4
+ var TextSegment = (function() {
5
+ var TextSegment = function (obj) {
6
+ this.content = "";
7
+ this.actual = "";
8
+ this.textDirection = "";
9
+ this.localGui = "";
10
+ this.isVisible = true;
11
+ this.isSeparator = false;
12
+ this.isParsed = false;
13
+ this.keep = false;
14
+ this.inBounds = false;
15
+ this.inPoints = false;
16
+ var prop = "";
17
+ for (prop in obj) {
18
+ if (obj.hasOwnProperty(prop)) {
19
+ this[prop] = obj[prop];
20
+ }
21
+ }
22
+ };
23
+ return TextSegment;
24
+ })();
25
+
26
+ var tools = (function() {
27
+ function initBounds(bounds) {
28
+ if (!bounds) {
29
+ return false;
30
+ }
31
+ if (typeof(bounds.start) === "undefined") {
32
+ bounds.start = "";
33
+ }
34
+ if (typeof(bounds.end) === "undefined") {
35
+ bounds.end = "";
36
+ }
37
+ if (typeof(bounds.startAfter) !== "undefined") {
38
+ bounds.start = bounds.startAfter;
39
+ bounds.after = true;
40
+ } else {
41
+ bounds.after = false;
42
+ }
43
+ if (typeof(bounds.endBefore) !== "undefined") {
44
+ bounds.end = bounds.endBefore;
45
+ bounds.before = true;
46
+ } else {
47
+ bounds.before = false;
48
+ }
49
+ var startPos = parseInt(bounds.startPos, 10);
50
+ if (!isNaN(startPos)) {
51
+ bounds.usePos = true;
52
+ } else {
53
+ bounds.usePos = false;
54
+ }
55
+ var bLength = parseInt(bounds.length, 10);
56
+ if (!isNaN(bLength)) {
57
+ bounds.useLength = true;
58
+ } else {
59
+ bounds.useLength = false;
60
+ }
61
+ bounds.loops = typeof(bounds.loops) !== "undefined" ? !!bounds.loops : true;
62
+ return true;
63
+ }
64
+
65
+ function getBounds(segment, src) {
66
+ var bounds = {};
67
+ for (var prop in src) {
68
+ if (src.hasOwnProperty(prop)) {
69
+ bounds[prop] = src[prop];
70
+ }
71
+ }
72
+ var content = segment.content;
73
+ var usePos = bounds.usePos && bounds.startPos < content.length;
74
+ if (usePos) {
75
+ bounds.start = "";
76
+ bounds.loops = false;
77
+ }
78
+ bounds.bStart = usePos ? bounds.startPos : bounds.start.length > 0 ? content.indexOf(bounds.start) : 0;
79
+ var useLength = bounds.useLength && bounds.length > 0 && bounds.bStart + bounds.length < content.length;
80
+ if (useLength) {
81
+ bounds.end = "";
82
+ }
83
+ bounds.bEnd = useLength ? bounds.bStart + bounds.length : bounds.end.length > 0 ?
84
+ content.indexOf(bounds.end, bounds.bStart + bounds.start.length) + 1 : content.length;
85
+ if (!bounds.after) {
86
+ bounds.start = "";
87
+ }
88
+ if (!bounds.before) {
89
+ bounds.end = "";
90
+ }
91
+ return bounds;
92
+ }
93
+
94
+ return {
95
+ handleSubcontents: function (segments, args, subs, origContent, locale) { // jshint unused: false
96
+ if (!subs.content || typeof(subs.content) !== "string" || subs.content.length === 0) {
97
+ return segments;
98
+ }
99
+ var sLoops = true;
100
+ if (typeof(subs.loops) !== "undefined") {
101
+ sLoops = !!subs.loops;
102
+ }
103
+ for (var j = 0; true; j++) {
104
+ if (j >= segments.length) {
105
+ break;
106
+ }
107
+ if (segments[j].isParsed || segments.keep || segments[j].isSeparator) {
108
+ continue;
109
+ }
110
+ var content = segments[j].content;
111
+ var start = content.indexOf(subs.content);
112
+ if (start < 0) {
113
+ continue;
114
+ }
115
+ var end;
116
+ var length = 0;
117
+ if (subs.continued) {
118
+ do {
119
+ length++;
120
+ end = content.indexOf(subs.content, start + length * subs.content.length);
121
+ } while (end === 0);
122
+ } else {
123
+ length = 1;
124
+ }
125
+ end = start + length * subs.content.length;
126
+ segments.splice(j, 1);
127
+ if (start > 0) {
128
+ segments.splice(j, 0, new TextSegment({
129
+ content: content.substring(0, start),
130
+ localGui: args.dir,
131
+ keep: true
132
+ }));
133
+ j++;
134
+ }
135
+ segments.splice(j, 0, new TextSegment({
136
+ content: content.substring(start, end),
137
+ textDirection: subs.subDir,
138
+ localGui: args.dir
139
+ }));
140
+ if (end < content.length) {
141
+ segments.splice(j + 1, 0, new TextSegment({
142
+ content: content.substring(end, content.length),
143
+ localGui: args.dir,
144
+ keep: true
145
+ }));
146
+ }
147
+ if (!sLoops) {
148
+ break;
149
+ }
150
+ }
151
+ },
152
+
153
+ handleBounds: function (segments, args, aBounds, origContent, locale) {
154
+ for (var i = 0; i < aBounds.length; i++) {
155
+ if (!initBounds(aBounds[i])) {
156
+ continue;
157
+ }
158
+ for (var j = 0; true; j++) {
159
+ if (j >= segments.length) {
160
+ break;
161
+ }
162
+ if (segments[j].isParsed || segments[j].inBounds || segments.keep || segments[j].isSeparator) {
163
+ continue;
164
+ }
165
+ var bounds = getBounds(segments[j], aBounds[i]);
166
+ var start = bounds.bStart;
167
+ var end = bounds.bEnd;
168
+ if (start < 0 || end < 0) {
169
+ continue;
170
+ }
171
+ var content = segments[j].content;
172
+
173
+ segments.splice(j, 1);
174
+ if (start > 0) {
175
+ segments.splice(j, 0, new TextSegment({
176
+ content: content.substring(0, start),
177
+ localGui: args.dir,
178
+ keep: true
179
+ }));
180
+ j++;
181
+ }
182
+ if (bounds.start) {
183
+ segments.splice(j, 0, new TextSegment({
184
+ content: bounds.start,
185
+ localGui: args.dir,
186
+ isSeparator: true
187
+ }));
188
+ j++;
189
+ }
190
+ segments.splice(j, 0, new TextSegment({
191
+ content: content.substring(start + bounds.start.length, end - bounds.end.length),
192
+ textDirection: bounds.subDir,
193
+ localGui: args.dir,
194
+ inBounds: true
195
+ }));
196
+ if (bounds.end) {
197
+ j++;
198
+ segments.splice(j, 0, new TextSegment({
199
+ content: bounds.end,
200
+ localGui: args.dir,
201
+ isSeparator: true
202
+ }));
203
+ }
204
+ if (end + bounds.end.length < content.length) {
205
+ segments.splice(j + 1, 0, new TextSegment({
206
+ content: content.substring(end + bounds.end.length, content.length),
207
+ localGui: args.dir,
208
+ keep: true
209
+ }));
210
+ }
211
+ if (!bounds.loops) {
212
+ break;
213
+ }
214
+ }
215
+ }
216
+ for (i = 0; i < segments.length; i++) {
217
+ segments[i].inBounds = false;
218
+ }
219
+ return segments;
220
+ },
221
+
222
+ handleCases: function (segments, args, cases, origContent, locale) {
223
+ if (cases.length === 0) {
224
+ return segments;
225
+ }
226
+ var hArgs = {};
227
+ for (var prop in args) {
228
+ if (args.hasOwnProperty(prop)) {
229
+ hArgs[prop] = args[prop];
230
+ }
231
+ }
232
+ for (var i = 0; i < cases.length; i++) {
233
+ if (!cases[i].handler || typeof(cases[i].handler.handle) !== "function") {
234
+ cases[i].handler = args.commonHandler;
235
+ }
236
+ if (cases[i].args) {
237
+ hArgs.cases = cases[i].args.cases;
238
+ hArgs.points = cases[i].args.points;
239
+ hArgs.bounds = cases[i].args.bounds;
240
+ hArgs.subs = cases[i].args.subs;
241
+ } else {
242
+ hArgs.cases = [];
243
+ hArgs.points = [];
244
+ hArgs.bounds = [];
245
+ hArgs.subs = {};
246
+ }
247
+ cases[i].handler.handle(origContent, segments, hArgs, locale);
248
+ }
249
+ return segments;
250
+ },
251
+
252
+ handlePoints: function (segments, args, points, origContent, locale) { //jshint unused: false
253
+ for (var i = 0; i < points.length; i++) {
254
+ for (var j = 0; true; j++) {
255
+ if (j >= segments.length) {
256
+ break;
257
+ }
258
+ if (segments[j].isParsed || segments[j].keep || segments[j].isSeparator) {
259
+ continue;
260
+ }
261
+ var content = segments[j].content;
262
+ var pos = content.indexOf(points[i]);
263
+ if (pos >= 0) {
264
+ segments.splice(j, 1);
265
+ if (pos > 0) {
266
+ segments.splice(j, 0, new TextSegment({
267
+ content: content.substring(0, pos),
268
+ textDirection: args.subDir,
269
+ localGui: args.dir,
270
+ inPoints: true
271
+ }));
272
+ j++;
273
+ }
274
+ segments.splice(j, 0, new TextSegment({
275
+ content: points[i],
276
+ localGui: args.dir,
277
+ isSeparator: true
278
+ }));
279
+ if (pos + points[i].length + 1 <= content.length) {
280
+ segments.splice(j + 1, 0, new TextSegment({
281
+ content: content.substring(pos + points[i].length),
282
+ textDirection: args.subDir,
283
+ localGui: args.dir,
284
+ inPoints: true
285
+ }));
286
+ }
287
+ }
288
+ }
289
+ }
290
+ for (i = 0; i < segments.length; i++) {
291
+ if (segments[i].keep) {
292
+ segments[i].keep = false;
293
+ } else if(segments[i].inPoints){
294
+ segments[i].isParsed = true;
295
+ segments[i].inPoints = false;
296
+ }
297
+ }
298
+ return segments;
299
+ }
300
+ };
301
+ })();
302
+
303
+ var common = (function() {
304
+ return {
305
+ handle: function (content, segments, args, locale) {
306
+ var cases = [];
307
+ if (Array.isArray(args.cases)) {
308
+ cases = args.cases;
309
+ }
310
+ var points = [];
311
+ if (typeof(args.points) !== "undefined") {
312
+ if (Array.isArray(args.points)) {
313
+ points = args.points;
314
+ } else if (typeof(args.points) === "string") {
315
+ points = args.points.split("");
316
+ }
317
+ }
318
+ var subs = {};
319
+ if (typeof(args.subs) === "object") {
320
+ subs = args.subs;
321
+ }
322
+ var aBounds = [];
323
+ if (Array.isArray(args.bounds)) {
324
+ aBounds = args.bounds;
325
+ }
326
+
327
+ tools.handleBounds(segments, args, aBounds, content, locale);
328
+ tools.handleSubcontents(segments, args, subs, content, locale);
329
+ tools.handleCases(segments, args, cases, content, locale);
330
+ tools.handlePoints(segments, args, points, content, locale);
331
+ return segments;
332
+ }
333
+ };
334
+ })();
335
+
336
+ var misc = (function() {
337
+ var isBidiLocale = function (locale) {
338
+ var lang = !locale ? "" : locale.split("-")[0];
339
+ if (!lang || lang.length < 2) {
340
+ return false;
341
+ }
342
+ return ["iw", "he", "ar", "fa", "ur"].some(function (bidiLang) {
343
+ return bidiLang === lang;
344
+ });
345
+ };
346
+ var LRE = "\u202A";
347
+ var RLE = "\u202B";
348
+ var PDF = "\u202C";
349
+ var LRM = "\u200E";
350
+ var RLM = "\u200F";
351
+ var LRO = "\u202D";
352
+ var RLO = "\u202E";
353
+
354
+ return {
355
+ LRE: LRE,
356
+ RLE: RLE,
357
+ PDF: PDF,
358
+ LRM: LRM,
359
+ RLM: RLM,
360
+ LRO: LRO,
361
+ RLO: RLO,
362
+
363
+ getLocaleDetails: function (locale) {
364
+ if (!locale) {
365
+ locale = typeof navigator === "undefined" ? "" :
366
+ (navigator.language ||
367
+ navigator.userLanguage ||
368
+ "");
369
+ }
370
+ locale = locale.toLowerCase();
371
+ if (isBidiLocale(locale)) {
372
+ var full = locale.split("-");
373
+ return {lang: full[0], country: full[1] ? full[1] : ""};
374
+ }
375
+ return {lang: "not-bidi"};
376
+ },
377
+
378
+ removeUcc: function (text) {
379
+ if (text) {
380
+ return text.replace(/[\u200E\u200F\u202A-\u202E]/g, "");
381
+ }
382
+ return text;
383
+ },
384
+
385
+ removeTags: function (text) {
386
+ if (text) {
387
+ return text.replace(/<[^<]*>/g, "");
388
+ }
389
+ return text;
390
+ },
391
+
392
+ getDirection: function (text, dir, guiDir, checkEnd) {
393
+ if (dir !== "auto" && (/^(rtl|ltr)$/i).test(dir)) {
394
+ return dir;
395
+ }
396
+ guiDir = (/^(rtl|ltr)$/i).test(guiDir) ? guiDir : "ltr";
397
+ var txt = !checkEnd ? text : text.split("").reverse().join("");
398
+ var fdc = /[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(txt);
399
+ return fdc ? (fdc[0] <= "z" ? "ltr" : "rtl") : guiDir;
400
+ },
401
+
402
+ hasArabicChar: function (text) {
403
+ var fdc = /[\u0600-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(text);
404
+ return !!fdc;
405
+ },
406
+
407
+ showMarks: function (text, guiDir) {
408
+ var result = "";
409
+ for (var i = 0; i < text.length; i++) {
410
+ var c = "" + text.charAt(i);
411
+ switch (c) {
412
+ case LRM:
413
+ result += "<LRM>";
414
+ break;
415
+ case RLM:
416
+ result += "<RLM>";
417
+ break;
418
+ case LRE:
419
+ result += "<LRE>";
420
+ break;
421
+ case RLE:
422
+ result += "<RLE>";
423
+ break;
424
+ case LRO:
425
+ result += "<LRO>";
426
+ break;
427
+ case RLO:
428
+ result += "<RLO>";
429
+ break;
430
+ case PDF:
431
+ result += "<PDF>";
432
+ break;
433
+ default:
434
+ result += c;
435
+ }
436
+ }
437
+ var mark = typeof(guiDir) === "undefined" || !((/^(rtl|ltr)$/i).test(guiDir)) ? "" :
438
+ guiDir === "rtl" ? RLO : LRO;
439
+ return mark + result + (mark === "" ? "" : PDF);
440
+ },
441
+
442
+ hideMarks: function (text) {
443
+ var txt = text.replace(/<LRM>/g, this.LRM).replace(/<RLM>/g, this.RLM).replace(/<LRE>/g, this.LRE);
444
+ return txt.replace(/<RLE>/g, this.RLE).replace(/<LRO>/g, this.LRO).replace(/<RLO>/g, this.RLO).replace(/<PDF>/g, this.PDF);
445
+ },
446
+
447
+ showTags: function (text) {
448
+ return "<xmp>" + text + "</xmp>";
449
+ },
450
+
451
+ hideTags: function (text) {
452
+ return text.replace(/<xmp>/g,"").replace(/<\/xmp>/g,"");
453
+ }
454
+ };
455
+ })();
456
+
457
+ var stext = (function() {
458
+ var stt = {};
459
+
460
+ // args
461
+ // handler: main handler (default - dbidi/stt/handlers/common)
462
+ // guiDir: GUI direction (default - "ltr")
463
+ // dir: main stt direction (default - guiDir)
464
+ // subDir: direction of subsegments
465
+ // points: array of delimiters (default - [])
466
+ // bounds: array of definitions of bounds in which handler works
467
+ // subs: object defines special handling for some substring if found
468
+ // cases: array of additional modules with their args for handling special cases (default - [])
469
+ function parseAndDisplayStructure(content, fArgs, isHtml, locale) {
470
+ if (!content || !fArgs) {
471
+ return content;
472
+ }
473
+ return displayStructure(parseStructure(content, fArgs, locale), fArgs, isHtml);
474
+ }
475
+
476
+ function checkArguments(fArgs, fullCheck) {
477
+ var args = Array.isArray(fArgs)? fArgs[0] : fArgs;
478
+ if (!args.guiDir) {
479
+ args.guiDir = "ltr";
480
+ }
481
+ if (!args.dir) {
482
+ args.dir = args.guiDir;
483
+ }
484
+ if (!fullCheck) {
485
+ return args;
486
+ }
487
+ if (typeof(args.points) === "undefined") {
488
+ args.points = [];
489
+ }
490
+ if (!args.cases) {
491
+ args.cases = [];
492
+ }
493
+ if (!args.bounds) {
494
+ args.bounds = [];
495
+ }
496
+ args.commonHandler = common;
497
+ return args;
498
+ }
499
+
500
+ function parseStructure(content, fArgs, locale) {
501
+ if (!content || !fArgs) {
502
+ return new TextSegment({content: ""});
503
+ }
504
+ var args = checkArguments(fArgs, true);
505
+ var segments = [new TextSegment(
506
+ {
507
+ content: content,
508
+ actual: content,
509
+ localGui: args.dir
510
+ })];
511
+ var parse = common.handle;
512
+ if (args.handler && typeof(args.handler) === "function") {
513
+ parse = args.handler.handle;
514
+ }
515
+ parse(content, segments, args, locale);
516
+ return segments;
517
+ }
518
+
519
+ function displayStructure(segments, fArgs, isHtml) {
520
+ var args = checkArguments(fArgs, false);
521
+ if (isHtml) {
522
+ return getResultWithHtml(segments, args);
523
+ }
524
+ else {
525
+ return getResultWithUcc(segments, args);
526
+ }
527
+ }
528
+
529
+ function getResultWithUcc(segments, args, isHtml) {
530
+ var result = "";
531
+ var checkedDir = "";
532
+ var prevDir = "";
533
+ var stop = false;
534
+ for (var i = 0; i < segments.length; i++) {
535
+ if (segments[i].isVisible) {
536
+ var dir = segments[i].textDirection;
537
+ var lDir = segments[i].localGui;
538
+ if (lDir !== "" && prevDir === "") {
539
+ result += (lDir === "rtl" ? misc.RLE : misc.LRE);
540
+ }
541
+ else if(prevDir !== "" && (lDir === "" || lDir !== prevDir || stop)) {
542
+ result += misc.PDF + (i == segments.length - 1 && lDir !== ""? "" : args.dir === "rtl" ? misc.RLM : misc.LRM);
543
+ if (lDir !== "") {
544
+ result += (lDir === "rtl" ? misc.RLE : misc.LRE);
545
+ }
546
+ }
547
+ if (dir === "auto") {
548
+ dir = misc.getDirection(segments[i].content, dir, args.guiDir);
549
+ }
550
+ if ((/^(rtl|ltr)$/i).test(dir)) {
551
+ result += (dir === "rtl" ? misc.RLE : misc.LRE) + segments[i].content + misc.PDF;
552
+ checkedDir = dir;
553
+ }
554
+ else {
555
+ result += segments[i].content;
556
+ checkedDir = misc.getDirection(segments[i].content, dir, args.guiDir, true);
557
+ }
558
+ if (i < segments.length - 1) {
559
+ var locDir = lDir && segments[i+1].localGui? lDir : args.dir;
560
+ result += locDir === "rtl" ? misc.RLM : misc.LRM;
561
+ }
562
+ else if(prevDir !== "") {
563
+ result += misc.PDF;
564
+ }
565
+ prevDir = lDir;
566
+ stop = false;
567
+ }
568
+ else {
569
+ stop = true;
570
+ }
571
+ }
572
+ var sttDir = args.dir === "auto" ? misc.getDirection(segments[0].actual, args.dir, args.guiDir) : args.dir;
573
+ if (sttDir !== args.guiDir) {
574
+ result = (sttDir === "rtl" ? misc.RLE : misc.LRE) + result + misc.PDF;
575
+ }
576
+ return result;
577
+ }
578
+
579
+ function getResultWithHtml(segments, args, isHtml) {
580
+ var result = "";
581
+ var checkedDir = "";
582
+ var prevDir = "";
583
+ for (var i = 0; i < segments.length; i++) {
584
+ if (segments[i].isVisible) {
585
+ var dir = segments[i].textDirection;
586
+ var lDir = segments[i].localGui;
587
+ if (lDir !== "" && prevDir === "") {
588
+ result += "<bdi dir='" + (lDir === "rtl" ? "rtl" : "ltr") + "'>";
589
+ }
590
+ else if(prevDir !== "" && (lDir === "" || lDir !== prevDir || stop)) {
591
+ result += "</bdi>" + (i == segments.length - 1 && lDir !== ""? "" : "<span style='unicode-bidi: embed; direction: " + (args.dir === "rtl" ? "rtl" : "ltr") + ";'></span>");
592
+ if (lDir !== "") {
593
+ result += "<bdi dir='" + (lDir === "rtl" ? "rtl" : "ltr") + "'>";
594
+ }
595
+ }
596
+
597
+ if (dir === "auto") {
598
+ dir = misc.getDirection(segments[i].content, dir, args.guiDir);
599
+ }
600
+ if ((/^(rtl|ltr)$/i).test(dir)) {
601
+ //result += "<span style='unicode-bidi: embed; direction: " + (dir === "rtl" ? "rtl" : "ltr") + ";'>" + segments[i].content + "</span>";
602
+ result += "<bdi dir='" + (dir === "rtl" ? "rtl" : "ltr") + "'>" + segments[i].content + "</bdi>";
603
+ checkedDir = dir;
604
+ }
605
+ else {
606
+ result += segments[i].content;
607
+ checkedDir = misc.getDirection(segments[i].content, dir, args.guiDir, true);
608
+ }
609
+ if (i < segments.length - 1) {
610
+ var locDir = lDir && segments[i+1].localGui? lDir : args.dir;
611
+ result += "<span style='unicode-bidi: embed; direction: " + (locDir === "rtl" ? "rtl" : "ltr") + ";'></span>";
612
+ }
613
+ else if(prevDir !== "") {
614
+ result += "</bdi>";
615
+ }
616
+ prevDir = lDir;
617
+ stop = false;
618
+ }
619
+ else {
620
+ stop = true;
621
+ }
622
+ }
623
+ var sttDir = args.dir === "auto" ? misc.getDirection(segments[0].actual, args.dir, args.guiDir) : args.dir;
624
+ if (sttDir !== args.guiDir) {
625
+ result = "<bdi dir='" + (sttDir === "rtl" ? "rtl" : "ltr") + "'>" + result + "</bdi>";
626
+ }
627
+ return result;
628
+ }
629
+
630
+ //TBD ?
631
+ function restore(text, isHtml) {
632
+ return text;
633
+ }
634
+
635
+ stt.parseAndDisplayStructure = parseAndDisplayStructure;
636
+ stt.parseStructure = parseStructure;
637
+ stt.displayStructure = displayStructure;
638
+ stt.restore = restore;
639
+
640
+ return stt;
641
+ })();
642
+
643
+ var breadcrumb = (function() {
644
+ return {
645
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
646
+ var fArgs =
647
+ {
648
+ guiDir: isRtl ? "rtl" : "ltr",
649
+ dir: args.dir ? args.dir : isRtl ? "rtl" : "ltr",
650
+ subs: {
651
+ content: ">",
652
+ continued: true,
653
+ subDir: isRtl ? "rtl" : "ltr"
654
+ },
655
+ cases: [{
656
+ args: {
657
+ subs: {
658
+ content: "<",
659
+ continued: true,
660
+ subDir: isRtl ? "ltr" : "rtl"
661
+ }
662
+ }
663
+ }]
664
+ };
665
+
666
+ if (!parseOnly) {
667
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
668
+ }
669
+ else {
670
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
671
+ }
672
+ }
673
+ };
674
+ })();
675
+
676
+ var comma = (function() {
677
+ return {
678
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
679
+ var fArgs =
680
+ {
681
+ guiDir: isRtl ? "rtl" : "ltr",
682
+ dir: "ltr",
683
+ points: ","
684
+ };
685
+ if (!parseOnly) {
686
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
687
+ }
688
+ else {
689
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
690
+ }
691
+ }
692
+ };
693
+ })();
694
+
695
+ var email = (function() {
696
+ function getDir(text, locale) {
697
+ if (misc.getLocaleDetails(locale).lang !== "ar") {
698
+ return "ltr";
699
+ }
700
+ var ind = text.indexOf("@");
701
+ if (ind > 0 && ind < text.length - 1) {
702
+ return misc.hasArabicChar(text.substring(ind + 1)) ? "rtl" : "ltr";
703
+ }
704
+ return "ltr";
705
+ }
706
+
707
+ return {
708
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
709
+ var fArgs =
710
+ {
711
+ guiDir: isRtl ? "rtl" : "ltr",
712
+ dir: getDir(text, locale),
713
+ points: "<>.:,;@",
714
+ cases: [{
715
+ handler: common,
716
+ args: {
717
+ bounds: [{
718
+ startAfter: "\"",
719
+ endBefore: "\""
720
+ },
721
+ {
722
+ startAfter: "(",
723
+ endBefore: ")"
724
+ }
725
+ ],
726
+ points: ""
727
+ }
728
+ }]
729
+ };
730
+ if (!parseOnly) {
731
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
732
+ }
733
+ else {
734
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
735
+ }
736
+ }
737
+ };
738
+ })();
739
+
740
+ var filepath = (function() {
741
+ return {
742
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
743
+ var fArgs =
744
+ {
745
+ guiDir: isRtl ? "rtl" : "ltr",
746
+ dir: "ltr",
747
+ points: "/\\:."
748
+ };
749
+ if (!parseOnly) {
750
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
751
+ }
752
+ else {
753
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
754
+ }
755
+ }
756
+ };
757
+ })();
758
+
759
+ var formula = (function() {
760
+ return {
761
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
762
+ var fArgs =
763
+ {
764
+ guiDir: isRtl ? "rtl" : "ltr",
765
+ dir: "ltr",
766
+ points: " /%^&[]<>=!?~:.,|()+-*{}",
767
+ };
768
+ if (!parseOnly) {
769
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
770
+ }
771
+ else {
772
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
773
+ }
774
+ }
775
+ };
776
+ })();
777
+
778
+
779
+ var sql = (function() {
780
+ return {
781
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
782
+ var fArgs =
783
+ {
784
+ guiDir: isRtl ? "rtl" : "ltr",
785
+ dir: "ltr",
786
+ points: "\t!#%&()*+,-./:;<=>?|[]{}",
787
+ cases: [{
788
+ handler: common,
789
+ args: {
790
+ bounds: [{
791
+ startAfter: "/*",
792
+ endBefore: "*/"
793
+ },
794
+ {
795
+ startAfter: "--",
796
+ end: "\n"
797
+ },
798
+ {
799
+ startAfter: "--"
800
+ }
801
+ ]
802
+ }
803
+ },
804
+ {
805
+ handler: common,
806
+ args: {
807
+ subs: {
808
+ content: " ",
809
+ continued: true
810
+ }
811
+ }
812
+ },
813
+ {
814
+ handler: common,
815
+ args: {
816
+ bounds: [{
817
+ startAfter: "'",
818
+ endBefore: "'"
819
+ },
820
+ {
821
+ startAfter: "\"",
822
+ endBefore: "\""
823
+ }
824
+ ]
825
+ }
826
+ }
827
+ ]
828
+ };
829
+ if (!parseOnly) {
830
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
831
+ }
832
+ else {
833
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
834
+ }
835
+ }
836
+ };
837
+ })();
838
+
839
+ var underscore = (function() {
840
+ return {
841
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
842
+ var fArgs =
843
+ {
844
+ guiDir: isRtl ? "rtl" : "ltr",
845
+ dir: "ltr",
846
+ points: "_"
847
+ };
848
+ if (!parseOnly) {
849
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
850
+ }
851
+ else {
852
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
853
+ }
854
+ }
855
+ };
856
+ })();
857
+
858
+ var url = (function() {
859
+ return {
860
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
861
+ var fArgs =
862
+ {
863
+ guiDir: isRtl ? "rtl" : "ltr",
864
+ dir: "ltr",
865
+ points: ":?#/@.[]="
866
+ };
867
+ if (!parseOnly) {
868
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
869
+ }
870
+ else {
871
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
872
+ }
873
+ }
874
+ };
875
+ })();
876
+
877
+ var word = (function() {
878
+ return {
879
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
880
+ var fArgs =
881
+ {
882
+ guiDir: isRtl ? "rtl" : "ltr",
883
+ dir: args.dir ? args.dir : isRtl ? "rtl" : "ltr",
884
+ points: " ,.!?;:",
885
+ };
886
+ if (!parseOnly) {
887
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
888
+ }
889
+ else {
890
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
891
+ }
892
+ }
893
+ };
894
+ })();
895
+
896
+ var xpath = (function() {
897
+ return {
898
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
899
+ var fArgs =
900
+ {
901
+ guiDir: isRtl ? "rtl" : "ltr",
902
+ dir: "ltr",
903
+ points: " /[]<>=!:@.|()+-*",
904
+ cases: [{
905
+ handler: common,
906
+ args: {
907
+ bounds: [{
908
+ startAfter: "\"",
909
+ endBefore: "\""
910
+ },
911
+ {
912
+ startAfter: "'",
913
+ endBefore: "'"
914
+ }
915
+ ],
916
+ points: ""
917
+ }
918
+ }
919
+ ]
920
+ };
921
+ if (!parseOnly) {
922
+ return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
923
+ }
924
+ else {
925
+ return stext.parseStructure(text, fArgs, !!isHtml, locale);
926
+ }
927
+ }
928
+ };
929
+ })();
930
+
931
+ var custom = (function() {
932
+ return {
933
+ format: function (text, args, isRtl, isHtml, locale, parseOnly) {
934
+ var hArgs = {};
935
+ var prop = "";
936
+ var sArgs = Array.isArray(args)? args[0] : args;
937
+ for (prop in sArgs) {
938
+ if (sArgs.hasOwnProperty(prop)) {
939
+ hArgs[prop] = sArgs[prop];
940
+ }
941
+ }
942
+ hArgs.guiDir = isRtl ? "rtl" : "ltr";
943
+ hArgs.dir = hArgs.dir ? hArgs.dir : hArgs.guiDir;
944
+ if (!parseOnly) {
945
+ return stext.parseAndDisplayStructure(text, hArgs, !!isHtml, locale);
946
+ }
947
+ else {
948
+ return stext.parseStructure(text, hArgs, !!isHtml, locale);
949
+ }
950
+ }
951
+ };
952
+ })();
953
+
954
+ var message = (function() {
955
+ var params = {msgLang: "en", msgDir: "", phLang: "", phDir: "", phPacking: ["{","}"], phStt: {type: "none", args: {}}, guiDir: ""};
956
+ var parametersChecked = false;
957
+
958
+ function getDirectionOfLanguage(lang) {
959
+ if (lang === "he" || lang === "iw" || lang === "ar") {
960
+ return "rtl";
961
+ }
962
+ return "ltr";
963
+ }
964
+
965
+ function checkParameters(obj) {
966
+ if (obj.msgDir.length === 0) {
967
+ obj.msgDir = getDirectionOfLanguage(obj.msgLang);
968
+ }
969
+ obj.msgDir = obj.msgDir !== "ltr" && obj.msgDir !== "rtl" && obj.msgDir != "auto"? "ltr" : obj.msgDir;
970
+ if (obj.guiDir.length === 0) {
971
+ obj.guiDir = obj.msgDir;
972
+ }
973
+ obj.guiDir = obj.guiDir !== "rtl"? "ltr" : "rtl";
974
+ if (obj.phDir.length === 0) {
975
+ obj.phDir = obj.phLang.length === 0? obj.msgDir : getDirectionOfLanguage(obj.phLang);
976
+ }
977
+ obj.phDir = obj.phDir !== "ltr" && obj.phDir !== "rtl" && obj.phDir != "auto"? "ltr" : obj.phDir;
978
+ if (typeof (obj.phPacking) === "string") {
979
+ obj.phPacking = obj.phPacking.split("");
980
+ }
981
+ if (obj.phPacking.length < 2) {
982
+ obj.phPacking = ["{","}"];
983
+ }
984
+ }
985
+
986
+ return {
987
+ setDefaults: function (args) {
988
+ for (var prop in args) {
989
+ if (params.hasOwnProperty(prop)) {
990
+ params[prop] = args[prop];
991
+ }
992
+ }
993
+ checkParameters(params);
994
+ parametersChecked = true;
995
+ },
996
+
997
+ format: function (text) {
998
+ if (!parametersChecked) {
999
+ checkParameters(params);
1000
+ parametersChecked = true;
1001
+ }
1002
+ var isHtml = false;
1003
+ var hasHtmlArg = false;
1004
+ var spLength = params.phPacking[0].length;
1005
+ var epLength = params.phPacking[1].length;
1006
+ if (arguments.length > 0) {
1007
+ var last = arguments[arguments.length-1];
1008
+ if (typeof (last) === "boolean") {
1009
+ isHtml = last;
1010
+ hasHtmlArg = true;
1011
+ }
1012
+ }
1013
+ //Message
1014
+ var re = new RegExp(params.phPacking[0] + "\\d+" + params.phPacking[1]);
1015
+ var m;
1016
+ var tSegments = [];
1017
+ var offset = 0;
1018
+ var txt = text;
1019
+ while ((m = re.exec(txt)) != null) {
1020
+ var lastIndex = txt.indexOf(m[0]) + m[0].length;
1021
+ if (lastIndex > m[0].length) {
1022
+ tSegments.push({text: txt.substring(0, lastIndex - m[0].length), ph: false});
1023
+ }
1024
+ tSegments.push({text: m[0], ph: true});
1025
+ offset += lastIndex;
1026
+ txt = txt.substring(lastIndex, txt.length);
1027
+ }
1028
+ if (offset < text.length) {
1029
+ tSegments.push({text: text.substring(offset, text.length), ph: false});
1030
+ }
1031
+ //Parameters
1032
+ var tArgs = [];
1033
+ for (var i = 1; i < arguments.length - (hasHtmlArg? 1 : 0); i++) {
1034
+ var arg = arguments[i];
1035
+ var checkArr = arg;
1036
+ var inLoop = false;
1037
+ var indArr = 0;
1038
+ if (Array.isArray(checkArr)) {
1039
+ arg = checkArr[0];
1040
+ if (typeof(arg) === "undefined") {
1041
+ continue;
1042
+ }
1043
+ inLoop = true;
1044
+ }
1045
+ do {
1046
+ if (typeof (arg) === "string") {
1047
+ tArgs.push({text: arg, dir: params.phDir, stt: params.stt});
1048
+ }
1049
+ else if(typeof (arg) === "boolean") {
1050
+ isHtml = arg;
1051
+ }
1052
+ else if(typeof (arg) === "object") {
1053
+ tArgs.push(arg);
1054
+ if (!arg.hasOwnProperty("text")) {
1055
+ tArgs[tArgs.length-1].text = "{???}";
1056
+ }
1057
+ if (!arg.hasOwnProperty("dir") || arg.dir.length === 0) {
1058
+ tArgs[tArgs.length-1].dir = params.phDir;
1059
+ }
1060
+ if (!arg.hasOwnProperty("stt") || (typeof (arg.stt) === "string" && arg.stt.length === 0) ||
1061
+ (typeof (arg.stt) === "object" && Object.keys(arg.stt).length === 0)) {
1062
+ tArgs[tArgs.length-1].stt = params.phStt;
1063
+ }
1064
+ }
1065
+ else {
1066
+ tArgs.push({text: "" + arg, dir: params.phDir, stt: params.phStt});
1067
+ }
1068
+ if (inLoop) {
1069
+ indArr++;
1070
+ if (indArr == checkArr.length) {
1071
+ inLoop = false;
1072
+ }
1073
+ else {
1074
+ arg = checkArr[indArr];
1075
+ }
1076
+ }
1077
+ } while(inLoop);
1078
+ }
1079
+ //Indexing
1080
+ var segments = [];
1081
+ for (i = 0; i < tSegments.length; i++) {
1082
+ var t = tSegments[i];
1083
+ if (!t.ph) {
1084
+ segments.push(new TextSegment({content: t.text, textDirection: params.msgDir}));
1085
+ }
1086
+ else {
1087
+ var ind = parseInt(t.text.substring(spLength, t.text.length - epLength));
1088
+ if (isNaN(ind) || ind >= tArgs.length) {
1089
+ segments.push(new TextSegment({content: t.text, textDirection: params.msgDir}));
1090
+ continue;
1091
+ }
1092
+ var sttType = "none";
1093
+ if (!tArgs[ind].stt) {
1094
+ tArgs[ind].stt = params.phStt;
1095
+ }
1096
+ if (tArgs[ind].stt) {
1097
+ if (typeof (tArgs[ind].stt) === "string") {
1098
+ sttType = tArgs[ind].stt;
1099
+ }
1100
+ else if(tArgs[ind].stt.hasOwnProperty("type")) {
1101
+ sttType = tArgs[ind].stt.type;
1102
+ }
1103
+ }
1104
+ if (sttType.toLowerCase() !== "none") {
1105
+ var sttSegs = getHandler(sttType).format(tArgs[ind].text, tArgs[ind].stt.args || {},
1106
+ params.msgDir === "rtl", false, params.msgLang, true);
1107
+ for (var j = 0; j < sttSegs.length; j++) {
1108
+ segments.push(sttSegs[j]);
1109
+ }
1110
+ segments.push(new TextSegment({isVisible: false}));
1111
+ }
1112
+ else {
1113
+ segments.push(new TextSegment({content: tArgs[ind].text, textDirection: (tArgs[ind].dir? tArgs[ind].dir : params.phDir)}));
1114
+ }
1115
+ }
1116
+ }
1117
+ var result = stext.displayStructure(segments, {guiDir: params.guiDir, dir: params.msgDir}, isHtml);
1118
+ return result;
1119
+ }
1120
+ };
1121
+ })();
1122
+
1123
+ var event = null;
1124
+
1125
+ function getHandler(type) {
1126
+ switch (type) {
1127
+ case "breadcrumb" :
1128
+ return breadcrumb;
1129
+ case "comma" :
1130
+ return comma;
1131
+ case "email" :
1132
+ return email;
1133
+ case "filepath" :
1134
+ return filepath;
1135
+ case "formula" :
1136
+ return formula;
1137
+ case "sql" :
1138
+ return sql;
1139
+ case "underscore" :
1140
+ return underscore;
1141
+ case "url" :
1142
+ return url;
1143
+ case "word" :
1144
+ return word;
1145
+ case "xpath" :
1146
+ return xpath;
1147
+ default:
1148
+ return custom;
1149
+ }
1150
+ }
1151
+
1152
+ function isInputEventSupported(element) {
1153
+ var agent = window.navigator.userAgent;
1154
+ if (agent.indexOf("MSIE") >=0 || agent.indexOf("Trident") >=0 || agent.indexOf("Edge") >=0) {
1155
+ return false;
1156
+ }
1157
+ var checked = document.createElement(element.tagName);
1158
+ checked.contentEditable = true;
1159
+ var isSupported = ("oninput" in checked);
1160
+ if (!isSupported) {
1161
+ checked.setAttribute('oninput', 'return;');
1162
+ isSupported = typeof checked['oninput'] == 'function';
1163
+ }
1164
+ checked = null;
1165
+ return isSupported;
1166
+ }
1167
+
1168
+ function attachElement(element, type, args, isRtl, locale) {
1169
+ //if (!element || element.nodeType != 1 || !element.isContentEditable)
1170
+ if (!element || element.nodeType != 1) {
1171
+ return false;
1172
+ }
1173
+ if (!event) {
1174
+ event = document.createEvent('Event');
1175
+ event.initEvent('TF', true, true);
1176
+ }
1177
+ element.setAttribute("data-tf-type", type);
1178
+ var sArgs = args === "undefined"? "{}" : JSON.stringify(Array.isArray(args)? args[0] : args);
1179
+ element.setAttribute("data-tf-args", sArgs);
1180
+ var dir = "ltr";
1181
+ if (isRtl === "undefined") {
1182
+ if (element.dir) {
1183
+ dir = element.dir;
1184
+ }
1185
+ else if(element.style && element.style.direction) {
1186
+ dir = element.style.direction;
1187
+ }
1188
+ isRtl = dir.toLowerCase() === "rtl";
1189
+ }
1190
+ element.setAttribute("data-tf-dir", isRtl);
1191
+ element.setAttribute("data-tf-locale", misc.getLocaleDetails(locale).lang);
1192
+ if (isInputEventSupported(element)) {
1193
+ var ehandler = element.oninput;
1194
+ element.oninput = function(event) {
1195
+ displayWithStructure(event.target);
1196
+ };
1197
+ }
1198
+ else {
1199
+ element.onkeyup = function(e) {
1200
+ displayWithStructure(e.target);
1201
+ element.dispatchEvent(event);
1202
+ };
1203
+ element.onmouseup = function(e) {
1204
+ displayWithStructure(e.target);
1205
+ element.dispatchEvent(event);
1206
+ };
1207
+ }
1208
+ displayWithStructure(element);
1209
+
1210
+ return true;
1211
+ }
1212
+
1213
+ function detachElement(element) {
1214
+ if (!element || element.nodeType != 1) {
1215
+ return;
1216
+ }
1217
+ element.removeAttribute("data-tf-type");
1218
+ element.removeAttribute("data-tf-args");
1219
+ element.removeAttribute("data-tf-dir");
1220
+ element.removeAttribute("data-tf-locale");
1221
+ element.innerHTML = element.textContent || "";
1222
+ }
1223
+
1224
+ function displayWithStructure(element) {
1225
+ var txt = element.textContent || "";
1226
+ var selection = document.getSelection();
1227
+ if (txt.length === 0 || !selection || selection.rangeCount <= 0) {
1228
+ element.dispatchEvent(event);
1229
+ return;
1230
+ }
1231
+
1232
+ var range = selection.getRangeAt(0);
1233
+ var tempRange = range.cloneRange(), startNode, startOffset;
1234
+ startNode = range.startContainer;
1235
+ startOffset = range.startOffset;
1236
+ var textOffset = 0;
1237
+ if (startNode.nodeType === 3) {
1238
+ textOffset += startOffset;
1239
+ }
1240
+ tempRange.setStart(element,0);
1241
+ tempRange.setEndBefore(startNode);
1242
+ var div = document.createElement('div');
1243
+ div.appendChild(tempRange.cloneContents());
1244
+ textOffset += div.textContent.length;
1245
+
1246
+ element.innerHTML = getHandler(element.getAttribute("data-tf-type")).
1247
+ format(txt, JSON.parse(element.getAttribute("data-tf-args")), (element.getAttribute("data-tf-dir") === "true"? true : false),
1248
+ true, element.getAttribute("data-tf-locale"));
1249
+ var parent = element;
1250
+ var node = element;
1251
+ var newOffset = 0;
1252
+ var inEnd = false;
1253
+ selection.removeAllRanges();
1254
+ range.setStart(element,0);
1255
+ range.setEnd(element,0);
1256
+ while (node) {
1257
+ if (node.nodeType === 3) {
1258
+ if (newOffset + node.nodeValue.length >= textOffset) {
1259
+ range.setStart(node, textOffset - newOffset);
1260
+ break;
1261
+ }
1262
+ else {
1263
+ newOffset += node.nodeValue.length;
1264
+ node = node.nextSibling;
1265
+ }
1266
+ }
1267
+ else if(node.hasChildNodes()) {
1268
+ parent = node;
1269
+ node = parent.firstChild;
1270
+ continue;
1271
+ }
1272
+ else {
1273
+ node = node.nextSibling;
1274
+ }
1275
+ while (!node) {
1276
+ if (parent === element) {
1277
+ inEnd = true;
1278
+ break;
1279
+ }
1280
+ node = parent.nextSibling;
1281
+ parent = parent.parentNode;
1282
+ }
1283
+ if (inEnd) {
1284
+ break;
1285
+ }
1286
+ }
1287
+
1288
+ selection.addRange(range);
1289
+ element.dispatchEvent(event);
1290
+ }
1291
+
1292
+ return {
1293
+ /*!
1294
+ * Returns the HTML representation of a given structured text
1295
+ * @param text - the structured text
1296
+ * @param type - could be one of filepath, url, email
1297
+ * @param args - pass additional arguments to the handler. generally null.
1298
+ * @param isRtl - indicates if the GUI is mirrored
1299
+ * @param locale - the browser locale
1300
+ */
1301
+ getHtml: function (text, type, args, isRtl, locale) {
1302
+ return getHandler(type).format(text, args, isRtl, true, locale);
1303
+ },
1304
+ /*!
1305
+ * Handle Structured text correct display for a given HTML element.
1306
+ * @param element - the element : should be of type div contenteditable=true
1307
+ * @param type - could be one of filepath, url, email
1308
+ * @param args - pass additional arguments to the handler. generally null.
1309
+ * @param isRtl - indicates if the GUI is mirrored
1310
+ * @param locale - the browser locale
1311
+ */
1312
+ attach: function (element, type, args, isRtl, locale) {
1313
+ return attachElement(element, type, args, isRtl, locale);
1314
+ }
1315
+ };
1316
+ })();