@verdocs/web-sdk 1.1.0 → 1.4.2

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 (420) hide show
  1. package/dist/cjs/Auth-adc80bd4.js +68 -0
  2. package/dist/cjs/{Transport-68c8b1f4.js → Token-1ec62bd3.js} +505 -178
  3. package/dist/cjs/buffer-es6-bc8199b1.js +2018 -0
  4. package/dist/cjs/{index-6fc067b7.js → index-589f3be8.js} +83 -366
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/popper-71bf3058.js +1790 -0
  7. package/dist/cjs/verdocs-auth.cjs.entry.js +12 -73
  8. package/dist/cjs/verdocs-button_2.cjs.entry.js +17 -10
  9. package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +36 -1819
  10. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +3 -3
  11. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +81 -0
  12. package/dist/cjs/verdocs-loader.cjs.entry.js +2 -2
  13. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +3 -3
  14. package/dist/cjs/verdocs-organization-card.cjs.entry.js +3 -3
  15. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +31 -0
  16. package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +228 -0
  17. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +20 -0
  18. package/dist/cjs/verdocs-search.cjs.entry.js +4 -4
  19. package/dist/cjs/verdocs-sign.cjs.entry.js +24 -29
  20. package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +4 -4
  21. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +7529 -0
  22. package/dist/cjs/verdocs-template-card.cjs.entry.js +3 -3
  23. package/dist/cjs/verdocs-template-tags.cjs.entry.js +3 -3
  24. package/dist/cjs/verdocs-toggle.cjs.entry.js +3 -3
  25. package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +3 -3
  26. package/dist/cjs/verdocs-web-sdk.cjs.js +3 -3
  27. package/dist/collection/collection-manifest.json +8 -9
  28. package/dist/collection/components/controls/verdocs-button/verdocs-button.css +110 -34
  29. package/dist/collection/components/controls/verdocs-button/verdocs-button.js +85 -13
  30. package/dist/collection/components/controls/verdocs-button/verdocs-button.stories.js +41 -2
  31. package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.css +7 -10
  32. package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js +1 -15
  33. package/dist/collection/components/controls/verdocs-loader/verdocs-loader.js +3 -0
  34. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.css +4 -6
  35. package/dist/collection/components/controls/verdocs-status-indicator/accepted-dark.svg +4 -0
  36. package/dist/collection/components/controls/verdocs-status-indicator/accepted-light.svg +4 -0
  37. package/dist/collection/components/controls/verdocs-status-indicator/arrowright.svg +3 -0
  38. package/dist/collection/components/controls/verdocs-status-indicator/canceled-dark.svg +3 -0
  39. package/dist/collection/components/controls/verdocs-status-indicator/canceled-light.svg +3 -0
  40. package/dist/collection/components/controls/verdocs-status-indicator/complete-dark.svg +3 -0
  41. package/dist/collection/components/controls/verdocs-status-indicator/complete-light.svg +3 -0
  42. package/dist/collection/components/controls/verdocs-status-indicator/declined-dark.svg +3 -0
  43. package/dist/collection/components/controls/verdocs-status-indicator/declined-light.svg +3 -0
  44. package/dist/collection/components/controls/verdocs-status-indicator/in-progress-dark.svg +3 -0
  45. package/dist/collection/components/controls/verdocs-status-indicator/in-progress-light.svg +3 -0
  46. package/dist/collection/components/controls/verdocs-status-indicator/opened-dark.svg +4 -0
  47. package/dist/collection/components/controls/verdocs-status-indicator/opened-light.svg +4 -0
  48. package/dist/collection/components/controls/verdocs-status-indicator/pending-dark.svg +3 -0
  49. package/dist/collection/components/controls/verdocs-status-indicator/pending-light.svg +3 -0
  50. package/dist/collection/components/controls/verdocs-status-indicator/recipient-flow.js +218 -0
  51. package/dist/collection/components/controls/verdocs-status-indicator/signed-dark.svg +4 -0
  52. package/dist/collection/components/controls/verdocs-status-indicator/signed-light.svg +4 -0
  53. package/dist/collection/components/controls/verdocs-status-indicator/some-signed-dark.svg +3 -0
  54. package/dist/collection/components/controls/verdocs-status-indicator/some-signed-light.svg +3 -0
  55. package/dist/collection/components/controls/verdocs-status-indicator/submitted-dark.svg +3 -0
  56. package/dist/collection/components/controls/verdocs-status-indicator/submitted-light.svg +3 -0
  57. package/dist/collection/components/controls/verdocs-status-indicator/verdocs-status-indicator.css +48 -0
  58. package/dist/collection/components/controls/verdocs-status-indicator/verdocs-status-indicator.js +344 -0
  59. package/dist/collection/components/controls/verdocs-status-indicator/verdocs-status-indicator.stories.js +69 -0
  60. package/dist/collection/components/controls/verdocs-template-card/verdocs-template-card.css +5 -7
  61. package/dist/collection/components/controls/verdocs-template-tags/verdocs-template-tags.css +5 -7
  62. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.css +4 -6
  63. package/dist/collection/components/controls/verdocs-toggle/verdocs-toggle.css +4 -6
  64. package/dist/collection/components/controls/verdocs-toggle/verdocs-toggle.stories.js +1 -1
  65. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.css +3 -4
  66. package/dist/collection/components/dialogs/verdocs-kba-dialog/question.svg +4 -0
  67. package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.css +95 -0
  68. package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.js +292 -0
  69. package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.stories.js +36 -0
  70. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +3 -4
  71. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.css +5 -6
  72. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +2 -2
  73. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +3 -4
  74. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.css +2 -4
  75. package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.stories.js +1 -1
  76. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.css +1 -3
  77. package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.stories.js +1 -1
  78. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.css +1 -3
  79. package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.stories.js +1 -1
  80. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.css +1 -3
  81. package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.stories.js +1 -1
  82. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.css +1 -3
  83. package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.stories.js +1 -1
  84. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.css +1 -3
  85. package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.stories.js +1 -1
  86. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +1 -3
  87. package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.stories.js +1 -1
  88. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.css +1 -3
  89. package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.stories.js +1 -1
  90. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.css +1 -3
  91. package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.stories.js +1 -1
  92. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.css +1 -3
  93. package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.stories.js +1 -1
  94. package/dist/collection/components/elements/{search-quick-functions → verdocs-quick-functions}/document-icon.svg +0 -0
  95. package/dist/collection/components/elements/{search-quick-functions → verdocs-quick-functions}/template-icon.svg +0 -0
  96. package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.css → verdocs-quick-functions/verdocs-quick-functions.css} +6 -8
  97. package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.js → verdocs-quick-functions/verdocs-quick-functions.js} +9 -10
  98. package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.stories.js → verdocs-quick-functions/verdocs-quick-functions.stories.js} +3 -3
  99. package/dist/collection/components/elements/{search-starred → verdocs-search-activity}/document-icon.svg +0 -0
  100. package/dist/collection/components/elements/{search-starred/search-starred.css → verdocs-search-activity/verdocs-search-activity.css} +13 -15
  101. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +168 -0
  102. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.stories.js +14 -0
  103. package/dist/collection/components/elements/{search-box → verdocs-search-box}/close.svg +0 -0
  104. package/dist/collection/components/elements/{search-box → verdocs-search-box}/search.svg +0 -0
  105. package/dist/collection/components/elements/{search-box/search-box.css → verdocs-search-box/verdocs-search-box.css} +10 -12
  106. package/dist/collection/components/elements/{search-box/search-box.js → verdocs-search-box/verdocs-search-box.js} +14 -15
  107. package/dist/collection/components/elements/{search-box/search-box.stories.js → verdocs-search-box/verdocs-search-box.stories.js} +3 -3
  108. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.css +4 -0
  109. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +19 -0
  110. package/dist/collection/components/elements/{search-tabs/search-tabs.stories.js → verdocs-search-tabs/verdocs-search-tabs.stories.js} +3 -3
  111. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +3 -5
  112. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +2 -2
  113. package/dist/collection/components/embeds/verdocs-search/verdocs-search.css +2 -4
  114. package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +4 -4
  115. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +2 -3
  116. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +3 -6
  117. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -2
  118. package/dist/collection/components/embeds/verdocs-view/verdocs-view.css +1 -3
  119. package/dist/components/Auth.js +64 -0
  120. package/dist/{esm/Transport-797d3c59.js → components/Token.js} +504 -178
  121. package/dist/{cjs/buffer-es6-ce0cdd81.js → components/buffer-es6.js} +38 -2
  122. package/dist/components/index.d.ts +53 -0
  123. package/dist/components/index.js +33 -0
  124. package/dist/components/popper.js +1788 -0
  125. package/dist/components/verdocs-auth.d.ts +11 -0
  126. package/dist/components/verdocs-auth.js +156 -0
  127. package/dist/components/verdocs-button.d.ts +11 -0
  128. package/dist/components/verdocs-button.js +6 -0
  129. package/dist/components/verdocs-button2.js +68 -0
  130. package/dist/components/verdocs-dropdown.d.ts +11 -0
  131. package/dist/components/verdocs-dropdown.js +6 -0
  132. package/dist/components/verdocs-dropdown2.js +94 -0
  133. package/dist/components/verdocs-field-attachment.d.ts +11 -0
  134. package/dist/components/verdocs-field-attachment.js +6 -0
  135. package/dist/components/verdocs-field-attachment2.js +88 -0
  136. package/dist/components/verdocs-field-checkbox.d.ts +11 -0
  137. package/dist/components/verdocs-field-checkbox.js +6 -0
  138. package/dist/components/verdocs-field-checkbox2.js +55 -0
  139. package/dist/components/verdocs-field-date.d.ts +11 -0
  140. package/dist/components/verdocs-field-date.js +6 -0
  141. package/dist/components/verdocs-field-date2.js +2775 -0
  142. package/dist/components/verdocs-field-dropdown.d.ts +11 -0
  143. package/dist/components/verdocs-field-dropdown.js +6 -0
  144. package/dist/components/verdocs-field-dropdown2.js +78 -0
  145. package/dist/components/verdocs-field-initial.d.ts +11 -0
  146. package/dist/components/verdocs-field-initial.js +6 -0
  147. package/dist/components/verdocs-field-initial2.js +86 -0
  148. package/dist/components/verdocs-field-payment.d.ts +11 -0
  149. package/dist/components/verdocs-field-payment.js +6 -0
  150. package/dist/components/verdocs-field-payment2.js +114 -0
  151. package/dist/components/verdocs-field-radio-button.d.ts +11 -0
  152. package/dist/components/verdocs-field-radio-button.js +6 -0
  153. package/dist/components/verdocs-field-radio-button2.js +66 -0
  154. package/dist/components/verdocs-field-signature.d.ts +11 -0
  155. package/dist/components/verdocs-field-signature.js +6 -0
  156. package/dist/components/verdocs-field-signature2.js +86 -0
  157. package/dist/components/verdocs-field-textarea.d.ts +11 -0
  158. package/dist/components/verdocs-field-textarea.js +6 -0
  159. package/dist/components/verdocs-field-textarea2.js +82 -0
  160. package/dist/components/verdocs-field-textbox.d.ts +11 -0
  161. package/dist/components/verdocs-field-textbox.js +6 -0
  162. package/dist/components/verdocs-field-textbox2.js +82 -0
  163. package/dist/components/verdocs-initial-dialog.d.ts +11 -0
  164. package/dist/components/verdocs-initial-dialog.js +6 -0
  165. package/dist/components/verdocs-initial-dialog2.js +272 -0
  166. package/dist/components/verdocs-kba-dialog.d.ts +11 -0
  167. package/dist/components/verdocs-kba-dialog.js +112 -0
  168. package/dist/components/verdocs-loader.d.ts +11 -0
  169. package/dist/components/verdocs-loader.js +6 -0
  170. package/dist/components/verdocs-loader2.js +30 -0
  171. package/dist/components/verdocs-ok-dialog.d.ts +11 -0
  172. package/dist/components/verdocs-ok-dialog.js +6 -0
  173. package/dist/components/verdocs-ok-dialog2.js +70 -0
  174. package/dist/components/verdocs-organization-card.d.ts +11 -0
  175. package/dist/components/verdocs-organization-card.js +38 -0
  176. package/dist/components/verdocs-quick-functions.d.ts +11 -0
  177. package/dist/components/verdocs-quick-functions.js +45 -0
  178. package/dist/components/verdocs-search-activity.d.ts +11 -0
  179. package/dist/components/verdocs-search-activity.js +6 -0
  180. package/dist/components/verdocs-search-activity2.js +193 -0
  181. package/dist/components/verdocs-search-box.d.ts +11 -0
  182. package/dist/components/verdocs-search-box.js +6 -0
  183. package/dist/components/verdocs-search-box2.js +75 -0
  184. package/dist/components/verdocs-search-tabs.d.ts +11 -0
  185. package/dist/components/verdocs-search-tabs.js +36 -0
  186. package/dist/components/verdocs-search.d.ts +11 -0
  187. package/dist/components/verdocs-search.js +45 -0
  188. package/dist/components/verdocs-sign.d.ts +11 -0
  189. package/dist/components/verdocs-sign.js +628 -0
  190. package/dist/components/verdocs-signature-dialog.d.ts +11 -0
  191. package/dist/components/verdocs-signature-dialog.js +6 -0
  192. package/dist/components/verdocs-signature-dialog2.js +268 -0
  193. package/dist/components/verdocs-status-indicator.d.ts +11 -0
  194. package/dist/components/verdocs-status-indicator.js +7550 -0
  195. package/dist/components/verdocs-template-card.d.ts +11 -0
  196. package/dist/components/verdocs-template-card.js +54 -0
  197. package/dist/components/verdocs-template-tags.d.ts +11 -0
  198. package/dist/components/verdocs-template-tags.js +36 -0
  199. package/dist/components/verdocs-text-input.d.ts +11 -0
  200. package/dist/components/verdocs-text-input.js +6 -0
  201. package/dist/components/verdocs-text-input2.js +81 -0
  202. package/dist/components/verdocs-toggle.d.ts +11 -0
  203. package/dist/components/verdocs-toggle.js +53 -0
  204. package/dist/components/verdocs-upload-dialog.d.ts +11 -0
  205. package/dist/components/verdocs-upload-dialog.js +6 -0
  206. package/dist/components/verdocs-upload-dialog2.js +144 -0
  207. package/dist/components/verdocs-view.d.ts +11 -0
  208. package/dist/components/verdocs-view.js +6 -0
  209. package/dist/{custom-elements/index.js → components/verdocs-view2.js} +30 -11055
  210. package/dist/docs.d.ts +3 -0
  211. package/dist/docs.json +1341 -1084
  212. package/dist/esm/Auth-ff6040be.js +64 -0
  213. package/dist/esm/Token-a587e3ad.js +2325 -0
  214. package/dist/esm/{buffer-es6-681a33da.js → buffer-es6-136673c8.js} +39 -1
  215. package/dist/esm/{index-80d1b936.js → index-859bc689.js} +83 -367
  216. package/dist/esm/loader.js +3 -3
  217. package/dist/esm/polyfills/css-shim.js +1 -1
  218. package/dist/esm/popper-93ecb064.js +1788 -0
  219. package/dist/esm/verdocs-auth.entry.js +7 -68
  220. package/dist/esm/verdocs-button_2.entry.js +17 -10
  221. package/dist/esm/verdocs-dropdown_12.entry.js +28 -1811
  222. package/dist/esm/verdocs-initial-dialog.entry.js +3 -3
  223. package/dist/esm/verdocs-kba-dialog.entry.js +77 -0
  224. package/dist/esm/verdocs-loader.entry.js +2 -2
  225. package/dist/esm/verdocs-ok-dialog.entry.js +3 -3
  226. package/dist/esm/verdocs-organization-card.entry.js +3 -3
  227. package/dist/esm/verdocs-quick-functions.entry.js +27 -0
  228. package/dist/esm/verdocs-search-activity_2.entry.js +223 -0
  229. package/dist/esm/verdocs-search-tabs.entry.js +16 -0
  230. package/dist/esm/verdocs-search.entry.js +4 -4
  231. package/dist/esm/verdocs-sign.entry.js +16 -21
  232. package/dist/esm/verdocs-signature-dialog.entry.js +4 -4
  233. package/dist/esm/verdocs-status-indicator.entry.js +7525 -0
  234. package/dist/esm/verdocs-template-card.entry.js +3 -3
  235. package/dist/esm/verdocs-template-tags.entry.js +3 -3
  236. package/dist/esm/verdocs-toggle.entry.js +3 -3
  237. package/dist/esm/verdocs-upload-dialog.entry.js +3 -3
  238. package/dist/esm/verdocs-web-sdk.js +3 -3
  239. package/dist/esm-es5/Auth-ff6040be.js +1 -0
  240. package/dist/esm-es5/Token-a587e3ad.js +1 -0
  241. package/dist/esm-es5/{buffer-es6-681a33da.js → buffer-es6-136673c8.js} +2 -2
  242. package/dist/esm-es5/index-859bc689.js +2 -0
  243. package/dist/esm-es5/loader.js +1 -1
  244. package/dist/esm-es5/popper-93ecb064.js +1 -0
  245. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  246. package/dist/esm-es5/verdocs-button_2.entry.js +1 -1
  247. package/dist/esm-es5/verdocs-dropdown_12.entry.js +2 -2
  248. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
  249. package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -0
  250. package/dist/esm-es5/verdocs-loader.entry.js +1 -1
  251. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  252. package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
  253. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -0
  254. package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -0
  255. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -0
  256. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  257. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  258. package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
  259. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -0
  260. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  261. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  262. package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
  263. package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
  264. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  265. package/dist/types/components/controls/verdocs-button/verdocs-button.d.ts +26 -6
  266. package/dist/types/components/controls/verdocs-button/verdocs-button.stories.d.ts +4 -1
  267. package/dist/types/components/controls/verdocs-dropdown/verdocs-dropdown.d.ts +0 -14
  268. package/dist/types/components/controls/verdocs-loader/verdocs-loader.d.ts +3 -0
  269. package/dist/types/components/controls/verdocs-status-indicator/recipient-flow.d.ts +4 -0
  270. package/dist/types/components/controls/verdocs-status-indicator/verdocs-status-indicator.d.ts +42 -0
  271. package/dist/types/components/controls/{verdocs-document-status/verdocs-document-status.stories.d.ts → verdocs-status-indicator/verdocs-status-indicator.stories.d.ts} +4 -1
  272. package/dist/types/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.d.ts +57 -0
  273. package/dist/types/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.stories.d.ts +15 -0
  274. package/dist/types/components/elements/{search-quick-functions/search-quick-functions.d.ts → verdocs-quick-functions/verdocs-quick-functions.d.ts} +1 -1
  275. package/dist/types/components/elements/{search-quick-functions/search-quick-functions.stories.d.ts → verdocs-quick-functions/verdocs-quick-functions.stories.d.ts} +0 -0
  276. package/dist/types/components/elements/{search-starred/search-starred.d.ts → verdocs-search-activity/verdocs-search-activity.d.ts} +10 -3
  277. package/dist/types/components/elements/{search-starred/search-starred.stories.d.ts → verdocs-search-activity/verdocs-search-activity.stories.d.ts} +2 -2
  278. package/dist/types/components/elements/{search-box/search-box.d.ts → verdocs-search-box/verdocs-search-box.d.ts} +1 -1
  279. package/dist/types/components/elements/{search-box/search-box.stories.d.ts → verdocs-search-box/verdocs-search-box.stories.d.ts} +0 -0
  280. package/dist/types/components/elements/{search-tabs/search-tabs.d.ts → verdocs-search-tabs/verdocs-search-tabs.d.ts} +1 -1
  281. package/dist/types/components/elements/{search-tabs/search-tabs.stories.d.ts → verdocs-search-tabs/verdocs-search-tabs.stories.d.ts} +0 -0
  282. package/dist/types/components.d.ts +407 -222
  283. package/dist/verdocs-web-sdk/p-0353c423.entry.js +1 -0
  284. package/dist/verdocs-web-sdk/p-11bc03a5.js +1 -0
  285. package/dist/verdocs-web-sdk/{p-993a0a23.system.entry.js → p-144e0842.system.entry.js} +1 -1
  286. package/dist/verdocs-web-sdk/p-15b7ed4d.entry.js +1 -0
  287. package/dist/verdocs-web-sdk/{p-d299cd16.system.entry.js → p-1f55d8ac.system.entry.js} +1 -1
  288. package/dist/verdocs-web-sdk/p-2bc58746.js +2 -0
  289. package/dist/verdocs-web-sdk/p-34bb9854.system.entry.js +1 -0
  290. package/dist/verdocs-web-sdk/p-3d1eb63d.system.entry.js +1 -0
  291. package/dist/verdocs-web-sdk/p-3f437456.system.entry.js +1 -0
  292. package/dist/verdocs-web-sdk/p-432c3151.system.entry.js +1 -0
  293. package/dist/verdocs-web-sdk/p-466cf9bf.system.entry.js +1 -0
  294. package/dist/verdocs-web-sdk/p-4c66f794.js +1 -0
  295. package/dist/verdocs-web-sdk/p-5dfd73f9.system.js +7 -0
  296. package/dist/verdocs-web-sdk/p-6348272c.js +1 -0
  297. package/dist/verdocs-web-sdk/p-6393b2b4.entry.js +1 -0
  298. package/dist/verdocs-web-sdk/p-66b19637.entry.js +1 -0
  299. package/dist/verdocs-web-sdk/p-6802ef91.system.entry.js +1 -0
  300. package/dist/verdocs-web-sdk/p-6ac9e6f8.entry.js +1 -0
  301. package/dist/verdocs-web-sdk/p-6d65d54e.system.entry.js +1 -0
  302. package/dist/verdocs-web-sdk/p-6fa6fb3c.entry.js +1 -0
  303. package/dist/verdocs-web-sdk/p-829b235c.entry.js +1 -0
  304. package/dist/verdocs-web-sdk/p-8795dbe8.entry.js +1 -0
  305. package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -0
  306. package/dist/verdocs-web-sdk/p-8c6db319.entry.js +1 -0
  307. package/dist/verdocs-web-sdk/p-8c6e29a5.entry.js +1 -0
  308. package/dist/verdocs-web-sdk/p-92632d8e.system.entry.js +1 -0
  309. package/dist/verdocs-web-sdk/p-96c0bf40.system.js +1 -0
  310. package/dist/verdocs-web-sdk/p-98d72550.system.entry.js +23 -0
  311. package/dist/verdocs-web-sdk/p-9b34c794.entry.js +1 -0
  312. package/dist/verdocs-web-sdk/p-9fbb3fc2.entry.js +1 -0
  313. package/dist/verdocs-web-sdk/p-a1fcf0c4.entry.js +23 -0
  314. package/dist/verdocs-web-sdk/p-b1cd24f7.entry.js +1 -0
  315. package/dist/verdocs-web-sdk/p-bf2620cb.entry.js +1 -0
  316. package/dist/verdocs-web-sdk/p-c2f97ef9.system.entry.js +1 -0
  317. package/dist/verdocs-web-sdk/p-caed7818.system.js +2 -0
  318. package/dist/verdocs-web-sdk/p-cc127684.system.entry.js +1 -0
  319. package/dist/verdocs-web-sdk/p-cd6d1fe5.system.entry.js +1 -0
  320. package/dist/verdocs-web-sdk/p-d6206c17.system.entry.js +1 -0
  321. package/dist/verdocs-web-sdk/p-da667373.entry.js +1 -0
  322. package/dist/verdocs-web-sdk/p-e2e643c5.system.entry.js +1 -0
  323. package/dist/verdocs-web-sdk/p-e3659c64.system.js +1 -0
  324. package/dist/verdocs-web-sdk/p-e609b2ee.system.js +1 -0
  325. package/dist/verdocs-web-sdk/p-e719f9ca.system.entry.js +1 -0
  326. package/dist/verdocs-web-sdk/p-ed5baeb4.entry.js +1 -0
  327. package/dist/verdocs-web-sdk/p-ef932a87.js +1 -0
  328. package/dist/verdocs-web-sdk/p-f0d0f959.system.entry.js +1 -0
  329. package/dist/verdocs-web-sdk/p-f7e26fbd.entry.js +1 -0
  330. package/dist/verdocs-web-sdk/p-f814d5cc.system.entry.js +1 -0
  331. package/dist/verdocs-web-sdk/p-f9d431ef.entry.js +1 -0
  332. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  333. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +2 -1
  334. package/package.json +34 -34
  335. package/dist/cjs/Token-65a1dc17.js +0 -71
  336. package/dist/cjs/index-4bf5cc66.js +0 -46
  337. package/dist/cjs/search-box_5.cjs.entry.js +0 -283
  338. package/dist/cjs/search-tabs.cjs.entry.js +0 -20
  339. package/dist/cjs/verdocs-document-status.cjs.entry.js +0 -54
  340. package/dist/collection/components/controls/verdocs-document-status/check.svg +0 -3
  341. package/dist/collection/components/controls/verdocs-document-status/pending.svg +0 -1
  342. package/dist/collection/components/controls/verdocs-document-status/stop.svg +0 -1
  343. package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.css +0 -18
  344. package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.js +0 -70
  345. package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.stories.js +0 -15
  346. package/dist/collection/components/controls/verdocs-document-status/x.svg +0 -1
  347. package/dist/collection/components/elements/search-recent/search-icon.svg +0 -1
  348. package/dist/collection/components/elements/search-recent/search-recent.css +0 -65
  349. package/dist/collection/components/elements/search-recent/search-recent.js +0 -98
  350. package/dist/collection/components/elements/search-recent/search-recent.stories.js +0 -12
  351. package/dist/collection/components/elements/search-saved/search-icon.svg +0 -1
  352. package/dist/collection/components/elements/search-saved/search-saved.css +0 -56
  353. package/dist/collection/components/elements/search-saved/search-saved.js +0 -98
  354. package/dist/collection/components/elements/search-saved/search-saved.stories.js +0 -12
  355. package/dist/collection/components/elements/search-starred/search-starred.js +0 -114
  356. package/dist/collection/components/elements/search-starred/search-starred.stories.js +0 -35
  357. package/dist/collection/components/elements/search-tabs/search-tabs.css +0 -3
  358. package/dist/collection/components/elements/search-tabs/search-tabs.js +0 -20
  359. package/dist/custom-elements/index.d.ts +0 -237
  360. package/dist/custom-elements.json +0 -727
  361. package/dist/esm/Token-a058076d.js +0 -69
  362. package/dist/esm/index-2b1938ea.js +0 -39
  363. package/dist/esm/search-box_5.entry.js +0 -275
  364. package/dist/esm/search-tabs.entry.js +0 -16
  365. package/dist/esm/verdocs-document-status.entry.js +0 -50
  366. package/dist/esm-es5/Token-a058076d.js +0 -1
  367. package/dist/esm-es5/Transport-797d3c59.js +0 -1
  368. package/dist/esm-es5/index-2b1938ea.js +0 -1
  369. package/dist/esm-es5/index-80d1b936.js +0 -1
  370. package/dist/esm-es5/search-box_5.entry.js +0 -1
  371. package/dist/esm-es5/search-tabs.entry.js +0 -1
  372. package/dist/esm-es5/verdocs-document-status.entry.js +0 -1
  373. package/dist/types/components/controls/verdocs-document-status/verdocs-document-status.d.ts +0 -11
  374. package/dist/types/components/elements/search-recent/search-recent.d.ts +0 -25
  375. package/dist/types/components/elements/search-recent/search-recent.stories.d.ts +0 -7
  376. package/dist/types/components/elements/search-saved/search-saved.d.ts +0 -25
  377. package/dist/types/components/elements/search-saved/search-saved.stories.d.ts +0 -7
  378. package/dist/verdocs-web-sdk/p-0956a3bc.system.entry.js +0 -1
  379. package/dist/verdocs-web-sdk/p-24236b87.entry.js +0 -1
  380. package/dist/verdocs-web-sdk/p-29abe078.js +0 -1
  381. package/dist/verdocs-web-sdk/p-2ded0974.entry.js +0 -1
  382. package/dist/verdocs-web-sdk/p-30d908ea.entry.js +0 -1
  383. package/dist/verdocs-web-sdk/p-37b07203.system.js +0 -1
  384. package/dist/verdocs-web-sdk/p-3a102b59.entry.js +0 -1
  385. package/dist/verdocs-web-sdk/p-3b2cd409.system.entry.js +0 -1
  386. package/dist/verdocs-web-sdk/p-3c70c740.system.js +0 -1
  387. package/dist/verdocs-web-sdk/p-403cb7cf.js +0 -1
  388. package/dist/verdocs-web-sdk/p-4a538cbc.js +0 -1
  389. package/dist/verdocs-web-sdk/p-5a6041c0.entry.js +0 -1
  390. package/dist/verdocs-web-sdk/p-62ec194f.js +0 -1
  391. package/dist/verdocs-web-sdk/p-6327fd83.entry.js +0 -1
  392. package/dist/verdocs-web-sdk/p-7f9a96d5.system.entry.js +0 -1
  393. package/dist/verdocs-web-sdk/p-80c7bc0c.system.entry.js +0 -1
  394. package/dist/verdocs-web-sdk/p-81b15287.system.entry.js +0 -1
  395. package/dist/verdocs-web-sdk/p-82f4cb67.system.entry.js +0 -1
  396. package/dist/verdocs-web-sdk/p-83dbc583.entry.js +0 -1
  397. package/dist/verdocs-web-sdk/p-853e30f2.system.entry.js +0 -1
  398. package/dist/verdocs-web-sdk/p-8739595c.system.js +0 -1
  399. package/dist/verdocs-web-sdk/p-89f5fc2b.entry.js +0 -1
  400. package/dist/verdocs-web-sdk/p-94d6f88f.system.entry.js +0 -1
  401. package/dist/verdocs-web-sdk/p-9a896baf.system.entry.js +0 -1
  402. package/dist/verdocs-web-sdk/p-a415926b.system.entry.js +0 -1
  403. package/dist/verdocs-web-sdk/p-a4fc6ad9.entry.js +0 -1
  404. package/dist/verdocs-web-sdk/p-a73a1ff8.system.entry.js +0 -1
  405. package/dist/verdocs-web-sdk/p-aec93cc9.entry.js +0 -1
  406. package/dist/verdocs-web-sdk/p-b07ae79f.entry.js +0 -1
  407. package/dist/verdocs-web-sdk/p-b13ee3be.entry.js +0 -1
  408. package/dist/verdocs-web-sdk/p-ba8a7e2d.system.entry.js +0 -1
  409. package/dist/verdocs-web-sdk/p-bdfa7db9.system.entry.js +0 -23
  410. package/dist/verdocs-web-sdk/p-cdae8dba.entry.js +0 -1
  411. package/dist/verdocs-web-sdk/p-cec7e9ea.js +0 -1
  412. package/dist/verdocs-web-sdk/p-d03d748c.entry.js +0 -1
  413. package/dist/verdocs-web-sdk/p-d82dc646.system.entry.js +0 -1
  414. package/dist/verdocs-web-sdk/p-d9474f48.system.js +0 -7
  415. package/dist/verdocs-web-sdk/p-eaffa4b1.entry.js +0 -1
  416. package/dist/verdocs-web-sdk/p-ee14709c.system.js +0 -1
  417. package/dist/verdocs-web-sdk/p-f4786f62.entry.js +0 -23
  418. package/dist/verdocs-web-sdk/p-fae1351f.system.entry.js +0 -1
  419. package/dist/verdocs-web-sdk/p-fc3d921f.system.js +0 -1
  420. package/dist/verdocs-web-sdk/p-fcfe34db.entry.js +0 -1
@@ -0,0 +1,2018 @@
1
+ 'use strict';
2
+
3
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
+
5
+ function getDefaultExportFromCjs (x) {
6
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+ }
8
+
9
+ function createCommonjsModule(fn, basedir, module) {
10
+ return module = {
11
+ path: basedir,
12
+ exports: {},
13
+ require: function (path, base) {
14
+ return commonjsRequire();
15
+ }
16
+ }, fn(module, module.exports), module.exports;
17
+ }
18
+
19
+ function getAugmentedNamespace(n) {
20
+ if (n.__esModule) return n;
21
+ var a = Object.defineProperty({}, '__esModule', {value: true});
22
+ Object.keys(n).forEach(function (k) {
23
+ var d = Object.getOwnPropertyDescriptor(n, k);
24
+ Object.defineProperty(a, k, d.get ? d : {
25
+ enumerable: true,
26
+ get: function () {
27
+ return n[k];
28
+ }
29
+ });
30
+ });
31
+ return a;
32
+ }
33
+
34
+ function commonjsRequire () {
35
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
36
+ }
37
+
38
+ // for now just expose the builtin process global from node.js
39
+ var process_1 = commonjsGlobal.process;
40
+
41
+ const global$1 = (typeof global !== "undefined" ? global :
42
+ typeof self !== "undefined" ? self :
43
+ typeof window !== "undefined" ? window : {});
44
+
45
+ var lookup = [];
46
+ var revLookup = [];
47
+ var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
48
+ var inited = false;
49
+ function init () {
50
+ inited = true;
51
+ var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
52
+ for (var i = 0, len = code.length; i < len; ++i) {
53
+ lookup[i] = code[i];
54
+ revLookup[code.charCodeAt(i)] = i;
55
+ }
56
+
57
+ revLookup['-'.charCodeAt(0)] = 62;
58
+ revLookup['_'.charCodeAt(0)] = 63;
59
+ }
60
+
61
+ function toByteArray (b64) {
62
+ if (!inited) {
63
+ init();
64
+ }
65
+ var i, j, l, tmp, placeHolders, arr;
66
+ var len = b64.length;
67
+
68
+ if (len % 4 > 0) {
69
+ throw new Error('Invalid string. Length must be a multiple of 4')
70
+ }
71
+
72
+ // the number of equal signs (place holders)
73
+ // if there are two placeholders, than the two characters before it
74
+ // represent one byte
75
+ // if there is only one, then the three characters before it represent 2 bytes
76
+ // this is just a cheap hack to not do indexOf twice
77
+ placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
78
+
79
+ // base64 is 4/3 + up to two characters of the original data
80
+ arr = new Arr(len * 3 / 4 - placeHolders);
81
+
82
+ // if there are placeholders, only get up to the last complete 4 chars
83
+ l = placeHolders > 0 ? len - 4 : len;
84
+
85
+ var L = 0;
86
+
87
+ for (i = 0, j = 0; i < l; i += 4, j += 3) {
88
+ tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)];
89
+ arr[L++] = (tmp >> 16) & 0xFF;
90
+ arr[L++] = (tmp >> 8) & 0xFF;
91
+ arr[L++] = tmp & 0xFF;
92
+ }
93
+
94
+ if (placeHolders === 2) {
95
+ tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);
96
+ arr[L++] = tmp & 0xFF;
97
+ } else if (placeHolders === 1) {
98
+ tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2);
99
+ arr[L++] = (tmp >> 8) & 0xFF;
100
+ arr[L++] = tmp & 0xFF;
101
+ }
102
+
103
+ return arr
104
+ }
105
+
106
+ function tripletToBase64 (num) {
107
+ return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
108
+ }
109
+
110
+ function encodeChunk (uint8, start, end) {
111
+ var tmp;
112
+ var output = [];
113
+ for (var i = start; i < end; i += 3) {
114
+ tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
115
+ output.push(tripletToBase64(tmp));
116
+ }
117
+ return output.join('')
118
+ }
119
+
120
+ function fromByteArray (uint8) {
121
+ if (!inited) {
122
+ init();
123
+ }
124
+ var tmp;
125
+ var len = uint8.length;
126
+ var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
127
+ var output = '';
128
+ var parts = [];
129
+ var maxChunkLength = 16383; // must be multiple of 3
130
+
131
+ // go through the array every three bytes, we'll deal with trailing stuff later
132
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
133
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)));
134
+ }
135
+
136
+ // pad the end with zeros, but make sure to not forget the extra bytes
137
+ if (extraBytes === 1) {
138
+ tmp = uint8[len - 1];
139
+ output += lookup[tmp >> 2];
140
+ output += lookup[(tmp << 4) & 0x3F];
141
+ output += '==';
142
+ } else if (extraBytes === 2) {
143
+ tmp = (uint8[len - 2] << 8) + (uint8[len - 1]);
144
+ output += lookup[tmp >> 10];
145
+ output += lookup[(tmp >> 4) & 0x3F];
146
+ output += lookup[(tmp << 2) & 0x3F];
147
+ output += '=';
148
+ }
149
+
150
+ parts.push(output);
151
+
152
+ return parts.join('')
153
+ }
154
+
155
+ function read (buffer, offset, isLE, mLen, nBytes) {
156
+ var e, m;
157
+ var eLen = nBytes * 8 - mLen - 1;
158
+ var eMax = (1 << eLen) - 1;
159
+ var eBias = eMax >> 1;
160
+ var nBits = -7;
161
+ var i = isLE ? (nBytes - 1) : 0;
162
+ var d = isLE ? -1 : 1;
163
+ var s = buffer[offset + i];
164
+
165
+ i += d;
166
+
167
+ e = s & ((1 << (-nBits)) - 1);
168
+ s >>= (-nBits);
169
+ nBits += eLen;
170
+ for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
171
+
172
+ m = e & ((1 << (-nBits)) - 1);
173
+ e >>= (-nBits);
174
+ nBits += mLen;
175
+ for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
176
+
177
+ if (e === 0) {
178
+ e = 1 - eBias;
179
+ } else if (e === eMax) {
180
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
181
+ } else {
182
+ m = m + Math.pow(2, mLen);
183
+ e = e - eBias;
184
+ }
185
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
186
+ }
187
+
188
+ function write (buffer, value, offset, isLE, mLen, nBytes) {
189
+ var e, m, c;
190
+ var eLen = nBytes * 8 - mLen - 1;
191
+ var eMax = (1 << eLen) - 1;
192
+ var eBias = eMax >> 1;
193
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0);
194
+ var i = isLE ? 0 : (nBytes - 1);
195
+ var d = isLE ? 1 : -1;
196
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
197
+
198
+ value = Math.abs(value);
199
+
200
+ if (isNaN(value) || value === Infinity) {
201
+ m = isNaN(value) ? 1 : 0;
202
+ e = eMax;
203
+ } else {
204
+ e = Math.floor(Math.log(value) / Math.LN2);
205
+ if (value * (c = Math.pow(2, -e)) < 1) {
206
+ e--;
207
+ c *= 2;
208
+ }
209
+ if (e + eBias >= 1) {
210
+ value += rt / c;
211
+ } else {
212
+ value += rt * Math.pow(2, 1 - eBias);
213
+ }
214
+ if (value * c >= 2) {
215
+ e++;
216
+ c /= 2;
217
+ }
218
+
219
+ if (e + eBias >= eMax) {
220
+ m = 0;
221
+ e = eMax;
222
+ } else if (e + eBias >= 1) {
223
+ m = (value * c - 1) * Math.pow(2, mLen);
224
+ e = e + eBias;
225
+ } else {
226
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
227
+ e = 0;
228
+ }
229
+ }
230
+
231
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
232
+
233
+ e = (e << mLen) | m;
234
+ eLen += mLen;
235
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
236
+
237
+ buffer[offset + i - d] |= s * 128;
238
+ }
239
+
240
+ var toString = {}.toString;
241
+
242
+ var isArray = Array.isArray || function (arr) {
243
+ return toString.call(arr) == '[object Array]';
244
+ };
245
+
246
+ /*!
247
+ * The buffer module from node.js, for the browser.
248
+ *
249
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
250
+ * @license MIT
251
+ */
252
+
253
+ var INSPECT_MAX_BYTES = 50;
254
+
255
+ /**
256
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
257
+ * === true Use Uint8Array implementation (fastest)
258
+ * === false Use Object implementation (most compatible, even IE6)
259
+ *
260
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
261
+ * Opera 11.6+, iOS 4.2+.
262
+ *
263
+ * Due to various browser bugs, sometimes the Object implementation will be used even
264
+ * when the browser supports typed arrays.
265
+ *
266
+ * Note:
267
+ *
268
+ * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
269
+ * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
270
+ *
271
+ * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
272
+ *
273
+ * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
274
+ * incorrect length in some situations.
275
+
276
+ * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
277
+ * get the Object implementation, which is slower but behaves correctly.
278
+ */
279
+ Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined
280
+ ? global$1.TYPED_ARRAY_SUPPORT
281
+ : true;
282
+
283
+ function kMaxLength () {
284
+ return Buffer.TYPED_ARRAY_SUPPORT
285
+ ? 0x7fffffff
286
+ : 0x3fffffff
287
+ }
288
+
289
+ function createBuffer (that, length) {
290
+ if (kMaxLength() < length) {
291
+ throw new RangeError('Invalid typed array length')
292
+ }
293
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
294
+ // Return an augmented `Uint8Array` instance, for best performance
295
+ that = new Uint8Array(length);
296
+ that.__proto__ = Buffer.prototype;
297
+ } else {
298
+ // Fallback: Return an object instance of the Buffer class
299
+ if (that === null) {
300
+ that = new Buffer(length);
301
+ }
302
+ that.length = length;
303
+ }
304
+
305
+ return that
306
+ }
307
+
308
+ /**
309
+ * The Buffer constructor returns instances of `Uint8Array` that have their
310
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
311
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
312
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
313
+ * returns a single octet.
314
+ *
315
+ * The `Uint8Array` prototype remains unmodified.
316
+ */
317
+
318
+ function Buffer (arg, encodingOrOffset, length) {
319
+ if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
320
+ return new Buffer(arg, encodingOrOffset, length)
321
+ }
322
+
323
+ // Common case.
324
+ if (typeof arg === 'number') {
325
+ if (typeof encodingOrOffset === 'string') {
326
+ throw new Error(
327
+ 'If encoding is specified then the first argument must be a string'
328
+ )
329
+ }
330
+ return allocUnsafe(this, arg)
331
+ }
332
+ return from(this, arg, encodingOrOffset, length)
333
+ }
334
+
335
+ Buffer.poolSize = 8192; // not used by this implementation
336
+
337
+ // TODO: Legacy, not needed anymore. Remove in next major version.
338
+ Buffer._augment = function (arr) {
339
+ arr.__proto__ = Buffer.prototype;
340
+ return arr
341
+ };
342
+
343
+ function from (that, value, encodingOrOffset, length) {
344
+ if (typeof value === 'number') {
345
+ throw new TypeError('"value" argument must not be a number')
346
+ }
347
+
348
+ if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
349
+ return fromArrayBuffer(that, value, encodingOrOffset, length)
350
+ }
351
+
352
+ if (typeof value === 'string') {
353
+ return fromString(that, value, encodingOrOffset)
354
+ }
355
+
356
+ return fromObject(that, value)
357
+ }
358
+
359
+ /**
360
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
361
+ * if value is a number.
362
+ * Buffer.from(str[, encoding])
363
+ * Buffer.from(array)
364
+ * Buffer.from(buffer)
365
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
366
+ **/
367
+ Buffer.from = function (value, encodingOrOffset, length) {
368
+ return from(null, value, encodingOrOffset, length)
369
+ };
370
+
371
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
372
+ Buffer.prototype.__proto__ = Uint8Array.prototype;
373
+ Buffer.__proto__ = Uint8Array;
374
+ }
375
+
376
+ function assertSize (size) {
377
+ if (typeof size !== 'number') {
378
+ throw new TypeError('"size" argument must be a number')
379
+ } else if (size < 0) {
380
+ throw new RangeError('"size" argument must not be negative')
381
+ }
382
+ }
383
+
384
+ function alloc (that, size, fill, encoding) {
385
+ assertSize(size);
386
+ if (size <= 0) {
387
+ return createBuffer(that, size)
388
+ }
389
+ if (fill !== undefined) {
390
+ // Only pay attention to encoding if it's a string. This
391
+ // prevents accidentally sending in a number that would
392
+ // be interpretted as a start offset.
393
+ return typeof encoding === 'string'
394
+ ? createBuffer(that, size).fill(fill, encoding)
395
+ : createBuffer(that, size).fill(fill)
396
+ }
397
+ return createBuffer(that, size)
398
+ }
399
+
400
+ /**
401
+ * Creates a new filled Buffer instance.
402
+ * alloc(size[, fill[, encoding]])
403
+ **/
404
+ Buffer.alloc = function (size, fill, encoding) {
405
+ return alloc(null, size, fill, encoding)
406
+ };
407
+
408
+ function allocUnsafe (that, size) {
409
+ assertSize(size);
410
+ that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
411
+ if (!Buffer.TYPED_ARRAY_SUPPORT) {
412
+ for (var i = 0; i < size; ++i) {
413
+ that[i] = 0;
414
+ }
415
+ }
416
+ return that
417
+ }
418
+
419
+ /**
420
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
421
+ * */
422
+ Buffer.allocUnsafe = function (size) {
423
+ return allocUnsafe(null, size)
424
+ };
425
+ /**
426
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
427
+ */
428
+ Buffer.allocUnsafeSlow = function (size) {
429
+ return allocUnsafe(null, size)
430
+ };
431
+
432
+ function fromString (that, string, encoding) {
433
+ if (typeof encoding !== 'string' || encoding === '') {
434
+ encoding = 'utf8';
435
+ }
436
+
437
+ if (!Buffer.isEncoding(encoding)) {
438
+ throw new TypeError('"encoding" must be a valid string encoding')
439
+ }
440
+
441
+ var length = byteLength(string, encoding) | 0;
442
+ that = createBuffer(that, length);
443
+
444
+ var actual = that.write(string, encoding);
445
+
446
+ if (actual !== length) {
447
+ // Writing a hex string, for example, that contains invalid characters will
448
+ // cause everything after the first invalid character to be ignored. (e.g.
449
+ // 'abxxcd' will be treated as 'ab')
450
+ that = that.slice(0, actual);
451
+ }
452
+
453
+ return that
454
+ }
455
+
456
+ function fromArrayLike (that, array) {
457
+ var length = array.length < 0 ? 0 : checked(array.length) | 0;
458
+ that = createBuffer(that, length);
459
+ for (var i = 0; i < length; i += 1) {
460
+ that[i] = array[i] & 255;
461
+ }
462
+ return that
463
+ }
464
+
465
+ function fromArrayBuffer (that, array, byteOffset, length) {
466
+
467
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
468
+ throw new RangeError('\'offset\' is out of bounds')
469
+ }
470
+
471
+ if (array.byteLength < byteOffset + (length || 0)) {
472
+ throw new RangeError('\'length\' is out of bounds')
473
+ }
474
+
475
+ if (byteOffset === undefined && length === undefined) {
476
+ array = new Uint8Array(array);
477
+ } else if (length === undefined) {
478
+ array = new Uint8Array(array, byteOffset);
479
+ } else {
480
+ array = new Uint8Array(array, byteOffset, length);
481
+ }
482
+
483
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
484
+ // Return an augmented `Uint8Array` instance, for best performance
485
+ that = array;
486
+ that.__proto__ = Buffer.prototype;
487
+ } else {
488
+ // Fallback: Return an object instance of the Buffer class
489
+ that = fromArrayLike(that, array);
490
+ }
491
+ return that
492
+ }
493
+
494
+ function fromObject (that, obj) {
495
+ if (internalIsBuffer(obj)) {
496
+ var len = checked(obj.length) | 0;
497
+ that = createBuffer(that, len);
498
+
499
+ if (that.length === 0) {
500
+ return that
501
+ }
502
+
503
+ obj.copy(that, 0, 0, len);
504
+ return that
505
+ }
506
+
507
+ if (obj) {
508
+ if ((typeof ArrayBuffer !== 'undefined' &&
509
+ obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
510
+ if (typeof obj.length !== 'number' || isnan(obj.length)) {
511
+ return createBuffer(that, 0)
512
+ }
513
+ return fromArrayLike(that, obj)
514
+ }
515
+
516
+ if (obj.type === 'Buffer' && isArray(obj.data)) {
517
+ return fromArrayLike(that, obj.data)
518
+ }
519
+ }
520
+
521
+ throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
522
+ }
523
+
524
+ function checked (length) {
525
+ // Note: cannot use `length < kMaxLength()` here because that fails when
526
+ // length is NaN (which is otherwise coerced to zero.)
527
+ if (length >= kMaxLength()) {
528
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
529
+ 'size: 0x' + kMaxLength().toString(16) + ' bytes')
530
+ }
531
+ return length | 0
532
+ }
533
+ Buffer.isBuffer = isBuffer;
534
+ function internalIsBuffer (b) {
535
+ return !!(b != null && b._isBuffer)
536
+ }
537
+
538
+ Buffer.compare = function compare (a, b) {
539
+ if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
540
+ throw new TypeError('Arguments must be Buffers')
541
+ }
542
+
543
+ if (a === b) return 0
544
+
545
+ var x = a.length;
546
+ var y = b.length;
547
+
548
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
549
+ if (a[i] !== b[i]) {
550
+ x = a[i];
551
+ y = b[i];
552
+ break
553
+ }
554
+ }
555
+
556
+ if (x < y) return -1
557
+ if (y < x) return 1
558
+ return 0
559
+ };
560
+
561
+ Buffer.isEncoding = function isEncoding (encoding) {
562
+ switch (String(encoding).toLowerCase()) {
563
+ case 'hex':
564
+ case 'utf8':
565
+ case 'utf-8':
566
+ case 'ascii':
567
+ case 'latin1':
568
+ case 'binary':
569
+ case 'base64':
570
+ case 'ucs2':
571
+ case 'ucs-2':
572
+ case 'utf16le':
573
+ case 'utf-16le':
574
+ return true
575
+ default:
576
+ return false
577
+ }
578
+ };
579
+
580
+ Buffer.concat = function concat (list, length) {
581
+ if (!isArray(list)) {
582
+ throw new TypeError('"list" argument must be an Array of Buffers')
583
+ }
584
+
585
+ if (list.length === 0) {
586
+ return Buffer.alloc(0)
587
+ }
588
+
589
+ var i;
590
+ if (length === undefined) {
591
+ length = 0;
592
+ for (i = 0; i < list.length; ++i) {
593
+ length += list[i].length;
594
+ }
595
+ }
596
+
597
+ var buffer = Buffer.allocUnsafe(length);
598
+ var pos = 0;
599
+ for (i = 0; i < list.length; ++i) {
600
+ var buf = list[i];
601
+ if (!internalIsBuffer(buf)) {
602
+ throw new TypeError('"list" argument must be an Array of Buffers')
603
+ }
604
+ buf.copy(buffer, pos);
605
+ pos += buf.length;
606
+ }
607
+ return buffer
608
+ };
609
+
610
+ function byteLength (string, encoding) {
611
+ if (internalIsBuffer(string)) {
612
+ return string.length
613
+ }
614
+ if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
615
+ (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
616
+ return string.byteLength
617
+ }
618
+ if (typeof string !== 'string') {
619
+ string = '' + string;
620
+ }
621
+
622
+ var len = string.length;
623
+ if (len === 0) return 0
624
+
625
+ // Use a for loop to avoid recursion
626
+ var loweredCase = false;
627
+ for (;;) {
628
+ switch (encoding) {
629
+ case 'ascii':
630
+ case 'latin1':
631
+ case 'binary':
632
+ return len
633
+ case 'utf8':
634
+ case 'utf-8':
635
+ case undefined:
636
+ return utf8ToBytes(string).length
637
+ case 'ucs2':
638
+ case 'ucs-2':
639
+ case 'utf16le':
640
+ case 'utf-16le':
641
+ return len * 2
642
+ case 'hex':
643
+ return len >>> 1
644
+ case 'base64':
645
+ return base64ToBytes(string).length
646
+ default:
647
+ if (loweredCase) return utf8ToBytes(string).length // assume utf8
648
+ encoding = ('' + encoding).toLowerCase();
649
+ loweredCase = true;
650
+ }
651
+ }
652
+ }
653
+ Buffer.byteLength = byteLength;
654
+
655
+ function slowToString (encoding, start, end) {
656
+ var loweredCase = false;
657
+
658
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
659
+ // property of a typed array.
660
+
661
+ // This behaves neither like String nor Uint8Array in that we set start/end
662
+ // to their upper/lower bounds if the value passed is out of range.
663
+ // undefined is handled specially as per ECMA-262 6th Edition,
664
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
665
+ if (start === undefined || start < 0) {
666
+ start = 0;
667
+ }
668
+ // Return early if start > this.length. Done here to prevent potential uint32
669
+ // coercion fail below.
670
+ if (start > this.length) {
671
+ return ''
672
+ }
673
+
674
+ if (end === undefined || end > this.length) {
675
+ end = this.length;
676
+ }
677
+
678
+ if (end <= 0) {
679
+ return ''
680
+ }
681
+
682
+ // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
683
+ end >>>= 0;
684
+ start >>>= 0;
685
+
686
+ if (end <= start) {
687
+ return ''
688
+ }
689
+
690
+ if (!encoding) encoding = 'utf8';
691
+
692
+ while (true) {
693
+ switch (encoding) {
694
+ case 'hex':
695
+ return hexSlice(this, start, end)
696
+
697
+ case 'utf8':
698
+ case 'utf-8':
699
+ return utf8Slice(this, start, end)
700
+
701
+ case 'ascii':
702
+ return asciiSlice(this, start, end)
703
+
704
+ case 'latin1':
705
+ case 'binary':
706
+ return latin1Slice(this, start, end)
707
+
708
+ case 'base64':
709
+ return base64Slice(this, start, end)
710
+
711
+ case 'ucs2':
712
+ case 'ucs-2':
713
+ case 'utf16le':
714
+ case 'utf-16le':
715
+ return utf16leSlice(this, start, end)
716
+
717
+ default:
718
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
719
+ encoding = (encoding + '').toLowerCase();
720
+ loweredCase = true;
721
+ }
722
+ }
723
+ }
724
+
725
+ // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
726
+ // Buffer instances.
727
+ Buffer.prototype._isBuffer = true;
728
+
729
+ function swap (b, n, m) {
730
+ var i = b[n];
731
+ b[n] = b[m];
732
+ b[m] = i;
733
+ }
734
+
735
+ Buffer.prototype.swap16 = function swap16 () {
736
+ var len = this.length;
737
+ if (len % 2 !== 0) {
738
+ throw new RangeError('Buffer size must be a multiple of 16-bits')
739
+ }
740
+ for (var i = 0; i < len; i += 2) {
741
+ swap(this, i, i + 1);
742
+ }
743
+ return this
744
+ };
745
+
746
+ Buffer.prototype.swap32 = function swap32 () {
747
+ var len = this.length;
748
+ if (len % 4 !== 0) {
749
+ throw new RangeError('Buffer size must be a multiple of 32-bits')
750
+ }
751
+ for (var i = 0; i < len; i += 4) {
752
+ swap(this, i, i + 3);
753
+ swap(this, i + 1, i + 2);
754
+ }
755
+ return this
756
+ };
757
+
758
+ Buffer.prototype.swap64 = function swap64 () {
759
+ var len = this.length;
760
+ if (len % 8 !== 0) {
761
+ throw new RangeError('Buffer size must be a multiple of 64-bits')
762
+ }
763
+ for (var i = 0; i < len; i += 8) {
764
+ swap(this, i, i + 7);
765
+ swap(this, i + 1, i + 6);
766
+ swap(this, i + 2, i + 5);
767
+ swap(this, i + 3, i + 4);
768
+ }
769
+ return this
770
+ };
771
+
772
+ Buffer.prototype.toString = function toString () {
773
+ var length = this.length | 0;
774
+ if (length === 0) return ''
775
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
776
+ return slowToString.apply(this, arguments)
777
+ };
778
+
779
+ Buffer.prototype.equals = function equals (b) {
780
+ if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')
781
+ if (this === b) return true
782
+ return Buffer.compare(this, b) === 0
783
+ };
784
+
785
+ Buffer.prototype.inspect = function inspect () {
786
+ var str = '';
787
+ var max = INSPECT_MAX_BYTES;
788
+ if (this.length > 0) {
789
+ str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
790
+ if (this.length > max) str += ' ... ';
791
+ }
792
+ return '<Buffer ' + str + '>'
793
+ };
794
+
795
+ Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
796
+ if (!internalIsBuffer(target)) {
797
+ throw new TypeError('Argument must be a Buffer')
798
+ }
799
+
800
+ if (start === undefined) {
801
+ start = 0;
802
+ }
803
+ if (end === undefined) {
804
+ end = target ? target.length : 0;
805
+ }
806
+ if (thisStart === undefined) {
807
+ thisStart = 0;
808
+ }
809
+ if (thisEnd === undefined) {
810
+ thisEnd = this.length;
811
+ }
812
+
813
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
814
+ throw new RangeError('out of range index')
815
+ }
816
+
817
+ if (thisStart >= thisEnd && start >= end) {
818
+ return 0
819
+ }
820
+ if (thisStart >= thisEnd) {
821
+ return -1
822
+ }
823
+ if (start >= end) {
824
+ return 1
825
+ }
826
+
827
+ start >>>= 0;
828
+ end >>>= 0;
829
+ thisStart >>>= 0;
830
+ thisEnd >>>= 0;
831
+
832
+ if (this === target) return 0
833
+
834
+ var x = thisEnd - thisStart;
835
+ var y = end - start;
836
+ var len = Math.min(x, y);
837
+
838
+ var thisCopy = this.slice(thisStart, thisEnd);
839
+ var targetCopy = target.slice(start, end);
840
+
841
+ for (var i = 0; i < len; ++i) {
842
+ if (thisCopy[i] !== targetCopy[i]) {
843
+ x = thisCopy[i];
844
+ y = targetCopy[i];
845
+ break
846
+ }
847
+ }
848
+
849
+ if (x < y) return -1
850
+ if (y < x) return 1
851
+ return 0
852
+ };
853
+
854
+ // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
855
+ // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
856
+ //
857
+ // Arguments:
858
+ // - buffer - a Buffer to search
859
+ // - val - a string, Buffer, or number
860
+ // - byteOffset - an index into `buffer`; will be clamped to an int32
861
+ // - encoding - an optional encoding, relevant is val is a string
862
+ // - dir - true for indexOf, false for lastIndexOf
863
+ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
864
+ // Empty buffer means no match
865
+ if (buffer.length === 0) return -1
866
+
867
+ // Normalize byteOffset
868
+ if (typeof byteOffset === 'string') {
869
+ encoding = byteOffset;
870
+ byteOffset = 0;
871
+ } else if (byteOffset > 0x7fffffff) {
872
+ byteOffset = 0x7fffffff;
873
+ } else if (byteOffset < -0x80000000) {
874
+ byteOffset = -0x80000000;
875
+ }
876
+ byteOffset = +byteOffset; // Coerce to Number.
877
+ if (isNaN(byteOffset)) {
878
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
879
+ byteOffset = dir ? 0 : (buffer.length - 1);
880
+ }
881
+
882
+ // Normalize byteOffset: negative offsets start from the end of the buffer
883
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
884
+ if (byteOffset >= buffer.length) {
885
+ if (dir) return -1
886
+ else byteOffset = buffer.length - 1;
887
+ } else if (byteOffset < 0) {
888
+ if (dir) byteOffset = 0;
889
+ else return -1
890
+ }
891
+
892
+ // Normalize val
893
+ if (typeof val === 'string') {
894
+ val = Buffer.from(val, encoding);
895
+ }
896
+
897
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
898
+ if (internalIsBuffer(val)) {
899
+ // Special case: looking for empty string/buffer always fails
900
+ if (val.length === 0) {
901
+ return -1
902
+ }
903
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
904
+ } else if (typeof val === 'number') {
905
+ val = val & 0xFF; // Search for a byte value [0-255]
906
+ if (Buffer.TYPED_ARRAY_SUPPORT &&
907
+ typeof Uint8Array.prototype.indexOf === 'function') {
908
+ if (dir) {
909
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
910
+ } else {
911
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
912
+ }
913
+ }
914
+ return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
915
+ }
916
+
917
+ throw new TypeError('val must be string, number or Buffer')
918
+ }
919
+
920
+ function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
921
+ var indexSize = 1;
922
+ var arrLength = arr.length;
923
+ var valLength = val.length;
924
+
925
+ if (encoding !== undefined) {
926
+ encoding = String(encoding).toLowerCase();
927
+ if (encoding === 'ucs2' || encoding === 'ucs-2' ||
928
+ encoding === 'utf16le' || encoding === 'utf-16le') {
929
+ if (arr.length < 2 || val.length < 2) {
930
+ return -1
931
+ }
932
+ indexSize = 2;
933
+ arrLength /= 2;
934
+ valLength /= 2;
935
+ byteOffset /= 2;
936
+ }
937
+ }
938
+
939
+ function read (buf, i) {
940
+ if (indexSize === 1) {
941
+ return buf[i]
942
+ } else {
943
+ return buf.readUInt16BE(i * indexSize)
944
+ }
945
+ }
946
+
947
+ var i;
948
+ if (dir) {
949
+ var foundIndex = -1;
950
+ for (i = byteOffset; i < arrLength; i++) {
951
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
952
+ if (foundIndex === -1) foundIndex = i;
953
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
954
+ } else {
955
+ if (foundIndex !== -1) i -= i - foundIndex;
956
+ foundIndex = -1;
957
+ }
958
+ }
959
+ } else {
960
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
961
+ for (i = byteOffset; i >= 0; i--) {
962
+ var found = true;
963
+ for (var j = 0; j < valLength; j++) {
964
+ if (read(arr, i + j) !== read(val, j)) {
965
+ found = false;
966
+ break
967
+ }
968
+ }
969
+ if (found) return i
970
+ }
971
+ }
972
+
973
+ return -1
974
+ }
975
+
976
+ Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
977
+ return this.indexOf(val, byteOffset, encoding) !== -1
978
+ };
979
+
980
+ Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
981
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
982
+ };
983
+
984
+ Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
985
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
986
+ };
987
+
988
+ function hexWrite (buf, string, offset, length) {
989
+ offset = Number(offset) || 0;
990
+ var remaining = buf.length - offset;
991
+ if (!length) {
992
+ length = remaining;
993
+ } else {
994
+ length = Number(length);
995
+ if (length > remaining) {
996
+ length = remaining;
997
+ }
998
+ }
999
+
1000
+ // must be an even number of digits
1001
+ var strLen = string.length;
1002
+ if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
1003
+
1004
+ if (length > strLen / 2) {
1005
+ length = strLen / 2;
1006
+ }
1007
+ for (var i = 0; i < length; ++i) {
1008
+ var parsed = parseInt(string.substr(i * 2, 2), 16);
1009
+ if (isNaN(parsed)) return i
1010
+ buf[offset + i] = parsed;
1011
+ }
1012
+ return i
1013
+ }
1014
+
1015
+ function utf8Write (buf, string, offset, length) {
1016
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
1017
+ }
1018
+
1019
+ function asciiWrite (buf, string, offset, length) {
1020
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
1021
+ }
1022
+
1023
+ function latin1Write (buf, string, offset, length) {
1024
+ return asciiWrite(buf, string, offset, length)
1025
+ }
1026
+
1027
+ function base64Write (buf, string, offset, length) {
1028
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
1029
+ }
1030
+
1031
+ function ucs2Write (buf, string, offset, length) {
1032
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
1033
+ }
1034
+
1035
+ Buffer.prototype.write = function write (string, offset, length, encoding) {
1036
+ // Buffer#write(string)
1037
+ if (offset === undefined) {
1038
+ encoding = 'utf8';
1039
+ length = this.length;
1040
+ offset = 0;
1041
+ // Buffer#write(string, encoding)
1042
+ } else if (length === undefined && typeof offset === 'string') {
1043
+ encoding = offset;
1044
+ length = this.length;
1045
+ offset = 0;
1046
+ // Buffer#write(string, offset[, length][, encoding])
1047
+ } else if (isFinite(offset)) {
1048
+ offset = offset | 0;
1049
+ if (isFinite(length)) {
1050
+ length = length | 0;
1051
+ if (encoding === undefined) encoding = 'utf8';
1052
+ } else {
1053
+ encoding = length;
1054
+ length = undefined;
1055
+ }
1056
+ // legacy write(string, encoding, offset, length) - remove in v0.13
1057
+ } else {
1058
+ throw new Error(
1059
+ 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
1060
+ )
1061
+ }
1062
+
1063
+ var remaining = this.length - offset;
1064
+ if (length === undefined || length > remaining) length = remaining;
1065
+
1066
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
1067
+ throw new RangeError('Attempt to write outside buffer bounds')
1068
+ }
1069
+
1070
+ if (!encoding) encoding = 'utf8';
1071
+
1072
+ var loweredCase = false;
1073
+ for (;;) {
1074
+ switch (encoding) {
1075
+ case 'hex':
1076
+ return hexWrite(this, string, offset, length)
1077
+
1078
+ case 'utf8':
1079
+ case 'utf-8':
1080
+ return utf8Write(this, string, offset, length)
1081
+
1082
+ case 'ascii':
1083
+ return asciiWrite(this, string, offset, length)
1084
+
1085
+ case 'latin1':
1086
+ case 'binary':
1087
+ return latin1Write(this, string, offset, length)
1088
+
1089
+ case 'base64':
1090
+ // Warning: maxLength not taken into account in base64Write
1091
+ return base64Write(this, string, offset, length)
1092
+
1093
+ case 'ucs2':
1094
+ case 'ucs-2':
1095
+ case 'utf16le':
1096
+ case 'utf-16le':
1097
+ return ucs2Write(this, string, offset, length)
1098
+
1099
+ default:
1100
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
1101
+ encoding = ('' + encoding).toLowerCase();
1102
+ loweredCase = true;
1103
+ }
1104
+ }
1105
+ };
1106
+
1107
+ Buffer.prototype.toJSON = function toJSON () {
1108
+ return {
1109
+ type: 'Buffer',
1110
+ data: Array.prototype.slice.call(this._arr || this, 0)
1111
+ }
1112
+ };
1113
+
1114
+ function base64Slice (buf, start, end) {
1115
+ if (start === 0 && end === buf.length) {
1116
+ return fromByteArray(buf)
1117
+ } else {
1118
+ return fromByteArray(buf.slice(start, end))
1119
+ }
1120
+ }
1121
+
1122
+ function utf8Slice (buf, start, end) {
1123
+ end = Math.min(buf.length, end);
1124
+ var res = [];
1125
+
1126
+ var i = start;
1127
+ while (i < end) {
1128
+ var firstByte = buf[i];
1129
+ var codePoint = null;
1130
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
1131
+ : (firstByte > 0xDF) ? 3
1132
+ : (firstByte > 0xBF) ? 2
1133
+ : 1;
1134
+
1135
+ if (i + bytesPerSequence <= end) {
1136
+ var secondByte, thirdByte, fourthByte, tempCodePoint;
1137
+
1138
+ switch (bytesPerSequence) {
1139
+ case 1:
1140
+ if (firstByte < 0x80) {
1141
+ codePoint = firstByte;
1142
+ }
1143
+ break
1144
+ case 2:
1145
+ secondByte = buf[i + 1];
1146
+ if ((secondByte & 0xC0) === 0x80) {
1147
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F);
1148
+ if (tempCodePoint > 0x7F) {
1149
+ codePoint = tempCodePoint;
1150
+ }
1151
+ }
1152
+ break
1153
+ case 3:
1154
+ secondByte = buf[i + 1];
1155
+ thirdByte = buf[i + 2];
1156
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
1157
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F);
1158
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
1159
+ codePoint = tempCodePoint;
1160
+ }
1161
+ }
1162
+ break
1163
+ case 4:
1164
+ secondByte = buf[i + 1];
1165
+ thirdByte = buf[i + 2];
1166
+ fourthByte = buf[i + 3];
1167
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
1168
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F);
1169
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
1170
+ codePoint = tempCodePoint;
1171
+ }
1172
+ }
1173
+ }
1174
+ }
1175
+
1176
+ if (codePoint === null) {
1177
+ // we did not generate a valid codePoint so insert a
1178
+ // replacement char (U+FFFD) and advance only 1 byte
1179
+ codePoint = 0xFFFD;
1180
+ bytesPerSequence = 1;
1181
+ } else if (codePoint > 0xFFFF) {
1182
+ // encode to utf16 (surrogate pair dance)
1183
+ codePoint -= 0x10000;
1184
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800);
1185
+ codePoint = 0xDC00 | codePoint & 0x3FF;
1186
+ }
1187
+
1188
+ res.push(codePoint);
1189
+ i += bytesPerSequence;
1190
+ }
1191
+
1192
+ return decodeCodePointsArray(res)
1193
+ }
1194
+
1195
+ // Based on http://stackoverflow.com/a/22747272/680742, the browser with
1196
+ // the lowest limit is Chrome, with 0x10000 args.
1197
+ // We go 1 magnitude less, for safety
1198
+ var MAX_ARGUMENTS_LENGTH = 0x1000;
1199
+
1200
+ function decodeCodePointsArray (codePoints) {
1201
+ var len = codePoints.length;
1202
+ if (len <= MAX_ARGUMENTS_LENGTH) {
1203
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
1204
+ }
1205
+
1206
+ // Decode in chunks to avoid "call stack size exceeded".
1207
+ var res = '';
1208
+ var i = 0;
1209
+ while (i < len) {
1210
+ res += String.fromCharCode.apply(
1211
+ String,
1212
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
1213
+ );
1214
+ }
1215
+ return res
1216
+ }
1217
+
1218
+ function asciiSlice (buf, start, end) {
1219
+ var ret = '';
1220
+ end = Math.min(buf.length, end);
1221
+
1222
+ for (var i = start; i < end; ++i) {
1223
+ ret += String.fromCharCode(buf[i] & 0x7F);
1224
+ }
1225
+ return ret
1226
+ }
1227
+
1228
+ function latin1Slice (buf, start, end) {
1229
+ var ret = '';
1230
+ end = Math.min(buf.length, end);
1231
+
1232
+ for (var i = start; i < end; ++i) {
1233
+ ret += String.fromCharCode(buf[i]);
1234
+ }
1235
+ return ret
1236
+ }
1237
+
1238
+ function hexSlice (buf, start, end) {
1239
+ var len = buf.length;
1240
+
1241
+ if (!start || start < 0) start = 0;
1242
+ if (!end || end < 0 || end > len) end = len;
1243
+
1244
+ var out = '';
1245
+ for (var i = start; i < end; ++i) {
1246
+ out += toHex(buf[i]);
1247
+ }
1248
+ return out
1249
+ }
1250
+
1251
+ function utf16leSlice (buf, start, end) {
1252
+ var bytes = buf.slice(start, end);
1253
+ var res = '';
1254
+ for (var i = 0; i < bytes.length; i += 2) {
1255
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
1256
+ }
1257
+ return res
1258
+ }
1259
+
1260
+ Buffer.prototype.slice = function slice (start, end) {
1261
+ var len = this.length;
1262
+ start = ~~start;
1263
+ end = end === undefined ? len : ~~end;
1264
+
1265
+ if (start < 0) {
1266
+ start += len;
1267
+ if (start < 0) start = 0;
1268
+ } else if (start > len) {
1269
+ start = len;
1270
+ }
1271
+
1272
+ if (end < 0) {
1273
+ end += len;
1274
+ if (end < 0) end = 0;
1275
+ } else if (end > len) {
1276
+ end = len;
1277
+ }
1278
+
1279
+ if (end < start) end = start;
1280
+
1281
+ var newBuf;
1282
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1283
+ newBuf = this.subarray(start, end);
1284
+ newBuf.__proto__ = Buffer.prototype;
1285
+ } else {
1286
+ var sliceLen = end - start;
1287
+ newBuf = new Buffer(sliceLen, undefined);
1288
+ for (var i = 0; i < sliceLen; ++i) {
1289
+ newBuf[i] = this[i + start];
1290
+ }
1291
+ }
1292
+
1293
+ return newBuf
1294
+ };
1295
+
1296
+ /*
1297
+ * Need to make sure that buffer isn't trying to write out of bounds.
1298
+ */
1299
+ function checkOffset (offset, ext, length) {
1300
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
1301
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
1302
+ }
1303
+
1304
+ Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
1305
+ offset = offset | 0;
1306
+ byteLength = byteLength | 0;
1307
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
1308
+
1309
+ var val = this[offset];
1310
+ var mul = 1;
1311
+ var i = 0;
1312
+ while (++i < byteLength && (mul *= 0x100)) {
1313
+ val += this[offset + i] * mul;
1314
+ }
1315
+
1316
+ return val
1317
+ };
1318
+
1319
+ Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
1320
+ offset = offset | 0;
1321
+ byteLength = byteLength | 0;
1322
+ if (!noAssert) {
1323
+ checkOffset(offset, byteLength, this.length);
1324
+ }
1325
+
1326
+ var val = this[offset + --byteLength];
1327
+ var mul = 1;
1328
+ while (byteLength > 0 && (mul *= 0x100)) {
1329
+ val += this[offset + --byteLength] * mul;
1330
+ }
1331
+
1332
+ return val
1333
+ };
1334
+
1335
+ Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
1336
+ if (!noAssert) checkOffset(offset, 1, this.length);
1337
+ return this[offset]
1338
+ };
1339
+
1340
+ Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
1341
+ if (!noAssert) checkOffset(offset, 2, this.length);
1342
+ return this[offset] | (this[offset + 1] << 8)
1343
+ };
1344
+
1345
+ Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
1346
+ if (!noAssert) checkOffset(offset, 2, this.length);
1347
+ return (this[offset] << 8) | this[offset + 1]
1348
+ };
1349
+
1350
+ Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
1351
+ if (!noAssert) checkOffset(offset, 4, this.length);
1352
+
1353
+ return ((this[offset]) |
1354
+ (this[offset + 1] << 8) |
1355
+ (this[offset + 2] << 16)) +
1356
+ (this[offset + 3] * 0x1000000)
1357
+ };
1358
+
1359
+ Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
1360
+ if (!noAssert) checkOffset(offset, 4, this.length);
1361
+
1362
+ return (this[offset] * 0x1000000) +
1363
+ ((this[offset + 1] << 16) |
1364
+ (this[offset + 2] << 8) |
1365
+ this[offset + 3])
1366
+ };
1367
+
1368
+ Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
1369
+ offset = offset | 0;
1370
+ byteLength = byteLength | 0;
1371
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
1372
+
1373
+ var val = this[offset];
1374
+ var mul = 1;
1375
+ var i = 0;
1376
+ while (++i < byteLength && (mul *= 0x100)) {
1377
+ val += this[offset + i] * mul;
1378
+ }
1379
+ mul *= 0x80;
1380
+
1381
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
1382
+
1383
+ return val
1384
+ };
1385
+
1386
+ Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
1387
+ offset = offset | 0;
1388
+ byteLength = byteLength | 0;
1389
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
1390
+
1391
+ var i = byteLength;
1392
+ var mul = 1;
1393
+ var val = this[offset + --i];
1394
+ while (i > 0 && (mul *= 0x100)) {
1395
+ val += this[offset + --i] * mul;
1396
+ }
1397
+ mul *= 0x80;
1398
+
1399
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
1400
+
1401
+ return val
1402
+ };
1403
+
1404
+ Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
1405
+ if (!noAssert) checkOffset(offset, 1, this.length);
1406
+ if (!(this[offset] & 0x80)) return (this[offset])
1407
+ return ((0xff - this[offset] + 1) * -1)
1408
+ };
1409
+
1410
+ Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
1411
+ if (!noAssert) checkOffset(offset, 2, this.length);
1412
+ var val = this[offset] | (this[offset + 1] << 8);
1413
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
1414
+ };
1415
+
1416
+ Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
1417
+ if (!noAssert) checkOffset(offset, 2, this.length);
1418
+ var val = this[offset + 1] | (this[offset] << 8);
1419
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
1420
+ };
1421
+
1422
+ Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
1423
+ if (!noAssert) checkOffset(offset, 4, this.length);
1424
+
1425
+ return (this[offset]) |
1426
+ (this[offset + 1] << 8) |
1427
+ (this[offset + 2] << 16) |
1428
+ (this[offset + 3] << 24)
1429
+ };
1430
+
1431
+ Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
1432
+ if (!noAssert) checkOffset(offset, 4, this.length);
1433
+
1434
+ return (this[offset] << 24) |
1435
+ (this[offset + 1] << 16) |
1436
+ (this[offset + 2] << 8) |
1437
+ (this[offset + 3])
1438
+ };
1439
+
1440
+ Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
1441
+ if (!noAssert) checkOffset(offset, 4, this.length);
1442
+ return read(this, offset, true, 23, 4)
1443
+ };
1444
+
1445
+ Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
1446
+ if (!noAssert) checkOffset(offset, 4, this.length);
1447
+ return read(this, offset, false, 23, 4)
1448
+ };
1449
+
1450
+ Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
1451
+ if (!noAssert) checkOffset(offset, 8, this.length);
1452
+ return read(this, offset, true, 52, 8)
1453
+ };
1454
+
1455
+ Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
1456
+ if (!noAssert) checkOffset(offset, 8, this.length);
1457
+ return read(this, offset, false, 52, 8)
1458
+ };
1459
+
1460
+ function checkInt (buf, value, offset, ext, max, min) {
1461
+ if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
1462
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
1463
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
1464
+ }
1465
+
1466
+ Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
1467
+ value = +value;
1468
+ offset = offset | 0;
1469
+ byteLength = byteLength | 0;
1470
+ if (!noAssert) {
1471
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
1472
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
1473
+ }
1474
+
1475
+ var mul = 1;
1476
+ var i = 0;
1477
+ this[offset] = value & 0xFF;
1478
+ while (++i < byteLength && (mul *= 0x100)) {
1479
+ this[offset + i] = (value / mul) & 0xFF;
1480
+ }
1481
+
1482
+ return offset + byteLength
1483
+ };
1484
+
1485
+ Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
1486
+ value = +value;
1487
+ offset = offset | 0;
1488
+ byteLength = byteLength | 0;
1489
+ if (!noAssert) {
1490
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1;
1491
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
1492
+ }
1493
+
1494
+ var i = byteLength - 1;
1495
+ var mul = 1;
1496
+ this[offset + i] = value & 0xFF;
1497
+ while (--i >= 0 && (mul *= 0x100)) {
1498
+ this[offset + i] = (value / mul) & 0xFF;
1499
+ }
1500
+
1501
+ return offset + byteLength
1502
+ };
1503
+
1504
+ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
1505
+ value = +value;
1506
+ offset = offset | 0;
1507
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
1508
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
1509
+ this[offset] = (value & 0xff);
1510
+ return offset + 1
1511
+ };
1512
+
1513
+ function objectWriteUInt16 (buf, value, offset, littleEndian) {
1514
+ if (value < 0) value = 0xffff + value + 1;
1515
+ for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
1516
+ buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
1517
+ (littleEndian ? i : 1 - i) * 8;
1518
+ }
1519
+ }
1520
+
1521
+ Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
1522
+ value = +value;
1523
+ offset = offset | 0;
1524
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
1525
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1526
+ this[offset] = (value & 0xff);
1527
+ this[offset + 1] = (value >>> 8);
1528
+ } else {
1529
+ objectWriteUInt16(this, value, offset, true);
1530
+ }
1531
+ return offset + 2
1532
+ };
1533
+
1534
+ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
1535
+ value = +value;
1536
+ offset = offset | 0;
1537
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
1538
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1539
+ this[offset] = (value >>> 8);
1540
+ this[offset + 1] = (value & 0xff);
1541
+ } else {
1542
+ objectWriteUInt16(this, value, offset, false);
1543
+ }
1544
+ return offset + 2
1545
+ };
1546
+
1547
+ function objectWriteUInt32 (buf, value, offset, littleEndian) {
1548
+ if (value < 0) value = 0xffffffff + value + 1;
1549
+ for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
1550
+ buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff;
1551
+ }
1552
+ }
1553
+
1554
+ Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
1555
+ value = +value;
1556
+ offset = offset | 0;
1557
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
1558
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1559
+ this[offset + 3] = (value >>> 24);
1560
+ this[offset + 2] = (value >>> 16);
1561
+ this[offset + 1] = (value >>> 8);
1562
+ this[offset] = (value & 0xff);
1563
+ } else {
1564
+ objectWriteUInt32(this, value, offset, true);
1565
+ }
1566
+ return offset + 4
1567
+ };
1568
+
1569
+ Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
1570
+ value = +value;
1571
+ offset = offset | 0;
1572
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
1573
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1574
+ this[offset] = (value >>> 24);
1575
+ this[offset + 1] = (value >>> 16);
1576
+ this[offset + 2] = (value >>> 8);
1577
+ this[offset + 3] = (value & 0xff);
1578
+ } else {
1579
+ objectWriteUInt32(this, value, offset, false);
1580
+ }
1581
+ return offset + 4
1582
+ };
1583
+
1584
+ Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
1585
+ value = +value;
1586
+ offset = offset | 0;
1587
+ if (!noAssert) {
1588
+ var limit = Math.pow(2, 8 * byteLength - 1);
1589
+
1590
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
1591
+ }
1592
+
1593
+ var i = 0;
1594
+ var mul = 1;
1595
+ var sub = 0;
1596
+ this[offset] = value & 0xFF;
1597
+ while (++i < byteLength && (mul *= 0x100)) {
1598
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
1599
+ sub = 1;
1600
+ }
1601
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
1602
+ }
1603
+
1604
+ return offset + byteLength
1605
+ };
1606
+
1607
+ Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
1608
+ value = +value;
1609
+ offset = offset | 0;
1610
+ if (!noAssert) {
1611
+ var limit = Math.pow(2, 8 * byteLength - 1);
1612
+
1613
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
1614
+ }
1615
+
1616
+ var i = byteLength - 1;
1617
+ var mul = 1;
1618
+ var sub = 0;
1619
+ this[offset + i] = value & 0xFF;
1620
+ while (--i >= 0 && (mul *= 0x100)) {
1621
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
1622
+ sub = 1;
1623
+ }
1624
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
1625
+ }
1626
+
1627
+ return offset + byteLength
1628
+ };
1629
+
1630
+ Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
1631
+ value = +value;
1632
+ offset = offset | 0;
1633
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
1634
+ if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
1635
+ if (value < 0) value = 0xff + value + 1;
1636
+ this[offset] = (value & 0xff);
1637
+ return offset + 1
1638
+ };
1639
+
1640
+ Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
1641
+ value = +value;
1642
+ offset = offset | 0;
1643
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
1644
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1645
+ this[offset] = (value & 0xff);
1646
+ this[offset + 1] = (value >>> 8);
1647
+ } else {
1648
+ objectWriteUInt16(this, value, offset, true);
1649
+ }
1650
+ return offset + 2
1651
+ };
1652
+
1653
+ Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
1654
+ value = +value;
1655
+ offset = offset | 0;
1656
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
1657
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1658
+ this[offset] = (value >>> 8);
1659
+ this[offset + 1] = (value & 0xff);
1660
+ } else {
1661
+ objectWriteUInt16(this, value, offset, false);
1662
+ }
1663
+ return offset + 2
1664
+ };
1665
+
1666
+ Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
1667
+ value = +value;
1668
+ offset = offset | 0;
1669
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
1670
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1671
+ this[offset] = (value & 0xff);
1672
+ this[offset + 1] = (value >>> 8);
1673
+ this[offset + 2] = (value >>> 16);
1674
+ this[offset + 3] = (value >>> 24);
1675
+ } else {
1676
+ objectWriteUInt32(this, value, offset, true);
1677
+ }
1678
+ return offset + 4
1679
+ };
1680
+
1681
+ Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
1682
+ value = +value;
1683
+ offset = offset | 0;
1684
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
1685
+ if (value < 0) value = 0xffffffff + value + 1;
1686
+ if (Buffer.TYPED_ARRAY_SUPPORT) {
1687
+ this[offset] = (value >>> 24);
1688
+ this[offset + 1] = (value >>> 16);
1689
+ this[offset + 2] = (value >>> 8);
1690
+ this[offset + 3] = (value & 0xff);
1691
+ } else {
1692
+ objectWriteUInt32(this, value, offset, false);
1693
+ }
1694
+ return offset + 4
1695
+ };
1696
+
1697
+ function checkIEEE754 (buf, value, offset, ext, max, min) {
1698
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
1699
+ if (offset < 0) throw new RangeError('Index out of range')
1700
+ }
1701
+
1702
+ function writeFloat (buf, value, offset, littleEndian, noAssert) {
1703
+ if (!noAssert) {
1704
+ checkIEEE754(buf, value, offset, 4);
1705
+ }
1706
+ write(buf, value, offset, littleEndian, 23, 4);
1707
+ return offset + 4
1708
+ }
1709
+
1710
+ Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
1711
+ return writeFloat(this, value, offset, true, noAssert)
1712
+ };
1713
+
1714
+ Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
1715
+ return writeFloat(this, value, offset, false, noAssert)
1716
+ };
1717
+
1718
+ function writeDouble (buf, value, offset, littleEndian, noAssert) {
1719
+ if (!noAssert) {
1720
+ checkIEEE754(buf, value, offset, 8);
1721
+ }
1722
+ write(buf, value, offset, littleEndian, 52, 8);
1723
+ return offset + 8
1724
+ }
1725
+
1726
+ Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
1727
+ return writeDouble(this, value, offset, true, noAssert)
1728
+ };
1729
+
1730
+ Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
1731
+ return writeDouble(this, value, offset, false, noAssert)
1732
+ };
1733
+
1734
+ // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
1735
+ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
1736
+ if (!start) start = 0;
1737
+ if (!end && end !== 0) end = this.length;
1738
+ if (targetStart >= target.length) targetStart = target.length;
1739
+ if (!targetStart) targetStart = 0;
1740
+ if (end > 0 && end < start) end = start;
1741
+
1742
+ // Copy 0 bytes; we're done
1743
+ if (end === start) return 0
1744
+ if (target.length === 0 || this.length === 0) return 0
1745
+
1746
+ // Fatal error conditions
1747
+ if (targetStart < 0) {
1748
+ throw new RangeError('targetStart out of bounds')
1749
+ }
1750
+ if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
1751
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
1752
+
1753
+ // Are we oob?
1754
+ if (end > this.length) end = this.length;
1755
+ if (target.length - targetStart < end - start) {
1756
+ end = target.length - targetStart + start;
1757
+ }
1758
+
1759
+ var len = end - start;
1760
+ var i;
1761
+
1762
+ if (this === target && start < targetStart && targetStart < end) {
1763
+ // descending copy from end
1764
+ for (i = len - 1; i >= 0; --i) {
1765
+ target[i + targetStart] = this[i + start];
1766
+ }
1767
+ } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
1768
+ // ascending copy from start
1769
+ for (i = 0; i < len; ++i) {
1770
+ target[i + targetStart] = this[i + start];
1771
+ }
1772
+ } else {
1773
+ Uint8Array.prototype.set.call(
1774
+ target,
1775
+ this.subarray(start, start + len),
1776
+ targetStart
1777
+ );
1778
+ }
1779
+
1780
+ return len
1781
+ };
1782
+
1783
+ // Usage:
1784
+ // buffer.fill(number[, offset[, end]])
1785
+ // buffer.fill(buffer[, offset[, end]])
1786
+ // buffer.fill(string[, offset[, end]][, encoding])
1787
+ Buffer.prototype.fill = function fill (val, start, end, encoding) {
1788
+ // Handle string cases:
1789
+ if (typeof val === 'string') {
1790
+ if (typeof start === 'string') {
1791
+ encoding = start;
1792
+ start = 0;
1793
+ end = this.length;
1794
+ } else if (typeof end === 'string') {
1795
+ encoding = end;
1796
+ end = this.length;
1797
+ }
1798
+ if (val.length === 1) {
1799
+ var code = val.charCodeAt(0);
1800
+ if (code < 256) {
1801
+ val = code;
1802
+ }
1803
+ }
1804
+ if (encoding !== undefined && typeof encoding !== 'string') {
1805
+ throw new TypeError('encoding must be a string')
1806
+ }
1807
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
1808
+ throw new TypeError('Unknown encoding: ' + encoding)
1809
+ }
1810
+ } else if (typeof val === 'number') {
1811
+ val = val & 255;
1812
+ }
1813
+
1814
+ // Invalid ranges are not set to a default, so can range check early.
1815
+ if (start < 0 || this.length < start || this.length < end) {
1816
+ throw new RangeError('Out of range index')
1817
+ }
1818
+
1819
+ if (end <= start) {
1820
+ return this
1821
+ }
1822
+
1823
+ start = start >>> 0;
1824
+ end = end === undefined ? this.length : end >>> 0;
1825
+
1826
+ if (!val) val = 0;
1827
+
1828
+ var i;
1829
+ if (typeof val === 'number') {
1830
+ for (i = start; i < end; ++i) {
1831
+ this[i] = val;
1832
+ }
1833
+ } else {
1834
+ var bytes = internalIsBuffer(val)
1835
+ ? val
1836
+ : utf8ToBytes(new Buffer(val, encoding).toString());
1837
+ var len = bytes.length;
1838
+ for (i = 0; i < end - start; ++i) {
1839
+ this[i + start] = bytes[i % len];
1840
+ }
1841
+ }
1842
+
1843
+ return this
1844
+ };
1845
+
1846
+ // HELPER FUNCTIONS
1847
+ // ================
1848
+
1849
+ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
1850
+
1851
+ function base64clean (str) {
1852
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
1853
+ str = stringtrim(str).replace(INVALID_BASE64_RE, '');
1854
+ // Node converts strings with length < 2 to ''
1855
+ if (str.length < 2) return ''
1856
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
1857
+ while (str.length % 4 !== 0) {
1858
+ str = str + '=';
1859
+ }
1860
+ return str
1861
+ }
1862
+
1863
+ function stringtrim (str) {
1864
+ if (str.trim) return str.trim()
1865
+ return str.replace(/^\s+|\s+$/g, '')
1866
+ }
1867
+
1868
+ function toHex (n) {
1869
+ if (n < 16) return '0' + n.toString(16)
1870
+ return n.toString(16)
1871
+ }
1872
+
1873
+ function utf8ToBytes (string, units) {
1874
+ units = units || Infinity;
1875
+ var codePoint;
1876
+ var length = string.length;
1877
+ var leadSurrogate = null;
1878
+ var bytes = [];
1879
+
1880
+ for (var i = 0; i < length; ++i) {
1881
+ codePoint = string.charCodeAt(i);
1882
+
1883
+ // is surrogate component
1884
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
1885
+ // last char was a lead
1886
+ if (!leadSurrogate) {
1887
+ // no lead yet
1888
+ if (codePoint > 0xDBFF) {
1889
+ // unexpected trail
1890
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
1891
+ continue
1892
+ } else if (i + 1 === length) {
1893
+ // unpaired lead
1894
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
1895
+ continue
1896
+ }
1897
+
1898
+ // valid lead
1899
+ leadSurrogate = codePoint;
1900
+
1901
+ continue
1902
+ }
1903
+
1904
+ // 2 leads in a row
1905
+ if (codePoint < 0xDC00) {
1906
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
1907
+ leadSurrogate = codePoint;
1908
+ continue
1909
+ }
1910
+
1911
+ // valid surrogate pair
1912
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
1913
+ } else if (leadSurrogate) {
1914
+ // valid bmp char, but last char was a lead
1915
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
1916
+ }
1917
+
1918
+ leadSurrogate = null;
1919
+
1920
+ // encode utf8
1921
+ if (codePoint < 0x80) {
1922
+ if ((units -= 1) < 0) break
1923
+ bytes.push(codePoint);
1924
+ } else if (codePoint < 0x800) {
1925
+ if ((units -= 2) < 0) break
1926
+ bytes.push(
1927
+ codePoint >> 0x6 | 0xC0,
1928
+ codePoint & 0x3F | 0x80
1929
+ );
1930
+ } else if (codePoint < 0x10000) {
1931
+ if ((units -= 3) < 0) break
1932
+ bytes.push(
1933
+ codePoint >> 0xC | 0xE0,
1934
+ codePoint >> 0x6 & 0x3F | 0x80,
1935
+ codePoint & 0x3F | 0x80
1936
+ );
1937
+ } else if (codePoint < 0x110000) {
1938
+ if ((units -= 4) < 0) break
1939
+ bytes.push(
1940
+ codePoint >> 0x12 | 0xF0,
1941
+ codePoint >> 0xC & 0x3F | 0x80,
1942
+ codePoint >> 0x6 & 0x3F | 0x80,
1943
+ codePoint & 0x3F | 0x80
1944
+ );
1945
+ } else {
1946
+ throw new Error('Invalid code point')
1947
+ }
1948
+ }
1949
+
1950
+ return bytes
1951
+ }
1952
+
1953
+ function asciiToBytes (str) {
1954
+ var byteArray = [];
1955
+ for (var i = 0; i < str.length; ++i) {
1956
+ // Node's code seems to be doing this and not & 0x7F..
1957
+ byteArray.push(str.charCodeAt(i) & 0xFF);
1958
+ }
1959
+ return byteArray
1960
+ }
1961
+
1962
+ function utf16leToBytes (str, units) {
1963
+ var c, hi, lo;
1964
+ var byteArray = [];
1965
+ for (var i = 0; i < str.length; ++i) {
1966
+ if ((units -= 2) < 0) break
1967
+
1968
+ c = str.charCodeAt(i);
1969
+ hi = c >> 8;
1970
+ lo = c % 256;
1971
+ byteArray.push(lo);
1972
+ byteArray.push(hi);
1973
+ }
1974
+
1975
+ return byteArray
1976
+ }
1977
+
1978
+
1979
+ function base64ToBytes (str) {
1980
+ return toByteArray(base64clean(str))
1981
+ }
1982
+
1983
+ function blitBuffer (src, dst, offset, length) {
1984
+ for (var i = 0; i < length; ++i) {
1985
+ if ((i + offset >= dst.length) || (i >= src.length)) break
1986
+ dst[i + offset] = src[i];
1987
+ }
1988
+ return i
1989
+ }
1990
+
1991
+ function isnan (val) {
1992
+ return val !== val // eslint-disable-line no-self-compare
1993
+ }
1994
+
1995
+
1996
+ // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
1997
+ // The _isBuffer check is for Safari 5-7 support, because it's missing
1998
+ // Object.prototype.constructor. Remove this eventually
1999
+ function isBuffer(obj) {
2000
+ return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
2001
+ }
2002
+
2003
+ function isFastBuffer (obj) {
2004
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
2005
+ }
2006
+
2007
+ // For Node v0.10 support. Remove this eventually.
2008
+ function isSlowBuffer (obj) {
2009
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
2010
+ }
2011
+
2012
+ exports.Buffer = Buffer;
2013
+ exports.commonjsGlobal = commonjsGlobal;
2014
+ exports.commonjsRequire = commonjsRequire;
2015
+ exports.createCommonjsModule = createCommonjsModule;
2016
+ exports.getAugmentedNamespace = getAugmentedNamespace;
2017
+ exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
2018
+ exports.process_1 = process_1;