react-id-card-generator 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (825) hide show
  1. package/README.md +214 -0
  2. package/dist/cjs/_virtual/_commonjsHelpers.js +11 -0
  3. package/dist/cjs/_virtual/_commonjsHelpers.js.map +1 -0
  4. package/dist/cjs/_virtual/index.js +6 -0
  5. package/dist/cjs/_virtual/index.js.map +1 -0
  6. package/dist/cjs/_virtual/make-built-in.js +6 -0
  7. package/dist/cjs/_virtual/make-built-in.js.map +1 -0
  8. package/dist/cjs/_virtual/new-promise-capability.js +6 -0
  9. package/dist/cjs/_virtual/new-promise-capability.js.map +1 -0
  10. package/dist/cjs/_virtual/object-define-properties.js +6 -0
  11. package/dist/cjs/_virtual/object-define-properties.js.map +1 -0
  12. package/dist/cjs/_virtual/object-define-property.js +6 -0
  13. package/dist/cjs/_virtual/object-define-property.js.map +1 -0
  14. package/dist/cjs/_virtual/object-get-own-property-descriptor.js +6 -0
  15. package/dist/cjs/_virtual/object-get-own-property-descriptor.js.map +1 -0
  16. package/dist/cjs/_virtual/object-get-own-property-names.js +6 -0
  17. package/dist/cjs/_virtual/object-get-own-property-names.js.map +1 -0
  18. package/dist/cjs/_virtual/object-get-own-property-symbols.js +6 -0
  19. package/dist/cjs/_virtual/object-get-own-property-symbols.js.map +1 -0
  20. package/dist/cjs/_virtual/object-property-is-enumerable.js +6 -0
  21. package/dist/cjs/_virtual/object-property-is-enumerable.js.map +1 -0
  22. package/dist/cjs/_virtual/performance-now.js +6 -0
  23. package/dist/cjs/_virtual/performance-now.js.map +1 -0
  24. package/dist/cjs/_virtual/qrious.js +6 -0
  25. package/dist/cjs/_virtual/qrious.js.map +1 -0
  26. package/dist/cjs/_virtual/shared-store.js +6 -0
  27. package/dist/cjs/_virtual/shared-store.js.map +1 -0
  28. package/dist/cjs/components/IDCardDesigner.js +283 -0
  29. package/dist/cjs/components/IDCardDesigner.js.map +1 -0
  30. package/dist/cjs/components/IDCardGenerator.js +139 -0
  31. package/dist/cjs/components/IDCardGenerator.js.map +1 -0
  32. package/dist/cjs/components/IDCardPreview.js +168 -0
  33. package/dist/cjs/components/IDCardPreview.js.map +1 -0
  34. package/dist/cjs/core/exportUtils.js +155 -0
  35. package/dist/cjs/core/exportUtils.js.map +1 -0
  36. package/dist/cjs/core/qrUtils.js +64 -0
  37. package/dist/cjs/core/qrUtils.js.map +1 -0
  38. package/dist/cjs/hooks/useFieldMapping.js +148 -0
  39. package/dist/cjs/hooks/useFieldMapping.js.map +1 -0
  40. package/dist/cjs/hooks/useIDCardExport.js +81 -0
  41. package/dist/cjs/hooks/useIDCardExport.js.map +1 -0
  42. package/dist/cjs/hooks/useIDCardTemplate.js +155 -0
  43. package/dist/cjs/hooks/useIDCardTemplate.js.map +1 -0
  44. package/dist/cjs/index.js +48 -0
  45. package/dist/cjs/index.js.map +1 -0
  46. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +30 -0
  47. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js.map +1 -0
  48. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/defineProperty.js +15 -0
  49. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +1 -0
  50. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +17 -0
  51. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -0
  52. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +12 -0
  53. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +1 -0
  54. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/typeof.js +14 -0
  55. package/dist/cjs/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -0
  56. package/dist/cjs/node_modules/canvg/lib/index.es.js +6645 -0
  57. package/dist/cjs/node_modules/canvg/lib/index.es.js.map +1 -0
  58. package/dist/cjs/node_modules/core-js/internals/a-callable.js +18 -0
  59. package/dist/cjs/node_modules/core-js/internals/a-callable.js.map +1 -0
  60. package/dist/cjs/node_modules/core-js/internals/a-constructor.js +18 -0
  61. package/dist/cjs/node_modules/core-js/internals/a-constructor.js.map +1 -0
  62. package/dist/cjs/node_modules/core-js/internals/a-possible-prototype.js +16 -0
  63. package/dist/cjs/node_modules/core-js/internals/a-possible-prototype.js.map +1 -0
  64. package/dist/cjs/node_modules/core-js/internals/add-to-unscopables.js +30 -0
  65. package/dist/cjs/node_modules/core-js/internals/add-to-unscopables.js.map +1 -0
  66. package/dist/cjs/node_modules/core-js/internals/advance-string-index.js +14 -0
  67. package/dist/cjs/node_modules/core-js/internals/advance-string-index.js.map +1 -0
  68. package/dist/cjs/node_modules/core-js/internals/an-instance.js +15 -0
  69. package/dist/cjs/node_modules/core-js/internals/an-instance.js.map +1 -0
  70. package/dist/cjs/node_modules/core-js/internals/an-object.js +17 -0
  71. package/dist/cjs/node_modules/core-js/internals/an-object.js.map +1 -0
  72. package/dist/cjs/node_modules/core-js/internals/array-includes.js +39 -0
  73. package/dist/cjs/node_modules/core-js/internals/array-includes.js.map +1 -0
  74. package/dist/cjs/node_modules/core-js/internals/array-method-is-strict.js +16 -0
  75. package/dist/cjs/node_modules/core-js/internals/array-method-is-strict.js.map +1 -0
  76. package/dist/cjs/node_modules/core-js/internals/array-reduce.js +51 -0
  77. package/dist/cjs/node_modules/core-js/internals/array-reduce.js.map +1 -0
  78. package/dist/cjs/node_modules/core-js/internals/array-slice.js +10 -0
  79. package/dist/cjs/node_modules/core-js/internals/array-slice.js.map +1 -0
  80. package/dist/cjs/node_modules/core-js/internals/check-correctness-of-iteration.js +49 -0
  81. package/dist/cjs/node_modules/core-js/internals/check-correctness-of-iteration.js.map +1 -0
  82. package/dist/cjs/node_modules/core-js/internals/classof-raw.js +15 -0
  83. package/dist/cjs/node_modules/core-js/internals/classof-raw.js.map +1 -0
  84. package/dist/cjs/node_modules/core-js/internals/classof.js +39 -0
  85. package/dist/cjs/node_modules/core-js/internals/classof.js.map +1 -0
  86. package/dist/cjs/node_modules/core-js/internals/copy-constructor-properties.js +28 -0
  87. package/dist/cjs/node_modules/core-js/internals/copy-constructor-properties.js.map +1 -0
  88. package/dist/cjs/node_modules/core-js/internals/correct-is-regexp-logic.js +22 -0
  89. package/dist/cjs/node_modules/core-js/internals/correct-is-regexp-logic.js.map +1 -0
  90. package/dist/cjs/node_modules/core-js/internals/correct-prototype-getter.js +15 -0
  91. package/dist/cjs/node_modules/core-js/internals/correct-prototype-getter.js.map +1 -0
  92. package/dist/cjs/node_modules/core-js/internals/create-iter-result-object.js +10 -0
  93. package/dist/cjs/node_modules/core-js/internals/create-iter-result-object.js.map +1 -0
  94. package/dist/cjs/node_modules/core-js/internals/create-non-enumerable-property.js +20 -0
  95. package/dist/cjs/node_modules/core-js/internals/create-non-enumerable-property.js.map +1 -0
  96. package/dist/cjs/node_modules/core-js/internals/create-property-descriptor.js +13 -0
  97. package/dist/cjs/node_modules/core-js/internals/create-property-descriptor.js.map +1 -0
  98. package/dist/cjs/node_modules/core-js/internals/define-built-in-accessor.js +17 -0
  99. package/dist/cjs/node_modules/core-js/internals/define-built-in-accessor.js.map +1 -0
  100. package/dist/cjs/node_modules/core-js/internals/define-built-in.js +38 -0
  101. package/dist/cjs/node_modules/core-js/internals/define-built-in.js.map +1 -0
  102. package/dist/cjs/node_modules/core-js/internals/define-global-property.js +19 -0
  103. package/dist/cjs/node_modules/core-js/internals/define-global-property.js.map +1 -0
  104. package/dist/cjs/node_modules/core-js/internals/descriptors.js +14 -0
  105. package/dist/cjs/node_modules/core-js/internals/descriptors.js.map +1 -0
  106. package/dist/cjs/node_modules/core-js/internals/document-create-element.js +18 -0
  107. package/dist/cjs/node_modules/core-js/internals/document-create-element.js.map +1 -0
  108. package/dist/cjs/node_modules/core-js/internals/dom-iterables.js +40 -0
  109. package/dist/cjs/node_modules/core-js/internals/dom-iterables.js.map +1 -0
  110. package/dist/cjs/node_modules/core-js/internals/dom-token-list-prototype.js +14 -0
  111. package/dist/cjs/node_modules/core-js/internals/dom-token-list-prototype.js.map +1 -0
  112. package/dist/cjs/node_modules/core-js/internals/enum-bug-keys.js +15 -0
  113. package/dist/cjs/node_modules/core-js/internals/enum-bug-keys.js.map +1 -0
  114. package/dist/cjs/node_modules/core-js/internals/environment-is-ios-pebble.js +10 -0
  115. package/dist/cjs/node_modules/core-js/internals/environment-is-ios-pebble.js.map +1 -0
  116. package/dist/cjs/node_modules/core-js/internals/environment-is-ios.js +11 -0
  117. package/dist/cjs/node_modules/core-js/internals/environment-is-ios.js.map +1 -0
  118. package/dist/cjs/node_modules/core-js/internals/environment-is-node.js +10 -0
  119. package/dist/cjs/node_modules/core-js/internals/environment-is-node.js.map +1 -0
  120. package/dist/cjs/node_modules/core-js/internals/environment-is-webos-webkit.js +10 -0
  121. package/dist/cjs/node_modules/core-js/internals/environment-is-webos-webkit.js.map +1 -0
  122. package/dist/cjs/node_modules/core-js/internals/environment-user-agent.js +13 -0
  123. package/dist/cjs/node_modules/core-js/internals/environment-user-agent.js.map +1 -0
  124. package/dist/cjs/node_modules/core-js/internals/environment-v8-version.js +35 -0
  125. package/dist/cjs/node_modules/core-js/internals/environment-v8-version.js.map +1 -0
  126. package/dist/cjs/node_modules/core-js/internals/environment.js +29 -0
  127. package/dist/cjs/node_modules/core-js/internals/environment.js.map +1 -0
  128. package/dist/cjs/node_modules/core-js/internals/export.js +68 -0
  129. package/dist/cjs/node_modules/core-js/internals/export.js.map +1 -0
  130. package/dist/cjs/node_modules/core-js/internals/fails.js +12 -0
  131. package/dist/cjs/node_modules/core-js/internals/fails.js.map +1 -0
  132. package/dist/cjs/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js +90 -0
  133. package/dist/cjs/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js.map +1 -0
  134. package/dist/cjs/node_modules/core-js/internals/function-apply.js +17 -0
  135. package/dist/cjs/node_modules/core-js/internals/function-apply.js.map +1 -0
  136. package/dist/cjs/node_modules/core-js/internals/function-bind-context.js +22 -0
  137. package/dist/cjs/node_modules/core-js/internals/function-bind-context.js.map +1 -0
  138. package/dist/cjs/node_modules/core-js/internals/function-bind-native.js +15 -0
  139. package/dist/cjs/node_modules/core-js/internals/function-bind-native.js.map +1 -0
  140. package/dist/cjs/node_modules/core-js/internals/function-call.js +14 -0
  141. package/dist/cjs/node_modules/core-js/internals/function-call.js.map +1 -0
  142. package/dist/cjs/node_modules/core-js/internals/function-name.js +24 -0
  143. package/dist/cjs/node_modules/core-js/internals/function-name.js.map +1 -0
  144. package/dist/cjs/node_modules/core-js/internals/function-uncurry-this-accessor.js +17 -0
  145. package/dist/cjs/node_modules/core-js/internals/function-uncurry-this-accessor.js.map +1 -0
  146. package/dist/cjs/node_modules/core-js/internals/function-uncurry-this-clause.js +17 -0
  147. package/dist/cjs/node_modules/core-js/internals/function-uncurry-this-clause.js.map +1 -0
  148. package/dist/cjs/node_modules/core-js/internals/function-uncurry-this.js +19 -0
  149. package/dist/cjs/node_modules/core-js/internals/function-uncurry-this.js.map +1 -0
  150. package/dist/cjs/node_modules/core-js/internals/get-built-in.js +18 -0
  151. package/dist/cjs/node_modules/core-js/internals/get-built-in.js.map +1 -0
  152. package/dist/cjs/node_modules/core-js/internals/get-iterator-method.js +24 -0
  153. package/dist/cjs/node_modules/core-js/internals/get-iterator-method.js.map +1 -0
  154. package/dist/cjs/node_modules/core-js/internals/get-iterator.js +24 -0
  155. package/dist/cjs/node_modules/core-js/internals/get-iterator.js.map +1 -0
  156. package/dist/cjs/node_modules/core-js/internals/get-method.js +17 -0
  157. package/dist/cjs/node_modules/core-js/internals/get-method.js.map +1 -0
  158. package/dist/cjs/node_modules/core-js/internals/get-substitution.js +53 -0
  159. package/dist/cjs/node_modules/core-js/internals/get-substitution.js.map +1 -0
  160. package/dist/cjs/node_modules/core-js/internals/global-this.js +22 -0
  161. package/dist/cjs/node_modules/core-js/internals/global-this.js.map +1 -0
  162. package/dist/cjs/node_modules/core-js/internals/has-own-property.js +19 -0
  163. package/dist/cjs/node_modules/core-js/internals/has-own-property.js.map +1 -0
  164. package/dist/cjs/node_modules/core-js/internals/hidden-keys.js +6 -0
  165. package/dist/cjs/node_modules/core-js/internals/hidden-keys.js.map +1 -0
  166. package/dist/cjs/node_modules/core-js/internals/host-report-errors.js +11 -0
  167. package/dist/cjs/node_modules/core-js/internals/host-report-errors.js.map +1 -0
  168. package/dist/cjs/node_modules/core-js/internals/html.js +10 -0
  169. package/dist/cjs/node_modules/core-js/internals/html.js.map +1 -0
  170. package/dist/cjs/node_modules/core-js/internals/ie8-dom-define.js +20 -0
  171. package/dist/cjs/node_modules/core-js/internals/ie8-dom-define.js.map +1 -0
  172. package/dist/cjs/node_modules/core-js/internals/indexed-object.js +24 -0
  173. package/dist/cjs/node_modules/core-js/internals/indexed-object.js.map +1 -0
  174. package/dist/cjs/node_modules/core-js/internals/inspect-source.js +23 -0
  175. package/dist/cjs/node_modules/core-js/internals/inspect-source.js.map +1 -0
  176. package/dist/cjs/node_modules/core-js/internals/internal-state.js +84 -0
  177. package/dist/cjs/node_modules/core-js/internals/internal-state.js.map +1 -0
  178. package/dist/cjs/node_modules/core-js/internals/is-array-iterator-method.js +18 -0
  179. package/dist/cjs/node_modules/core-js/internals/is-array-iterator-method.js.map +1 -0
  180. package/dist/cjs/node_modules/core-js/internals/is-array.js +15 -0
  181. package/dist/cjs/node_modules/core-js/internals/is-array.js.map +1 -0
  182. package/dist/cjs/node_modules/core-js/internals/is-callable.js +16 -0
  183. package/dist/cjs/node_modules/core-js/internals/is-callable.js.map +1 -0
  184. package/dist/cjs/node_modules/core-js/internals/is-constructor.js +63 -0
  185. package/dist/cjs/node_modules/core-js/internals/is-constructor.js.map +1 -0
  186. package/dist/cjs/node_modules/core-js/internals/is-forced.js +30 -0
  187. package/dist/cjs/node_modules/core-js/internals/is-forced.js.map +1 -0
  188. package/dist/cjs/node_modules/core-js/internals/is-null-or-undefined.js +10 -0
  189. package/dist/cjs/node_modules/core-js/internals/is-null-or-undefined.js.map +1 -0
  190. package/dist/cjs/node_modules/core-js/internals/is-object.js +12 -0
  191. package/dist/cjs/node_modules/core-js/internals/is-object.js.map +1 -0
  192. package/dist/cjs/node_modules/core-js/internals/is-possible-prototype.js +12 -0
  193. package/dist/cjs/node_modules/core-js/internals/is-possible-prototype.js.map +1 -0
  194. package/dist/cjs/node_modules/core-js/internals/is-regexp.js +21 -0
  195. package/dist/cjs/node_modules/core-js/internals/is-regexp.js.map +1 -0
  196. package/dist/cjs/node_modules/core-js/internals/is-symbol.js +23 -0
  197. package/dist/cjs/node_modules/core-js/internals/is-symbol.js.map +1 -0
  198. package/dist/cjs/node_modules/core-js/internals/iterate.js +84 -0
  199. package/dist/cjs/node_modules/core-js/internals/iterate.js.map +1 -0
  200. package/dist/cjs/node_modules/core-js/internals/iterator-close.js +32 -0
  201. package/dist/cjs/node_modules/core-js/internals/iterator-close.js.map +1 -0
  202. package/dist/cjs/node_modules/core-js/internals/iterator-create-constructor.js +26 -0
  203. package/dist/cjs/node_modules/core-js/internals/iterator-create-constructor.js.map +1 -0
  204. package/dist/cjs/node_modules/core-js/internals/iterator-define.js +118 -0
  205. package/dist/cjs/node_modules/core-js/internals/iterator-define.js.map +1 -0
  206. package/dist/cjs/node_modules/core-js/internals/iterators-core.js +58 -0
  207. package/dist/cjs/node_modules/core-js/internals/iterators-core.js.map +1 -0
  208. package/dist/cjs/node_modules/core-js/internals/iterators.js +6 -0
  209. package/dist/cjs/node_modules/core-js/internals/iterators.js.map +1 -0
  210. package/dist/cjs/node_modules/core-js/internals/length-of-array-like.js +14 -0
  211. package/dist/cjs/node_modules/core-js/internals/length-of-array-like.js.map +1 -0
  212. package/dist/cjs/node_modules/core-js/internals/make-built-in.js +71 -0
  213. package/dist/cjs/node_modules/core-js/internals/make-built-in.js.map +1 -0
  214. package/dist/cjs/node_modules/core-js/internals/math-trunc.js +15 -0
  215. package/dist/cjs/node_modules/core-js/internals/math-trunc.js.map +1 -0
  216. package/dist/cjs/node_modules/core-js/internals/microtask.js +93 -0
  217. package/dist/cjs/node_modules/core-js/internals/microtask.js.map +1 -0
  218. package/dist/cjs/node_modules/core-js/internals/new-promise-capability.js +28 -0
  219. package/dist/cjs/node_modules/core-js/internals/new-promise-capability.js.map +1 -0
  220. package/dist/cjs/node_modules/core-js/internals/not-a-regexp.js +16 -0
  221. package/dist/cjs/node_modules/core-js/internals/not-a-regexp.js.map +1 -0
  222. package/dist/cjs/node_modules/core-js/internals/object-create.js +98 -0
  223. package/dist/cjs/node_modules/core-js/internals/object-create.js.map +1 -0
  224. package/dist/cjs/node_modules/core-js/internals/object-define-properties.js +34 -0
  225. package/dist/cjs/node_modules/core-js/internals/object-define-properties.js.map +1 -0
  226. package/dist/cjs/node_modules/core-js/internals/object-define-property.js +55 -0
  227. package/dist/cjs/node_modules/core-js/internals/object-define-property.js.map +1 -0
  228. package/dist/cjs/node_modules/core-js/internals/object-get-own-property-descriptor.js +38 -0
  229. package/dist/cjs/node_modules/core-js/internals/object-get-own-property-descriptor.js.map +1 -0
  230. package/dist/cjs/node_modules/core-js/internals/object-get-own-property-names.js +20 -0
  231. package/dist/cjs/node_modules/core-js/internals/object-get-own-property-names.js.map +1 -0
  232. package/dist/cjs/node_modules/core-js/internals/object-get-own-property-symbols.js +9 -0
  233. package/dist/cjs/node_modules/core-js/internals/object-get-own-property-symbols.js.map +1 -0
  234. package/dist/cjs/node_modules/core-js/internals/object-get-prototype-of.js +32 -0
  235. package/dist/cjs/node_modules/core-js/internals/object-get-prototype-of.js.map +1 -0
  236. package/dist/cjs/node_modules/core-js/internals/object-is-prototype-of.js +10 -0
  237. package/dist/cjs/node_modules/core-js/internals/object-is-prototype-of.js.map +1 -0
  238. package/dist/cjs/node_modules/core-js/internals/object-keys-internal.js +31 -0
  239. package/dist/cjs/node_modules/core-js/internals/object-keys-internal.js.map +1 -0
  240. package/dist/cjs/node_modules/core-js/internals/object-keys.js +17 -0
  241. package/dist/cjs/node_modules/core-js/internals/object-keys.js.map +1 -0
  242. package/dist/cjs/node_modules/core-js/internals/object-property-is-enumerable.js +20 -0
  243. package/dist/cjs/node_modules/core-js/internals/object-property-is-enumerable.js.map +1 -0
  244. package/dist/cjs/node_modules/core-js/internals/object-set-prototype-of.js +38 -0
  245. package/dist/cjs/node_modules/core-js/internals/object-set-prototype-of.js.map +1 -0
  246. package/dist/cjs/node_modules/core-js/internals/ordinary-to-primitive.js +24 -0
  247. package/dist/cjs/node_modules/core-js/internals/ordinary-to-primitive.js.map +1 -0
  248. package/dist/cjs/node_modules/core-js/internals/own-keys.js +27 -0
  249. package/dist/cjs/node_modules/core-js/internals/own-keys.js.map +1 -0
  250. package/dist/cjs/node_modules/core-js/internals/path.js +10 -0
  251. package/dist/cjs/node_modules/core-js/internals/path.js.map +1 -0
  252. package/dist/cjs/node_modules/core-js/internals/perform.js +12 -0
  253. package/dist/cjs/node_modules/core-js/internals/perform.js.map +1 -0
  254. package/dist/cjs/node_modules/core-js/internals/promise-constructor-detection.js +57 -0
  255. package/dist/cjs/node_modules/core-js/internals/promise-constructor-detection.js.map +1 -0
  256. package/dist/cjs/node_modules/core-js/internals/promise-native-constructor.js +10 -0
  257. package/dist/cjs/node_modules/core-js/internals/promise-native-constructor.js.map +1 -0
  258. package/dist/cjs/node_modules/core-js/internals/promise-resolve.js +22 -0
  259. package/dist/cjs/node_modules/core-js/internals/promise-resolve.js.map +1 -0
  260. package/dist/cjs/node_modules/core-js/internals/promise-statics-incorrect-iteration.js +16 -0
  261. package/dist/cjs/node_modules/core-js/internals/promise-statics-incorrect-iteration.js.map +1 -0
  262. package/dist/cjs/node_modules/core-js/internals/queue.js +29 -0
  263. package/dist/cjs/node_modules/core-js/internals/queue.js.map +1 -0
  264. package/dist/cjs/node_modules/core-js/internals/regexp-exec-abstract.js +31 -0
  265. package/dist/cjs/node_modules/core-js/internals/regexp-exec-abstract.js.map +1 -0
  266. package/dist/cjs/node_modules/core-js/internals/regexp-exec.js +132 -0
  267. package/dist/cjs/node_modules/core-js/internals/regexp-exec.js.map +1 -0
  268. package/dist/cjs/node_modules/core-js/internals/regexp-flags-detection.js +54 -0
  269. package/dist/cjs/node_modules/core-js/internals/regexp-flags-detection.js.map +1 -0
  270. package/dist/cjs/node_modules/core-js/internals/regexp-flags.js +24 -0
  271. package/dist/cjs/node_modules/core-js/internals/regexp-flags.js.map +1 -0
  272. package/dist/cjs/node_modules/core-js/internals/regexp-get-flags.js +26 -0
  273. package/dist/cjs/node_modules/core-js/internals/regexp-get-flags.js.map +1 -0
  274. package/dist/cjs/node_modules/core-js/internals/regexp-sticky-helpers.js +37 -0
  275. package/dist/cjs/node_modules/core-js/internals/regexp-sticky-helpers.js.map +1 -0
  276. package/dist/cjs/node_modules/core-js/internals/regexp-unsupported-dot-all.js +18 -0
  277. package/dist/cjs/node_modules/core-js/internals/regexp-unsupported-dot-all.js.map +1 -0
  278. package/dist/cjs/node_modules/core-js/internals/regexp-unsupported-ncg.js +19 -0
  279. package/dist/cjs/node_modules/core-js/internals/regexp-unsupported-ncg.js.map +1 -0
  280. package/dist/cjs/node_modules/core-js/internals/require-object-coercible.js +17 -0
  281. package/dist/cjs/node_modules/core-js/internals/require-object-coercible.js.map +1 -0
  282. package/dist/cjs/node_modules/core-js/internals/safe-get-built-in.js +20 -0
  283. package/dist/cjs/node_modules/core-js/internals/safe-get-built-in.js.map +1 -0
  284. package/dist/cjs/node_modules/core-js/internals/set-species.js +27 -0
  285. package/dist/cjs/node_modules/core-js/internals/set-species.js.map +1 -0
  286. package/dist/cjs/node_modules/core-js/internals/set-to-string-tag.js +22 -0
  287. package/dist/cjs/node_modules/core-js/internals/set-to-string-tag.js.map +1 -0
  288. package/dist/cjs/node_modules/core-js/internals/shared-key.js +16 -0
  289. package/dist/cjs/node_modules/core-js/internals/shared-key.js.map +1 -0
  290. package/dist/cjs/node_modules/core-js/internals/shared-store.js +24 -0
  291. package/dist/cjs/node_modules/core-js/internals/shared-store.js.map +1 -0
  292. package/dist/cjs/node_modules/core-js/internals/shared.js +12 -0
  293. package/dist/cjs/node_modules/core-js/internals/shared.js.map +1 -0
  294. package/dist/cjs/node_modules/core-js/internals/species-constructor.js +24 -0
  295. package/dist/cjs/node_modules/core-js/internals/species-constructor.js.map +1 -0
  296. package/dist/cjs/node_modules/core-js/internals/string-multibyte.js +43 -0
  297. package/dist/cjs/node_modules/core-js/internals/string-multibyte.js.map +1 -0
  298. package/dist/cjs/node_modules/core-js/internals/string-trim-forced.js +24 -0
  299. package/dist/cjs/node_modules/core-js/internals/string-trim-forced.js.map +1 -0
  300. package/dist/cjs/node_modules/core-js/internals/string-trim.js +34 -0
  301. package/dist/cjs/node_modules/core-js/internals/string-trim.js.map +1 -0
  302. package/dist/cjs/node_modules/core-js/internals/symbol-constructor-detection.js +27 -0
  303. package/dist/cjs/node_modules/core-js/internals/symbol-constructor-detection.js.map +1 -0
  304. package/dist/cjs/node_modules/core-js/internals/task.js +132 -0
  305. package/dist/cjs/node_modules/core-js/internals/task.js.map +1 -0
  306. package/dist/cjs/node_modules/core-js/internals/to-absolute-index.js +19 -0
  307. package/dist/cjs/node_modules/core-js/internals/to-absolute-index.js.map +1 -0
  308. package/dist/cjs/node_modules/core-js/internals/to-indexed-object.js +15 -0
  309. package/dist/cjs/node_modules/core-js/internals/to-indexed-object.js.map +1 -0
  310. package/dist/cjs/node_modules/core-js/internals/to-integer-or-infinity.js +16 -0
  311. package/dist/cjs/node_modules/core-js/internals/to-integer-or-infinity.js.map +1 -0
  312. package/dist/cjs/node_modules/core-js/internals/to-length.js +17 -0
  313. package/dist/cjs/node_modules/core-js/internals/to-length.js.map +1 -0
  314. package/dist/cjs/node_modules/core-js/internals/to-object.js +16 -0
  315. package/dist/cjs/node_modules/core-js/internals/to-object.js.map +1 -0
  316. package/dist/cjs/node_modules/core-js/internals/to-primitive.js +37 -0
  317. package/dist/cjs/node_modules/core-js/internals/to-primitive.js.map +1 -0
  318. package/dist/cjs/node_modules/core-js/internals/to-property-key.js +17 -0
  319. package/dist/cjs/node_modules/core-js/internals/to-property-key.js.map +1 -0
  320. package/dist/cjs/node_modules/core-js/internals/to-string-tag-support.js +15 -0
  321. package/dist/cjs/node_modules/core-js/internals/to-string-tag-support.js.map +1 -0
  322. package/dist/cjs/node_modules/core-js/internals/to-string.js +15 -0
  323. package/dist/cjs/node_modules/core-js/internals/to-string.js.map +1 -0
  324. package/dist/cjs/node_modules/core-js/internals/try-to-string.js +14 -0
  325. package/dist/cjs/node_modules/core-js/internals/try-to-string.js.map +1 -0
  326. package/dist/cjs/node_modules/core-js/internals/uid.js +16 -0
  327. package/dist/cjs/node_modules/core-js/internals/uid.js.map +1 -0
  328. package/dist/cjs/node_modules/core-js/internals/use-symbol-as-uid.js +13 -0
  329. package/dist/cjs/node_modules/core-js/internals/use-symbol-as-uid.js.map +1 -0
  330. package/dist/cjs/node_modules/core-js/internals/v8-prototype-define-bug.js +20 -0
  331. package/dist/cjs/node_modules/core-js/internals/v8-prototype-define-bug.js.map +1 -0
  332. package/dist/cjs/node_modules/core-js/internals/validate-arguments-length.js +11 -0
  333. package/dist/cjs/node_modules/core-js/internals/validate-arguments-length.js.map +1 -0
  334. package/dist/cjs/node_modules/core-js/internals/weak-map-basic-detection.js +14 -0
  335. package/dist/cjs/node_modules/core-js/internals/weak-map-basic-detection.js.map +1 -0
  336. package/dist/cjs/node_modules/core-js/internals/well-known-symbol.js +30 -0
  337. package/dist/cjs/node_modules/core-js/internals/well-known-symbol.js.map +1 -0
  338. package/dist/cjs/node_modules/core-js/internals/whitespaces.js +8 -0
  339. package/dist/cjs/node_modules/core-js/internals/whitespaces.js.map +1 -0
  340. package/dist/cjs/node_modules/core-js/modules/es.array.index-of.js +30 -0
  341. package/dist/cjs/node_modules/core-js/modules/es.array.index-of.js.map +1 -0
  342. package/dist/cjs/node_modules/core-js/modules/es.array.iterator.js +75 -0
  343. package/dist/cjs/node_modules/core-js/modules/es.array.iterator.js.map +1 -0
  344. package/dist/cjs/node_modules/core-js/modules/es.array.reduce.js +28 -0
  345. package/dist/cjs/node_modules/core-js/modules/es.array.reduce.js.map +1 -0
  346. package/dist/cjs/node_modules/core-js/modules/es.array.reverse.js +25 -0
  347. package/dist/cjs/node_modules/core-js/modules/es.array.reverse.js.map +1 -0
  348. package/dist/cjs/node_modules/core-js/modules/es.promise.all.js +50 -0
  349. package/dist/cjs/node_modules/core-js/modules/es.promise.all.js.map +1 -0
  350. package/dist/cjs/node_modules/core-js/modules/es.promise.catch.js +34 -0
  351. package/dist/cjs/node_modules/core-js/modules/es.promise.catch.js.map +1 -0
  352. package/dist/cjs/node_modules/core-js/modules/es.promise.constructor.js +319 -0
  353. package/dist/cjs/node_modules/core-js/modules/es.promise.constructor.js.map +1 -0
  354. package/dist/cjs/node_modules/core-js/modules/es.promise.race.js +37 -0
  355. package/dist/cjs/node_modules/core-js/modules/es.promise.race.js.map +1 -0
  356. package/dist/cjs/node_modules/core-js/modules/es.promise.reject.js +22 -0
  357. package/dist/cjs/node_modules/core-js/modules/es.promise.reject.js.map +1 -0
  358. package/dist/cjs/node_modules/core-js/modules/es.promise.resolve.js +23 -0
  359. package/dist/cjs/node_modules/core-js/modules/es.promise.resolve.js.map +1 -0
  360. package/dist/cjs/node_modules/core-js/modules/es.regexp.exec.js +14 -0
  361. package/dist/cjs/node_modules/core-js/modules/es.regexp.exec.js.map +1 -0
  362. package/dist/cjs/node_modules/core-js/modules/es.regexp.to-string.js +35 -0
  363. package/dist/cjs/node_modules/core-js/modules/es.regexp.to-string.js.map +1 -0
  364. package/dist/cjs/node_modules/core-js/modules/es.string.ends-with.js +45 -0
  365. package/dist/cjs/node_modules/core-js/modules/es.string.ends-with.js.map +1 -0
  366. package/dist/cjs/node_modules/core-js/modules/es.string.includes.js +30 -0
  367. package/dist/cjs/node_modules/core-js/modules/es.string.includes.js.map +1 -0
  368. package/dist/cjs/node_modules/core-js/modules/es.string.match.js +69 -0
  369. package/dist/cjs/node_modules/core-js/modules/es.string.match.js.map +1 -0
  370. package/dist/cjs/node_modules/core-js/modules/es.string.replace.js +165 -0
  371. package/dist/cjs/node_modules/core-js/modules/es.string.replace.js.map +1 -0
  372. package/dist/cjs/node_modules/core-js/modules/es.string.split.js +128 -0
  373. package/dist/cjs/node_modules/core-js/modules/es.string.split.js.map +1 -0
  374. package/dist/cjs/node_modules/core-js/modules/es.string.starts-with.js +43 -0
  375. package/dist/cjs/node_modules/core-js/modules/es.string.starts-with.js.map +1 -0
  376. package/dist/cjs/node_modules/core-js/modules/es.string.trim.js +18 -0
  377. package/dist/cjs/node_modules/core-js/modules/es.string.trim.js.map +1 -0
  378. package/dist/cjs/node_modules/core-js/modules/web.dom-collections.iterator.js +47 -0
  379. package/dist/cjs/node_modules/core-js/modules/web.dom-collections.iterator.js.map +1 -0
  380. package/dist/cjs/node_modules/dompurify/dist/purify.es.js +1533 -0
  381. package/dist/cjs/node_modules/dompurify/dist/purify.es.js.map +1 -0
  382. package/dist/cjs/node_modules/fflate/esm/browser.js +807 -0
  383. package/dist/cjs/node_modules/fflate/esm/browser.js.map +1 -0
  384. package/dist/cjs/node_modules/html2canvas/dist/html2canvas.esm.js +7824 -0
  385. package/dist/cjs/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -0
  386. package/dist/cjs/node_modules/jspdf/dist/jspdf.es.min.js +358 -0
  387. package/dist/cjs/node_modules/jspdf/dist/jspdf.es.min.js.map +1 -0
  388. package/dist/cjs/node_modules/performance-now/lib/performance-now.js +46 -0
  389. package/dist/cjs/node_modules/performance-now/lib/performance-now.js.map +1 -0
  390. package/dist/cjs/node_modules/qrious/dist/qrious.js +2374 -0
  391. package/dist/cjs/node_modules/qrious/dist/qrious.js.map +1 -0
  392. package/dist/cjs/node_modules/raf/index.js +87 -0
  393. package/dist/cjs/node_modules/raf/index.js.map +1 -0
  394. package/dist/cjs/node_modules/rgbcolor/index.js +311 -0
  395. package/dist/cjs/node_modules/rgbcolor/index.js.map +1 -0
  396. package/dist/cjs/node_modules/stackblur-canvas/dist/stackblur-es.js +384 -0
  397. package/dist/cjs/node_modules/stackblur-canvas/dist/stackblur-es.js.map +1 -0
  398. package/dist/cjs/node_modules/svg-pathdata/lib/SVGPathData.module.js +23 -0
  399. package/dist/cjs/node_modules/svg-pathdata/lib/SVGPathData.module.js.map +1 -0
  400. package/dist/cjs/storage/templateStorage.js +154 -0
  401. package/dist/cjs/storage/templateStorage.js.map +1 -0
  402. package/dist/cjs/styles.css +1 -0
  403. package/dist/cjs/utils/styleUtils.js +98 -0
  404. package/dist/cjs/utils/styleUtils.js.map +1 -0
  405. package/dist/cjs/utils/validators.js +144 -0
  406. package/dist/cjs/utils/validators.js.map +1 -0
  407. package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
  408. package/dist/esm/_virtual/_commonjsHelpers.js.map +1 -0
  409. package/dist/esm/_virtual/index.js +4 -0
  410. package/dist/esm/_virtual/index.js.map +1 -0
  411. package/dist/esm/_virtual/make-built-in.js +4 -0
  412. package/dist/esm/_virtual/make-built-in.js.map +1 -0
  413. package/dist/esm/_virtual/new-promise-capability.js +4 -0
  414. package/dist/esm/_virtual/new-promise-capability.js.map +1 -0
  415. package/dist/esm/_virtual/object-define-properties.js +4 -0
  416. package/dist/esm/_virtual/object-define-properties.js.map +1 -0
  417. package/dist/esm/_virtual/object-define-property.js +4 -0
  418. package/dist/esm/_virtual/object-define-property.js.map +1 -0
  419. package/dist/esm/_virtual/object-get-own-property-descriptor.js +4 -0
  420. package/dist/esm/_virtual/object-get-own-property-descriptor.js.map +1 -0
  421. package/dist/esm/_virtual/object-get-own-property-names.js +4 -0
  422. package/dist/esm/_virtual/object-get-own-property-names.js.map +1 -0
  423. package/dist/esm/_virtual/object-get-own-property-symbols.js +4 -0
  424. package/dist/esm/_virtual/object-get-own-property-symbols.js.map +1 -0
  425. package/dist/esm/_virtual/object-property-is-enumerable.js +4 -0
  426. package/dist/esm/_virtual/object-property-is-enumerable.js.map +1 -0
  427. package/dist/esm/_virtual/performance-now.js +4 -0
  428. package/dist/esm/_virtual/performance-now.js.map +1 -0
  429. package/dist/esm/_virtual/qrious.js +4 -0
  430. package/dist/esm/_virtual/qrious.js.map +1 -0
  431. package/dist/esm/_virtual/shared-store.js +4 -0
  432. package/dist/esm/_virtual/shared-store.js.map +1 -0
  433. package/dist/esm/components/IDCardDesigner.js +278 -0
  434. package/dist/esm/components/IDCardDesigner.js.map +1 -0
  435. package/dist/esm/components/IDCardGenerator.js +134 -0
  436. package/dist/esm/components/IDCardGenerator.js.map +1 -0
  437. package/dist/esm/components/IDCardPreview.js +163 -0
  438. package/dist/esm/components/IDCardPreview.js.map +1 -0
  439. package/dist/esm/core/exportUtils.js +151 -0
  440. package/dist/esm/core/exportUtils.js.map +1 -0
  441. package/dist/esm/core/qrUtils.js +60 -0
  442. package/dist/esm/core/qrUtils.js.map +1 -0
  443. package/dist/esm/hooks/useFieldMapping.js +146 -0
  444. package/dist/esm/hooks/useFieldMapping.js.map +1 -0
  445. package/dist/esm/hooks/useIDCardExport.js +79 -0
  446. package/dist/esm/hooks/useIDCardExport.js.map +1 -0
  447. package/dist/esm/hooks/useIDCardTemplate.js +153 -0
  448. package/dist/esm/hooks/useIDCardTemplate.js.map +1 -0
  449. package/dist/esm/index.js +12 -0
  450. package/dist/esm/index.js.map +1 -0
  451. package/dist/esm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +28 -0
  452. package/dist/esm/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js.map +1 -0
  453. package/dist/esm/node_modules/@babel/runtime/helpers/esm/defineProperty.js +13 -0
  454. package/dist/esm/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +1 -0
  455. package/dist/esm/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +15 -0
  456. package/dist/esm/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -0
  457. package/dist/esm/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +10 -0
  458. package/dist/esm/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +1 -0
  459. package/dist/esm/node_modules/@babel/runtime/helpers/esm/typeof.js +12 -0
  460. package/dist/esm/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -0
  461. package/dist/esm/node_modules/canvg/lib/index.es.js +6556 -0
  462. package/dist/esm/node_modules/canvg/lib/index.es.js.map +1 -0
  463. package/dist/esm/node_modules/core-js/internals/a-callable.js +16 -0
  464. package/dist/esm/node_modules/core-js/internals/a-callable.js.map +1 -0
  465. package/dist/esm/node_modules/core-js/internals/a-constructor.js +16 -0
  466. package/dist/esm/node_modules/core-js/internals/a-constructor.js.map +1 -0
  467. package/dist/esm/node_modules/core-js/internals/a-possible-prototype.js +14 -0
  468. package/dist/esm/node_modules/core-js/internals/a-possible-prototype.js.map +1 -0
  469. package/dist/esm/node_modules/core-js/internals/add-to-unscopables.js +28 -0
  470. package/dist/esm/node_modules/core-js/internals/add-to-unscopables.js.map +1 -0
  471. package/dist/esm/node_modules/core-js/internals/advance-string-index.js +12 -0
  472. package/dist/esm/node_modules/core-js/internals/advance-string-index.js.map +1 -0
  473. package/dist/esm/node_modules/core-js/internals/an-instance.js +13 -0
  474. package/dist/esm/node_modules/core-js/internals/an-instance.js.map +1 -0
  475. package/dist/esm/node_modules/core-js/internals/an-object.js +15 -0
  476. package/dist/esm/node_modules/core-js/internals/an-object.js.map +1 -0
  477. package/dist/esm/node_modules/core-js/internals/array-includes.js +37 -0
  478. package/dist/esm/node_modules/core-js/internals/array-includes.js.map +1 -0
  479. package/dist/esm/node_modules/core-js/internals/array-method-is-strict.js +14 -0
  480. package/dist/esm/node_modules/core-js/internals/array-method-is-strict.js.map +1 -0
  481. package/dist/esm/node_modules/core-js/internals/array-reduce.js +49 -0
  482. package/dist/esm/node_modules/core-js/internals/array-reduce.js.map +1 -0
  483. package/dist/esm/node_modules/core-js/internals/array-slice.js +8 -0
  484. package/dist/esm/node_modules/core-js/internals/array-slice.js.map +1 -0
  485. package/dist/esm/node_modules/core-js/internals/check-correctness-of-iteration.js +47 -0
  486. package/dist/esm/node_modules/core-js/internals/check-correctness-of-iteration.js.map +1 -0
  487. package/dist/esm/node_modules/core-js/internals/classof-raw.js +13 -0
  488. package/dist/esm/node_modules/core-js/internals/classof-raw.js.map +1 -0
  489. package/dist/esm/node_modules/core-js/internals/classof.js +37 -0
  490. package/dist/esm/node_modules/core-js/internals/classof.js.map +1 -0
  491. package/dist/esm/node_modules/core-js/internals/copy-constructor-properties.js +26 -0
  492. package/dist/esm/node_modules/core-js/internals/copy-constructor-properties.js.map +1 -0
  493. package/dist/esm/node_modules/core-js/internals/correct-is-regexp-logic.js +20 -0
  494. package/dist/esm/node_modules/core-js/internals/correct-is-regexp-logic.js.map +1 -0
  495. package/dist/esm/node_modules/core-js/internals/correct-prototype-getter.js +13 -0
  496. package/dist/esm/node_modules/core-js/internals/correct-prototype-getter.js.map +1 -0
  497. package/dist/esm/node_modules/core-js/internals/create-iter-result-object.js +8 -0
  498. package/dist/esm/node_modules/core-js/internals/create-iter-result-object.js.map +1 -0
  499. package/dist/esm/node_modules/core-js/internals/create-non-enumerable-property.js +18 -0
  500. package/dist/esm/node_modules/core-js/internals/create-non-enumerable-property.js.map +1 -0
  501. package/dist/esm/node_modules/core-js/internals/create-property-descriptor.js +11 -0
  502. package/dist/esm/node_modules/core-js/internals/create-property-descriptor.js.map +1 -0
  503. package/dist/esm/node_modules/core-js/internals/define-built-in-accessor.js +15 -0
  504. package/dist/esm/node_modules/core-js/internals/define-built-in-accessor.js.map +1 -0
  505. package/dist/esm/node_modules/core-js/internals/define-built-in.js +36 -0
  506. package/dist/esm/node_modules/core-js/internals/define-built-in.js.map +1 -0
  507. package/dist/esm/node_modules/core-js/internals/define-global-property.js +17 -0
  508. package/dist/esm/node_modules/core-js/internals/define-global-property.js.map +1 -0
  509. package/dist/esm/node_modules/core-js/internals/descriptors.js +12 -0
  510. package/dist/esm/node_modules/core-js/internals/descriptors.js.map +1 -0
  511. package/dist/esm/node_modules/core-js/internals/document-create-element.js +16 -0
  512. package/dist/esm/node_modules/core-js/internals/document-create-element.js.map +1 -0
  513. package/dist/esm/node_modules/core-js/internals/dom-iterables.js +38 -0
  514. package/dist/esm/node_modules/core-js/internals/dom-iterables.js.map +1 -0
  515. package/dist/esm/node_modules/core-js/internals/dom-token-list-prototype.js +12 -0
  516. package/dist/esm/node_modules/core-js/internals/dom-token-list-prototype.js.map +1 -0
  517. package/dist/esm/node_modules/core-js/internals/enum-bug-keys.js +13 -0
  518. package/dist/esm/node_modules/core-js/internals/enum-bug-keys.js.map +1 -0
  519. package/dist/esm/node_modules/core-js/internals/environment-is-ios-pebble.js +8 -0
  520. package/dist/esm/node_modules/core-js/internals/environment-is-ios-pebble.js.map +1 -0
  521. package/dist/esm/node_modules/core-js/internals/environment-is-ios.js +9 -0
  522. package/dist/esm/node_modules/core-js/internals/environment-is-ios.js.map +1 -0
  523. package/dist/esm/node_modules/core-js/internals/environment-is-node.js +8 -0
  524. package/dist/esm/node_modules/core-js/internals/environment-is-node.js.map +1 -0
  525. package/dist/esm/node_modules/core-js/internals/environment-is-webos-webkit.js +8 -0
  526. package/dist/esm/node_modules/core-js/internals/environment-is-webos-webkit.js.map +1 -0
  527. package/dist/esm/node_modules/core-js/internals/environment-user-agent.js +11 -0
  528. package/dist/esm/node_modules/core-js/internals/environment-user-agent.js.map +1 -0
  529. package/dist/esm/node_modules/core-js/internals/environment-v8-version.js +33 -0
  530. package/dist/esm/node_modules/core-js/internals/environment-v8-version.js.map +1 -0
  531. package/dist/esm/node_modules/core-js/internals/environment.js +27 -0
  532. package/dist/esm/node_modules/core-js/internals/environment.js.map +1 -0
  533. package/dist/esm/node_modules/core-js/internals/export.js +66 -0
  534. package/dist/esm/node_modules/core-js/internals/export.js.map +1 -0
  535. package/dist/esm/node_modules/core-js/internals/fails.js +10 -0
  536. package/dist/esm/node_modules/core-js/internals/fails.js.map +1 -0
  537. package/dist/esm/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js +88 -0
  538. package/dist/esm/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js.map +1 -0
  539. package/dist/esm/node_modules/core-js/internals/function-apply.js +15 -0
  540. package/dist/esm/node_modules/core-js/internals/function-apply.js.map +1 -0
  541. package/dist/esm/node_modules/core-js/internals/function-bind-context.js +20 -0
  542. package/dist/esm/node_modules/core-js/internals/function-bind-context.js.map +1 -0
  543. package/dist/esm/node_modules/core-js/internals/function-bind-native.js +13 -0
  544. package/dist/esm/node_modules/core-js/internals/function-bind-native.js.map +1 -0
  545. package/dist/esm/node_modules/core-js/internals/function-call.js +12 -0
  546. package/dist/esm/node_modules/core-js/internals/function-call.js.map +1 -0
  547. package/dist/esm/node_modules/core-js/internals/function-name.js +22 -0
  548. package/dist/esm/node_modules/core-js/internals/function-name.js.map +1 -0
  549. package/dist/esm/node_modules/core-js/internals/function-uncurry-this-accessor.js +15 -0
  550. package/dist/esm/node_modules/core-js/internals/function-uncurry-this-accessor.js.map +1 -0
  551. package/dist/esm/node_modules/core-js/internals/function-uncurry-this-clause.js +15 -0
  552. package/dist/esm/node_modules/core-js/internals/function-uncurry-this-clause.js.map +1 -0
  553. package/dist/esm/node_modules/core-js/internals/function-uncurry-this.js +17 -0
  554. package/dist/esm/node_modules/core-js/internals/function-uncurry-this.js.map +1 -0
  555. package/dist/esm/node_modules/core-js/internals/get-built-in.js +16 -0
  556. package/dist/esm/node_modules/core-js/internals/get-built-in.js.map +1 -0
  557. package/dist/esm/node_modules/core-js/internals/get-iterator-method.js +22 -0
  558. package/dist/esm/node_modules/core-js/internals/get-iterator-method.js.map +1 -0
  559. package/dist/esm/node_modules/core-js/internals/get-iterator.js +22 -0
  560. package/dist/esm/node_modules/core-js/internals/get-iterator.js.map +1 -0
  561. package/dist/esm/node_modules/core-js/internals/get-method.js +15 -0
  562. package/dist/esm/node_modules/core-js/internals/get-method.js.map +1 -0
  563. package/dist/esm/node_modules/core-js/internals/get-substitution.js +51 -0
  564. package/dist/esm/node_modules/core-js/internals/get-substitution.js.map +1 -0
  565. package/dist/esm/node_modules/core-js/internals/global-this.js +20 -0
  566. package/dist/esm/node_modules/core-js/internals/global-this.js.map +1 -0
  567. package/dist/esm/node_modules/core-js/internals/has-own-property.js +17 -0
  568. package/dist/esm/node_modules/core-js/internals/has-own-property.js.map +1 -0
  569. package/dist/esm/node_modules/core-js/internals/hidden-keys.js +4 -0
  570. package/dist/esm/node_modules/core-js/internals/hidden-keys.js.map +1 -0
  571. package/dist/esm/node_modules/core-js/internals/host-report-errors.js +9 -0
  572. package/dist/esm/node_modules/core-js/internals/host-report-errors.js.map +1 -0
  573. package/dist/esm/node_modules/core-js/internals/html.js +8 -0
  574. package/dist/esm/node_modules/core-js/internals/html.js.map +1 -0
  575. package/dist/esm/node_modules/core-js/internals/ie8-dom-define.js +18 -0
  576. package/dist/esm/node_modules/core-js/internals/ie8-dom-define.js.map +1 -0
  577. package/dist/esm/node_modules/core-js/internals/indexed-object.js +22 -0
  578. package/dist/esm/node_modules/core-js/internals/indexed-object.js.map +1 -0
  579. package/dist/esm/node_modules/core-js/internals/inspect-source.js +21 -0
  580. package/dist/esm/node_modules/core-js/internals/inspect-source.js.map +1 -0
  581. package/dist/esm/node_modules/core-js/internals/internal-state.js +82 -0
  582. package/dist/esm/node_modules/core-js/internals/internal-state.js.map +1 -0
  583. package/dist/esm/node_modules/core-js/internals/is-array-iterator-method.js +16 -0
  584. package/dist/esm/node_modules/core-js/internals/is-array-iterator-method.js.map +1 -0
  585. package/dist/esm/node_modules/core-js/internals/is-array.js +13 -0
  586. package/dist/esm/node_modules/core-js/internals/is-array.js.map +1 -0
  587. package/dist/esm/node_modules/core-js/internals/is-callable.js +14 -0
  588. package/dist/esm/node_modules/core-js/internals/is-callable.js.map +1 -0
  589. package/dist/esm/node_modules/core-js/internals/is-constructor.js +61 -0
  590. package/dist/esm/node_modules/core-js/internals/is-constructor.js.map +1 -0
  591. package/dist/esm/node_modules/core-js/internals/is-forced.js +28 -0
  592. package/dist/esm/node_modules/core-js/internals/is-forced.js.map +1 -0
  593. package/dist/esm/node_modules/core-js/internals/is-null-or-undefined.js +8 -0
  594. package/dist/esm/node_modules/core-js/internals/is-null-or-undefined.js.map +1 -0
  595. package/dist/esm/node_modules/core-js/internals/is-object.js +10 -0
  596. package/dist/esm/node_modules/core-js/internals/is-object.js.map +1 -0
  597. package/dist/esm/node_modules/core-js/internals/is-possible-prototype.js +10 -0
  598. package/dist/esm/node_modules/core-js/internals/is-possible-prototype.js.map +1 -0
  599. package/dist/esm/node_modules/core-js/internals/is-regexp.js +19 -0
  600. package/dist/esm/node_modules/core-js/internals/is-regexp.js.map +1 -0
  601. package/dist/esm/node_modules/core-js/internals/is-symbol.js +21 -0
  602. package/dist/esm/node_modules/core-js/internals/is-symbol.js.map +1 -0
  603. package/dist/esm/node_modules/core-js/internals/iterate.js +82 -0
  604. package/dist/esm/node_modules/core-js/internals/iterate.js.map +1 -0
  605. package/dist/esm/node_modules/core-js/internals/iterator-close.js +30 -0
  606. package/dist/esm/node_modules/core-js/internals/iterator-close.js.map +1 -0
  607. package/dist/esm/node_modules/core-js/internals/iterator-create-constructor.js +24 -0
  608. package/dist/esm/node_modules/core-js/internals/iterator-create-constructor.js.map +1 -0
  609. package/dist/esm/node_modules/core-js/internals/iterator-define.js +116 -0
  610. package/dist/esm/node_modules/core-js/internals/iterator-define.js.map +1 -0
  611. package/dist/esm/node_modules/core-js/internals/iterators-core.js +56 -0
  612. package/dist/esm/node_modules/core-js/internals/iterators-core.js.map +1 -0
  613. package/dist/esm/node_modules/core-js/internals/iterators.js +4 -0
  614. package/dist/esm/node_modules/core-js/internals/iterators.js.map +1 -0
  615. package/dist/esm/node_modules/core-js/internals/length-of-array-like.js +12 -0
  616. package/dist/esm/node_modules/core-js/internals/length-of-array-like.js.map +1 -0
  617. package/dist/esm/node_modules/core-js/internals/make-built-in.js +69 -0
  618. package/dist/esm/node_modules/core-js/internals/make-built-in.js.map +1 -0
  619. package/dist/esm/node_modules/core-js/internals/math-trunc.js +13 -0
  620. package/dist/esm/node_modules/core-js/internals/math-trunc.js.map +1 -0
  621. package/dist/esm/node_modules/core-js/internals/microtask.js +91 -0
  622. package/dist/esm/node_modules/core-js/internals/microtask.js.map +1 -0
  623. package/dist/esm/node_modules/core-js/internals/new-promise-capability.js +26 -0
  624. package/dist/esm/node_modules/core-js/internals/new-promise-capability.js.map +1 -0
  625. package/dist/esm/node_modules/core-js/internals/not-a-regexp.js +14 -0
  626. package/dist/esm/node_modules/core-js/internals/not-a-regexp.js.map +1 -0
  627. package/dist/esm/node_modules/core-js/internals/object-create.js +96 -0
  628. package/dist/esm/node_modules/core-js/internals/object-create.js.map +1 -0
  629. package/dist/esm/node_modules/core-js/internals/object-define-properties.js +32 -0
  630. package/dist/esm/node_modules/core-js/internals/object-define-properties.js.map +1 -0
  631. package/dist/esm/node_modules/core-js/internals/object-define-property.js +53 -0
  632. package/dist/esm/node_modules/core-js/internals/object-define-property.js.map +1 -0
  633. package/dist/esm/node_modules/core-js/internals/object-get-own-property-descriptor.js +36 -0
  634. package/dist/esm/node_modules/core-js/internals/object-get-own-property-descriptor.js.map +1 -0
  635. package/dist/esm/node_modules/core-js/internals/object-get-own-property-names.js +18 -0
  636. package/dist/esm/node_modules/core-js/internals/object-get-own-property-names.js.map +1 -0
  637. package/dist/esm/node_modules/core-js/internals/object-get-own-property-symbols.js +7 -0
  638. package/dist/esm/node_modules/core-js/internals/object-get-own-property-symbols.js.map +1 -0
  639. package/dist/esm/node_modules/core-js/internals/object-get-prototype-of.js +30 -0
  640. package/dist/esm/node_modules/core-js/internals/object-get-prototype-of.js.map +1 -0
  641. package/dist/esm/node_modules/core-js/internals/object-is-prototype-of.js +8 -0
  642. package/dist/esm/node_modules/core-js/internals/object-is-prototype-of.js.map +1 -0
  643. package/dist/esm/node_modules/core-js/internals/object-keys-internal.js +29 -0
  644. package/dist/esm/node_modules/core-js/internals/object-keys-internal.js.map +1 -0
  645. package/dist/esm/node_modules/core-js/internals/object-keys.js +15 -0
  646. package/dist/esm/node_modules/core-js/internals/object-keys.js.map +1 -0
  647. package/dist/esm/node_modules/core-js/internals/object-property-is-enumerable.js +18 -0
  648. package/dist/esm/node_modules/core-js/internals/object-property-is-enumerable.js.map +1 -0
  649. package/dist/esm/node_modules/core-js/internals/object-set-prototype-of.js +36 -0
  650. package/dist/esm/node_modules/core-js/internals/object-set-prototype-of.js.map +1 -0
  651. package/dist/esm/node_modules/core-js/internals/ordinary-to-primitive.js +22 -0
  652. package/dist/esm/node_modules/core-js/internals/ordinary-to-primitive.js.map +1 -0
  653. package/dist/esm/node_modules/core-js/internals/own-keys.js +25 -0
  654. package/dist/esm/node_modules/core-js/internals/own-keys.js.map +1 -0
  655. package/dist/esm/node_modules/core-js/internals/path.js +8 -0
  656. package/dist/esm/node_modules/core-js/internals/path.js.map +1 -0
  657. package/dist/esm/node_modules/core-js/internals/perform.js +10 -0
  658. package/dist/esm/node_modules/core-js/internals/perform.js.map +1 -0
  659. package/dist/esm/node_modules/core-js/internals/promise-constructor-detection.js +55 -0
  660. package/dist/esm/node_modules/core-js/internals/promise-constructor-detection.js.map +1 -0
  661. package/dist/esm/node_modules/core-js/internals/promise-native-constructor.js +8 -0
  662. package/dist/esm/node_modules/core-js/internals/promise-native-constructor.js.map +1 -0
  663. package/dist/esm/node_modules/core-js/internals/promise-resolve.js +20 -0
  664. package/dist/esm/node_modules/core-js/internals/promise-resolve.js.map +1 -0
  665. package/dist/esm/node_modules/core-js/internals/promise-statics-incorrect-iteration.js +14 -0
  666. package/dist/esm/node_modules/core-js/internals/promise-statics-incorrect-iteration.js.map +1 -0
  667. package/dist/esm/node_modules/core-js/internals/queue.js +27 -0
  668. package/dist/esm/node_modules/core-js/internals/queue.js.map +1 -0
  669. package/dist/esm/node_modules/core-js/internals/regexp-exec-abstract.js +29 -0
  670. package/dist/esm/node_modules/core-js/internals/regexp-exec-abstract.js.map +1 -0
  671. package/dist/esm/node_modules/core-js/internals/regexp-exec.js +130 -0
  672. package/dist/esm/node_modules/core-js/internals/regexp-exec.js.map +1 -0
  673. package/dist/esm/node_modules/core-js/internals/regexp-flags-detection.js +52 -0
  674. package/dist/esm/node_modules/core-js/internals/regexp-flags-detection.js.map +1 -0
  675. package/dist/esm/node_modules/core-js/internals/regexp-flags.js +22 -0
  676. package/dist/esm/node_modules/core-js/internals/regexp-flags.js.map +1 -0
  677. package/dist/esm/node_modules/core-js/internals/regexp-get-flags.js +24 -0
  678. package/dist/esm/node_modules/core-js/internals/regexp-get-flags.js.map +1 -0
  679. package/dist/esm/node_modules/core-js/internals/regexp-sticky-helpers.js +35 -0
  680. package/dist/esm/node_modules/core-js/internals/regexp-sticky-helpers.js.map +1 -0
  681. package/dist/esm/node_modules/core-js/internals/regexp-unsupported-dot-all.js +16 -0
  682. package/dist/esm/node_modules/core-js/internals/regexp-unsupported-dot-all.js.map +1 -0
  683. package/dist/esm/node_modules/core-js/internals/regexp-unsupported-ncg.js +17 -0
  684. package/dist/esm/node_modules/core-js/internals/regexp-unsupported-ncg.js.map +1 -0
  685. package/dist/esm/node_modules/core-js/internals/require-object-coercible.js +15 -0
  686. package/dist/esm/node_modules/core-js/internals/require-object-coercible.js.map +1 -0
  687. package/dist/esm/node_modules/core-js/internals/safe-get-built-in.js +18 -0
  688. package/dist/esm/node_modules/core-js/internals/safe-get-built-in.js.map +1 -0
  689. package/dist/esm/node_modules/core-js/internals/set-species.js +25 -0
  690. package/dist/esm/node_modules/core-js/internals/set-species.js.map +1 -0
  691. package/dist/esm/node_modules/core-js/internals/set-to-string-tag.js +20 -0
  692. package/dist/esm/node_modules/core-js/internals/set-to-string-tag.js.map +1 -0
  693. package/dist/esm/node_modules/core-js/internals/shared-key.js +14 -0
  694. package/dist/esm/node_modules/core-js/internals/shared-key.js.map +1 -0
  695. package/dist/esm/node_modules/core-js/internals/shared-store.js +22 -0
  696. package/dist/esm/node_modules/core-js/internals/shared-store.js.map +1 -0
  697. package/dist/esm/node_modules/core-js/internals/shared.js +10 -0
  698. package/dist/esm/node_modules/core-js/internals/shared.js.map +1 -0
  699. package/dist/esm/node_modules/core-js/internals/species-constructor.js +22 -0
  700. package/dist/esm/node_modules/core-js/internals/species-constructor.js.map +1 -0
  701. package/dist/esm/node_modules/core-js/internals/string-multibyte.js +41 -0
  702. package/dist/esm/node_modules/core-js/internals/string-multibyte.js.map +1 -0
  703. package/dist/esm/node_modules/core-js/internals/string-trim-forced.js +22 -0
  704. package/dist/esm/node_modules/core-js/internals/string-trim-forced.js.map +1 -0
  705. package/dist/esm/node_modules/core-js/internals/string-trim.js +32 -0
  706. package/dist/esm/node_modules/core-js/internals/string-trim.js.map +1 -0
  707. package/dist/esm/node_modules/core-js/internals/symbol-constructor-detection.js +25 -0
  708. package/dist/esm/node_modules/core-js/internals/symbol-constructor-detection.js.map +1 -0
  709. package/dist/esm/node_modules/core-js/internals/task.js +130 -0
  710. package/dist/esm/node_modules/core-js/internals/task.js.map +1 -0
  711. package/dist/esm/node_modules/core-js/internals/to-absolute-index.js +17 -0
  712. package/dist/esm/node_modules/core-js/internals/to-absolute-index.js.map +1 -0
  713. package/dist/esm/node_modules/core-js/internals/to-indexed-object.js +13 -0
  714. package/dist/esm/node_modules/core-js/internals/to-indexed-object.js.map +1 -0
  715. package/dist/esm/node_modules/core-js/internals/to-integer-or-infinity.js +14 -0
  716. package/dist/esm/node_modules/core-js/internals/to-integer-or-infinity.js.map +1 -0
  717. package/dist/esm/node_modules/core-js/internals/to-length.js +15 -0
  718. package/dist/esm/node_modules/core-js/internals/to-length.js.map +1 -0
  719. package/dist/esm/node_modules/core-js/internals/to-object.js +14 -0
  720. package/dist/esm/node_modules/core-js/internals/to-object.js.map +1 -0
  721. package/dist/esm/node_modules/core-js/internals/to-primitive.js +35 -0
  722. package/dist/esm/node_modules/core-js/internals/to-primitive.js.map +1 -0
  723. package/dist/esm/node_modules/core-js/internals/to-property-key.js +15 -0
  724. package/dist/esm/node_modules/core-js/internals/to-property-key.js.map +1 -0
  725. package/dist/esm/node_modules/core-js/internals/to-string-tag-support.js +13 -0
  726. package/dist/esm/node_modules/core-js/internals/to-string-tag-support.js.map +1 -0
  727. package/dist/esm/node_modules/core-js/internals/to-string.js +13 -0
  728. package/dist/esm/node_modules/core-js/internals/to-string.js.map +1 -0
  729. package/dist/esm/node_modules/core-js/internals/try-to-string.js +12 -0
  730. package/dist/esm/node_modules/core-js/internals/try-to-string.js.map +1 -0
  731. package/dist/esm/node_modules/core-js/internals/uid.js +14 -0
  732. package/dist/esm/node_modules/core-js/internals/uid.js.map +1 -0
  733. package/dist/esm/node_modules/core-js/internals/use-symbol-as-uid.js +11 -0
  734. package/dist/esm/node_modules/core-js/internals/use-symbol-as-uid.js.map +1 -0
  735. package/dist/esm/node_modules/core-js/internals/v8-prototype-define-bug.js +18 -0
  736. package/dist/esm/node_modules/core-js/internals/v8-prototype-define-bug.js.map +1 -0
  737. package/dist/esm/node_modules/core-js/internals/validate-arguments-length.js +9 -0
  738. package/dist/esm/node_modules/core-js/internals/validate-arguments-length.js.map +1 -0
  739. package/dist/esm/node_modules/core-js/internals/weak-map-basic-detection.js +12 -0
  740. package/dist/esm/node_modules/core-js/internals/weak-map-basic-detection.js.map +1 -0
  741. package/dist/esm/node_modules/core-js/internals/well-known-symbol.js +28 -0
  742. package/dist/esm/node_modules/core-js/internals/well-known-symbol.js.map +1 -0
  743. package/dist/esm/node_modules/core-js/internals/whitespaces.js +6 -0
  744. package/dist/esm/node_modules/core-js/internals/whitespaces.js.map +1 -0
  745. package/dist/esm/node_modules/core-js/modules/es.array.index-of.js +28 -0
  746. package/dist/esm/node_modules/core-js/modules/es.array.index-of.js.map +1 -0
  747. package/dist/esm/node_modules/core-js/modules/es.array.iterator.js +73 -0
  748. package/dist/esm/node_modules/core-js/modules/es.array.iterator.js.map +1 -0
  749. package/dist/esm/node_modules/core-js/modules/es.array.reduce.js +26 -0
  750. package/dist/esm/node_modules/core-js/modules/es.array.reduce.js.map +1 -0
  751. package/dist/esm/node_modules/core-js/modules/es.array.reverse.js +23 -0
  752. package/dist/esm/node_modules/core-js/modules/es.array.reverse.js.map +1 -0
  753. package/dist/esm/node_modules/core-js/modules/es.promise.all.js +48 -0
  754. package/dist/esm/node_modules/core-js/modules/es.promise.all.js.map +1 -0
  755. package/dist/esm/node_modules/core-js/modules/es.promise.catch.js +32 -0
  756. package/dist/esm/node_modules/core-js/modules/es.promise.catch.js.map +1 -0
  757. package/dist/esm/node_modules/core-js/modules/es.promise.constructor.js +317 -0
  758. package/dist/esm/node_modules/core-js/modules/es.promise.constructor.js.map +1 -0
  759. package/dist/esm/node_modules/core-js/modules/es.promise.race.js +35 -0
  760. package/dist/esm/node_modules/core-js/modules/es.promise.race.js.map +1 -0
  761. package/dist/esm/node_modules/core-js/modules/es.promise.reject.js +20 -0
  762. package/dist/esm/node_modules/core-js/modules/es.promise.reject.js.map +1 -0
  763. package/dist/esm/node_modules/core-js/modules/es.promise.resolve.js +21 -0
  764. package/dist/esm/node_modules/core-js/modules/es.promise.resolve.js.map +1 -0
  765. package/dist/esm/node_modules/core-js/modules/es.regexp.exec.js +12 -0
  766. package/dist/esm/node_modules/core-js/modules/es.regexp.exec.js.map +1 -0
  767. package/dist/esm/node_modules/core-js/modules/es.regexp.to-string.js +33 -0
  768. package/dist/esm/node_modules/core-js/modules/es.regexp.to-string.js.map +1 -0
  769. package/dist/esm/node_modules/core-js/modules/es.string.ends-with.js +43 -0
  770. package/dist/esm/node_modules/core-js/modules/es.string.ends-with.js.map +1 -0
  771. package/dist/esm/node_modules/core-js/modules/es.string.includes.js +28 -0
  772. package/dist/esm/node_modules/core-js/modules/es.string.includes.js.map +1 -0
  773. package/dist/esm/node_modules/core-js/modules/es.string.match.js +67 -0
  774. package/dist/esm/node_modules/core-js/modules/es.string.match.js.map +1 -0
  775. package/dist/esm/node_modules/core-js/modules/es.string.replace.js +163 -0
  776. package/dist/esm/node_modules/core-js/modules/es.string.replace.js.map +1 -0
  777. package/dist/esm/node_modules/core-js/modules/es.string.split.js +126 -0
  778. package/dist/esm/node_modules/core-js/modules/es.string.split.js.map +1 -0
  779. package/dist/esm/node_modules/core-js/modules/es.string.starts-with.js +41 -0
  780. package/dist/esm/node_modules/core-js/modules/es.string.starts-with.js.map +1 -0
  781. package/dist/esm/node_modules/core-js/modules/es.string.trim.js +16 -0
  782. package/dist/esm/node_modules/core-js/modules/es.string.trim.js.map +1 -0
  783. package/dist/esm/node_modules/core-js/modules/web.dom-collections.iterator.js +45 -0
  784. package/dist/esm/node_modules/core-js/modules/web.dom-collections.iterator.js.map +1 -0
  785. package/dist/esm/node_modules/dompurify/dist/purify.es.js +1531 -0
  786. package/dist/esm/node_modules/dompurify/dist/purify.es.js.map +1 -0
  787. package/dist/esm/node_modules/fflate/esm/browser.js +804 -0
  788. package/dist/esm/node_modules/fflate/esm/browser.js.map +1 -0
  789. package/dist/esm/node_modules/html2canvas/dist/html2canvas.esm.js +7822 -0
  790. package/dist/esm/node_modules/html2canvas/dist/html2canvas.esm.js.map +1 -0
  791. package/dist/esm/node_modules/jspdf/dist/jspdf.es.min.js +337 -0
  792. package/dist/esm/node_modules/jspdf/dist/jspdf.es.min.js.map +1 -0
  793. package/dist/esm/node_modules/performance-now/lib/performance-now.js +44 -0
  794. package/dist/esm/node_modules/performance-now/lib/performance-now.js.map +1 -0
  795. package/dist/esm/node_modules/qrious/dist/qrious.js +2372 -0
  796. package/dist/esm/node_modules/qrious/dist/qrious.js.map +1 -0
  797. package/dist/esm/node_modules/raf/index.js +85 -0
  798. package/dist/esm/node_modules/raf/index.js.map +1 -0
  799. package/dist/esm/node_modules/rgbcolor/index.js +309 -0
  800. package/dist/esm/node_modules/rgbcolor/index.js.map +1 -0
  801. package/dist/esm/node_modules/stackblur-canvas/dist/stackblur-es.js +380 -0
  802. package/dist/esm/node_modules/stackblur-canvas/dist/stackblur-es.js.map +1 -0
  803. package/dist/esm/node_modules/svg-pathdata/lib/SVGPathData.module.js +18 -0
  804. package/dist/esm/node_modules/svg-pathdata/lib/SVGPathData.module.js.map +1 -0
  805. package/dist/esm/storage/templateStorage.js +144 -0
  806. package/dist/esm/storage/templateStorage.js.map +1 -0
  807. package/dist/esm/styles.css +1 -0
  808. package/dist/esm/utils/styleUtils.js +91 -0
  809. package/dist/esm/utils/styleUtils.js.map +1 -0
  810. package/dist/esm/utils/validators.js +139 -0
  811. package/dist/esm/utils/validators.js.map +1 -0
  812. package/dist/types/components/IDCardDesigner.d.ts +18 -0
  813. package/dist/types/components/IDCardGenerator.d.ts +19 -0
  814. package/dist/types/components/IDCardPreview.d.ts +15 -0
  815. package/dist/types/core/exportUtils.d.ts +34 -0
  816. package/dist/types/core/qrUtils.d.ts +27 -0
  817. package/dist/types/hooks/useFieldMapping.d.ts +10 -0
  818. package/dist/types/hooks/useIDCardExport.d.ts +10 -0
  819. package/dist/types/hooks/useIDCardTemplate.d.ts +10 -0
  820. package/dist/types/index.d.ts +33 -0
  821. package/dist/types/storage/templateStorage.d.ts +53 -0
  822. package/dist/types/types/index.d.ts +235 -0
  823. package/dist/types/utils/styleUtils.d.ts +34 -0
  824. package/dist/types/utils/validators.d.ts +27 -0
  825. package/package.json +65 -0
@@ -0,0 +1,2372 @@
1
+ import { commonjsGlobal, getDefaultExportFromCjs } from '../../../_virtual/_commonjsHelpers.js';
2
+ import { __module as qrious } from '../../../_virtual/qrious.js';
3
+
4
+ /*
5
+ * QRious v4.0.2
6
+ * Copyright (C) 2017 Alasdair Mercer
7
+ * Copyright (C) 2010 Tom Zerucha
8
+ *
9
+ * This program is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+
23
+ (function (module, exports$1) {
24
+ (function (global, factory) {
25
+ module.exports = factory() ;
26
+ }(commonjsGlobal, (function () {
27
+ /*
28
+ * Copyright (C) 2017 Alasdair Mercer, !ninja
29
+ *
30
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
31
+ * of this software and associated documentation files (the "Software"), to deal
32
+ * in the Software without restriction, including without limitation the rights
33
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34
+ * copies of the Software, and to permit persons to whom the Software is
35
+ * furnished to do so, subject to the following conditions:
36
+ *
37
+ * The above copyright notice and this permission notice shall be included in all
38
+ * copies or substantial portions of the Software.
39
+ *
40
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46
+ * SOFTWARE.
47
+ */
48
+
49
+ /**
50
+ * A bare-bones constructor for surrogate prototype swapping.
51
+ *
52
+ * @private
53
+ * @constructor
54
+ */
55
+ var Constructor = /* istanbul ignore next */ function() {};
56
+ /**
57
+ * A reference to <code>Object.prototype.hasOwnProperty</code>.
58
+ *
59
+ * @private
60
+ * @type {Function}
61
+ */
62
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
63
+ /**
64
+ * A reference to <code>Array.prototype.slice</code>.
65
+ *
66
+ * @private
67
+ * @type {Function}
68
+ */
69
+ var slice = Array.prototype.slice;
70
+
71
+ /**
72
+ * Creates an object which inherits the given <code>prototype</code>.
73
+ *
74
+ * Optionally, the created object can be extended further with the specified <code>properties</code>.
75
+ *
76
+ * @param {Object} prototype - the prototype to be inherited by the created object
77
+ * @param {Object} [properties] - the optional properties to be extended by the created object
78
+ * @return {Object} The newly created object.
79
+ * @private
80
+ */
81
+ function createObject(prototype, properties) {
82
+ var result;
83
+ /* istanbul ignore next */
84
+ if (typeof Object.create === 'function') {
85
+ result = Object.create(prototype);
86
+ } else {
87
+ Constructor.prototype = prototype;
88
+ result = new Constructor();
89
+ Constructor.prototype = null;
90
+ }
91
+
92
+ if (properties) {
93
+ extendObject(true, result, properties);
94
+ }
95
+
96
+ return result;
97
+ }
98
+
99
+ /**
100
+ * Extends the constructor to which this method is associated with the <code>prototype</code> and/or
101
+ * <code>statics</code> provided.
102
+ *
103
+ * If <code>name</code> is provided, it will be used as the class name and can be accessed via a special
104
+ * <code>class_</code> property on the child constructor, otherwise the class name of the super constructor will be used
105
+ * instead. The class name may also be used string representation for instances of the child constructor (via
106
+ * <code>toString</code>), but this is not applicable to the <i>lite</i> version of Nevis.
107
+ *
108
+ * If <code>constructor</code> is provided, it will be used as the constructor for the child, otherwise a simple
109
+ * constructor which only calls the super constructor will be used instead.
110
+ *
111
+ * The super constructor can be accessed via a special <code>super_</code> property on the child constructor.
112
+ *
113
+ * @param {string} [name=this.class_] - the class name to be used for the child constructor
114
+ * @param {Function} [constructor] - the constructor for the child
115
+ * @param {Object} [prototype] - the prototype properties to be defined for the child
116
+ * @param {Object} [statics] - the static properties to be defined for the child
117
+ * @return {Function} The child <code>constructor</code> provided or the one created if none was given.
118
+ * @public
119
+ */
120
+ function extend(name, constructor, prototype, statics) {
121
+ var superConstructor = this;
122
+
123
+ if (typeof name !== 'string') {
124
+ statics = prototype;
125
+ prototype = constructor;
126
+ constructor = name;
127
+ name = null;
128
+ }
129
+
130
+ if (typeof constructor !== 'function') {
131
+ statics = prototype;
132
+ prototype = constructor;
133
+ constructor = function() {
134
+ return superConstructor.apply(this, arguments);
135
+ };
136
+ }
137
+
138
+ extendObject(false, constructor, superConstructor, statics);
139
+
140
+ constructor.prototype = createObject(superConstructor.prototype, prototype);
141
+ constructor.prototype.constructor = constructor;
142
+
143
+ constructor.class_ = name || superConstructor.class_;
144
+ constructor.super_ = superConstructor;
145
+
146
+ return constructor;
147
+ }
148
+
149
+ /**
150
+ * Extends the specified <code>target</code> object with the properties in each of the <code>sources</code> provided.
151
+ *
152
+ * if any source is <code>null</code> it will be ignored.
153
+ *
154
+ * @param {boolean} own - <code>true</code> to only copy <b>own</b> properties from <code>sources</code> onto
155
+ * <code>target</code>; otherwise <code>false</code>
156
+ * @param {Object} target - the target object which should be extended
157
+ * @param {...Object} [sources] - the source objects whose properties are to be copied onto <code>target</code>
158
+ * @return {void}
159
+ * @private
160
+ */
161
+ function extendObject(own, target, sources) {
162
+ sources = slice.call(arguments, 2);
163
+
164
+ var property;
165
+ var source;
166
+
167
+ for (var i = 0, length = sources.length; i < length; i++) {
168
+ source = sources[i];
169
+
170
+ for (property in source) {
171
+ if (!own || hasOwnProperty.call(source, property)) {
172
+ target[property] = source[property];
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ var extend_1 = extend;
179
+
180
+ /**
181
+ * The base class from which all others should extend.
182
+ *
183
+ * @public
184
+ * @constructor
185
+ */
186
+ function Nevis() {}
187
+ Nevis.class_ = 'Nevis';
188
+ Nevis.super_ = Object;
189
+
190
+ /**
191
+ * Extends the constructor to which this method is associated with the <code>prototype</code> and/or
192
+ * <code>statics</code> provided.
193
+ *
194
+ * If <code>name</code> is provided, it will be used as the class name and can be accessed via a special
195
+ * <code>class_</code> property on the child constructor, otherwise the class name of the super constructor will be used
196
+ * instead. The class name may also be used string representation for instances of the child constructor (via
197
+ * <code>toString</code>), but this is not applicable to the <i>lite</i> version of Nevis.
198
+ *
199
+ * If <code>constructor</code> is provided, it will be used as the constructor for the child, otherwise a simple
200
+ * constructor which only calls the super constructor will be used instead.
201
+ *
202
+ * The super constructor can be accessed via a special <code>super_</code> property on the child constructor.
203
+ *
204
+ * @param {string} [name=this.class_] - the class name to be used for the child constructor
205
+ * @param {Function} [constructor] - the constructor for the child
206
+ * @param {Object} [prototype] - the prototype properties to be defined for the child
207
+ * @param {Object} [statics] - the static properties to be defined for the child
208
+ * @return {Function} The child <code>constructor</code> provided or the one created if none was given.
209
+ * @public
210
+ * @static
211
+ * @memberof Nevis
212
+ */
213
+ Nevis.extend = extend_1;
214
+
215
+ var nevis = Nevis;
216
+
217
+ var lite = nevis;
218
+
219
+ /**
220
+ * Responsible for rendering a QR code {@link Frame} on a specific type of element.
221
+ *
222
+ * A renderer may be dependant on the rendering of another element, so the ordering of their execution is important.
223
+ *
224
+ * The rendering of a element can be deferred by disabling the renderer initially, however, any attempt get the element
225
+ * from the renderer will result in it being immediately enabled and the element being rendered.
226
+ *
227
+ * @param {QRious} qrious - the {@link QRious} instance to be used
228
+ * @param {*} element - the element onto which the QR code is to be rendered
229
+ * @param {boolean} [enabled] - <code>true</code> this {@link Renderer} is enabled; otherwise <code>false</code>.
230
+ * @public
231
+ * @class
232
+ * @extends Nevis
233
+ */
234
+ var Renderer = lite.extend(function(qrious, element, enabled) {
235
+ /**
236
+ * The {@link QRious} instance.
237
+ *
238
+ * @protected
239
+ * @type {QRious}
240
+ * @memberof Renderer#
241
+ */
242
+ this.qrious = qrious;
243
+
244
+ /**
245
+ * The element onto which this {@link Renderer} is rendering the QR code.
246
+ *
247
+ * @protected
248
+ * @type {*}
249
+ * @memberof Renderer#
250
+ */
251
+ this.element = element;
252
+ this.element.qrious = qrious;
253
+
254
+ /**
255
+ * Whether this {@link Renderer} is enabled.
256
+ *
257
+ * @protected
258
+ * @type {boolean}
259
+ * @memberof Renderer#
260
+ */
261
+ this.enabled = Boolean(enabled);
262
+ }, {
263
+
264
+ /**
265
+ * Draws the specified QR code <code>frame</code> on the underlying element.
266
+ *
267
+ * Implementations of {@link Renderer} <b>must</b> override this method with their own specific logic.
268
+ *
269
+ * @param {Frame} frame - the {@link Frame} to be drawn
270
+ * @return {void}
271
+ * @protected
272
+ * @abstract
273
+ * @memberof Renderer#
274
+ */
275
+ draw: function(frame) {},
276
+
277
+ /**
278
+ * Returns the element onto which this {@link Renderer} is rendering the QR code.
279
+ *
280
+ * If this method is called while this {@link Renderer} is disabled, it will be immediately enabled and rendered
281
+ * before the element is returned.
282
+ *
283
+ * @return {*} The element.
284
+ * @public
285
+ * @memberof Renderer#
286
+ */
287
+ getElement: function() {
288
+ if (!this.enabled) {
289
+ this.enabled = true;
290
+ this.render();
291
+ }
292
+
293
+ return this.element;
294
+ },
295
+
296
+ /**
297
+ * Calculates the size (in pixel units) to represent an individual module within the QR code based on the
298
+ * <code>frame</code> provided.
299
+ *
300
+ * Any configured padding will be excluded from the returned size.
301
+ *
302
+ * The returned value will be at least one, even in cases where the size of the QR code does not fit its contents.
303
+ * This is done so that the inevitable clipping is handled more gracefully since this way at least something is
304
+ * displayed instead of just a blank space filled by the background color.
305
+ *
306
+ * @param {Frame} frame - the {@link Frame} from which the module size is to be derived
307
+ * @return {number} The pixel size for each module in the QR code which will be no less than one.
308
+ * @protected
309
+ * @memberof Renderer#
310
+ */
311
+ getModuleSize: function(frame) {
312
+ var qrious = this.qrious;
313
+ var padding = qrious.padding || 0;
314
+ var pixels = Math.floor((qrious.size - (padding * 2)) / frame.width);
315
+
316
+ return Math.max(1, pixels);
317
+ },
318
+
319
+ /**
320
+ * Calculates the offset/padding (in pixel units) to be inserted before the QR code based on the <code>frame</code>
321
+ * provided.
322
+ *
323
+ * The returned value will be zero if there is no available offset or if the size of the QR code does not fit its
324
+ * contents. It will never be a negative value. This is done so that the inevitable clipping appears more naturally
325
+ * and it is not clipped from all directions.
326
+ *
327
+ * @param {Frame} frame - the {@link Frame} from which the offset is to be derived
328
+ * @return {number} The pixel offset for the QR code which will be no less than zero.
329
+ * @protected
330
+ * @memberof Renderer#
331
+ */
332
+ getOffset: function(frame) {
333
+ var qrious = this.qrious;
334
+ var padding = qrious.padding;
335
+
336
+ if (padding != null) {
337
+ return padding;
338
+ }
339
+
340
+ var moduleSize = this.getModuleSize(frame);
341
+ var offset = Math.floor((qrious.size - (moduleSize * frame.width)) / 2);
342
+
343
+ return Math.max(0, offset);
344
+ },
345
+
346
+ /**
347
+ * Renders a QR code on the underlying element based on the <code>frame</code> provided.
348
+ *
349
+ * @param {Frame} frame - the {@link Frame} to be rendered
350
+ * @return {void}
351
+ * @public
352
+ * @memberof Renderer#
353
+ */
354
+ render: function(frame) {
355
+ if (this.enabled) {
356
+ this.resize();
357
+ this.reset();
358
+ this.draw(frame);
359
+ }
360
+ },
361
+
362
+ /**
363
+ * Resets the underlying element, effectively clearing any previously rendered QR code.
364
+ *
365
+ * Implementations of {@link Renderer} <b>must</b> override this method with their own specific logic.
366
+ *
367
+ * @return {void}
368
+ * @protected
369
+ * @abstract
370
+ * @memberof Renderer#
371
+ */
372
+ reset: function() {},
373
+
374
+ /**
375
+ * Ensures that the size of the underlying element matches that defined on the associated {@link QRious} instance.
376
+ *
377
+ * Implementations of {@link Renderer} <b>must</b> override this method with their own specific logic.
378
+ *
379
+ * @return {void}
380
+ * @protected
381
+ * @abstract
382
+ * @memberof Renderer#
383
+ */
384
+ resize: function() {}
385
+
386
+ });
387
+
388
+ var Renderer_1 = Renderer;
389
+
390
+ /**
391
+ * An implementation of {@link Renderer} for working with <code>canvas</code> elements.
392
+ *
393
+ * @public
394
+ * @class
395
+ * @extends Renderer
396
+ */
397
+ var CanvasRenderer = Renderer_1.extend({
398
+
399
+ /**
400
+ * @override
401
+ */
402
+ draw: function(frame) {
403
+ var i, j;
404
+ var qrious = this.qrious;
405
+ var moduleSize = this.getModuleSize(frame);
406
+ var offset = this.getOffset(frame);
407
+ var context = this.element.getContext('2d');
408
+
409
+ context.fillStyle = qrious.foreground;
410
+ context.globalAlpha = qrious.foregroundAlpha;
411
+
412
+ for (i = 0; i < frame.width; i++) {
413
+ for (j = 0; j < frame.width; j++) {
414
+ if (frame.buffer[(j * frame.width) + i]) {
415
+ context.fillRect((moduleSize * i) + offset, (moduleSize * j) + offset, moduleSize, moduleSize);
416
+ }
417
+ }
418
+ }
419
+ },
420
+
421
+ /**
422
+ * @override
423
+ */
424
+ reset: function() {
425
+ var qrious = this.qrious;
426
+ var context = this.element.getContext('2d');
427
+ var size = qrious.size;
428
+
429
+ context.lineWidth = 1;
430
+ context.clearRect(0, 0, size, size);
431
+ context.fillStyle = qrious.background;
432
+ context.globalAlpha = qrious.backgroundAlpha;
433
+ context.fillRect(0, 0, size, size);
434
+ },
435
+
436
+ /**
437
+ * @override
438
+ */
439
+ resize: function() {
440
+ var element = this.element;
441
+
442
+ element.width = element.height = this.qrious.size;
443
+ }
444
+
445
+ });
446
+
447
+ var CanvasRenderer_1 = CanvasRenderer;
448
+
449
+ /* eslint no-multi-spaces: "off" */
450
+
451
+
452
+
453
+ /**
454
+ * Contains alignment pattern information.
455
+ *
456
+ * @public
457
+ * @class
458
+ * @extends Nevis
459
+ */
460
+ var Alignment = lite.extend(null, {
461
+
462
+ /**
463
+ * The alignment pattern block.
464
+ *
465
+ * @public
466
+ * @static
467
+ * @type {number[]}
468
+ * @memberof Alignment
469
+ */
470
+ BLOCK: [
471
+ 0, 11, 15, 19, 23, 27, 31,
472
+ 16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24,
473
+ 26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28
474
+ ]
475
+
476
+ });
477
+
478
+ var Alignment_1 = Alignment;
479
+
480
+ /* eslint no-multi-spaces: "off" */
481
+
482
+
483
+
484
+ /**
485
+ * Contains error correction information.
486
+ *
487
+ * @public
488
+ * @class
489
+ * @extends Nevis
490
+ */
491
+ var ErrorCorrection = lite.extend(null, {
492
+
493
+ /**
494
+ * The error correction blocks.
495
+ *
496
+ * There are four elements per version. The first two indicate the number of blocks, then the data width, and finally
497
+ * the ECC width.
498
+ *
499
+ * @public
500
+ * @static
501
+ * @type {number[]}
502
+ * @memberof ErrorCorrection
503
+ */
504
+ BLOCKS: [
505
+ 1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17,
506
+ 1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28,
507
+ 1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22,
508
+ 1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16,
509
+ 1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22,
510
+ 2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28,
511
+ 2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26,
512
+ 2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26,
513
+ 2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24,
514
+ 2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28,
515
+ 4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24,
516
+ 2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28,
517
+ 4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22,
518
+ 3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24,
519
+ 5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24,
520
+ 5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30,
521
+ 1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28,
522
+ 5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28,
523
+ 3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26,
524
+ 3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28,
525
+ 4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30,
526
+ 2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24,
527
+ 4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30,
528
+ 6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30,
529
+ 8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30,
530
+ 10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30,
531
+ 8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30,
532
+ 3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30,
533
+ 7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30,
534
+ 5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30,
535
+ 13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30,
536
+ 17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30,
537
+ 17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30,
538
+ 13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30,
539
+ 12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30,
540
+ 6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30,
541
+ 17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30,
542
+ 4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30,
543
+ 20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30,
544
+ 19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30
545
+ ],
546
+
547
+ /**
548
+ * The final format bits with mask (level << 3 | mask).
549
+ *
550
+ * @public
551
+ * @static
552
+ * @type {number[]}
553
+ * @memberof ErrorCorrection
554
+ */
555
+ FINAL_FORMAT: [
556
+ // L
557
+ 0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976,
558
+ // M
559
+ 0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0,
560
+ // Q
561
+ 0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed,
562
+ // H
563
+ 0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b
564
+ ],
565
+
566
+ /**
567
+ * A map of human-readable ECC levels.
568
+ *
569
+ * @public
570
+ * @static
571
+ * @type {Object.<string, number>}
572
+ * @memberof ErrorCorrection
573
+ */
574
+ LEVELS: {
575
+ L: 1,
576
+ M: 2,
577
+ Q: 3,
578
+ H: 4
579
+ }
580
+
581
+ });
582
+
583
+ var ErrorCorrection_1 = ErrorCorrection;
584
+
585
+ /**
586
+ * Contains Galois field information.
587
+ *
588
+ * @public
589
+ * @class
590
+ * @extends Nevis
591
+ */
592
+ var Galois = lite.extend(null, {
593
+
594
+ /**
595
+ * The Galois field exponent table.
596
+ *
597
+ * @public
598
+ * @static
599
+ * @type {number[]}
600
+ * @memberof Galois
601
+ */
602
+ EXPONENT: [
603
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26,
604
+ 0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0,
605
+ 0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23,
606
+ 0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1,
607
+ 0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0,
608
+ 0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2,
609
+ 0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce,
610
+ 0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc,
611
+ 0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54,
612
+ 0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73,
613
+ 0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff,
614
+ 0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41,
615
+ 0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6,
616
+ 0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09,
617
+ 0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16,
618
+ 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00
619
+ ],
620
+
621
+ /**
622
+ * The Galois field log table.
623
+ *
624
+ * @public
625
+ * @static
626
+ * @type {number[]}
627
+ * @memberof Galois
628
+ */
629
+ LOG: [
630
+ 0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b,
631
+ 0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71,
632
+ 0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45,
633
+ 0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6,
634
+ 0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88,
635
+ 0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40,
636
+ 0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d,
637
+ 0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57,
638
+ 0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18,
639
+ 0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e,
640
+ 0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61,
641
+ 0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2,
642
+ 0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6,
643
+ 0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a,
644
+ 0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7,
645
+ 0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf
646
+ ]
647
+
648
+ });
649
+
650
+ var Galois_1 = Galois;
651
+
652
+ /**
653
+ * Contains version pattern information.
654
+ *
655
+ * @public
656
+ * @class
657
+ * @extends Nevis
658
+ */
659
+ var Version = lite.extend(null, {
660
+
661
+ /**
662
+ * The version pattern block.
663
+ *
664
+ * @public
665
+ * @static
666
+ * @type {number[]}
667
+ * @memberof Version
668
+ */
669
+ BLOCK: [
670
+ 0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d, 0x928, 0xb78, 0x45d, 0xa17, 0x532,
671
+ 0x9a6, 0x683, 0x8c9, 0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75, 0x250, 0x9d5,
672
+ 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64, 0x541, 0xc69
673
+ ]
674
+
675
+ });
676
+
677
+ var Version_1 = Version;
678
+
679
+ /**
680
+ * Generates information for a QR code frame based on a specific value to be encoded.
681
+ *
682
+ * @param {Frame~Options} options - the options to be used
683
+ * @public
684
+ * @class
685
+ * @extends Nevis
686
+ */
687
+ var Frame = lite.extend(function(options) {
688
+ var dataBlock, eccBlock, index, neccBlock1, neccBlock2;
689
+ var valueLength = options.value.length;
690
+
691
+ this._badness = [];
692
+ this._level = ErrorCorrection_1.LEVELS[options.level];
693
+ this._polynomial = [];
694
+ this._value = options.value;
695
+ this._version = 0;
696
+ this._stringBuffer = [];
697
+
698
+ while (this._version < 40) {
699
+ this._version++;
700
+
701
+ index = ((this._level - 1) * 4) + ((this._version - 1) * 16);
702
+
703
+ neccBlock1 = ErrorCorrection_1.BLOCKS[index++];
704
+ neccBlock2 = ErrorCorrection_1.BLOCKS[index++];
705
+ dataBlock = ErrorCorrection_1.BLOCKS[index++];
706
+ eccBlock = ErrorCorrection_1.BLOCKS[index];
707
+
708
+ index = (dataBlock * (neccBlock1 + neccBlock2)) + neccBlock2 - 3 + (this._version <= 9);
709
+
710
+ if (valueLength <= index) {
711
+ break;
712
+ }
713
+ }
714
+
715
+ this._dataBlock = dataBlock;
716
+ this._eccBlock = eccBlock;
717
+ this._neccBlock1 = neccBlock1;
718
+ this._neccBlock2 = neccBlock2;
719
+
720
+ /**
721
+ * The data width is based on version.
722
+ *
723
+ * @public
724
+ * @type {number}
725
+ * @memberof Frame#
726
+ */
727
+ // FIXME: Ensure that it fits instead of being truncated.
728
+ var width = this.width = 17 + (4 * this._version);
729
+
730
+ /**
731
+ * The image buffer.
732
+ *
733
+ * @public
734
+ * @type {number[]}
735
+ * @memberof Frame#
736
+ */
737
+ this.buffer = Frame._createArray(width * width);
738
+
739
+ this._ecc = Frame._createArray(dataBlock + ((dataBlock + eccBlock) * (neccBlock1 + neccBlock2)) + neccBlock2);
740
+ this._mask = Frame._createArray(((width * (width + 1)) + 1) / 2);
741
+
742
+ this._insertFinders();
743
+ this._insertAlignments();
744
+
745
+ // Insert single foreground cell.
746
+ this.buffer[8 + (width * (width - 8))] = 1;
747
+
748
+ this._insertTimingGap();
749
+ this._reverseMask();
750
+ this._insertTimingRowAndColumn();
751
+ this._insertVersion();
752
+ this._syncMask();
753
+ this._convertBitStream(valueLength);
754
+ this._calculatePolynomial();
755
+ this._appendEccToData();
756
+ this._interleaveBlocks();
757
+ this._pack();
758
+ this._finish();
759
+ }, {
760
+
761
+ _addAlignment: function(x, y) {
762
+ var i;
763
+ var buffer = this.buffer;
764
+ var width = this.width;
765
+
766
+ buffer[x + (width * y)] = 1;
767
+
768
+ for (i = -2; i < 2; i++) {
769
+ buffer[x + i + (width * (y - 2))] = 1;
770
+ buffer[x - 2 + (width * (y + i + 1))] = 1;
771
+ buffer[x + 2 + (width * (y + i))] = 1;
772
+ buffer[x + i + 1 + (width * (y + 2))] = 1;
773
+ }
774
+
775
+ for (i = 0; i < 2; i++) {
776
+ this._setMask(x - 1, y + i);
777
+ this._setMask(x + 1, y - i);
778
+ this._setMask(x - i, y - 1);
779
+ this._setMask(x + i, y + 1);
780
+ }
781
+ },
782
+
783
+ _appendData: function(data, dataLength, ecc, eccLength) {
784
+ var bit, i, j;
785
+ var polynomial = this._polynomial;
786
+ var stringBuffer = this._stringBuffer;
787
+
788
+ for (i = 0; i < eccLength; i++) {
789
+ stringBuffer[ecc + i] = 0;
790
+ }
791
+
792
+ for (i = 0; i < dataLength; i++) {
793
+ bit = Galois_1.LOG[stringBuffer[data + i] ^ stringBuffer[ecc]];
794
+
795
+ if (bit !== 255) {
796
+ for (j = 1; j < eccLength; j++) {
797
+ stringBuffer[ecc + j - 1] = stringBuffer[ecc + j] ^
798
+ Galois_1.EXPONENT[Frame._modN(bit + polynomial[eccLength - j])];
799
+ }
800
+ } else {
801
+ for (j = ecc; j < ecc + eccLength; j++) {
802
+ stringBuffer[j] = stringBuffer[j + 1];
803
+ }
804
+ }
805
+
806
+ stringBuffer[ecc + eccLength - 1] = bit === 255 ? 0 : Galois_1.EXPONENT[Frame._modN(bit + polynomial[0])];
807
+ }
808
+ },
809
+
810
+ _appendEccToData: function() {
811
+ var i;
812
+ var data = 0;
813
+ var dataBlock = this._dataBlock;
814
+ var ecc = this._calculateMaxLength();
815
+ var eccBlock = this._eccBlock;
816
+
817
+ for (i = 0; i < this._neccBlock1; i++) {
818
+ this._appendData(data, dataBlock, ecc, eccBlock);
819
+
820
+ data += dataBlock;
821
+ ecc += eccBlock;
822
+ }
823
+
824
+ for (i = 0; i < this._neccBlock2; i++) {
825
+ this._appendData(data, dataBlock + 1, ecc, eccBlock);
826
+
827
+ data += dataBlock + 1;
828
+ ecc += eccBlock;
829
+ }
830
+ },
831
+
832
+ _applyMask: function(mask) {
833
+ var r3x, r3y, x, y;
834
+ var buffer = this.buffer;
835
+ var width = this.width;
836
+
837
+ switch (mask) {
838
+ case 0:
839
+ for (y = 0; y < width; y++) {
840
+ for (x = 0; x < width; x++) {
841
+ if (!((x + y) & 1) && !this._isMasked(x, y)) {
842
+ buffer[x + (y * width)] ^= 1;
843
+ }
844
+ }
845
+ }
846
+
847
+ break;
848
+ case 1:
849
+ for (y = 0; y < width; y++) {
850
+ for (x = 0; x < width; x++) {
851
+ if (!(y & 1) && !this._isMasked(x, y)) {
852
+ buffer[x + (y * width)] ^= 1;
853
+ }
854
+ }
855
+ }
856
+
857
+ break;
858
+ case 2:
859
+ for (y = 0; y < width; y++) {
860
+ for (r3x = 0, x = 0; x < width; x++, r3x++) {
861
+ if (r3x === 3) {
862
+ r3x = 0;
863
+ }
864
+
865
+ if (!r3x && !this._isMasked(x, y)) {
866
+ buffer[x + (y * width)] ^= 1;
867
+ }
868
+ }
869
+ }
870
+
871
+ break;
872
+ case 3:
873
+ for (r3y = 0, y = 0; y < width; y++, r3y++) {
874
+ if (r3y === 3) {
875
+ r3y = 0;
876
+ }
877
+
878
+ for (r3x = r3y, x = 0; x < width; x++, r3x++) {
879
+ if (r3x === 3) {
880
+ r3x = 0;
881
+ }
882
+
883
+ if (!r3x && !this._isMasked(x, y)) {
884
+ buffer[x + (y * width)] ^= 1;
885
+ }
886
+ }
887
+ }
888
+
889
+ break;
890
+ case 4:
891
+ for (y = 0; y < width; y++) {
892
+ for (r3x = 0, r3y = (y >> 1) & 1, x = 0; x < width; x++, r3x++) {
893
+ if (r3x === 3) {
894
+ r3x = 0;
895
+ r3y = !r3y;
896
+ }
897
+
898
+ if (!r3y && !this._isMasked(x, y)) {
899
+ buffer[x + (y * width)] ^= 1;
900
+ }
901
+ }
902
+ }
903
+
904
+ break;
905
+ case 5:
906
+ for (r3y = 0, y = 0; y < width; y++, r3y++) {
907
+ if (r3y === 3) {
908
+ r3y = 0;
909
+ }
910
+
911
+ for (r3x = 0, x = 0; x < width; x++, r3x++) {
912
+ if (r3x === 3) {
913
+ r3x = 0;
914
+ }
915
+
916
+ if (!((x & y & 1) + !(!r3x | !r3y)) && !this._isMasked(x, y)) {
917
+ buffer[x + (y * width)] ^= 1;
918
+ }
919
+ }
920
+ }
921
+
922
+ break;
923
+ case 6:
924
+ for (r3y = 0, y = 0; y < width; y++, r3y++) {
925
+ if (r3y === 3) {
926
+ r3y = 0;
927
+ }
928
+
929
+ for (r3x = 0, x = 0; x < width; x++, r3x++) {
930
+ if (r3x === 3) {
931
+ r3x = 0;
932
+ }
933
+
934
+ if (!((x & y & 1) + (r3x && r3x === r3y) & 1) && !this._isMasked(x, y)) {
935
+ buffer[x + (y * width)] ^= 1;
936
+ }
937
+ }
938
+ }
939
+
940
+ break;
941
+ case 7:
942
+ for (r3y = 0, y = 0; y < width; y++, r3y++) {
943
+ if (r3y === 3) {
944
+ r3y = 0;
945
+ }
946
+
947
+ for (r3x = 0, x = 0; x < width; x++, r3x++) {
948
+ if (r3x === 3) {
949
+ r3x = 0;
950
+ }
951
+
952
+ if (!((r3x && r3x === r3y) + (x + y & 1) & 1) && !this._isMasked(x, y)) {
953
+ buffer[x + (y * width)] ^= 1;
954
+ }
955
+ }
956
+ }
957
+
958
+ break;
959
+ }
960
+ },
961
+
962
+ _calculateMaxLength: function() {
963
+ return (this._dataBlock * (this._neccBlock1 + this._neccBlock2)) + this._neccBlock2;
964
+ },
965
+
966
+ _calculatePolynomial: function() {
967
+ var i, j;
968
+ var eccBlock = this._eccBlock;
969
+ var polynomial = this._polynomial;
970
+
971
+ polynomial[0] = 1;
972
+
973
+ for (i = 0; i < eccBlock; i++) {
974
+ polynomial[i + 1] = 1;
975
+
976
+ for (j = i; j > 0; j--) {
977
+ polynomial[j] = polynomial[j] ? polynomial[j - 1] ^
978
+ Galois_1.EXPONENT[Frame._modN(Galois_1.LOG[polynomial[j]] + i)] : polynomial[j - 1];
979
+ }
980
+
981
+ polynomial[0] = Galois_1.EXPONENT[Frame._modN(Galois_1.LOG[polynomial[0]] + i)];
982
+ }
983
+
984
+ // Use logs for generator polynomial to save calculation step.
985
+ for (i = 0; i <= eccBlock; i++) {
986
+ polynomial[i] = Galois_1.LOG[polynomial[i]];
987
+ }
988
+ },
989
+
990
+ _checkBadness: function() {
991
+ var b, b1, h, x, y;
992
+ var bad = 0;
993
+ var badness = this._badness;
994
+ var buffer = this.buffer;
995
+ var width = this.width;
996
+
997
+ // Blocks of same colour.
998
+ for (y = 0; y < width - 1; y++) {
999
+ for (x = 0; x < width - 1; x++) {
1000
+ // All foreground colour.
1001
+ if ((buffer[x + (width * y)] &&
1002
+ buffer[x + 1 + (width * y)] &&
1003
+ buffer[x + (width * (y + 1))] &&
1004
+ buffer[x + 1 + (width * (y + 1))]) ||
1005
+ // All background colour.
1006
+ !(buffer[x + (width * y)] ||
1007
+ buffer[x + 1 + (width * y)] ||
1008
+ buffer[x + (width * (y + 1))] ||
1009
+ buffer[x + 1 + (width * (y + 1))])) {
1010
+ bad += Frame.N2;
1011
+ }
1012
+ }
1013
+ }
1014
+
1015
+ var bw = 0;
1016
+
1017
+ // X runs.
1018
+ for (y = 0; y < width; y++) {
1019
+ h = 0;
1020
+
1021
+ badness[0] = 0;
1022
+
1023
+ for (b = 0, x = 0; x < width; x++) {
1024
+ b1 = buffer[x + (width * y)];
1025
+
1026
+ if (b === b1) {
1027
+ badness[h]++;
1028
+ } else {
1029
+ badness[++h] = 1;
1030
+ }
1031
+
1032
+ b = b1;
1033
+ bw += b ? 1 : -1;
1034
+ }
1035
+
1036
+ bad += this._getBadness(h);
1037
+ }
1038
+
1039
+ if (bw < 0) {
1040
+ bw = -bw;
1041
+ }
1042
+
1043
+ var count = 0;
1044
+ var big = bw;
1045
+ big += big << 2;
1046
+ big <<= 1;
1047
+
1048
+ while (big > width * width) {
1049
+ big -= width * width;
1050
+ count++;
1051
+ }
1052
+
1053
+ bad += count * Frame.N4;
1054
+
1055
+ // Y runs.
1056
+ for (x = 0; x < width; x++) {
1057
+ h = 0;
1058
+
1059
+ badness[0] = 0;
1060
+
1061
+ for (b = 0, y = 0; y < width; y++) {
1062
+ b1 = buffer[x + (width * y)];
1063
+
1064
+ if (b === b1) {
1065
+ badness[h]++;
1066
+ } else {
1067
+ badness[++h] = 1;
1068
+ }
1069
+
1070
+ b = b1;
1071
+ }
1072
+
1073
+ bad += this._getBadness(h);
1074
+ }
1075
+
1076
+ return bad;
1077
+ },
1078
+
1079
+ _convertBitStream: function(length) {
1080
+ var bit, i;
1081
+ var ecc = this._ecc;
1082
+ var version = this._version;
1083
+
1084
+ // Convert string to bit stream. 8-bit data to QR-coded 8-bit data (numeric, alphanumeric, or kanji not supported).
1085
+ for (i = 0; i < length; i++) {
1086
+ ecc[i] = this._value.charCodeAt(i);
1087
+ }
1088
+
1089
+ var stringBuffer = this._stringBuffer = ecc.slice();
1090
+ var maxLength = this._calculateMaxLength();
1091
+
1092
+ if (length >= maxLength - 2) {
1093
+ length = maxLength - 2;
1094
+
1095
+ if (version > 9) {
1096
+ length--;
1097
+ }
1098
+ }
1099
+
1100
+ // Shift and re-pack to insert length prefix.
1101
+ var index = length;
1102
+
1103
+ if (version > 9) {
1104
+ stringBuffer[index + 2] = 0;
1105
+ stringBuffer[index + 3] = 0;
1106
+
1107
+ while (index--) {
1108
+ bit = stringBuffer[index];
1109
+
1110
+ stringBuffer[index + 3] |= 255 & (bit << 4);
1111
+ stringBuffer[index + 2] = bit >> 4;
1112
+ }
1113
+
1114
+ stringBuffer[2] |= 255 & (length << 4);
1115
+ stringBuffer[1] = length >> 4;
1116
+ stringBuffer[0] = 0x40 | (length >> 12);
1117
+ } else {
1118
+ stringBuffer[index + 1] = 0;
1119
+ stringBuffer[index + 2] = 0;
1120
+
1121
+ while (index--) {
1122
+ bit = stringBuffer[index];
1123
+
1124
+ stringBuffer[index + 2] |= 255 & (bit << 4);
1125
+ stringBuffer[index + 1] = bit >> 4;
1126
+ }
1127
+
1128
+ stringBuffer[1] |= 255 & (length << 4);
1129
+ stringBuffer[0] = 0x40 | (length >> 4);
1130
+ }
1131
+
1132
+ // Fill to end with pad pattern.
1133
+ index = length + 3 - (version < 10);
1134
+
1135
+ while (index < maxLength) {
1136
+ stringBuffer[index++] = 0xec;
1137
+ stringBuffer[index++] = 0x11;
1138
+ }
1139
+ },
1140
+
1141
+ _getBadness: function(length) {
1142
+ var i;
1143
+ var badRuns = 0;
1144
+ var badness = this._badness;
1145
+
1146
+ for (i = 0; i <= length; i++) {
1147
+ if (badness[i] >= 5) {
1148
+ badRuns += Frame.N1 + badness[i] - 5;
1149
+ }
1150
+ }
1151
+
1152
+ // FBFFFBF as in finder.
1153
+ for (i = 3; i < length - 1; i += 2) {
1154
+ if (badness[i - 2] === badness[i + 2] &&
1155
+ badness[i + 2] === badness[i - 1] &&
1156
+ badness[i - 1] === badness[i + 1] &&
1157
+ badness[i - 1] * 3 === badness[i] &&
1158
+ // Background around the foreground pattern? Not part of the specs.
1159
+ (badness[i - 3] === 0 || i + 3 > length ||
1160
+ badness[i - 3] * 3 >= badness[i] * 4 ||
1161
+ badness[i + 3] * 3 >= badness[i] * 4)) {
1162
+ badRuns += Frame.N3;
1163
+ }
1164
+ }
1165
+
1166
+ return badRuns;
1167
+ },
1168
+
1169
+ _finish: function() {
1170
+ // Save pre-mask copy of frame.
1171
+ this._stringBuffer = this.buffer.slice();
1172
+
1173
+ var currentMask, i;
1174
+ var bit = 0;
1175
+ var mask = 30000;
1176
+
1177
+ /*
1178
+ * Using for instead of while since in original Arduino code if an early mask was "good enough" it wouldn't try for
1179
+ * a better one since they get more complex and take longer.
1180
+ */
1181
+ for (i = 0; i < 8; i++) {
1182
+ // Returns foreground-background imbalance.
1183
+ this._applyMask(i);
1184
+
1185
+ currentMask = this._checkBadness();
1186
+
1187
+ // Is current mask better than previous best?
1188
+ if (currentMask < mask) {
1189
+ mask = currentMask;
1190
+ bit = i;
1191
+ }
1192
+
1193
+ // Don't increment "i" to a void redoing mask.
1194
+ if (bit === 7) {
1195
+ break;
1196
+ }
1197
+
1198
+ // Reset for next pass.
1199
+ this.buffer = this._stringBuffer.slice();
1200
+ }
1201
+
1202
+ // Redo best mask as none were "good enough" (i.e. last wasn't bit).
1203
+ if (bit !== i) {
1204
+ this._applyMask(bit);
1205
+ }
1206
+
1207
+ // Add in final mask/ECC level bytes.
1208
+ mask = ErrorCorrection_1.FINAL_FORMAT[bit + (this._level - 1 << 3)];
1209
+
1210
+ var buffer = this.buffer;
1211
+ var width = this.width;
1212
+
1213
+ // Low byte.
1214
+ for (i = 0; i < 8; i++, mask >>= 1) {
1215
+ if (mask & 1) {
1216
+ buffer[width - 1 - i + (width * 8)] = 1;
1217
+
1218
+ if (i < 6) {
1219
+ buffer[8 + (width * i)] = 1;
1220
+ } else {
1221
+ buffer[8 + (width * (i + 1))] = 1;
1222
+ }
1223
+ }
1224
+ }
1225
+
1226
+ // High byte.
1227
+ for (i = 0; i < 7; i++, mask >>= 1) {
1228
+ if (mask & 1) {
1229
+ buffer[8 + (width * (width - 7 + i))] = 1;
1230
+
1231
+ if (i) {
1232
+ buffer[6 - i + (width * 8)] = 1;
1233
+ } else {
1234
+ buffer[7 + (width * 8)] = 1;
1235
+ }
1236
+ }
1237
+ }
1238
+ },
1239
+
1240
+ _interleaveBlocks: function() {
1241
+ var i, j;
1242
+ var dataBlock = this._dataBlock;
1243
+ var ecc = this._ecc;
1244
+ var eccBlock = this._eccBlock;
1245
+ var k = 0;
1246
+ var maxLength = this._calculateMaxLength();
1247
+ var neccBlock1 = this._neccBlock1;
1248
+ var neccBlock2 = this._neccBlock2;
1249
+ var stringBuffer = this._stringBuffer;
1250
+
1251
+ for (i = 0; i < dataBlock; i++) {
1252
+ for (j = 0; j < neccBlock1; j++) {
1253
+ ecc[k++] = stringBuffer[i + (j * dataBlock)];
1254
+ }
1255
+
1256
+ for (j = 0; j < neccBlock2; j++) {
1257
+ ecc[k++] = stringBuffer[(neccBlock1 * dataBlock) + i + (j * (dataBlock + 1))];
1258
+ }
1259
+ }
1260
+
1261
+ for (j = 0; j < neccBlock2; j++) {
1262
+ ecc[k++] = stringBuffer[(neccBlock1 * dataBlock) + i + (j * (dataBlock + 1))];
1263
+ }
1264
+
1265
+ for (i = 0; i < eccBlock; i++) {
1266
+ for (j = 0; j < neccBlock1 + neccBlock2; j++) {
1267
+ ecc[k++] = stringBuffer[maxLength + i + (j * eccBlock)];
1268
+ }
1269
+ }
1270
+
1271
+ this._stringBuffer = ecc;
1272
+ },
1273
+
1274
+ _insertAlignments: function() {
1275
+ var i, x, y;
1276
+ var version = this._version;
1277
+ var width = this.width;
1278
+
1279
+ if (version > 1) {
1280
+ i = Alignment_1.BLOCK[version];
1281
+ y = width - 7;
1282
+
1283
+ for (;;) {
1284
+ x = width - 7;
1285
+
1286
+ while (x > i - 3) {
1287
+ this._addAlignment(x, y);
1288
+
1289
+ if (x < i) {
1290
+ break;
1291
+ }
1292
+
1293
+ x -= i;
1294
+ }
1295
+
1296
+ if (y <= i + 9) {
1297
+ break;
1298
+ }
1299
+
1300
+ y -= i;
1301
+
1302
+ this._addAlignment(6, y);
1303
+ this._addAlignment(y, 6);
1304
+ }
1305
+ }
1306
+ },
1307
+
1308
+ _insertFinders: function() {
1309
+ var i, j, x, y;
1310
+ var buffer = this.buffer;
1311
+ var width = this.width;
1312
+
1313
+ for (i = 0; i < 3; i++) {
1314
+ j = 0;
1315
+ y = 0;
1316
+
1317
+ if (i === 1) {
1318
+ j = width - 7;
1319
+ }
1320
+ if (i === 2) {
1321
+ y = width - 7;
1322
+ }
1323
+
1324
+ buffer[y + 3 + (width * (j + 3))] = 1;
1325
+
1326
+ for (x = 0; x < 6; x++) {
1327
+ buffer[y + x + (width * j)] = 1;
1328
+ buffer[y + (width * (j + x + 1))] = 1;
1329
+ buffer[y + 6 + (width * (j + x))] = 1;
1330
+ buffer[y + x + 1 + (width * (j + 6))] = 1;
1331
+ }
1332
+
1333
+ for (x = 1; x < 5; x++) {
1334
+ this._setMask(y + x, j + 1);
1335
+ this._setMask(y + 1, j + x + 1);
1336
+ this._setMask(y + 5, j + x);
1337
+ this._setMask(y + x + 1, j + 5);
1338
+ }
1339
+
1340
+ for (x = 2; x < 4; x++) {
1341
+ buffer[y + x + (width * (j + 2))] = 1;
1342
+ buffer[y + 2 + (width * (j + x + 1))] = 1;
1343
+ buffer[y + 4 + (width * (j + x))] = 1;
1344
+ buffer[y + x + 1 + (width * (j + 4))] = 1;
1345
+ }
1346
+ }
1347
+ },
1348
+
1349
+ _insertTimingGap: function() {
1350
+ var x, y;
1351
+ var width = this.width;
1352
+
1353
+ for (y = 0; y < 7; y++) {
1354
+ this._setMask(7, y);
1355
+ this._setMask(width - 8, y);
1356
+ this._setMask(7, y + width - 7);
1357
+ }
1358
+
1359
+ for (x = 0; x < 8; x++) {
1360
+ this._setMask(x, 7);
1361
+ this._setMask(x + width - 8, 7);
1362
+ this._setMask(x, width - 8);
1363
+ }
1364
+ },
1365
+
1366
+ _insertTimingRowAndColumn: function() {
1367
+ var x;
1368
+ var buffer = this.buffer;
1369
+ var width = this.width;
1370
+
1371
+ for (x = 0; x < width - 14; x++) {
1372
+ if (x & 1) {
1373
+ this._setMask(8 + x, 6);
1374
+ this._setMask(6, 8 + x);
1375
+ } else {
1376
+ buffer[8 + x + (width * 6)] = 1;
1377
+ buffer[6 + (width * (8 + x))] = 1;
1378
+ }
1379
+ }
1380
+ },
1381
+
1382
+ _insertVersion: function() {
1383
+ var i, j, x, y;
1384
+ var buffer = this.buffer;
1385
+ var version = this._version;
1386
+ var width = this.width;
1387
+
1388
+ if (version > 6) {
1389
+ i = Version_1.BLOCK[version - 7];
1390
+ j = 17;
1391
+
1392
+ for (x = 0; x < 6; x++) {
1393
+ for (y = 0; y < 3; y++, j--) {
1394
+ if (1 & (j > 11 ? version >> j - 12 : i >> j)) {
1395
+ buffer[5 - x + (width * (2 - y + width - 11))] = 1;
1396
+ buffer[2 - y + width - 11 + (width * (5 - x))] = 1;
1397
+ } else {
1398
+ this._setMask(5 - x, 2 - y + width - 11);
1399
+ this._setMask(2 - y + width - 11, 5 - x);
1400
+ }
1401
+ }
1402
+ }
1403
+ }
1404
+ },
1405
+
1406
+ _isMasked: function(x, y) {
1407
+ var bit = Frame._getMaskBit(x, y);
1408
+
1409
+ return this._mask[bit] === 1;
1410
+ },
1411
+
1412
+ _pack: function() {
1413
+ var bit, i, j;
1414
+ var k = 1;
1415
+ var v = 1;
1416
+ var width = this.width;
1417
+ var x = width - 1;
1418
+ var y = width - 1;
1419
+
1420
+ // Interleaved data and ECC codes.
1421
+ var length = ((this._dataBlock + this._eccBlock) * (this._neccBlock1 + this._neccBlock2)) + this._neccBlock2;
1422
+
1423
+ for (i = 0; i < length; i++) {
1424
+ bit = this._stringBuffer[i];
1425
+
1426
+ for (j = 0; j < 8; j++, bit <<= 1) {
1427
+ if (0x80 & bit) {
1428
+ this.buffer[x + (width * y)] = 1;
1429
+ }
1430
+
1431
+ // Find next fill position.
1432
+ do {
1433
+ if (v) {
1434
+ x--;
1435
+ } else {
1436
+ x++;
1437
+
1438
+ if (k) {
1439
+ if (y !== 0) {
1440
+ y--;
1441
+ } else {
1442
+ x -= 2;
1443
+ k = !k;
1444
+
1445
+ if (x === 6) {
1446
+ x--;
1447
+ y = 9;
1448
+ }
1449
+ }
1450
+ } else if (y !== width - 1) {
1451
+ y++;
1452
+ } else {
1453
+ x -= 2;
1454
+ k = !k;
1455
+
1456
+ if (x === 6) {
1457
+ x--;
1458
+ y -= 8;
1459
+ }
1460
+ }
1461
+ }
1462
+
1463
+ v = !v;
1464
+ } while (this._isMasked(x, y));
1465
+ }
1466
+ }
1467
+ },
1468
+
1469
+ _reverseMask: function() {
1470
+ var x, y;
1471
+ var width = this.width;
1472
+
1473
+ for (x = 0; x < 9; x++) {
1474
+ this._setMask(x, 8);
1475
+ }
1476
+
1477
+ for (x = 0; x < 8; x++) {
1478
+ this._setMask(x + width - 8, 8);
1479
+ this._setMask(8, x);
1480
+ }
1481
+
1482
+ for (y = 0; y < 7; y++) {
1483
+ this._setMask(8, y + width - 7);
1484
+ }
1485
+ },
1486
+
1487
+ _setMask: function(x, y) {
1488
+ var bit = Frame._getMaskBit(x, y);
1489
+
1490
+ this._mask[bit] = 1;
1491
+ },
1492
+
1493
+ _syncMask: function() {
1494
+ var x, y;
1495
+ var width = this.width;
1496
+
1497
+ for (y = 0; y < width; y++) {
1498
+ for (x = 0; x <= y; x++) {
1499
+ if (this.buffer[x + (width * y)]) {
1500
+ this._setMask(x, y);
1501
+ }
1502
+ }
1503
+ }
1504
+ }
1505
+
1506
+ }, {
1507
+
1508
+ _createArray: function(length) {
1509
+ var i;
1510
+ var array = [];
1511
+
1512
+ for (i = 0; i < length; i++) {
1513
+ array[i] = 0;
1514
+ }
1515
+
1516
+ return array;
1517
+ },
1518
+
1519
+ _getMaskBit: function(x, y) {
1520
+ var bit;
1521
+
1522
+ if (x > y) {
1523
+ bit = x;
1524
+ x = y;
1525
+ y = bit;
1526
+ }
1527
+
1528
+ bit = y;
1529
+ bit += y * y;
1530
+ bit >>= 1;
1531
+ bit += x;
1532
+
1533
+ return bit;
1534
+ },
1535
+
1536
+ _modN: function(x) {
1537
+ while (x >= 255) {
1538
+ x -= 255;
1539
+ x = (x >> 8) + (x & 255);
1540
+ }
1541
+
1542
+ return x;
1543
+ },
1544
+
1545
+ // *Badness* coefficients.
1546
+ N1: 3,
1547
+ N2: 3,
1548
+ N3: 40,
1549
+ N4: 10
1550
+
1551
+ });
1552
+
1553
+ var Frame_1 = Frame;
1554
+
1555
+ /**
1556
+ * The options used by {@link Frame}.
1557
+ *
1558
+ * @typedef {Object} Frame~Options
1559
+ * @property {string} level - The ECC level to be used.
1560
+ * @property {string} value - The value to be encoded.
1561
+ */
1562
+
1563
+ /**
1564
+ * An implementation of {@link Renderer} for working with <code>img</code> elements.
1565
+ *
1566
+ * This depends on {@link CanvasRenderer} being executed first as this implementation simply applies the data URL from
1567
+ * the rendered <code>canvas</code> element as the <code>src</code> for the <code>img</code> element being rendered.
1568
+ *
1569
+ * @public
1570
+ * @class
1571
+ * @extends Renderer
1572
+ */
1573
+ var ImageRenderer = Renderer_1.extend({
1574
+
1575
+ /**
1576
+ * @override
1577
+ */
1578
+ draw: function() {
1579
+ this.element.src = this.qrious.toDataURL();
1580
+ },
1581
+
1582
+ /**
1583
+ * @override
1584
+ */
1585
+ reset: function() {
1586
+ this.element.src = '';
1587
+ },
1588
+
1589
+ /**
1590
+ * @override
1591
+ */
1592
+ resize: function() {
1593
+ var element = this.element;
1594
+
1595
+ element.width = element.height = this.qrious.size;
1596
+ }
1597
+
1598
+ });
1599
+
1600
+ var ImageRenderer_1 = ImageRenderer;
1601
+
1602
+ /**
1603
+ * Defines an available option while also configuring how values are applied to the target object.
1604
+ *
1605
+ * Optionally, a default value can be specified as well a value transformer for greater control over how the option
1606
+ * value is applied.
1607
+ *
1608
+ * If no value transformer is specified, then any specified option will be applied directly. All values are maintained
1609
+ * on the target object itself as a field using the option name prefixed with a single underscore.
1610
+ *
1611
+ * When an option is specified as modifiable, the {@link OptionManager} will be required to include a setter for the
1612
+ * property that is defined on the target object that uses the option name.
1613
+ *
1614
+ * @param {string} name - the name to be used
1615
+ * @param {boolean} [modifiable] - <code>true</code> if the property defined on target objects should include a setter;
1616
+ * otherwise <code>false</code>
1617
+ * @param {*} [defaultValue] - the default value to be used
1618
+ * @param {Option~ValueTransformer} [valueTransformer] - the value transformer to be used
1619
+ * @public
1620
+ * @class
1621
+ * @extends Nevis
1622
+ */
1623
+ var Option = lite.extend(function(name, modifiable, defaultValue, valueTransformer) {
1624
+ /**
1625
+ * The name for this {@link Option}.
1626
+ *
1627
+ * @public
1628
+ * @type {string}
1629
+ * @memberof Option#
1630
+ */
1631
+ this.name = name;
1632
+
1633
+ /**
1634
+ * Whether a setter should be included on the property defined on target objects for this {@link Option}.
1635
+ *
1636
+ * @public
1637
+ * @type {boolean}
1638
+ * @memberof Option#
1639
+ */
1640
+ this.modifiable = Boolean(modifiable);
1641
+
1642
+ /**
1643
+ * The default value for this {@link Option}.
1644
+ *
1645
+ * @public
1646
+ * @type {*}
1647
+ * @memberof Option#
1648
+ */
1649
+ this.defaultValue = defaultValue;
1650
+
1651
+ this._valueTransformer = valueTransformer;
1652
+ }, {
1653
+
1654
+ /**
1655
+ * Transforms the specified <code>value</code> so that it can be applied for this {@link Option}.
1656
+ *
1657
+ * If a value transformer has been specified for this {@link Option}, it will be called upon to transform
1658
+ * <code>value</code>. Otherwise, <code>value</code> will be returned directly.
1659
+ *
1660
+ * @param {*} value - the value to be transformed
1661
+ * @return {*} The transformed value or <code>value</code> if no value transformer is specified.
1662
+ * @public
1663
+ * @memberof Option#
1664
+ */
1665
+ transform: function(value) {
1666
+ var transformer = this._valueTransformer;
1667
+ if (typeof transformer === 'function') {
1668
+ return transformer(value, this);
1669
+ }
1670
+
1671
+ return value;
1672
+ }
1673
+
1674
+ });
1675
+
1676
+ var Option_1 = Option;
1677
+
1678
+ /**
1679
+ * Returns a transformed value for the specified <code>value</code> to be applied for the <code>option</code> provided.
1680
+ *
1681
+ * @callback Option~ValueTransformer
1682
+ * @param {*} value - the value to be transformed
1683
+ * @param {Option} option - the {@link Option} for which <code>value</code> is being transformed
1684
+ * @return {*} The transform value.
1685
+ */
1686
+
1687
+ /**
1688
+ * Contains utility methods that are useful throughout the library.
1689
+ *
1690
+ * @public
1691
+ * @class
1692
+ * @extends Nevis
1693
+ */
1694
+ var Utilities = lite.extend(null, {
1695
+
1696
+ /**
1697
+ * Returns the absolute value of a given number.
1698
+ *
1699
+ * This method is simply a convenient shorthand for <code>Math.abs</code> while ensuring that nulls are returned as
1700
+ * <code>null</code> instead of zero.
1701
+ *
1702
+ * @param {number} value - the number whose absolute value is to be returned
1703
+ * @return {number} The absolute value of <code>value</code> or <code>null</code> if <code>value</code> is
1704
+ * <code>null</code>.
1705
+ * @public
1706
+ * @static
1707
+ * @memberof Utilities
1708
+ */
1709
+ abs: function(value) {
1710
+ return value != null ? Math.abs(value) : null;
1711
+ },
1712
+
1713
+ /**
1714
+ * Returns whether the specified <code>object</code> has a property with the specified <code>name</code> as an own
1715
+ * (not inherited) property.
1716
+ *
1717
+ * @param {Object} object - the object on which the property is to be checked
1718
+ * @param {string} name - the name of the property to be checked
1719
+ * @return {boolean} <code>true</code> if <code>object</code> has an own property with <code>name</code>.
1720
+ * @public
1721
+ * @static
1722
+ * @memberof Utilities
1723
+ */
1724
+ hasOwn: function(object, name) {
1725
+ return Object.prototype.hasOwnProperty.call(object, name);
1726
+ },
1727
+
1728
+ /**
1729
+ * A non-operation method that does absolutely nothing.
1730
+ *
1731
+ * @return {void}
1732
+ * @public
1733
+ * @static
1734
+ * @memberof Utilities
1735
+ */
1736
+ noop: function() {},
1737
+
1738
+ /**
1739
+ * Transforms the specified <code>string</code> to upper case while remaining null-safe.
1740
+ *
1741
+ * @param {string} string - the string to be transformed to upper case
1742
+ * @return {string} <code>string</code> transformed to upper case if <code>string</code> is not <code>null</code>.
1743
+ * @public
1744
+ * @static
1745
+ * @memberof Utilities
1746
+ */
1747
+ toUpperCase: function(string) {
1748
+ return string != null ? string.toUpperCase() : null;
1749
+ }
1750
+
1751
+ });
1752
+
1753
+ var Utilities_1 = Utilities;
1754
+
1755
+ /**
1756
+ * Manages multiple {@link Option} instances that are intended to be used by multiple implementations.
1757
+ *
1758
+ * Although the option definitions are shared between targets, the values are maintained on the targets themselves.
1759
+ *
1760
+ * @param {Option[]} options - the options to be used
1761
+ * @public
1762
+ * @class
1763
+ * @extends Nevis
1764
+ */
1765
+ var OptionManager = lite.extend(function(options) {
1766
+ /**
1767
+ * The available options for this {@link OptionManager}.
1768
+ *
1769
+ * @public
1770
+ * @type {Object.<string, Option>}
1771
+ * @memberof OptionManager#
1772
+ */
1773
+ this.options = {};
1774
+
1775
+ options.forEach(function(option) {
1776
+ this.options[option.name] = option;
1777
+ }, this);
1778
+ }, {
1779
+
1780
+ /**
1781
+ * Returns whether an option with the specified <code>name</code> is available.
1782
+ *
1783
+ * @param {string} name - the name of the {@link Option} whose existence is to be checked
1784
+ * @return {boolean} <code>true</code> if an {@link Option} exists with <code>name</code>; otherwise
1785
+ * <code>false</code>.
1786
+ * @public
1787
+ * @memberof OptionManager#
1788
+ */
1789
+ exists: function(name) {
1790
+ return this.options[name] != null;
1791
+ },
1792
+
1793
+ /**
1794
+ * Returns the value of the option with the specified <code>name</code> on the <code>target</code> object provided.
1795
+ *
1796
+ * @param {string} name - the name of the {@link Option} whose value on <code>target</code> is to be returned
1797
+ * @param {Object} target - the object from which the value of the named {@link Option} is to be returned
1798
+ * @return {*} The value of the {@link Option} with <code>name</code> on <code>target</code>.
1799
+ * @public
1800
+ * @memberof OptionManager#
1801
+ */
1802
+ get: function(name, target) {
1803
+ return OptionManager._get(this.options[name], target);
1804
+ },
1805
+
1806
+ /**
1807
+ * Returns a copy of all of the available options on the <code>target</code> object provided.
1808
+ *
1809
+ * @param {Object} target - the object from which the option name/value pairs are to be returned
1810
+ * @return {Object.<string, *>} A hash containing the name/value pairs of all options on <code>target</code>.
1811
+ * @public
1812
+ * @memberof OptionManager#
1813
+ */
1814
+ getAll: function(target) {
1815
+ var name;
1816
+ var options = this.options;
1817
+ var result = {};
1818
+
1819
+ for (name in options) {
1820
+ if (Utilities_1.hasOwn(options, name)) {
1821
+ result[name] = OptionManager._get(options[name], target);
1822
+ }
1823
+ }
1824
+
1825
+ return result;
1826
+ },
1827
+
1828
+ /**
1829
+ * Initializes the available options for the <code>target</code> object provided and then applies the initial values
1830
+ * within the speciifed <code>options</code>.
1831
+ *
1832
+ * This method will throw an error if any of the names within <code>options</code> does not match an available option.
1833
+ *
1834
+ * This involves setting the default values and defining properties for all of the available options on
1835
+ * <code>target</code> before finally calling {@link OptionMananger#setAll} with <code>options</code> and
1836
+ * <code>target</code>. Any options that are configured to be modifiable will have a setter included in their defined
1837
+ * property that will allow its corresponding value to be modified.
1838
+ *
1839
+ * If a change handler is specified, it will be called whenever the value changes on <code>target</code> for a
1840
+ * modifiable option, but only when done so via the defined property's setter.
1841
+ *
1842
+ * @param {Object.<string, *>} options - the name/value pairs of the initial options to be set
1843
+ * @param {Object} target - the object on which the options are to be initialized
1844
+ * @param {Function} [changeHandler] - the function to be called whenever the value of an modifiable option changes on
1845
+ * <code>target</code>
1846
+ * @return {void}
1847
+ * @throws {Error} If <code>options</code> contains an invalid option name.
1848
+ * @public
1849
+ * @memberof OptionManager#
1850
+ */
1851
+ init: function(options, target, changeHandler) {
1852
+ if (typeof changeHandler !== 'function') {
1853
+ changeHandler = Utilities_1.noop;
1854
+ }
1855
+
1856
+ var name, option;
1857
+
1858
+ for (name in this.options) {
1859
+ if (Utilities_1.hasOwn(this.options, name)) {
1860
+ option = this.options[name];
1861
+
1862
+ OptionManager._set(option, option.defaultValue, target);
1863
+ OptionManager._createAccessor(option, target, changeHandler);
1864
+ }
1865
+ }
1866
+
1867
+ this._setAll(options, target, true);
1868
+ },
1869
+
1870
+ /**
1871
+ * Sets the value of the option with the specified <code>name</code> on the <code>target</code> object provided to
1872
+ * <code>value</code>.
1873
+ *
1874
+ * This method will throw an error if <code>name</code> does not match an available option or matches an option that
1875
+ * cannot be modified.
1876
+ *
1877
+ * If <code>value</code> is <code>null</code> and the {@link Option} has a default value configured, then that default
1878
+ * value will be used instead. If the {@link Option} also has a value transformer configured, it will be used to
1879
+ * transform whichever value was determined to be used.
1880
+ *
1881
+ * This method returns whether the value of the underlying field on <code>target</code> was changed as a result.
1882
+ *
1883
+ * @param {string} name - the name of the {@link Option} whose value is to be set
1884
+ * @param {*} value - the value to be set for the named {@link Option} on <code>target</code>
1885
+ * @param {Object} target - the object on which <code>value</code> is to be set for the named {@link Option}
1886
+ * @return {boolean} <code>true</code> if the underlying field on <code>target</code> was changed; otherwise
1887
+ * <code>false</code>.
1888
+ * @throws {Error} If <code>name</code> is invalid or is for an option that cannot be modified.
1889
+ * @public
1890
+ * @memberof OptionManager#
1891
+ */
1892
+ set: function(name, value, target) {
1893
+ return this._set(name, value, target);
1894
+ },
1895
+
1896
+ /**
1897
+ * Sets all of the specified <code>options</code> on the <code>target</code> object provided to their corresponding
1898
+ * values.
1899
+ *
1900
+ * This method will throw an error if any of the names within <code>options</code> does not match an available option
1901
+ * or matches an option that cannot be modified.
1902
+ *
1903
+ * If any value within <code>options</code> is <code>null</code> and the corresponding {@link Option} has a default
1904
+ * value configured, then that default value will be used instead. If an {@link Option} also has a value transformer
1905
+ * configured, it will be used to transform whichever value was determined to be used.
1906
+ *
1907
+ * This method returns whether the value for any of the underlying fields on <code>target</code> were changed as a
1908
+ * result.
1909
+ *
1910
+ * @param {Object.<string, *>} options - the name/value pairs of options to be set
1911
+ * @param {Object} target - the object on which the options are to be set
1912
+ * @return {boolean} <code>true</code> if any of the underlying fields on <code>target</code> were changed; otherwise
1913
+ * <code>false</code>.
1914
+ * @throws {Error} If <code>options</code> contains an invalid option name or an option that cannot be modiifed.
1915
+ * @public
1916
+ * @memberof OptionManager#
1917
+ */
1918
+ setAll: function(options, target) {
1919
+ return this._setAll(options, target);
1920
+ },
1921
+
1922
+ _set: function(name, value, target, allowUnmodifiable) {
1923
+ var option = this.options[name];
1924
+ if (!option) {
1925
+ throw new Error('Invalid option: ' + name);
1926
+ }
1927
+ if (!option.modifiable && !allowUnmodifiable) {
1928
+ throw new Error('Option cannot be modified: ' + name);
1929
+ }
1930
+
1931
+ return OptionManager._set(option, value, target);
1932
+ },
1933
+
1934
+ _setAll: function(options, target, allowUnmodifiable) {
1935
+ if (!options) {
1936
+ return false;
1937
+ }
1938
+
1939
+ var name;
1940
+ var changed = false;
1941
+
1942
+ for (name in options) {
1943
+ if (Utilities_1.hasOwn(options, name) && this._set(name, options[name], target, allowUnmodifiable)) {
1944
+ changed = true;
1945
+ }
1946
+ }
1947
+
1948
+ return changed;
1949
+ }
1950
+
1951
+ }, {
1952
+
1953
+ _createAccessor: function(option, target, changeHandler) {
1954
+ var descriptor = {
1955
+ get: function() {
1956
+ return OptionManager._get(option, target);
1957
+ }
1958
+ };
1959
+
1960
+ if (option.modifiable) {
1961
+ descriptor.set = function(value) {
1962
+ if (OptionManager._set(option, value, target)) {
1963
+ changeHandler(value, option);
1964
+ }
1965
+ };
1966
+ }
1967
+
1968
+ Object.defineProperty(target, option.name, descriptor);
1969
+ },
1970
+
1971
+ _get: function(option, target) {
1972
+ return target['_' + option.name];
1973
+ },
1974
+
1975
+ _set: function(option, value, target) {
1976
+ var fieldName = '_' + option.name;
1977
+ var oldValue = target[fieldName];
1978
+ var newValue = option.transform(value != null ? value : option.defaultValue);
1979
+
1980
+ target[fieldName] = newValue;
1981
+
1982
+ return newValue !== oldValue;
1983
+ }
1984
+
1985
+ });
1986
+
1987
+ var OptionManager_1 = OptionManager;
1988
+
1989
+ /**
1990
+ * Called whenever the value of a modifiable {@link Option} is changed on a target object via the defined property's
1991
+ * setter.
1992
+ *
1993
+ * @callback OptionManager~ChangeHandler
1994
+ * @param {*} value - the new value for <code>option</code> on the target object
1995
+ * @param {Option} option - the modifable {@link Option} whose value has changed on the target object.
1996
+ * @return {void}
1997
+ */
1998
+
1999
+ /**
2000
+ * A basic manager for {@link Service} implementations that are mapped to simple names.
2001
+ *
2002
+ * @public
2003
+ * @class
2004
+ * @extends Nevis
2005
+ */
2006
+ var ServiceManager = lite.extend(function() {
2007
+ this._services = {};
2008
+ }, {
2009
+
2010
+ /**
2011
+ * Returns the {@link Service} being managed with the specified <code>name</code>.
2012
+ *
2013
+ * @param {string} name - the name of the {@link Service} to be returned
2014
+ * @return {Service} The {@link Service} is being managed with <code>name</code>.
2015
+ * @throws {Error} If no {@link Service} is being managed with <code>name</code>.
2016
+ * @public
2017
+ * @memberof ServiceManager#
2018
+ */
2019
+ getService: function(name) {
2020
+ var service = this._services[name];
2021
+ if (!service) {
2022
+ throw new Error('Service is not being managed with name: ' + name);
2023
+ }
2024
+
2025
+ return service;
2026
+ },
2027
+
2028
+ /**
2029
+ * Sets the {@link Service} implementation to be managed for the specified <code>name</code> to the
2030
+ * <code>service</code> provided.
2031
+ *
2032
+ * @param {string} name - the name of the {@link Service} to be managed with <code>name</code>
2033
+ * @param {Service} service - the {@link Service} implementation to be managed
2034
+ * @return {void}
2035
+ * @throws {Error} If a {@link Service} is already being managed with the same <code>name</code>.
2036
+ * @public
2037
+ * @memberof ServiceManager#
2038
+ */
2039
+ setService: function(name, service) {
2040
+ if (this._services[name]) {
2041
+ throw new Error('Service is already managed with name: ' + name);
2042
+ }
2043
+
2044
+ if (service) {
2045
+ this._services[name] = service;
2046
+ }
2047
+ }
2048
+
2049
+ });
2050
+
2051
+ var ServiceManager_1 = ServiceManager;
2052
+
2053
+ var optionManager = new OptionManager_1([
2054
+ new Option_1('background', true, 'white'),
2055
+ new Option_1('backgroundAlpha', true, 1, Utilities_1.abs),
2056
+ new Option_1('element'),
2057
+ new Option_1('foreground', true, 'black'),
2058
+ new Option_1('foregroundAlpha', true, 1, Utilities_1.abs),
2059
+ new Option_1('level', true, 'L', Utilities_1.toUpperCase),
2060
+ new Option_1('mime', true, 'image/png'),
2061
+ new Option_1('padding', true, null, Utilities_1.abs),
2062
+ new Option_1('size', true, 100, Utilities_1.abs),
2063
+ new Option_1('value', true, '')
2064
+ ]);
2065
+ var serviceManager = new ServiceManager_1();
2066
+
2067
+ /**
2068
+ * Enables configuration of a QR code generator which uses HTML5 <code>canvas</code> for rendering.
2069
+ *
2070
+ * @param {QRious~Options} [options] - the options to be used
2071
+ * @throws {Error} If any <code>options</code> are invalid.
2072
+ * @public
2073
+ * @class
2074
+ * @extends Nevis
2075
+ */
2076
+ var QRious = lite.extend(function(options) {
2077
+ optionManager.init(options, this, this.update.bind(this));
2078
+
2079
+ var element = optionManager.get('element', this);
2080
+ var elementService = serviceManager.getService('element');
2081
+ var canvas = element && elementService.isCanvas(element) ? element : elementService.createCanvas();
2082
+ var image = element && elementService.isImage(element) ? element : elementService.createImage();
2083
+
2084
+ this._canvasRenderer = new CanvasRenderer_1(this, canvas, true);
2085
+ this._imageRenderer = new ImageRenderer_1(this, image, image === element);
2086
+
2087
+ this.update();
2088
+ }, {
2089
+
2090
+ /**
2091
+ * Returns all of the options configured for this {@link QRious}.
2092
+ *
2093
+ * Any changes made to the returned object will not be reflected in the options themselves or their corresponding
2094
+ * underlying fields.
2095
+ *
2096
+ * @return {Object.<string, *>} A copy of the applied options.
2097
+ * @public
2098
+ * @memberof QRious#
2099
+ */
2100
+ get: function() {
2101
+ return optionManager.getAll(this);
2102
+ },
2103
+
2104
+ /**
2105
+ * Sets all of the specified <code>options</code> and automatically updates this {@link QRious} if any of the
2106
+ * underlying fields are changed as a result.
2107
+ *
2108
+ * This is the preferred method for updating multiple options at one time to avoid unnecessary updates between
2109
+ * changes.
2110
+ *
2111
+ * @param {QRious~Options} options - the options to be set
2112
+ * @return {void}
2113
+ * @throws {Error} If any <code>options</code> are invalid or cannot be modified.
2114
+ * @public
2115
+ * @memberof QRious#
2116
+ */
2117
+ set: function(options) {
2118
+ if (optionManager.setAll(options, this)) {
2119
+ this.update();
2120
+ }
2121
+ },
2122
+
2123
+ /**
2124
+ * Returns the image data URI for the generated QR code using the <code>mime</code> provided.
2125
+ *
2126
+ * @param {string} [mime] - the MIME type for the image
2127
+ * @return {string} The image data URI for the QR code.
2128
+ * @public
2129
+ * @memberof QRious#
2130
+ */
2131
+ toDataURL: function(mime) {
2132
+ return this.canvas.toDataURL(mime || this.mime);
2133
+ },
2134
+
2135
+ /**
2136
+ * Updates this {@link QRious} by generating a new {@link Frame} and re-rendering the QR code.
2137
+ *
2138
+ * @return {void}
2139
+ * @protected
2140
+ * @memberof QRious#
2141
+ */
2142
+ update: function() {
2143
+ var frame = new Frame_1({
2144
+ level: this.level,
2145
+ value: this.value
2146
+ });
2147
+
2148
+ this._canvasRenderer.render(frame);
2149
+ this._imageRenderer.render(frame);
2150
+ }
2151
+
2152
+ }, {
2153
+
2154
+ /**
2155
+ * Configures the <code>service</code> provided to be used by all {@link QRious} instances.
2156
+ *
2157
+ * @param {Service} service - the {@link Service} to be configured
2158
+ * @return {void}
2159
+ * @throws {Error} If a {@link Service} has already been configured with the same name.
2160
+ * @public
2161
+ * @static
2162
+ * @memberof QRious
2163
+ */
2164
+ use: function(service) {
2165
+ serviceManager.setService(service.getName(), service);
2166
+ }
2167
+
2168
+ });
2169
+
2170
+ Object.defineProperties(QRious.prototype, {
2171
+
2172
+ canvas: {
2173
+ /**
2174
+ * Returns the <code>canvas</code> element being used to render the QR code for this {@link QRious}.
2175
+ *
2176
+ * @return {*} The <code>canvas</code> element.
2177
+ * @public
2178
+ * @memberof QRious#
2179
+ * @alias canvas
2180
+ */
2181
+ get: function() {
2182
+ return this._canvasRenderer.getElement();
2183
+ }
2184
+ },
2185
+
2186
+ image: {
2187
+ /**
2188
+ * Returns the <code>img</code> element being used to render the QR code for this {@link QRious}.
2189
+ *
2190
+ * @return {*} The <code>img</code> element.
2191
+ * @public
2192
+ * @memberof QRious#
2193
+ * @alias image
2194
+ */
2195
+ get: function() {
2196
+ return this._imageRenderer.getElement();
2197
+ }
2198
+ }
2199
+
2200
+ });
2201
+
2202
+ var QRious_1$2 = QRious;
2203
+
2204
+ /**
2205
+ * The options used by {@link QRious}.
2206
+ *
2207
+ * @typedef {Object} QRious~Options
2208
+ * @property {string} [background="white"] - The background color to be applied to the QR code.
2209
+ * @property {number} [backgroundAlpha=1] - The background alpha to be applied to the QR code.
2210
+ * @property {*} [element] - The element to be used to render the QR code which may either be an <code>canvas</code> or
2211
+ * <code>img</code>. The element(s) will be created if needed.
2212
+ * @property {string} [foreground="black"] - The foreground color to be applied to the QR code.
2213
+ * @property {number} [foregroundAlpha=1] - The foreground alpha to be applied to the QR code.
2214
+ * @property {string} [level="L"] - The error correction level to be applied to the QR code.
2215
+ * @property {string} [mime="image/png"] - The MIME type to be used to render the image for the QR code.
2216
+ * @property {number} [padding] - The padding for the QR code in pixels.
2217
+ * @property {number} [size=100] - The size of the QR code in pixels.
2218
+ * @property {string} [value=""] - The value to be encoded within the QR code.
2219
+ */
2220
+
2221
+ var index = QRious_1$2;
2222
+
2223
+ /**
2224
+ * Defines a service contract that must be met by all implementations.
2225
+ *
2226
+ * @public
2227
+ * @class
2228
+ * @extends Nevis
2229
+ */
2230
+ var Service = lite.extend({
2231
+
2232
+ /**
2233
+ * Returns the name of this {@link Service}.
2234
+ *
2235
+ * @return {string} The service name.
2236
+ * @public
2237
+ * @abstract
2238
+ * @memberof Service#
2239
+ */
2240
+ getName: function() {}
2241
+
2242
+ });
2243
+
2244
+ var Service_1 = Service;
2245
+
2246
+ /**
2247
+ * A service for working with elements.
2248
+ *
2249
+ * @public
2250
+ * @class
2251
+ * @extends Service
2252
+ */
2253
+ var ElementService = Service_1.extend({
2254
+
2255
+ /**
2256
+ * Creates an instance of a canvas element.
2257
+ *
2258
+ * Implementations of {@link ElementService} <b>must</b> override this method with their own specific logic.
2259
+ *
2260
+ * @return {*} The newly created canvas element.
2261
+ * @public
2262
+ * @abstract
2263
+ * @memberof ElementService#
2264
+ */
2265
+ createCanvas: function() {},
2266
+
2267
+ /**
2268
+ * Creates an instance of a image element.
2269
+ *
2270
+ * Implementations of {@link ElementService} <b>must</b> override this method with their own specific logic.
2271
+ *
2272
+ * @return {*} The newly created image element.
2273
+ * @public
2274
+ * @abstract
2275
+ * @memberof ElementService#
2276
+ */
2277
+ createImage: function() {},
2278
+
2279
+ /**
2280
+ * @override
2281
+ */
2282
+ getName: function() {
2283
+ return 'element';
2284
+ },
2285
+
2286
+ /**
2287
+ * Returns whether the specified <code>element</code> is a canvas.
2288
+ *
2289
+ * Implementations of {@link ElementService} <b>must</b> override this method with their own specific logic.
2290
+ *
2291
+ * @param {*} element - the element to be checked
2292
+ * @return {boolean} <code>true</code> if <code>element</code> is a canvas; otherwise <code>false</code>.
2293
+ * @public
2294
+ * @abstract
2295
+ * @memberof ElementService#
2296
+ */
2297
+ isCanvas: function(element) {},
2298
+
2299
+ /**
2300
+ * Returns whether the specified <code>element</code> is an image.
2301
+ *
2302
+ * Implementations of {@link ElementService} <b>must</b> override this method with their own specific logic.
2303
+ *
2304
+ * @param {*} element - the element to be checked
2305
+ * @return {boolean} <code>true</code> if <code>element</code> is an image; otherwise <code>false</code>.
2306
+ * @public
2307
+ * @abstract
2308
+ * @memberof ElementService#
2309
+ */
2310
+ isImage: function(element) {}
2311
+
2312
+ });
2313
+
2314
+ var ElementService_1 = ElementService;
2315
+
2316
+ /**
2317
+ * An implementation of {@link ElementService} intended for use within a browser environment.
2318
+ *
2319
+ * @public
2320
+ * @class
2321
+ * @extends ElementService
2322
+ */
2323
+ var BrowserElementService = ElementService_1.extend({
2324
+
2325
+ /**
2326
+ * @override
2327
+ */
2328
+ createCanvas: function() {
2329
+ return document.createElement('canvas');
2330
+ },
2331
+
2332
+ /**
2333
+ * @override
2334
+ */
2335
+ createImage: function() {
2336
+ return document.createElement('img');
2337
+ },
2338
+
2339
+ /**
2340
+ * @override
2341
+ */
2342
+ isCanvas: function(element) {
2343
+ return element instanceof HTMLCanvasElement;
2344
+ },
2345
+
2346
+ /**
2347
+ * @override
2348
+ */
2349
+ isImage: function(element) {
2350
+ return element instanceof HTMLImageElement;
2351
+ }
2352
+
2353
+ });
2354
+
2355
+ var BrowserElementService_1 = BrowserElementService;
2356
+
2357
+ index.use(new BrowserElementService_1());
2358
+
2359
+ var QRious_1 = index;
2360
+
2361
+ return QRious_1;
2362
+
2363
+ })));
2364
+
2365
+
2366
+ } (qrious));
2367
+
2368
+ var qriousExports = qrious.exports;
2369
+ var QRious = /*@__PURE__*/getDefaultExportFromCjs(qriousExports);
2370
+
2371
+ export { QRious as default };
2372
+ //# sourceMappingURL=qrious.js.map