@oracle/oraclejet 11.1.2 → 11.1.3

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 (683) hide show
  1. package/README.md +1 -1
  2. package/THIRDPARTYLICENSE.txt +7 -7
  3. package/dist/css/alta/oj-alta-min.css +1 -1
  4. package/dist/css/alta/oj-alta-notag-min.css +1 -1
  5. package/dist/css/alta/oj-alta-notag.css +69 -22
  6. package/dist/css/alta/oj-alta.css +69 -22
  7. package/dist/css/alta-android/oj-alta-min.css +1 -1
  8. package/dist/css/alta-android/oj-alta.css +69 -22
  9. package/dist/css/alta-ios/oj-alta-min.css +1 -1
  10. package/dist/css/alta-ios/oj-alta.css +69 -22
  11. package/dist/css/alta-windows/oj-alta-min.css +1 -1
  12. package/dist/css/alta-windows/oj-alta.css +69 -22
  13. package/dist/css/redwood/oj-redwood-min.css +1 -1
  14. package/dist/css/redwood/oj-redwood-notag-min.css +1 -1
  15. package/dist/css/redwood/oj-redwood-notag-novars-min.css +1 -1
  16. package/dist/css/redwood/oj-redwood-notag-novars.css +9 -2
  17. package/dist/css/redwood/oj-redwood-notag.css +9 -2
  18. package/dist/css/redwood/oj-redwood-novars-min.css +1 -1
  19. package/dist/css/redwood/oj-redwood-novars.css +9 -2
  20. package/dist/css/redwood/oj-redwood.css +9 -2
  21. package/dist/css/stable/oj-stable-min.css +1 -1
  22. package/dist/css/stable/oj-stable.css +112 -1
  23. package/dist/js/libs/oj/debug/ojcachediteratorresultsdataprovider.js +83 -41
  24. package/dist/js/libs/oj/debug/ojcore-base.js +2 -2
  25. package/dist/js/libs/oj/debug/ojdatacollection-common.js +43 -1
  26. package/dist/js/libs/oj/debug/ojdataproviderscroller.js +2 -2
  27. package/dist/js/libs/oj/debug/ojdrawerlayout.js +1 -0
  28. package/dist/js/libs/oj/debug/ojdrawerpopup.js +1 -6
  29. package/dist/js/libs/oj/debug/ojlistdataproviderview.js +28 -9
  30. package/dist/js/libs/oj/debug/ojlistview.js +20 -8
  31. package/dist/js/libs/oj/debug/ojtable.js +5 -5
  32. package/dist/js/libs/oj/debug/ojtreeview.js +12 -0
  33. package/dist/js/libs/oj/debug_esm/ojcachediteratorresultsdataprovider.js +83 -41
  34. package/dist/js/libs/oj/debug_esm/ojcore-base.js +2 -2
  35. package/dist/js/libs/oj/debug_esm/ojdatacollection-common.js +43 -2
  36. package/dist/js/libs/oj/debug_esm/ojdataproviderscroller.js +3 -3
  37. package/dist/js/libs/oj/debug_esm/ojdrawerlayout.js +1 -0
  38. package/dist/js/libs/oj/debug_esm/ojdrawerpopup.js +1 -6
  39. package/dist/js/libs/oj/debug_esm/ojlistdataproviderview.js +28 -9
  40. package/dist/js/libs/oj/debug_esm/ojlistview.js +21 -9
  41. package/dist/js/libs/oj/debug_esm/ojtable.js +6 -6
  42. package/dist/js/libs/oj/debug_esm/ojtreeview.js +12 -0
  43. package/dist/js/libs/oj/main-template.js +3 -3
  44. package/dist/js/libs/oj/min/ojcachediteratorresultsdataprovider.js +2 -2
  45. package/dist/js/libs/oj/min/ojcachediteratorresultsdataprovider.js.map +1 -1
  46. package/dist/js/libs/oj/min/ojcore-base.js +1 -1
  47. package/dist/js/libs/oj/min/ojdatacollection-common.js +1 -1
  48. package/dist/js/libs/oj/min/ojdatacollection-common.js.map +1 -1
  49. package/dist/js/libs/oj/min/ojdataproviderscroller.js +1 -1
  50. package/dist/js/libs/oj/min/ojdataproviderscroller.js.map +1 -1
  51. package/dist/js/libs/oj/min/ojdrawerlayout.js +1 -1
  52. package/dist/js/libs/oj/min/ojdrawerlayout.js.map +1 -1
  53. package/dist/js/libs/oj/min/ojdrawerpopup.js +1 -1
  54. package/dist/js/libs/oj/min/ojdrawerpopup.js.map +1 -1
  55. package/dist/js/libs/oj/min/ojlistdataproviderview.js +1 -1
  56. package/dist/js/libs/oj/min/ojlistdataproviderview.js.map +1 -1
  57. package/dist/js/libs/oj/min/ojlistview.js +1 -1
  58. package/dist/js/libs/oj/min/ojlistview.js.map +1 -1
  59. package/dist/js/libs/oj/min/ojtable.js +1 -1
  60. package/dist/js/libs/oj/min/ojtable.js.map +1 -1
  61. package/dist/js/libs/oj/min/ojtreeview.js +1 -1
  62. package/dist/js/libs/oj/min/ojtreeview.js.map +1 -1
  63. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-arraystore-1.5.6.js → offline-persistence-toolkit-arraystore-1.5.7.js} +0 -0
  64. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-core-1.5.6.js → offline-persistence-toolkit-core-1.5.7.js} +1359 -1350
  65. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-filesystemstore-1.5.6.js → offline-persistence-toolkit-filesystemstore-1.5.7.js} +1345 -1345
  66. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-localstore-1.5.6.js → offline-persistence-toolkit-localstore-1.5.7.js} +0 -0
  67. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-pouchdbstore-1.5.6.js → offline-persistence-toolkit-pouchdbstore-1.5.7.js} +1345 -1345
  68. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-responseproxy-1.5.6.js → offline-persistence-toolkit-responseproxy-1.5.7.js} +1345 -1345
  69. package/dist/js/libs/persist/debug/persistenceManager.js +1 -1
  70. package/dist/js/libs/persist/debug/persistenceUtils.js +13 -4
  71. package/dist/js/libs/persist/debug/pouchdb-browser-7.2.2.js +1345 -1345
  72. package/dist/js/libs/persist/min/{offline-persistence-toolkit-arraystore-1.5.6.js → offline-persistence-toolkit-arraystore-1.5.7.js} +0 -0
  73. package/dist/js/libs/persist/min/{offline-persistence-toolkit-core-1.5.6.js → offline-persistence-toolkit-core-1.5.7.js} +112 -112
  74. package/dist/js/libs/persist/min/{offline-persistence-toolkit-filesystemstore-1.5.6.js → offline-persistence-toolkit-filesystemstore-1.5.7.js} +449 -449
  75. package/dist/js/libs/persist/min/{offline-persistence-toolkit-localstore-1.5.6.js → offline-persistence-toolkit-localstore-1.5.7.js} +0 -0
  76. package/dist/js/libs/persist/min/{offline-persistence-toolkit-pouchdbstore-1.5.6.js → offline-persistence-toolkit-pouchdbstore-1.5.7.js} +111 -111
  77. package/dist/js/libs/persist/min/{offline-persistence-toolkit-responseproxy-1.5.6.js → offline-persistence-toolkit-responseproxy-1.5.7.js} +111 -111
  78. package/dist/js/libs/persist/min/persistenceUtils.js +1 -1
  79. package/dist/js/libs/persist/min/pouchdb-browser-7.2.2.js +111 -111
  80. package/dist/metadata/components/allComponents.json +233 -233
  81. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/accordion/themes/base/_oj-accordion.scss +0 -0
  82. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/accordion/themes/redwood/_oj-accordion.cssvars.scss +0 -0
  83. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/accordion/themes/redwood/oj-accordion.scss +0 -0
  84. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/accordion/themes/stable/_oj-accordion.cssvars.scss +0 -0
  85. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/accordion/themes/stable/oj-accordion.scss +0 -0
  86. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/action-card/themes/base/_oj-action-card.scss +0 -0
  87. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/action-card/themes/redwood/_oj-action-card.cssvars.scss +0 -0
  88. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/action-card/themes/redwood/oj-action-card.scss +0 -0
  89. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/action-card/themes/stable/_oj-action-card.cssvars.scss +0 -0
  90. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/action-card/themes/stable/oj-action-card.scss +0 -0
  91. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/base/_oj.common.servervars.scss +0 -0
  92. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/base/oj.common.settings.cssvariables.css +0 -0
  93. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/redwood/_oj-all-components-common.scss +0 -0
  94. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/redwood/_oj-all-components-notag.scss +0 -0
  95. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/redwood/_oj-all-components.scss +0 -0
  96. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/redwood/_oj.redwood.settings.scss +0 -0
  97. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/redwood/oj.redwood.cssvars.settings.css +0 -0
  98. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/stable/_oj-all-components-common.scss +2 -0
  99. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/stable/_oj-all-components-notag.scss +0 -0
  100. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/stable/_oj-all-components.scss +0 -0
  101. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/stable/_oj.stable.settings.scss +0 -0
  102. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/all-components/themes/stable/oj.stable.cssvars.settings.css +0 -0
  103. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/animation/themes/base/_oj-animation.scss +0 -0
  104. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/animation/themes/redwood/_oj-animation.cssvars.scss +0 -0
  105. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/animation/themes/redwood/_oj-animation.servervars.scss +0 -0
  106. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/animation/themes/redwood/oj-animation.scss +0 -0
  107. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/animation/themes/stable/_oj-animation.cssvars.scss +0 -0
  108. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/animation/themes/stable/_oj-animation.servervars.scss +0 -0
  109. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/animation/themes/stable/oj-animation.scss +0 -0
  110. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout/themes/base/_oj-app-layout.scss +0 -0
  111. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout/themes/redwood/_oj-app-layout.cssvars.scss +0 -0
  112. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout/themes/redwood/_oj-app-layout.scss +0 -0
  113. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout/themes/stable/_oj-app-layout.cssvars.scss +0 -0
  114. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout/themes/stable/_oj-app-layout.scss +0 -0
  115. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-hybrid/themes/base/_oj-app-layout-hybrid.scss +0 -0
  116. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-hybrid/themes/redwood/_oj-app-layout-hybrid.cssvars.scss +0 -0
  117. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-hybrid/themes/redwood/oj-app-layout-hybrid.scss +0 -0
  118. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-hybrid/themes/stable/_oj-app-layout-hybrid.cssvars.scss +0 -0
  119. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-hybrid/themes/stable/oj-app-layout-hybrid.scss +0 -0
  120. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-web/themes/base/_oj-app-layout-web.scss +0 -0
  121. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-web/themes/redwood/_oj-app-layout-web.cssvars.scss +0 -0
  122. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-web/themes/redwood/oj-app-layout-web.scss +0 -0
  123. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-web/themes/stable/_oj-app-layout-web.cssvars.scss +0 -0
  124. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/app-layout-web/themes/stable/oj-app-layout-web.scss +0 -0
  125. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/avatar/themes/base/_oj-avatar.scss +0 -0
  126. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/avatar/themes/redwood/_oj-avatar-scoped.cssvars.scss +0 -0
  127. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/avatar/themes/redwood/_oj-avatar.cssvars.scss +0 -0
  128. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/avatar/themes/redwood/oj-avatar.scss +0 -0
  129. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/avatar/themes/stable/_oj-avatar-scoped.cssvars.scss +0 -0
  130. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/avatar/themes/stable/_oj-avatar.cssvars.scss +0 -0
  131. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/avatar/themes/stable/oj-avatar.scss +0 -0
  132. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/badge/themes/base/_oj-badge.scss +0 -0
  133. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/badge/themes/redwood/_oj-badge-scoped.cssvars.scss +0 -0
  134. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/badge/themes/redwood/_oj-badge.cssvars.scss +0 -0
  135. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/badge/themes/redwood/oj-badge.scss +0 -0
  136. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/badge/themes/stable/_oj-badge-scoped.cssvars.scss +0 -0
  137. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/badge/themes/stable/_oj-badge.cssvars.scss +0 -0
  138. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/badge/themes/stable/oj-badge.scss +0 -0
  139. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/base/_oj-button.scss +0 -0
  140. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/redwood/_oj-button-ignore.scoped.cssvars.scss +0 -0
  141. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/redwood/_oj-button-scoped.cssvars.scss +0 -0
  142. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/redwood/_oj-button.cssvars.scss +0 -0
  143. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/redwood/oj-button.scss +0 -0
  144. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/stable/_oj-button-ignore.scoped.cssvars.scss +0 -0
  145. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/stable/_oj-button.cssvars.scss +0 -0
  146. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/button/themes/stable/oj-button.scss +0 -0
  147. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset/themes/base/_oj-buttonset.scss +0 -0
  148. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset/themes/redwood/_oj-buttonset-scoped.cssvars.scss +0 -0
  149. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset/themes/redwood/_oj-buttonset.cssvars.scss +0 -0
  150. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset/themes/redwood/_oj-buttonset.scss +0 -0
  151. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset/themes/stable/_oj-buttonset-scoped.cssvars.scss +0 -0
  152. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset/themes/stable/_oj-buttonset.cssvars.scss +0 -0
  153. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset/themes/stable/_oj-buttonset.scss +0 -0
  154. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset-many/themes/redwood/oj-buttonset-many.scss +0 -0
  155. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset-many/themes/stable/oj-buttonset-many.scss +0 -0
  156. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset-one/themes/redwood/oj-buttonset-one.scss +0 -0
  157. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/buttonset-one/themes/stable/oj-buttonset-one.scss +0 -0
  158. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/chart/themes/base/_oj-chart.scss +0 -0
  159. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/chart/themes/redwood/_oj-chart.cssvars.scss +0 -0
  160. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/chart/themes/redwood/oj-chart.scss +0 -0
  161. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/chart/themes/stable/_oj-chart.cssvars.scss +0 -0
  162. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/chart/themes/stable/oj-chart.scss +0 -0
  163. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/checkboxset/themes/redwood/_oj-checkboxset.cssvars.scss +0 -0
  164. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/checkboxset/themes/redwood/oj-checkboxset.scss +0 -0
  165. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/checkboxset/themes/stable/_oj-checkboxset.cssvars.scss +0 -0
  166. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/checkboxset/themes/stable/oj-checkboxset.scss +0 -0
  167. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/collapsible/themes/base/_oj-collapsible.scss +0 -0
  168. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/collapsible/themes/redwood/_oj-collapsible.cssvars.scss +0 -0
  169. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/collapsible/themes/redwood/oj-collapsible.scss +0 -0
  170. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/collapsible/themes/stable/_oj-collapsible.cssvars.scss +0 -0
  171. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/collapsible/themes/stable/oj-collapsible.scss +0 -0
  172. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/collection/themes/redwood/_oj-collection.cssvars.scss +0 -0
  173. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/collection/themes/stable/_oj-collection.cssvars.scss +0 -0
  174. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-palette/themes/base/_oj-color-palette.scss +0 -0
  175. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-palette/themes/redwood/_oj-color-palette.cssvars.scss +0 -0
  176. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-palette/themes/redwood/oj-color-palette.scss +0 -0
  177. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-palette/themes/stable/_oj-color-palette.cssvars.scss +0 -0
  178. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-palette/themes/stable/oj-color-palette.scss +0 -0
  179. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-spectrum/themes/base/_oj-color-spectrum.scss +0 -0
  180. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-spectrum/themes/redwood/_oj-color-spectrum.cssvars.scss +0 -0
  181. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-spectrum/themes/redwood/oj-color-spectrum.scss +0 -0
  182. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-spectrum/themes/stable/_oj-color-spectrum.cssvars.scss +0 -0
  183. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/color-spectrum/themes/stable/oj-color-spectrum.scss +0 -0
  184. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox/themes/base/_oj-combobox.scss +0 -0
  185. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox/themes/redwood/_oj-combobox.cssvars.scss +0 -0
  186. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox/themes/redwood/_oj-combobox.scss +0 -0
  187. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox/themes/stable/_oj-combobox.cssvars.scss +0 -0
  188. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox/themes/stable/_oj-combobox.scss +0 -0
  189. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox-many/themes/redwood/oj-combobox-many.scss +0 -0
  190. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox-many/themes/stable/oj-combobox-many.scss +0 -0
  191. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox-one/themes/redwood/oj-combobox-one.scss +0 -0
  192. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/combobox-one/themes/stable/oj-combobox-one.scss +0 -0
  193. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/conveyor-belt/themes/base/_oj-conveyor-belt.scss +0 -0
  194. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/conveyor-belt/themes/redwood/_oj-conveyor-belt.cssvars.scss +0 -0
  195. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/conveyor-belt/themes/redwood/oj-conveyor-belt.scss +0 -0
  196. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/conveyor-belt/themes/stable/_oj-conveyor-belt.cssvars.scss +0 -0
  197. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/conveyor-belt/themes/stable/oj-conveyor-belt.scss +0 -0
  198. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/core/themes/redwood/_oj-core-ignore.scoped.cssvars.scss +0 -0
  199. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/core/themes/redwood/_oj-core-scoped.cssvars.scss +0 -0
  200. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/core/themes/redwood/_oj-core.cssvars.scss +0 -0
  201. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/core/themes/stable/_oj-core.cssvars.scss +0 -0
  202. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/data-grid/themes/base/_oj-data-grid.scss +0 -0
  203. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/data-grid/themes/redwood/_oj-data-grid.cssvars.scss +0 -0
  204. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/data-grid/themes/redwood/oj-data-grid.scss +0 -0
  205. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/data-grid/themes/stable/_oj-data-grid.cssvars.scss +0 -0
  206. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/data-grid/themes/stable/oj-data-grid.scss +0 -0
  207. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-picker/themes/redwood/oj-date-picker.scss +0 -0
  208. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-picker/themes/stable/oj-date-picker.scss +0 -0
  209. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-time-picker/themes/base/_oj-date-time-picker.scss +0 -0
  210. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.cssvars.scss +0 -0
  211. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.servervars.scss +0 -0
  212. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-time-picker/themes/redwood/oj-date-time-picker.scss +0 -0
  213. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-time-picker/themes/stable/_oj-date-time-picker.cssvars.scss +0 -0
  214. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-time-picker/themes/stable/_oj-date-time-picker.servervars.scss +0 -0
  215. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/date-time-picker/themes/stable/oj-date-time-picker.scss +0 -0
  216. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/diagram/themes/base/_oj-diagram.scss +0 -0
  217. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/diagram/themes/redwood/_oj-diagram.cssvars.scss +0 -0
  218. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/diagram/themes/redwood/oj-diagram.scss +0 -0
  219. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/diagram/themes/stable/_oj-diagram.cssvars.scss +0 -0
  220. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/diagram/themes/stable/oj-diagram.scss +0 -0
  221. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/base/_oj-dialog.scss +0 -0
  222. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/redwood/_oj-dialog-scoped.cssvars.scss +0 -0
  223. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/redwood/_oj-dialog.cssvars.scss +0 -0
  224. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/redwood/_oj-dialog.servervars.scss +0 -0
  225. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/redwood/oj-dialog.scss +0 -0
  226. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/stable/_oj-dialog-scoped.cssvars.scss +0 -0
  227. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/stable/_oj-dialog.cssvars.scss +0 -0
  228. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/stable/_oj-dialog.servervars.scss +0 -0
  229. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dialog/themes/stable/oj-dialog.scss +0 -0
  230. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-layout/themes/base/_oj-drawer-layout.scss +0 -0
  231. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-layout/themes/redwood/_oj-drawer-layout.cssvars.scss +0 -0
  232. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-layout/themes/redwood/oj-drawer-layout.scss +0 -0
  233. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-layout/themes/stable/_oj-drawer-layout.cssvars.scss +0 -0
  234. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-layout/themes/stable/oj-drawer-layout.scss +0 -0
  235. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-popup/themes/base/_oj-drawer-popup.scss +10 -1
  236. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-popup/themes/redwood/_oj-drawer-popup.cssvars.scss +0 -0
  237. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-popup/themes/redwood/oj-drawer-popup.scss +0 -0
  238. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-popup/themes/stable/_oj-drawer-popup.cssvars.scss +0 -0
  239. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/drawer-popup/themes/stable/oj-drawer-popup.scss +0 -0
  240. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dvt/themes/base/_oj-dvt.scss +0 -0
  241. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dvt/themes/redwood/_oj-dvt.cssvars.scss +0 -0
  242. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dvt/themes/redwood/_oj-dvt.scss +0 -0
  243. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dvt/themes/stable/_oj-dvt.cssvars.scss +0 -0
  244. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/dvt/themes/stable/_oj-dvt.scss +0 -0
  245. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/file-picker/themes/base/_oj-file-picker.scss +0 -0
  246. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/file-picker/themes/redwood/_oj-file-picker.cssvars.scss +0 -0
  247. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/file-picker/themes/redwood/oj-file-picker.scss +0 -0
  248. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/file-picker/themes/stable/_oj-file-picker.cssvars.scss +0 -0
  249. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/file-picker/themes/stable/oj-file-picker.scss +0 -0
  250. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/film-strip/themes/base/_oj-film-strip.scss +0 -0
  251. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/film-strip/themes/redwood/_oj-film-strip.cssvars.scss +0 -0
  252. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/film-strip/themes/redwood/oj-film-strip.scss +0 -0
  253. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/film-strip/themes/stable/_oj-film-strip.cssvars.scss +0 -0
  254. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/film-strip/themes/stable/oj-film-strip.scss +0 -0
  255. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/flex/themes/base/_oj-flex.scss +0 -0
  256. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/flex/themes/redwood/oj-flex.scss +0 -0
  257. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/flex/themes/stable/oj-flex.scss +0 -0
  258. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/base/_oj-form-control.mixins.scss +0 -0
  259. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/base/_oj-form-control.scss +0 -0
  260. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/base/_oj-messaging.scss +0 -0
  261. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/redwood/_oj-form-control.cssvars.scss +0 -0
  262. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/redwood/_oj-form-control.scss +0 -0
  263. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/redwood/_oj-messaging.scss +0 -0
  264. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/redwood/_oj-messaging.servervars.scss +0 -0
  265. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/stable/_oj-form-control.cssvars.scss +0 -0
  266. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/stable/_oj-form-control.scss +0 -0
  267. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/stable/_oj-messaging.scss +0 -0
  268. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-control/themes/stable/_oj-messaging.servervars.scss +0 -0
  269. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-layout/themes/base/_oj-form-layout.scss +0 -0
  270. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-layout/themes/redwood/_oj-form-layout.cssvars.scss +0 -0
  271. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-layout/themes/redwood/_oj-form-layout.servervars.scss +0 -0
  272. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-layout/themes/redwood/oj-form-layout.scss +0 -0
  273. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-layout/themes/stable/_oj-form-layout.cssvars.scss +0 -0
  274. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-layout/themes/stable/_oj-form-layout.servervars.scss +0 -0
  275. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/form-layout/themes/stable/oj-form-layout.scss +0 -0
  276. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gantt/themes/base/_oj-gantt.scss +0 -0
  277. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gantt/themes/redwood/_oj-gantt.cssvars.scss +0 -0
  278. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gantt/themes/redwood/oj-gantt.scss +0 -0
  279. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gantt/themes/stable/_oj-gantt.cssvars.scss +0 -0
  280. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gantt/themes/stable/oj-gantt.scss +0 -0
  281. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gauge/themes/base/_oj-gauge.scss +0 -0
  282. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gauge/themes/redwood/_oj-gauge.cssvars.scss +0 -0
  283. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gauge/themes/redwood/oj-gauge.scss +0 -0
  284. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gauge/themes/stable/_oj-gauge.cssvars.scss +0 -0
  285. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/gauge/themes/stable/oj-gauge.scss +0 -0
  286. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/grid/themes/base/_oj-grid.scss +0 -0
  287. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/grid/themes/redwood/oj-grid.scss +0 -0
  288. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/grid/themes/stable/oj-grid.scss +0 -0
  289. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/base/_oj-helpers.scss +1 -1
  290. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/base/_oj-responsive-helpers.scss +0 -0
  291. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/redwood/_oj-theme.servervars.scss +0 -0
  292. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/redwood/oj-helpers.scss +0 -0
  293. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/redwood/oj-responsive.helpers.scss +0 -0
  294. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/stable/_oj-theme.servervars.scss +0 -0
  295. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/stable/oj-helpers.scss +0 -0
  296. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/helpers/themes/stable/oj-responsive.helpers.scss +0 -0
  297. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/highlight-text/themes/base/_oj-highlight-text.scss +0 -0
  298. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/highlight-text/themes/redwood/oj-highlight-text.scss +0 -0
  299. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/highlight-text/themes/stable/oj-highlight-text.scss +0 -0
  300. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icon-circle/themes/base/_oj-icon-circle.scss +0 -0
  301. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icon-circle/themes/redwood/_oj-icon-circle-ignore.scoped.cssvars.scss +0 -0
  302. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icon-circle/themes/redwood/_oj-icon-circle.cssvars.scss +0 -0
  303. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icon-circle/themes/redwood/oj-icon-circle.scss +0 -0
  304. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/base/_oj-icons.scss +0 -0
  305. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/redwood/_oj-icon-font.scss +0 -0
  306. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/redwood/_oj-icons-ignore.scoped.cssvars.scss +0 -0
  307. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/redwood/_oj-icons.cssvars.scss +0 -0
  308. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/redwood/oj-icons.scss +0 -0
  309. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/stable/_oj-icon-font.scss +0 -0
  310. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/stable/_oj-icons.cssvars.scss +0 -0
  311. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/icons/themes/stable/oj-icons.scss +0 -0
  312. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/indexer/themes/base/_oj-indexer.scss +0 -0
  313. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/indexer/themes/redwood/_oj-indexer.cssvars.scss +0 -0
  314. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/indexer/themes/redwood/oj-indexer.scss +0 -0
  315. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/indexer/themes/stable/_oj-indexer.cssvars.scss +0 -0
  316. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/indexer/themes/stable/oj-indexer.scss +0 -0
  317. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-date/themes/redwood/oj-input-date.scss +0 -0
  318. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-date/themes/stable/oj-input-date.scss +0 -0
  319. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-date-time/themes/redwood/oj-input-date-time.scss +0 -0
  320. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-date-time/themes/stable/oj-input-date-time.scss +0 -0
  321. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-number/themes/base/_oj-input-number.scss +0 -0
  322. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-number/themes/redwood/_oj-input-number.cssvars.scss +0 -0
  323. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-number/themes/redwood/oj-input-number.scss +0 -0
  324. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-number/themes/stable/_oj-input-number.cssvars.scss +0 -0
  325. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-number/themes/stable/oj-input-number.scss +0 -0
  326. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-password/themes/redwood/oj-input-password.scss +0 -0
  327. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-password/themes/stable/oj-input-password.scss +0 -0
  328. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-search/themes/base/_oj-input-search.scss +0 -0
  329. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-search/themes/redwood/_oj-input-search-scoped.cssvars.scss +0 -0
  330. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-search/themes/redwood/_oj-input-search.cssvars.scss +0 -0
  331. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-search/themes/redwood/_oj-input-search.scss +0 -0
  332. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-search/themes/stable/_oj-input-search-scoped.cssvars.scss +0 -0
  333. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-search/themes/stable/_oj-input-search.cssvars.scss +0 -0
  334. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-search/themes/stable/_oj-input-search.scss +0 -0
  335. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-text/themes/base/_oj-input-text.scss +0 -0
  336. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-text/themes/redwood/_oj-input-text.cssvars.scss +0 -0
  337. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-text/themes/redwood/oj-input-text.scss +0 -0
  338. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-text/themes/stable/_oj-input-text.cssvars.scss +0 -0
  339. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-text/themes/stable/oj-input-text.scss +0 -0
  340. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-time/themes/redwood/oj-input-time.scss +0 -0
  341. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/input-time/themes/stable/oj-input-time.scss +0 -0
  342. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label/themes/base/_oj-label.scss +0 -0
  343. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label/themes/redwood/_oj-label-scoped.cssvars.scss +0 -0
  344. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label/themes/redwood/_oj-label.cssvars.scss +0 -0
  345. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label/themes/redwood/oj-label.scss +0 -0
  346. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label/themes/stable/_oj-label.cssvars.scss +0 -0
  347. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label/themes/stable/oj-label.scss +0 -0
  348. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label-value/themes/base/_oj-label-value.scss +0 -0
  349. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label-value/themes/redwood/_oj-label-value.scss +0 -0
  350. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/label-value/themes/stable/_oj-label-value.scss +0 -0
  351. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/led-gauge/themes/base/_oj-led-gauge.scss +0 -0
  352. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/led-gauge/themes/redwood/_oj-led-gauge.cssvars.scss +0 -0
  353. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/led-gauge/themes/redwood/oj-led-gauge.scss +0 -0
  354. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/led-gauge/themes/stable/_oj-led-gauge.cssvars.scss +0 -0
  355. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/led-gauge/themes/stable/oj-led-gauge.scss +0 -0
  356. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/legend/themes/base/_oj-legend.scss +0 -0
  357. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/legend/themes/redwood/_oj-legend.cssvars.scss +0 -0
  358. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/legend/themes/redwood/oj-legend.scss +0 -0
  359. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/legend/themes/stable/_oj-legend.cssvars.scss +0 -0
  360. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/legend/themes/stable/oj-legend.scss +0 -0
  361. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-box/themes/base/_oj-list-box.scss +0 -0
  362. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-box/themes/redwood/_oj-list-box.cssvars.scss +0 -0
  363. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-box/themes/redwood/_oj-list-box.scss +0 -0
  364. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-box/themes/stable/_oj-list-box.cssvars.scss +0 -0
  365. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-box/themes/stable/_oj-list-box.scss +0 -0
  366. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-item-layout/themes/base/_oj-list-item-layout.scss +0 -0
  367. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-item-layout/themes/redwood/_oj-list-item-layout.cssvars.scss +0 -0
  368. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-item-layout/themes/redwood/oj-list-item-layout.scss +0 -0
  369. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-item-layout/themes/stable/_oj-list-item-layout.cssvars.scss +0 -0
  370. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-item-layout/themes/stable/oj-list-item-layout.scss +0 -0
  371. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-view/themes/base/_oj-list-view.scss +0 -0
  372. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-view/themes/redwood/_oj-list-view.cssvars.scss +0 -0
  373. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-view/themes/redwood/oj-list-view.scss +0 -0
  374. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-view/themes/stable/_oj-list-view.cssvars.scss +0 -0
  375. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/list-view/themes/stable/oj-list-view.scss +0 -0
  376. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/masonry-layout/themes/base/_oj-masonry-layout.scss +0 -0
  377. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.cssvars.scss +0 -0
  378. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.servervars.scss +0 -0
  379. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/masonry-layout/themes/redwood/oj-masonry-layout.scss +0 -0
  380. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/masonry-layout/themes/stable/_oj-masonry-layout.cssvars.scss +0 -0
  381. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/masonry-layout/themes/stable/_oj-masonry-layout.servervars.scss +0 -0
  382. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/masonry-layout/themes/stable/oj-masonry-layout.scss +0 -0
  383. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu/themes/base/_oj-menu.scss +0 -0
  384. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu/themes/redwood/_oj-menu.cssvars.scss +0 -0
  385. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu/themes/redwood/oj-menu.scss +0 -0
  386. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu/themes/stable/_oj-menu.cssvars.scss +0 -0
  387. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu/themes/stable/oj-menu.scss +0 -0
  388. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-button/themes/base/_oj-menu-button.scss +0 -0
  389. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-button/themes/redwood/_oj-menu-button.cssvars.scss +0 -0
  390. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-button/themes/redwood/_oj-menu-button.servervars.scss +0 -0
  391. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-button/themes/redwood/oj-menu-button.scss +0 -0
  392. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-button/themes/stable/_oj-menu-button.cssvars.scss +0 -0
  393. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-button/themes/stable/_oj-menu-button.servervars.scss +0 -0
  394. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-button/themes/stable/oj-menu-button.scss +0 -0
  395. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-select-many/themes/base/_oj-menu-select-many.scss +0 -0
  396. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-select-many/themes/redwood/_oj-menu-select-many.cssvars.scss +0 -0
  397. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-select-many/themes/redwood/oj-menu-select-many.scss +0 -0
  398. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-select-many/themes/stable/_oj-menu-select-many.cssvars.scss +0 -0
  399. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/menu-select-many/themes/stable/oj-menu-select-many.scss +0 -0
  400. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/base/_oj-message.scss +0 -0
  401. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/redwood/_oj-message-ignore.scoped.cssvars.scss +0 -0
  402. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/redwood/_oj-message.cssvars.scss +0 -0
  403. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/redwood/_oj-message.servervars.scss +0 -0
  404. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/redwood/oj-message.scss +0 -0
  405. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/stable/_oj-message.cssvars.scss +0 -0
  406. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/stable/_oj-message.servervars.scss +0 -0
  407. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/message/themes/stable/oj-message.scss +0 -0
  408. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/messages/themes/base/_oj-messages.scss +0 -0
  409. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/messages/themes/redwood/_oj-messages.cssvars.scss +0 -0
  410. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/messages/themes/redwood/_oj-messages.servervars.scss +0 -0
  411. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/messages/themes/redwood/oj-messages.scss +0 -0
  412. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/messages/themes/stable/_oj-messages.cssvars.scss +0 -0
  413. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/messages/themes/stable/_oj-messages.servervars.scss +0 -0
  414. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/messages/themes/stable/oj-messages.scss +0 -0
  415. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/module/themes/base/_oj-module.scss +0 -0
  416. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/module/themes/redwood/oj-module.scss +0 -0
  417. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/module/themes/stable/oj-module.scss +0 -0
  418. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/n-box/themes/base/_oj-n-box.scss +0 -0
  419. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/n-box/themes/redwood/_oj-n-box.cssvars.scss +0 -0
  420. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/n-box/themes/redwood/oj-n-box.scss +0 -0
  421. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/n-box/themes/stable/_oj-n-box.cssvars.scss +0 -0
  422. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/n-box/themes/stable/oj-n-box.scss +0 -0
  423. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/navigation-list/themes/base/_oj-navigation-list.scss +0 -0
  424. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/navigation-list/themes/redwood/_oj-navigation-list-scoped.cssvars.scss +0 -0
  425. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/navigation-list/themes/redwood/_oj-navigation-list.cssvars.scss +0 -0
  426. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/navigation-list/themes/redwood/oj-navigation-list.scss +0 -0
  427. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/navigation-list/themes/stable/_oj-navigation-list-scoped.cssvars.scss +0 -0
  428. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/navigation-list/themes/stable/_oj-navigation-list.cssvars.scss +0 -0
  429. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/navigation-list/themes/stable/oj-navigation-list.scss +0 -0
  430. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/off-canvas/themes/base/_oj-off-canvas.scss +0 -0
  431. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/off-canvas/themes/redwood/_oj-off-canvas.cssvars.scss +0 -0
  432. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/off-canvas/themes/redwood/oj-off-canvas.scss +0 -0
  433. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/off-canvas/themes/stable/_oj-off-canvas.cssvars.scss +0 -0
  434. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/off-canvas/themes/stable/oj-off-canvas.scss +0 -0
  435. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/optgroup/themes/base/_oj-optgroup.scss +0 -0
  436. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/optgroup/themes/redwood/oj-optgroup.scss +0 -0
  437. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/optgroup/themes/stable/oj-optgroup.scss +0 -0
  438. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/option/themes/base/_oj-option.scss +0 -0
  439. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/option/themes/redwood/oj-option.scss +0 -0
  440. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/option/themes/stable/oj-option.scss +0 -0
  441. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/paging-control/themes/base/_oj-paging-control.scss +0 -0
  442. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/paging-control/themes/redwood/_oj-paging-control.cssvars.scss +0 -0
  443. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/paging-control/themes/redwood/oj-paging-control.scss +0 -0
  444. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/paging-control/themes/stable/_oj-paging-control.cssvars.scss +0 -0
  445. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/paging-control/themes/stable/oj-paging-control.scss +0 -0
  446. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/palette/themes/redwood/_oj-palette-scoped.cssvars.scss +0 -0
  447. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/palette/themes/redwood/_oj-palette.cssvars.scss +0 -0
  448. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/palette/themes/stable/_oj-palette.cssvars.scss +0 -0
  449. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/panel/themes/base/_oj-panel.scss +0 -0
  450. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/panel/themes/redwood/_oj-panel-scoped.cssvars.scss +0 -0
  451. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/panel/themes/redwood/_oj-panel.cssvars.scss +0 -0
  452. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/panel/themes/redwood/oj-panel.scss +0 -0
  453. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/panel/themes/stable/_oj-panel.cssvars.scss +0 -0
  454. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/panel/themes/stable/oj-panel.scss +0 -0
  455. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/picto-chart/themes/base/_oj-picto-chart.scss +0 -0
  456. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/picto-chart/themes/redwood/_oj-picto-chart.cssvars.scss +0 -0
  457. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/picto-chart/themes/redwood/oj-picto-chart.scss +0 -0
  458. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/picto-chart/themes/stable/_oj-picto-chart.cssvars.scss +0 -0
  459. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/picto-chart/themes/stable/oj-picto-chart.scss +0 -0
  460. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/base/_oj-layer.scss +0 -0
  461. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/base/_oj-popup.scss +0 -0
  462. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/redwood/_oj-layer.scss +0 -0
  463. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/redwood/_oj-popup.cssvars.scss +0 -0
  464. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/redwood/oj-popup.scss +0 -0
  465. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/stable/_oj-layer.scss +0 -0
  466. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/stable/_oj-popup.cssvars.scss +0 -0
  467. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/popup/themes/stable/oj-popup.scss +0 -0
  468. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/base/_oj-progress-bar.scss +0 -0
  469. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/redwood/_oj-progress-bar-scoped.cssvars.scss +0 -0
  470. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/redwood/_oj-progress-bar.cssvars.scss +0 -0
  471. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/redwood/_oj-progress-bar.servervars.scss +0 -0
  472. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/redwood/oj-progress-bar.scss +0 -0
  473. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/stable/_oj-progress-bar.cssvars.scss +0 -0
  474. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/stable/_oj-progress-bar.servervars.scss +0 -0
  475. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-bar/themes/stable/oj-progress-bar.scss +0 -0
  476. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/base/_oj-progress-circle.scss +0 -0
  477. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/redwood/_oj-progress-circle-scoped.cssvars.scss +0 -0
  478. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/redwood/_oj-progress-circle.cssvars.scss +0 -0
  479. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/redwood/_oj-progress-circle.servervars.scss +0 -0
  480. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/redwood/oj-progress-circle.scss +0 -0
  481. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/stable/_oj-progress-circle.cssvars.scss +0 -0
  482. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/stable/_oj-progress-circle.servervars.scss +0 -0
  483. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/progress-circle/themes/stable/oj-progress-circle.scss +0 -0
  484. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radio-checkbox/themes/base/_oj-radiocheckbox.scss +0 -0
  485. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox-scoped.cssvars.scss +0 -0
  486. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.cssvars.scss +0 -0
  487. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.servervars.scss +0 -0
  488. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.cssvars.scss +0 -0
  489. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.servervars.scss +0 -0
  490. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radioset/themes/redwood/_oj-radioset.cssvars.scss +0 -0
  491. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radioset/themes/redwood/oj-radioset.scss +0 -0
  492. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radioset/themes/stable/_oj-radioset.cssvars.scss +0 -0
  493. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/radioset/themes/stable/oj-radioset.scss +0 -0
  494. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rangeslider/themes/redwood/_oj-rangeslider.cssvars.scss +0 -0
  495. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rangeslider/themes/redwood/oj-rangeslider.scss +0 -0
  496. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rangeslider/themes/stable/_oj-rangeslider.cssvars.scss +0 -0
  497. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rangeslider/themes/stable/oj-rangeslider.scss +0 -0
  498. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rating-gauge/themes/base/_oj-rating-gauge.scss +0 -0
  499. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rating-gauge/themes/redwood/_oj-rating-gauge.cssvars.scss +0 -0
  500. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rating-gauge/themes/redwood/oj-rating-gauge.scss +0 -0
  501. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rating-gauge/themes/stable/_oj-rating-gauge.cssvars.scss +0 -0
  502. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/rating-gauge/themes/stable/oj-rating-gauge.scss +0 -0
  503. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/refresher/themes/base/_oj-refresher.scss +0 -0
  504. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/refresher/themes/redwood/_oj-refresher.cssvars.scss +0 -0
  505. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/refresher/themes/redwood/_oj-refresher.servervars.scss +0 -0
  506. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/refresher/themes/redwood/oj-refresher.scss +0 -0
  507. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/refresher/themes/stable/_oj-refresher.cssvars.scss +0 -0
  508. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/refresher/themes/stable/_oj-refresher.servervars.scss +0 -0
  509. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/refresher/themes/stable/oj-refresher.scss +0 -0
  510. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/resizable/themes/base/_oj-resizable.scss +0 -0
  511. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/resizable/themes/redwood/_oj-resizable.scss +0 -0
  512. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/resizable/themes/stable/_oj-resizable.scss +0 -0
  513. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/row-expander/themes/base/_oj-row-expander.scss +0 -0
  514. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/row-expander/themes/redwood/_oj-row-expander.cssvars.scss +0 -0
  515. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/row-expander/themes/redwood/oj-row-expander.scss +0 -0
  516. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/row-expander/themes/stable/_oj-row-expander.cssvars.scss +0 -0
  517. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/row-expander/themes/stable/oj-row-expander.scss +0 -0
  518. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/scrollbar/themes/base/_oj-scrollbar.scss +0 -0
  519. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/scrollbar/themes/redwood/_oj-scrollbar-scoped.cssvars.scss +0 -0
  520. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/scrollbar/themes/redwood/_oj-scrollbar.cssvars.scss +0 -0
  521. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/scrollbar/themes/redwood/_oj-scrollbar.scss +0 -0
  522. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/scrollbar/themes/stable/_oj-scrollbar.cssvars.scss +0 -0
  523. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/scrollbar/themes/stable/_oj-scrollbar.scss +0 -0
  524. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select/themes/base/_oj-select.scss +0 -0
  525. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select/themes/redwood/_oj-select.cssvars.scss +0 -0
  526. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select/themes/redwood/_oj-select.scss +0 -0
  527. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select/themes/stable/_oj-select.cssvars.scss +0 -0
  528. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select/themes/stable/_oj-select.scss +0 -0
  529. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-many/themes/redwood/oj-select-many.scss +0 -0
  530. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-many/themes/stable/oj-select-many.scss +0 -0
  531. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-one/themes/redwood/oj-select-one.scss +0 -0
  532. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-original/themes/base/_oj-select-original.scss +0 -0
  533. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-original/themes/redwood/_oj-select-original.cssvars.scss +0 -0
  534. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-original/themes/redwood/_oj-select-original.scss +0 -0
  535. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-original/themes/stable/_oj-select-original.cssvars.scss +0 -0
  536. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-original/themes/stable/_oj-select-original.scss +0 -0
  537. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-single/themes/base/_oj-select-single.scss +0 -0
  538. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-single/themes/redwood/oj-select-single.scss +0 -0
  539. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/select-single/themes/stable/oj-select-single.scss +0 -0
  540. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/selector/themes/base/_oj-selector.scss +0 -0
  541. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/selector/themes/redwood/_oj-selector.cssvars.scss +0 -0
  542. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/selector/themes/redwood/oj-selector.scss +0 -0
  543. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/selector/themes/stable/_oj-selector.cssvars.scss +0 -0
  544. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/selector/themes/stable/oj-selector.scss +0 -0
  545. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/slider/themes/base/_oj-slider.scss +0 -0
  546. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/slider/themes/redwood/_oj-slider.cssvars.scss +0 -0
  547. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/slider/themes/redwood/oj-slider.scss +0 -0
  548. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/slider/themes/stable/_oj-slider.cssvars.scss +0 -0
  549. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/slider/themes/stable/oj-slider.scss +0 -0
  550. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/spark-chart/themes/base/_oj-spark-chart.scss +0 -0
  551. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/spark-chart/themes/redwood/oj-spark-chart.scss +0 -0
  552. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/spark-chart/themes/stable/oj-spark-chart.scss +0 -0
  553. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/status-meter-gauge/themes/base/_oj-status-meter-gauge.scss +0 -0
  554. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/status-meter-gauge/themes/redwood/_oj-status-meter-gauge.cssvars.scss +0 -0
  555. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/status-meter-gauge/themes/redwood/oj-status-meter-gauge.scss +0 -0
  556. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/status-meter-gauge/themes/stable/_oj-status-meter-gauge.cssvars.scss +0 -0
  557. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/status-meter-gauge/themes/stable/oj-status-meter-gauge.scss +0 -0
  558. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/stream-list/themes/base/_oj-stream-list.scss +0 -0
  559. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/stream-list/themes/redwood/_oj-stream-list.cssvars.scss +0 -0
  560. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/stream-list/themes/redwood/_oj-stream-list.servervars.scss +0 -0
  561. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/stream-list/themes/redwood/oj-stream-list.scss +0 -0
  562. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/stream-list/themes/stable/_oj-stream-list.cssvars.scss +0 -0
  563. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/stream-list/themes/stable/_oj-stream-list.servervars.scss +0 -0
  564. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/stream-list/themes/stable/oj-stream-list.scss +0 -0
  565. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/sunburst/themes/base/_oj-sunburst.scss +0 -0
  566. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/sunburst/themes/redwood/_oj-sunburst.cssvars.scss +0 -0
  567. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/sunburst/themes/redwood/oj-sunburst.scss +0 -0
  568. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/sunburst/themes/stable/_oj-sunburst.cssvars.scss +0 -0
  569. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/sunburst/themes/stable/oj-sunburst.scss +0 -0
  570. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/swipe-actions/themes/base/_oj-swipe-actions.scss +0 -0
  571. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/swipe-actions/themes/redwood/_oj-swipe-actions.cssvars.scss +0 -0
  572. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/swipe-actions/themes/redwood/oj-swipe-actions.scss +0 -0
  573. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/swipe-actions/themes/stable/_oj-swipe-actions.cssvars.scss +0 -0
  574. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/swipe-actions/themes/stable/oj-swipe-actions.scss +0 -0
  575. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switch/themes/base/_oj-switch.scss +0 -0
  576. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switch/themes/redwood/_oj-switch.cssvars.scss +0 -0
  577. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switch/themes/redwood/oj-switch.scss +0 -0
  578. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switch/themes/stable/_oj-switch.cssvars.scss +0 -0
  579. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switch/themes/stable/oj-switch.scss +0 -0
  580. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switcher/themes/base/_oj-switcher.scss +0 -0
  581. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switcher/themes/redwood/oj-switcher.scss +0 -0
  582. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/switcher/themes/stable/oj-switcher.scss +0 -0
  583. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tab-bar/themes/base/_oj-tab-bar.scss +0 -0
  584. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tab-bar/themes/redwood/_oj-tab-bar-scoped.cssvars.scss +0 -0
  585. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tab-bar/themes/redwood/_oj-tab-bar.cssvars.scss +0 -0
  586. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tab-bar/themes/redwood/oj-tab-bar.scss +0 -0
  587. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tab-bar/themes/stable/_oj-tab-bar-scoped.cssvars.scss +0 -0
  588. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tab-bar/themes/stable/_oj-tab-bar.cssvars.scss +0 -0
  589. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tab-bar/themes/stable/oj-tab-bar.scss +0 -0
  590. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/table/themes/base/_oj-table.scss +0 -0
  591. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/table/themes/redwood/_oj-table.cssvars.scss +0 -0
  592. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/table/themes/redwood/oj-table.scss +0 -0
  593. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/table/themes/stable/_oj-table.cssvars.scss +0 -0
  594. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/table/themes/stable/oj-table.scss +0 -0
  595. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tag-cloud/themes/base/_oj-tag-cloud.scss +0 -0
  596. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tag-cloud/themes/redwood/_oj-tag-cloud.cssvars.scss +0 -0
  597. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tag-cloud/themes/redwood/oj-tag-cloud.scss +0 -0
  598. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tag-cloud/themes/stable/_oj-tag-cloud.cssvars.scss +0 -0
  599. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tag-cloud/themes/stable/oj-tag-cloud.scss +0 -0
  600. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/base/_oj-notags.scss +0 -0
  601. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/base/_oj-tags.scss +0 -0
  602. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/redwood/_oj-tags-scoped.cssvars.scss +0 -0
  603. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/redwood/_oj-tags.cssvars.scss +0 -0
  604. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/redwood/oj-notags.scss +0 -0
  605. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/redwood/oj-tags.scss +0 -0
  606. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/stable/_oj-tags.cssvars.scss +0 -0
  607. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/stable/oj-notags.scss +0 -0
  608. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tags/themes/stable/oj-tags.scss +0 -0
  609. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-area/themes/base/_oj-text-area.scss +0 -0
  610. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-area/themes/redwood/_oj-text-area.cssvars.scss +0 -0
  611. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-area/themes/redwood/oj-text-area.scss +0 -0
  612. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-area/themes/stable/_oj-text-area.cssvars.scss +0 -0
  613. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-area/themes/stable/oj-text-area.scss +0 -0
  614. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-field/themes/base/_oj-text-field.cssvars.scss +0 -0
  615. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-field/themes/redwood/_oj-text-field-scoped.cssvars.scss +0 -0
  616. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-field/themes/redwood/_oj-text-field.cssvars.scss +0 -0
  617. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/text-field/themes/stable/_oj-text-field.cssvars.scss +0 -0
  618. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/thematic-map/themes/base/_oj-thematic-map.scss +0 -0
  619. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/thematic-map/themes/redwood/_oj-thematic-map.cssvars.scss +0 -0
  620. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/thematic-map/themes/redwood/oj-thematic-map.scss +0 -0
  621. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/thematic-map/themes/stable/_oj-thematic-map.cssvars.scss +0 -0
  622. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/thematic-map/themes/stable/oj-thematic-map.scss +0 -0
  623. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/time-axis/themes/base/_oj-time-axis.scss +0 -0
  624. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/time-axis/themes/redwood/_oj-time-axis.cssvars.scss +0 -0
  625. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/time-axis/themes/redwood/oj-time-axis.scss +0 -0
  626. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/time-axis/themes/stable/_oj-time-axis.cssvars.scss +0 -0
  627. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/time-axis/themes/stable/oj-time-axis.scss +0 -0
  628. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/timeline/themes/base/_oj-timeline.scss +0 -0
  629. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/timeline/themes/redwood/_oj-timeline.cssvars.scss +0 -0
  630. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/timeline/themes/redwood/oj-timeline.scss +0 -0
  631. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/timeline/themes/stable/_oj-timeline.cssvars.scss +0 -0
  632. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/timeline/themes/stable/oj-timeline.scss +0 -0
  633. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/toolbar/themes/base/_oj-toolbar.scss +0 -0
  634. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/toolbar/themes/redwood/_oj-toolbar.cssvars.scss +0 -0
  635. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/toolbar/themes/redwood/oj-toolbar.scss +0 -0
  636. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/toolbar/themes/stable/_oj-toolbar.cssvars.scss +0 -0
  637. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/toolbar/themes/stable/oj-toolbar.scss +0 -0
  638. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tooltip/themes/base/_oj-tooltip.scss +0 -0
  639. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tooltip/themes/redwood/_oj-tooltip.cssvars.scss +0 -0
  640. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tooltip/themes/redwood/oj-tooltip.scss +0 -0
  641. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tooltip/themes/stable/_oj-tooltip.cssvars.scss +0 -0
  642. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tooltip/themes/stable/oj-tooltip.scss +0 -0
  643. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/train/themes/base/_oj-train.scss +0 -0
  644. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/train/themes/redwood/_oj-train.cssvars.scss +0 -0
  645. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/train/themes/redwood/oj-train.scss +0 -0
  646. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/train/themes/stable/_oj-train.cssvars.scss +0 -0
  647. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/train/themes/stable/oj-train.scss +0 -0
  648. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tree-view/themes/base/_oj-tree-view.scss +0 -0
  649. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tree-view/themes/redwood/_oj-tree-view.cssvars.scss +0 -0
  650. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tree-view/themes/redwood/oj-tree-view.scss +0 -0
  651. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tree-view/themes/stable/_oj-tree-view.cssvars.scss +0 -0
  652. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/tree-view/themes/stable/oj-tree-view.scss +0 -0
  653. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/treemap/themes/base/_oj-treemap.scss +0 -0
  654. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/treemap/themes/redwood/_oj-treemap.cssvars.scss +0 -0
  655. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/treemap/themes/redwood/oj-treemap.scss +0 -0
  656. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/treemap/themes/stable/_oj-treemap.cssvars.scss +0 -0
  657. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/treemap/themes/stable/oj-treemap.scss +0 -0
  658. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/typography/themes/base/_oj-typography.scss +0 -0
  659. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/typography/themes/redwood/_oj-typography-scoped.cssvars.scss +0 -0
  660. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/typography/themes/redwood/_oj-typography.cssvars.scss +0 -0
  661. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/typography/themes/redwood/oj-typography.scss +0 -0
  662. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/typography/themes/stable/_oj-typography-scoped.cssvars.scss +0 -0
  663. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/typography/themes/stable/_oj-typography.cssvars.scss +0 -0
  664. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/typography/themes/stable/oj-typography.scss +0 -0
  665. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/utilities/_oj.utilities.bidi.scss +0 -0
  666. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/utilities/_oj.utilities.icons.scss +0 -0
  667. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/utilities/_oj.utilities.json.scss +0 -0
  668. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/utilities/_oj.utilities.masonrylayout.scss +0 -0
  669. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/utilities/_oj.utilities.modules.scss +0 -0
  670. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/validation-group/themes/base/_oj-validation-group.scss +0 -0
  671. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/validation-group/themes/redwood/oj-validation-group.scss +0 -0
  672. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/validation-group/themes/stable/oj-validation-group.scss +0 -0
  673. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/waterfall-layout/themes/base/_oj-waterfall-layout.scss +0 -0
  674. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/waterfall-layout/themes/redwood/_oj-waterfall-layout.cssvars.scss +0 -0
  675. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/waterfall-layout/themes/redwood/oj-waterfall-layout.scss +0 -0
  676. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/waterfall-layout/themes/stable/_oj-waterfall-layout.cssvars.scss +0 -0
  677. package/dist/pcss/oj/{v11.1.2 → v11.1.3}/oj/waterfall-layout/themes/stable/oj-waterfall-layout.scss +0 -0
  678. package/dist/scss/common/helpers/_oj.common.helpers.scss +1 -1
  679. package/dist/scss/common/widgets/_oj.common.formlayout.mixins.scss +12 -5
  680. package/dist/scss/common/widgets/_oj.common.treeview.scss +2 -0
  681. package/dist/webpack-tools/4.x/webpack.config.js +3 -3
  682. package/dist/webpack-tools/webpack.config.js +3 -3
  683. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  * All rights reserved.
4
4
  */
5
5
 
6
- define("persist/PersistenceStore",[],(function(){"use strict";var e=function(e){this._name=e};return(e.prototype={}).getName=function(){return this._name},e.prototype.getVersion=function(){return this._version},e.prototype.Init=function(e){return e&&e.version?this._version=e.version:this._version="0",Promise.resolve()},e.prototype.upsert=function(e,t,n,r){throw TypeError("failed in abstract function")},e.prototype.upsertAll=function(e){throw TypeError("failed in abstract function")},e.prototype.find=function(e){throw TypeError("failed in abstract function")},e.prototype.findByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.removeByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.delete=function(e){throw TypeError("failed in abstract function")},e.prototype.keys=function(){throw TypeError("failed in abstract function")},e.prototype.updateKey=function(e,t){throw TypeError("failed in abstract function")},e})),define("persist/impl/storageUtils",["./logger"],(function(e){"use strict";function t(e){var r,s=[];for(var u in e)if(e.hasOwnProperty(u)){var a=e[u];if(0===u.indexOf("$")){if(o(u)){if(!(a instanceof Array))throw new Error("not a valid expression: "+e);r={operator:u,array:[]};for(var c=0;c<a.length;c++){var f=t(a[c]);r.array.push(f)}}else if(i(u))throw new Error("not a valid expression: "+e)}else if("object"!=typeof a)s.push({left:u,right:a,operator:"$eq"});else{var l={left:u};n(l,a),s.push(l)}}return s.length>1?r={operator:"$and",array:s}:1===s.length&&(r=s[0]),r}function n(e,t){var n=!1;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(n||!i(r))throw new Error("parsing error "+t);e.operator=r,e.right=o,n=!0}}function r(e,t){var n=e.operator;if(o(n)){if(!e.left&&e.array instanceof Array){for(var s,c=e.array,f=0;f<c.length;f++){var l=r(c[f],t);if("$or"===n&&!0===l)return!0;if("$and"===n&&!1===l)return!1;s=l}return s}throw new Error("invalid expression tree!"+e)}if(!i(n))throw new Error("not a valid expression!"+e);var d,h=a(e.left,t),p=e.right;if("$lt"===n)return(h=(d=u(h,p))[0])<d[1];if("$gt"===n)return(h=(d=u(h,p))[0])>d[1];if("$lte"===n)return(h=(d=u(h,p))[0])<=d[1];if("$gte"===n)return(h=(d=u(h,p))[0])>=d[1];if("$eq"===n)return h===p;if("$ne"===n)return h!==p;if("$regex"===n)return null!==h.match(p);if("$exists"===n)return p?null!=h:null==h;if("$in"!==n){if("$nin"===n)return p.indexOf(h)<0;throw new Error("not a valid expression! "+e)}for(var v=0;v<p.length;v++)if(p[v]===h)return!0;return!1}function o(e){return"$and"===e||"$or"===e}function i(e){return"$lt"===e||"$gt"===e||"$lte"===e||"$gte"===e||"$eq"===e||"$ne"===e||"$regex"===e||"$exists"===e||"$in"===e||"$nin"===e}function s(e){return null!=e&&(e instanceof String||"string"==typeof e)}function u(e,t){return s(e)&&null==t?t="":s(t)&&null==e&&(e=""),[e,t]}function a(e,t){for(var n=e.split("."),r=t,o=0;o<n.length;o++)r=r[n[o]];return r}return{satisfy:function(n,o){return e.log("Offline Persistence Toolkit storageUtils: Processing selector: "+JSON.stringify(n)),!n||r(t(n),o)},getValue:a,assembleObject:function(e,t){var n;if(t){n={};for(var r=0;r<t.length;r++)for(var o=n,i=e,s=t[r].split("."),u=0;u<s.length;u++)i=i[s[u]],!o[s[u]]&&u<s.length-1&&(o[s[u]]={}),u===s.length-1?o[s[u]]=i:o=o[s[u]]}else n=e;return n},sortRows:function(e,t){return e&&Array.isArray(e)&&!(e.length<1)&&t&&Array.isArray(t)&&t.length?e.sort(function(e){return function(t,n){for(var r=0;r<e.length;r++){var o,i=e[r],s=!0;if("string"==typeof i)o=i;else{if("object"!=typeof i)throw new Error("invalid sort criteria.");var u=Object.keys(i);if(!u||1!==u.length)throw new Error("invalid sort criteria");s="asc"===i[o=u[0]].toLowerCase()}var c=a(o,t),f=a(o,n);if(c!=f)return s?c<f?-1:1:c<f?1:-1}return 0}}(t)):e}}})),define("persist/impl/keyValuePersistenceStore",["../PersistenceStore","./storageUtils","./logger"],(function(e,t,n){"use strict";var r=function(t){e.call(this,t)};return(r.prototype=new e).Init=function(e){return this._version=e&&e.version||"0",Promise.resolve()},r.prototype.getItem=function(e){throw TypeError("failed in abstract function")},r.prototype.removeByKey=function(e){throw TypeError("failed in abstract function")},r.prototype.keys=function(){throw TypeError("failed in abstract function")},r.prototype.findByKey=function(e){return n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: findByKey() with key: "+e),this.getItem(e).then((function(e){return e?Promise.resolve(e.value):Promise.resolve()}))},r.prototype.find=function(e){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: find() with expression: "+JSON.stringify(e));var r=this,o=[],i=[];return e=e||{},this.keys().then((function(n){for(var s=[],u=0;u<n.length;u++){var a=n[u];a&&s.push(function(n){return r.getItem(n).then((function(r){r&&t.satisfy(e.selector,r)&&(r.key=n,i.push(r))}))}(a))}return Promise.all(s).then((function(){for(var n=t.sortRows(i,e.sort),s=0;s<n.length;s++)o.push(r._constructReturnObject(e.fields,n[s]));return Promise.resolve(o)}))}))},r.prototype.updateKey=function(e,t){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: updateKey() with currentKey: "+e+" and new key: "+t);var r=this;return this.getItem(e).then((function(e){return e?r._insert(t,e.metadata,e.value):Promise.reject("No existing key found to update")})).then((function(){return r.removeByKey(e)}))},r.prototype._constructReturnObject=function(e,n){return e?t.assembleObject(n,e):n.value},r.prototype._removeByKeyMapCallback=function(e){var t=this;return function(n){var r;return r=e?n[e]:n,t.removeByKey(r)}},r.prototype.delete=function(e){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: delete() with expression: "+JSON.stringify(e));var t=this;if(!e)return this.deleteAll();var r=e;return r.fields=["key"],t.find(r).then((function(e){if(e&&e.length){var n=e.map(t._removeByKeyMapCallback("key"),t);return Promise.all(n)}return Promise.resolve()}))},r.prototype.deleteAll=function(){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: deleteAll()");var e,t=this,r=[];return this.keys().then((function(n){for(e=0;e<n.length;e++)r.push(t.removeByKey(n[e]));return Promise.all(r)}))},r.prototype.upsert=function(e,t,r,o){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: upsert() for key: "+e);var i=this;return this.getItem(e).then((function(n){if(n&&o){var s=n.metadata.versionIdentifier;return s!==o?Promise.reject({status:409}):t.versionIdentifier!==s?i._insert(e,t,r):Promise.resolve()}return i._insert(e,t,r)}))},r.prototype.upsertAll=function(e){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: upsertAll()");for(var t=[],r=0;r<e.length;r++){var o=e[r];t.push(this.upsert(o.key,o.metadata,o.value,o.expectedVersionIndentifier))}return Promise.all(t)},r})),define("persist/impl/PersistenceStoreMetadata",[],(function(){"use strict";var e=function(e,t,n){this.name=e,this.persistenceStoreFactory=t,this.versions=n};return(e.prototype={}).persistenceStoreFactory,e.prototype.versions,e})),function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pouchdb",[],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PouchDB=e()}((function(){return function e(t,n,r){function o(s,u){if(!n[s]){if(!t[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,(function(e){return o(t[s][1][e]||e)}),f,f.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments.length;if(t){for(var n=[],r=-1;++r<t;)n[r]=arguments[r];return e.call(this,n)}return e.call(this,[])}}},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){
6
+ define("persist/PersistenceStore",[],(function(){"use strict";var e=function(e){this._name=e};return(e.prototype={}).getName=function(){return this._name},e.prototype.getVersion=function(){return this._version},e.prototype.Init=function(e){return e&&e.version?this._version=e.version:this._version="0",Promise.resolve()},e.prototype.upsert=function(e,t,n,r){throw TypeError("failed in abstract function")},e.prototype.upsertAll=function(e){throw TypeError("failed in abstract function")},e.prototype.find=function(e){throw TypeError("failed in abstract function")},e.prototype.findByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.removeByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.delete=function(e){throw TypeError("failed in abstract function")},e.prototype.keys=function(){throw TypeError("failed in abstract function")},e.prototype.updateKey=function(e,t){throw TypeError("failed in abstract function")},e})),define("persist/impl/storageUtils",["./logger"],(function(e){"use strict";function t(e){var r,s=[];for(var u in e)if(e.hasOwnProperty(u)){var a=e[u];if(0===u.indexOf("$")){if(i(u)){if(!(a instanceof Array))throw new Error("not a valid expression: "+e);r={operator:u,array:[]};for(var c=0;c<a.length;c++){var f=t(a[c]);r.array.push(f)}}else if(o(u))throw new Error("not a valid expression: "+e)}else if("object"!=typeof a)s.push({left:u,right:a,operator:"$eq"});else{var l={left:u};n(l,a),s.push(l)}}return s.length>1?r={operator:"$and",array:s}:1===s.length&&(r=s[0]),r}function n(e,t){var n=!1;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(n||!o(r))throw new Error("parsing error "+t);e.operator=r,e.right=i,n=!0}}function r(e,t){var n=e.operator;if(i(n)){if(!e.left&&e.array instanceof Array){for(var s,c=e.array,f=0;f<c.length;f++){var l=r(c[f],t);if("$or"===n&&!0===l)return!0;if("$and"===n&&!1===l)return!1;s=l}return s}throw new Error("invalid expression tree!"+e)}if(!o(n))throw new Error("not a valid expression!"+e);var d,h=a(e.left,t),p=e.right;if("$lt"===n)return(h=(d=u(h,p))[0])<d[1];if("$gt"===n)return(h=(d=u(h,p))[0])>d[1];if("$lte"===n)return(h=(d=u(h,p))[0])<=d[1];if("$gte"===n)return(h=(d=u(h,p))[0])>=d[1];if("$eq"===n)return h===p;if("$ne"===n)return h!==p;if("$regex"===n)return null!==h.match(p);if("$exists"===n)return p?null!=h:null==h;if("$in"!==n){if("$nin"===n)return p.indexOf(h)<0;throw new Error("not a valid expression! "+e)}for(var v=0;v<p.length;v++)if(p[v]===h)return!0;return!1}function i(e){return"$and"===e||"$or"===e}function o(e){return"$lt"===e||"$gt"===e||"$lte"===e||"$gte"===e||"$eq"===e||"$ne"===e||"$regex"===e||"$exists"===e||"$in"===e||"$nin"===e}function s(e){return null!=e&&(e instanceof String||"string"==typeof e)}function u(e,t){return s(e)&&null==t?t="":s(t)&&null==e&&(e=""),[e,t]}function a(e,t){for(var n=e.split("."),r=t,i=0;i<n.length;i++)r=r[n[i]];return r}return{satisfy:function(n,i){return e.log("Offline Persistence Toolkit storageUtils: Processing selector: "+JSON.stringify(n)),!n||r(t(n),i)},getValue:a,assembleObject:function(e,t){var n;if(t){n={};for(var r=0;r<t.length;r++)for(var i=n,o=e,s=t[r].split("."),u=0;u<s.length;u++)o=o[s[u]],!i[s[u]]&&u<s.length-1&&(i[s[u]]={}),u===s.length-1?i[s[u]]=o:i=i[s[u]]}else n=e;return n},sortRows:function(e,t){return e&&Array.isArray(e)&&!(e.length<1)&&t&&Array.isArray(t)&&t.length?e.sort(function(e){return function(t,n){for(var r=0;r<e.length;r++){var i,o=e[r],s=!0;if("string"==typeof o)i=o;else{if("object"!=typeof o)throw new Error("invalid sort criteria.");var u=Object.keys(o);if(!u||1!==u.length)throw new Error("invalid sort criteria");s="asc"===o[i=u[0]].toLowerCase()}var c=a(i,t),f=a(i,n);if(c!=f)return s?c<f?-1:1:c<f?1:-1}return 0}}(t)):e}}})),define("persist/impl/keyValuePersistenceStore",["../PersistenceStore","./storageUtils","./logger"],(function(e,t,n){"use strict";var r=function(t){e.call(this,t)};return(r.prototype=new e).Init=function(e){return this._version=e&&e.version||"0",Promise.resolve()},r.prototype.getItem=function(e){throw TypeError("failed in abstract function")},r.prototype.removeByKey=function(e){throw TypeError("failed in abstract function")},r.prototype.keys=function(){throw TypeError("failed in abstract function")},r.prototype.findByKey=function(e){return n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: findByKey() with key: "+e),this.getItem(e).then((function(e){return e?Promise.resolve(e.value):Promise.resolve()}))},r.prototype.find=function(e){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: find() with expression: "+JSON.stringify(e));var r=this,i=[],o=[];return e=e||{},this.keys().then((function(n){for(var s=[],u=0;u<n.length;u++){var a=n[u];a&&s.push(function(n){return r.getItem(n).then((function(r){r&&t.satisfy(e.selector,r)&&(r.key=n,o.push(r))}))}(a))}return Promise.all(s).then((function(){for(var n=t.sortRows(o,e.sort),s=0;s<n.length;s++)i.push(r._constructReturnObject(e.fields,n[s]));return Promise.resolve(i)}))}))},r.prototype.updateKey=function(e,t){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: updateKey() with currentKey: "+e+" and new key: "+t);var r=this;return this.getItem(e).then((function(e){return e?r._insert(t,e.metadata,e.value):Promise.reject("No existing key found to update")})).then((function(){return r.removeByKey(e)}))},r.prototype._constructReturnObject=function(e,n){return e?t.assembleObject(n,e):n.value},r.prototype._removeByKeyMapCallback=function(e){var t=this;return function(n){var r;return r=e?n[e]:n,t.removeByKey(r)}},r.prototype.delete=function(e){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: delete() with expression: "+JSON.stringify(e));var t=this;if(!e)return this.deleteAll();var r=e;return r.fields=["key"],t.find(r).then((function(e){if(e&&e.length){var n=e.map(t._removeByKeyMapCallback("key"),t);return Promise.all(n)}return Promise.resolve()}))},r.prototype.deleteAll=function(){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: deleteAll()");var e,t=this,r=[];return this.keys().then((function(n){for(e=0;e<n.length;e++)r.push(t.removeByKey(n[e]));return Promise.all(r)}))},r.prototype.upsert=function(e,t,r,i){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: upsert() for key: "+e);var o=this;return this.getItem(e).then((function(n){if(n&&i){var s=n.metadata.versionIdentifier;return s!==i?Promise.reject({status:409}):t.versionIdentifier!==s?o._insert(e,t,r):Promise.resolve()}return o._insert(e,t,r)}))},r.prototype.upsertAll=function(e){n.log("Offline Persistence Toolkit keyValuePersistenceStore called by subclass: upsertAll()");for(var t=[],r=0;r<e.length;r++){var i=e[r];t.push(this.upsert(i.key,i.metadata,i.value,i.expectedVersionIndentifier))}return Promise.all(t)},r})),define("persist/impl/PersistenceStoreMetadata",[],(function(){"use strict";var e=function(e,t,n){this.name=e,this.persistenceStoreFactory=t,this.versions=n};return(e.prototype={}).persistenceStoreFactory,e.prototype.versions,e})),function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pouchdb",[],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PouchDB=e()}((function(){return function e(t,n,r){function i(s,u){if(!n[s]){if(!t[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,(function(e){return i(t[s][1][e]||e)}),f,f.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments.length;if(t){for(var n=[],r=-1;++r<t;)n[r]=arguments[r];return e.call(this,n)}return e.call(this,[])}}},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){
7
7
  // Copyright Joyent, Inc. and other Node contributors.
8
8
  // Permission is hereby granted, free of charge, to any person obtaining a
9
9
  // copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@ define("persist/PersistenceStore",[],(function(){"use strict";var e=function(e){
21
21
  // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22
22
  // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
23
23
  // USE OR OTHER DEALINGS IN THE SOFTWARE.
24
- var r=Object.create||function(e){var t=function(){};return t.prototype=e,new t},o=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n},i=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=r(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=s,
24
+ var r=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n},o=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=r(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=s,
25
25
  // Backwards-compat with node 0.10.x
26
26
  s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;
27
27
  // By default EventEmitters will print a warning if more than 10 listeners are
@@ -32,7 +32,7 @@ var u,a=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{valu
32
32
  // arguments and can be deoptimized because of that. These functions always have
33
33
  // the same number of arguments and thus do not get deoptimized, so the code
34
34
  // inside them can execute faster.
35
- function l(e,t,n){if(t)e.call(n);else for(var r=e.length,o=w(e,r),i=0;i<r;++i)o[i].call(n)}function d(e,t,n,r){if(t)e.call(n,r);else for(var o=e.length,i=w(e,o),s=0;s<o;++s)i[s].call(n,r)}function h(e,t,n,r,o){if(t)e.call(n,r,o);else for(var i=e.length,s=w(e,i),u=0;u<i;++u)s[u].call(n,r,o)}function p(e,t,n,r,o,i){if(t)e.call(n,r,o,i);else for(var s=e.length,u=w(e,s),a=0;a<s;++a)u[a].call(n,r,o,i)}function v(e,t,n,r){if(t)e.apply(n,r);else for(var o=e.length,i=w(e,o),s=0;s<o;++s)i[s].apply(n,r)}function y(e,t,n,o){var i,s,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(
35
+ function l(e,t,n){if(t)e.call(n);else for(var r=e.length,i=w(e,r),o=0;o<r;++o)i[o].call(n)}function d(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=w(e,i),s=0;s<i;++s)o[s].call(n,r)}function h(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,s=w(e,o),u=0;u<o;++u)s[u].call(n,r,i)}function p(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var s=e.length,u=w(e,s),a=0;a<s;++a)u[a].call(n,r,i,o)}function v(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=w(e,i),s=0;s<i;++s)o[s].apply(n,r)}function y(e,t,n,i){var o,s,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(
36
36
  // To avoid recursion in the case that type === "newListener"! Before
37
37
  // adding it to the listeners, first emit "newListener".
38
38
  s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),
@@ -42,17 +42,17 @@ s=e._events),u=s[t]):(s=e._events=r(null),e._eventsCount=0),u){
42
42
  // Check for listener leak
43
43
  if("function"==typeof u?
44
44
  // Adding the second element, need to change to array.
45
- u=s[t]=o?[n,u]:[u,n]:
45
+ u=s[t]=i?[n,u]:[u,n]:
46
46
  // If we've already got an array, just append.
47
- o?u.unshift(n):u.push(n),!u.warned&&(i=f(e))&&i>0&&u.length>i){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=u.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",a.name,a.message)}}else
47
+ i?u.unshift(n):u.push(n),!u.warned&&(o=f(e))&&o>0&&u.length>o){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=u.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",a.name,a.message)}}else
48
48
  // Optimize the case of one listener. Don't need the extra array object.
49
- u=s[t]=n,++e._eventsCount;return e}function g(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function _(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=i.call(g,r);return o.listener=n,r.wrapFn=o,o}function m(e,t,n){var r=e._events;if(!r)return[];var o=r[t];return o?"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):w(o,o.length):[]}function b(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function w(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}u?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){
49
+ u=s[t]=n,++e._eventsCount;return e}function g(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function _(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=o.call(g,r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(!r)return[];var i=r[t];return i?"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):w(i,i.length):[]}function b(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function w(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}u?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){
50
50
  // check whether the input is a positive number (whose value is zero or
51
51
  // greater and not a NaN).
52
52
  if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');a=e}}):s.defaultMaxListeners=a,
53
53
  // Obviously not all Emitters should be limited to 10. This function allows
54
54
  // that to be increased. Set to zero for unlimited.
55
- s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(e){var t,n,r,o,i,s,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;
55
+ s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(e){var t,n,r,i,o,s,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;
56
56
  // If there is no 'error' event listener then throw.
57
57
  if(u){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;// Unhandled 'error' event
58
58
  // At least give some kind of context to the user
@@ -60,38 +60,38 @@ var a=new Error('Unhandled "error" event. ('+t+")");throw a.context=t,a}if(!(n=s
60
60
  // fast cases
61
61
  case 1:l(n,c,this);break;case 2:d(n,c,this,arguments[1]);break;case 3:h(n,c,this,arguments[1],arguments[2]);break;case 4:p(n,c,this,arguments[1],arguments[2],arguments[3]);break;
62
62
  // slower
63
- default:for(o=new Array(r-1),i=1;i<r;i++)o[i-1]=arguments[i];v(n,c,this,o)}return!0},s.prototype.addListener=function(e,t){return y(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return y(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,_(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,_(this,e,t)),this},
63
+ default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];v(n,c,this,i)}return!0},s.prototype.addListener=function(e,t){return y(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return y(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,_(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,_(this,e,t)),this},
64
64
  // Emits a 'removeListener' event if and only if the listener was removed.
65
- s.prototype.removeListener=function(e,t){var n,o,i,s,u;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(o=this._events))return this;if(!(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=r(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){u=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():
65
+ s.prototype.removeListener=function(e,t){var n,i,o,s,u;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=r(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){u=n[s].listener,o=s;break}if(o<0)return this;0===o?n.shift():
66
66
  // About 1.5x faster than the two-arg version of Array#splice().
67
- function(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i),1===n.length&&(o[e]=n[0]),o.removeListener&&this.emit("removeListener",e,u||t)}return this},s.prototype.removeAllListeners=function(e){var t,n,i;if(!(n=this._events))return this;
67
+ function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,o),1===n.length&&(i[e]=n[0]),i.removeListener&&this.emit("removeListener",e,u||t)}return this},s.prototype.removeAllListeners=function(e){var t,n,o;if(!(n=this._events))return this;
68
68
  // not listening for removeListener, no need to emit
69
69
  if(!n.removeListener)return 0===arguments.length?(this._events=r(null),this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=r(null):delete n[e]),this;
70
70
  // emit removeListener for all listeners on all events
71
- if(0===arguments.length){var s,u=o(n);for(i=0;i<u.length;++i)"removeListener"!==(s=u[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=r(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)
71
+ if(0===arguments.length){var s,u=i(n);for(o=0;o<u.length;++o)"removeListener"!==(s=u[o])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=r(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)
72
72
  // LIFO order
73
- for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],4:[function(e,t,n){"use strict";var r,o,i,s=[e("./nextTick"),e("./queueMicrotask"),e("./mutation.js"),e("./messageChannel"),e("./stateChange"),e("./timeout")],u=-1,a=[],c=!1;function f(){r&&o&&(r=!1,o.length?a=o.concat(a):u=-1,a.length&&l())}
73
+ for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],4:[function(e,t,n){"use strict";var r,i,o,s=[e("./nextTick"),e("./queueMicrotask"),e("./mutation.js"),e("./messageChannel"),e("./stateChange"),e("./timeout")],u=-1,a=[],c=!1;function f(){r&&i&&(r=!1,i.length?a=i.concat(a):u=-1,a.length&&l())}
74
74
  //named nextTick for less confusing stack traces
75
- function l(){if(!r){c=!1,r=!0;for(var e=a.length,t=setTimeout(f);e;){for(o=a,a=[];o&&++u<e;)o[u].run();u=-1,e=a.length}o=null,u=-1,r=!1,clearTimeout(t)}}for(var d=-1,h=s.length;++d<h;)if(s[d]&&s[d].test&&s[d].test()){i=s[d].install(l);break}
75
+ function l(){if(!r){c=!1,r=!0;for(var e=a.length,t=setTimeout(f);e;){for(i=a,a=[];i&&++u<e;)i[u].run();u=-1,e=a.length}i=null,u=-1,r=!1,clearTimeout(t)}}for(var d=-1,h=s.length;++d<h;)if(s[d]&&s[d].test&&s[d].test()){o=s[d].install(l);break}
76
76
  // v8 likes predictible objects
77
- function p(e,t){this.fun=e,this.array=t}p.prototype.run=function(){var e=this.fun,t=this.array;switch(t.length){case 0:return e();case 1:return e(t[0]);case 2:return e(t[0],t[1]);case 3:return e(t[0],t[1],t[2]);default:return e.apply(null,t)}},t.exports=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new p(e,t)),c||r||(c=!0,i())}},{"./messageChannel":5,"./mutation.js":6,"./nextTick":2,"./queueMicrotask":7,"./stateChange":8,"./timeout":9}],5:[function(e,t,n){(function(e){"use strict";n.test=function(){return!e.setImmediate&&void 0!==e.MessageChannel},n.install=function(t){var n=new e.MessageChannel;return n.port1.onmessage=t,function(){n.port2.postMessage(0)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(e,t,n){(function(e){"use strict";
77
+ function p(e,t){this.fun=e,this.array=t}p.prototype.run=function(){var e=this.fun,t=this.array;switch(t.length){case 0:return e();case 1:return e(t[0]);case 2:return e(t[0],t[1]);case 3:return e(t[0],t[1],t[2]);default:return e.apply(null,t)}},t.exports=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new p(e,t)),c||r||(c=!0,o())}},{"./messageChannel":5,"./mutation.js":6,"./nextTick":2,"./queueMicrotask":7,"./stateChange":8,"./timeout":9}],5:[function(e,t,n){(function(e){(function(){"use strict";n.test=function(){return!e.setImmediate&&void 0!==e.MessageChannel},n.install=function(t){var n=new e.MessageChannel;return n.port1.onmessage=t,function(){n.port2.postMessage(0)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(e,t,n){(function(e){(function(){"use strict";
78
78
  //based off rsvp https://github.com/tildeio/rsvp.js
79
79
  //license https://github.com/tildeio/rsvp.js/blob/master/LICENSE
80
80
  //https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js
81
- var t=e.MutationObserver||e.WebKitMutationObserver;n.test=function(){return t},n.install=function(n){var r=0,o=new t(n),i=e.document.createTextNode("");return o.observe(i,{characterData:!0}),function(){i.data=r=++r%2}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(e,t,n){(function(e){"use strict";n.test=function(){return"function"==typeof e.queueMicrotask},n.install=function(t){return function(){e.queueMicrotask(t)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,n){(function(e){"use strict";n.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},n.install=function(t){return function(){
81
+ var t=e.MutationObserver||e.WebKitMutationObserver;n.test=function(){return t},n.install=function(n){var r=0,i=new t(n),o=e.document.createTextNode("");return i.observe(o,{characterData:!0}),function(){o.data=r=++r%2}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(e,t,n){(function(e){(function(){"use strict";n.test=function(){return"function"==typeof e.queueMicrotask},n.install=function(t){return function(){e.queueMicrotask(t)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,n){(function(e){(function(){"use strict";n.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},n.install=function(t){return function(){
82
82
  // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
83
83
  // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
84
- var n=e.document.createElement("script");return n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n),t}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t,n){"use strict";n.test=function(){return!0},n.install=function(e){return function(){setTimeout(e,0)}}},{}],10:[function(e,t,n){"function"==typeof Object.create?
84
+ var n=e.document.createElement("script");return n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n),t}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t,n){"use strict";n.test=function(){return!0},n.install=function(e){return function(){setTimeout(e,0)}}},{}],10:[function(e,t,n){"function"==typeof Object.create?
85
85
  // implementation from standard node.js 'util' module
86
86
  t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:
87
87
  // old school shim for old browsers
88
- t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){(function(n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o,i,s=r(e("immediate")),u=e("uuid"),a=r(e("spark-md5")),c=r(e("vuvuzela")),f=r(e("argsarray")),l=r(e("inherits")),d=r(e("events"));function h(e){return"$"+e}function p(e){return e.substring(1)}function v(){this._store={}}function y(e){
88
+ t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){(function(n){(function(){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i,o,s=r(e("immediate")),u=e("uuid"),a=r(e("spark-md5")),c=r(e("vuvuzela")),f=r(e("argsarray")),l=r(e("inherits")),d=r(e("events"));function h(e){return"$"+e}function p(e){return e.substring(1)}function v(){this._store={}}function y(e){
89
89
  // init with an array
90
90
  if(this._store=new v,e&&Array.isArray(e))for(var t=0,n=e.length;t<n;t++)this.add(e[t])}
91
91
  // most of this is borrowed from lodash.isPlainObject:
92
92
  // https://github.com/fis-components/lodash.isplainobject/
93
93
  // blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js
94
- v.prototype.get=function(e){var t=h(e);return this._store[t]},v.prototype.set=function(e,t){var n=h(e);return this._store[n]=t,!0},v.prototype.has=function(e){return h(e)in this._store},v.prototype.delete=function(e){var t=h(e),n=t in this._store;return delete this._store[t],n},v.prototype.forEach=function(e){for(var t=Object.keys(this._store),n=0,r=t.length;n<r;n++){var o=t[n];e(this._store[o],o=p(o))}},Object.defineProperty(v.prototype,"size",{get:function(){return Object.keys(this._store).length}}),y.prototype.add=function(e){return this._store.set(e,!0)},y.prototype.has=function(e){return this._store.has(e)},y.prototype.forEach=function(e){this._store.forEach((function(t,n){e(n)}))},Object.defineProperty(y.prototype,"size",{get:function(){return this._store.size}}),
94
+ v.prototype.get=function(e){var t=h(e);return this._store[t]},v.prototype.set=function(e,t){var n=h(e);return this._store[n]=t,!0},v.prototype.has=function(e){return h(e)in this._store},v.prototype.delete=function(e){var t=h(e),n=t in this._store;return delete this._store[t],n},v.prototype.forEach=function(e){for(var t=Object.keys(this._store),n=0,r=t.length;n<r;n++){var i=t[n];e(this._store[i],i=p(i))}},Object.defineProperty(v.prototype,"size",{get:function(){return Object.keys(this._store).length}}),y.prototype.add=function(e){return this._store.set(e,!0)},y.prototype.has=function(e){return this._store.has(e)},y.prototype.forEach=function(e){this._store.forEach((function(t,n){e(n)}))},Object.defineProperty(y.prototype,"size",{get:function(){return this._store.size}}),
95
95
  /* global Map,Set,Symbol */
96
96
  // Based on https://kangax.github.io/compat-table/es6/ we can sniff out
97
97
  // incomplete Map/Set implementations which would otherwise cause our tests to fail.
@@ -99,8 +99,8 @@ v.prototype.get=function(e){var t=h(e);return this._store[t]},v.prototype.set=fu
99
99
  function(){if("undefined"==typeof Symbol||"undefined"==typeof Map||"undefined"==typeof Set)return!1;var e=Object.getOwnPropertyDescriptor(Map,Symbol.species);return e&&"get"in e&&Map[Symbol.species]===Map}
100
100
  // based on https://github.com/montagejs/collections
101
101
  ()?(// prefer built-in Map/Set
102
- o=Set,i=Map):(// fall back to our polyfill
103
- o=y,i=v);var g,_,m=Function.prototype.toString,b=m.call(Object);function w(e){var t,n,r;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],n=0,r=e.length;n<r;n++)t[n]=w(e[n]);return t}
102
+ i=Set,o=Map):(// fall back to our polyfill
103
+ i=y,o=v);var g,_,m=Function.prototype.toString,b=m.call(Object);function w(e){var t,n,r;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],n=0,r=e.length;n<r;n++)t[n]=w(e[n]);return t}
104
104
  // special case: to avoid inconsistencies between IndexedDB
105
105
  // and other backends, we automatically stringify Dates
106
106
  if(e instanceof Date)return e.toISOString();if(function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||"undefined"!=typeof Blob&&e instanceof Blob}(e))return function(e){if(e instanceof ArrayBuffer)return function(e){if("function"==typeof e.slice)return e.slice(0);
@@ -114,7 +114,7 @@ return"function"==typeof e.slice?e.slice(0,t,n):e.webkitSlice(0,t,n);
114
114
  return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&m.call(n)==b}(e))return e;// don't clone objects like Workers
115
115
  for(n in t={},e)
116
116
  /* istanbul ignore else */
117
- if(Object.prototype.hasOwnProperty.call(e,n)){var o=w(e[n]);void 0!==o&&(t[n]=o)}return t}function k(e){var t=!1;return f((function(n){
117
+ if(Object.prototype.hasOwnProperty.call(e,n)){var i=w(e[n]);void 0!==i&&(t[n]=i)}return t}function k(e){var t=!1;return f((function(n){
118
118
  /* istanbul ignore if */
119
119
  if(t)
120
120
  // this is a smoke test and should never actually happen
@@ -122,27 +122,27 @@ throw new Error("once called more than once");t=!0,e.apply(this,n)}))}function j
122
122
  //create the function we will be returning
123
123
  return f((function(t){
124
124
  // Clone arguments
125
- t=w(t);var n=this,r="function"==typeof t[t.length-1]&&t.pop(),o=new Promise((function(r,o){var i;try{var s=k((function(e,t){e?o(e):r(t)}));
125
+ t=w(t);var n=this,r="function"==typeof t[t.length-1]&&t.pop(),i=new Promise((function(r,i){var o;try{var s=k((function(e,t){e?i(e):r(t)}));
126
126
  // create a callback for this invocation
127
127
  // apply the function in the orig context
128
- t.push(s),(i=e.apply(n,t))&&"function"==typeof i.then&&r(i)}catch(e){o(e)}}));
128
+ t.push(s),(o=e.apply(n,t))&&"function"==typeof o.then&&r(o)}catch(e){i(e)}}));
129
129
  // if the last argument is a function, assume its a callback
130
130
  // if there is a callback, call it back
131
- return r&&o.then((function(e){r(null,e)}),r),o}))}function O(e,t){return j(f((function(n){if(this._closed)return Promise.reject(new Error("database is closed"));if(this._destroyed)return Promise.reject(new Error("database is destroyed"));var r=this;return function(e,t,n){
131
+ return r&&i.then((function(e){r(null,e)}),r),i}))}function O(e,t){return j(f((function(n){if(this._closed)return Promise.reject(new Error("database is closed"));if(this._destroyed)return Promise.reject(new Error("database is destroyed"));var r=this;return function(e,t,n){
132
132
  /* istanbul ignore if */
133
- if(e.constructor.listeners("debug").length){for(var r=["api",e.name,t],o=0;o<n.length-1;o++)r.push(n[o]);e.constructor.emit("debug",r);
133
+ if(e.constructor.listeners("debug").length){for(var r=["api",e.name,t],i=0;i<n.length-1;i++)r.push(n[i]);e.constructor.emit("debug",r);
134
134
  // override the callback itself to log the response
135
- var i=n[n.length-1];n[n.length-1]=function(n,r){var o=["api",e.name,t];o=o.concat(n?["error",n]:["success",r]),e.constructor.emit("debug",o),i(n,r)}}}(r,e,n),this.taskqueue.isReady?t.apply(this,n):new Promise((function(t,o){r.taskqueue.addTask((function(i){i?o(i):t(r[e].apply(r,n))}))}))})))}
135
+ var o=n[n.length-1];n[n.length-1]=function(n,r){var i=["api",e.name,t];i=i.concat(n?["error",n]:["success",r]),e.constructor.emit("debug",i),o(n,r)}}}(r,e,n),this.taskqueue.isReady?t.apply(this,n):new Promise((function(t,i){r.taskqueue.addTask((function(o){o?i(o):t(r[e].apply(r,n))}))}))})))}
136
136
  // like underscore/lodash _.pick()
137
- function S(e,t){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];i in e&&(n[i]=e[i])}return n}
137
+ function S(e,t){for(var n={},r=0,i=t.length;r<i;r++){var o=t[r];o in e&&(n[o]=e[o])}return n}
138
138
  // Most browsers throttle concurrent requests at 6, so it's silly
139
139
  // to shim _bulk_get by trying to launch potentially hundreds of requests
140
140
  // and then letting the majority time out. We can handle this ourselves.
141
141
  function P(e){return e}function A(e){return[{ok:e}]}
142
142
  // shim for P/CouchDB adapters that don't directly implement _bulk_get
143
- function x(e,t,n){var r=t.docs,o=new i;
143
+ function x(e,t,n){var r=t.docs,i=new o;
144
144
  // consolidate into one request per doc if possible
145
- r.forEach((function(e){o.has(e.id)?o.get(e.id).push(e):o.set(e.id,[e])}));var s=o.size,u=0,a=new Array(s);function c(){var e;++u===s&&(e=[],a.forEach((function(t){t.docs.forEach((function(n){e.push({id:t.id,docs:[n]})}))})),n(null,{results:e}))}var f=[];o.forEach((function(e,t){f.push(t)}));var l=0;!function n(){if(!(l>=f.length)){var r=Math.min(l+6,f.length),i=f.slice(l,r);!function(r,i){r.forEach((function(r,s){var u=i+s,f=o.get(r),l=S(f[0],["atts_since","attachments"]);l.open_revs=f.map((function(e){
145
+ r.forEach((function(e){i.has(e.id)?i.get(e.id).push(e):i.set(e.id,[e])}));var s=i.size,u=0,a=new Array(s);function c(){var e;++u===s&&(e=[],a.forEach((function(t){t.docs.forEach((function(n){e.push({id:t.id,docs:[n]})}))})),n(null,{results:e}))}var f=[];i.forEach((function(e,t){f.push(t)}));var l=0;!function n(){if(!(l>=f.length)){var r=Math.min(l+6,f.length),o=f.slice(l,r);!function(r,o){r.forEach((function(r,s){var u=o+s,f=i.get(r),l=S(f[0],["atts_since","attachments"]);l.open_revs=f.map((function(e){
146
146
  // rev is optional, open_revs disallowed
147
147
  return e.rev})),
148
148
  // remove falsey / undefined revisions
@@ -152,8 +152,8 @@ l.open_revs=l.open_revs.filter(P);var d=P;0===l.open_revs.length&&(delete l.open
152
152
  // request
153
153
  d=A),
154
154
  // globally-supplied options
155
- ["revs","attachments","binary","ajax","latest"].forEach((function(e){e in t&&(l[e]=t[e])})),e.get(r,l,(function(e,t){var o,i,s;
156
- /* istanbul ignore if */o=e?[{error:e}]:d(t),i=r,s=o,a[u]={id:i,docs:s},c(),n()}))}))}(i,l),l+=i.length}}()}try{localStorage.setItem("_pouch_check_localstorage",1),g=!!localStorage.getItem("_pouch_check_localstorage")}catch(e){g=!1}function q(){return g}
155
+ ["revs","attachments","binary","ajax","latest"].forEach((function(e){e in t&&(l[e]=t[e])})),e.get(r,l,(function(e,t){var i,o,s;
156
+ /* istanbul ignore if */i=e?[{error:e}]:d(t),o=r,s=i,a[u]={id:o,docs:s},c(),n()}))}))}(o,l),l+=o.length}}()}try{localStorage.setItem("_pouch_check_localstorage",1),g=!!localStorage.getItem("_pouch_check_localstorage")}catch(e){g=!1}function q(){return g}
157
157
  // Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We
158
158
  function E(){d.call(this),this._listeners={},
159
159
  /* istanbul ignore next */
@@ -169,10 +169,10 @@ t=n),~~((t-e)*Math.random()+e);// ~~ coerces to an int, but fast.
169
169
  // when they see http errors in the console
170
170
  function $(e,t){C("info","The above "+e+" is totally normal. "+t)}l(E,d),E.prototype.addListener=function(e,t,n,r){
171
171
  /* istanbul ignore if */
172
- if(!this._listeners[t]){var o=this,i=!1;this._listeners[t]=u,this.on(e,u)}function u(){
172
+ if(!this._listeners[t]){var i=this,o=!1;this._listeners[t]=u,this.on(e,u)}function u(){
173
173
  /* istanbul ignore if */
174
- if(o._listeners[t])if(i)i="waiting";else{i=!0;var e=S(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);
175
- /* istanbul ignore next */n.changes(e).on("change",(function(e){e.seq>r.since&&!r.cancelled&&(r.since=e.seq,r.onChange(e))})).on("complete",(function(){"waiting"===i&&s(u),i=!1})).on("error",(function(){i=!1}))}}},E.prototype.removeListener=function(e,t){
174
+ if(i._listeners[t])if(o)o="waiting";else{o=!0;var e=S(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);
175
+ /* istanbul ignore next */n.changes(e).on("change",(function(e){e.seq>r.since&&!r.cancelled&&(r.since=e.seq,r.onChange(e))})).on("complete",(function(){"waiting"===o&&s(u),o=!1})).on("error",(function(){o=!1}))}}},E.prototype.removeListener=function(e,t){
176
176
  /* istanbul ignore if */
177
177
  t in this._listeners&&(d.prototype.removeListener.call(this,e,this._listeners[t]),delete this._listeners[t])},
178
178
  /* istanbul ignore next */
@@ -180,19 +180,19 @@ E.prototype.notifyLocalWindows=function(e){
180
180
  //do a useless change on a storage thing
181
181
  //in order to get other windows's listeners to activate
182
182
  q()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},E.prototype.notify=function(e){this.emit(e),this.notifyLocalWindows(e)},_="function"==typeof Object.assign?Object.assign:function(e){for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)// Skip over if undefined or null
183
- for(var o in r)
183
+ for(var i in r)
184
184
  // Avoid bugs when hasOwnProperty is shadowed
185
- Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};var T=_;function D(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}l(D,Error),D.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})},new D(401,"unauthorized","Name or password is incorrect.");var L=new D(400,"bad_request","Missing JSON list of 'docs'"),I=new D(404,"not_found","missing"),R=new D(409,"conflict","Document update conflict"),M=new D(400,"bad_request","_id field must contain a string"),N=new D(412,"missing_id","_id is required for puts"),K=new D(400,"bad_request","Only reserved document ids may start with underscore."),U=(new D(412,"precondition_failed","Database not open"),new D(500,"unknown_error","Database encountered an unknown error")),F=new D(500,"badarg","Some query argument is invalid"),J=(new D(400,"invalid_request","Request was invalid"),new D(400,"query_parse_error","Some query parameter is invalid")),V=new D(500,"doc_validation","Bad special document member"),z=new D(400,"bad_request","Something wrong with the request"),G=new D(400,"bad_request","Document must be a JSON object"),Q=(new D(404,"not_found","Database not found"),new D(500,"indexed_db_went_bad","unknown")),W=(new D(500,"web_sql_went_bad","unknown"),new D(500,"levelDB_went_went_bad","unknown"),new D(403,"forbidden","Forbidden by design doc validate_doc_update function"),new D(400,"bad_request","Invalid rev format")),Y=(new D(412,"file_exists","The database could not be created, the file already exists."),new D(412,"missing_stub","A pre-existing attachment stub wasn't found"));function H(e,t){function n(t){for(
185
+ Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};var T=_;function D(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}l(D,Error),D.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})},new D(401,"unauthorized","Name or password is incorrect.");var L=new D(400,"bad_request","Missing JSON list of 'docs'"),I=new D(404,"not_found","missing"),R=new D(409,"conflict","Document update conflict"),M=new D(400,"bad_request","_id field must contain a string"),N=new D(412,"missing_id","_id is required for puts"),K=new D(400,"bad_request","Only reserved document ids may start with underscore."),U=(new D(412,"precondition_failed","Database not open"),new D(500,"unknown_error","Database encountered an unknown error")),F=new D(500,"badarg","Some query argument is invalid"),J=(new D(400,"invalid_request","Request was invalid"),new D(400,"query_parse_error","Some query parameter is invalid")),V=new D(500,"doc_validation","Bad special document member"),z=new D(400,"bad_request","Something wrong with the request"),G=new D(400,"bad_request","Document must be a JSON object"),Q=(new D(404,"not_found","Database not found"),new D(500,"indexed_db_went_bad","unknown")),W=(new D(500,"web_sql_went_bad","unknown"),new D(500,"levelDB_went_went_bad","unknown"),new D(403,"forbidden","Forbidden by design doc validate_doc_update function"),new D(400,"bad_request","Invalid rev format")),Y=(new D(412,"file_exists","The database could not be created, the file already exists."),new D(412,"missing_stub","A pre-existing attachment stub wasn't found"));function H(e,t){function n(t){for(
186
186
  // inherit error properties from our parent error manually
187
187
  // so as to allow proper JSON parsing.
188
188
  /* jshint ignore:start */
189
- var n=Object.getOwnPropertyNames(e),r=0,o=n.length;r<o;r++)"function"!=typeof e[n[r]]&&(this[n[r]]=e[n[r]]);
189
+ var n=Object.getOwnPropertyNames(e),r=0,i=n.length;r<i;r++)"function"!=typeof e[n[r]]&&(this[n[r]]=e[n[r]]);
190
190
  /* jshint ignore:end */void 0!==t&&(this.reason=t)}return n.prototype=D.prototype,new n(t)}function X(e){if("object"!=typeof e){var t=e;(e=U).data=t}return"error"in e&&"conflict"===e.error&&(e.name="conflict",e.status=409),"name"in e||(e.name=e.error||"unknown"),"status"in e||(e.status=500),"message"in e||(e.message=e.message||e.reason),e}function Z(e){var t={},n=e.filter&&"function"==typeof e.filter;return t.query=e.query_params,function(r){r.doc||(
191
191
  // CSG sends events on the changes feed that don't have documents,
192
192
  // this hack makes a whole lot of existing code robust.
193
- r.doc={});var o=n&&function(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return H(z,r)}}(e.filter,r.doc,t);if("object"==typeof o)return o;if(o)return!1;if(e.include_docs){if(!e.attachments)for(var i in r.doc._attachments)
193
+ r.doc={});var i=n&&function(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return H(z,r)}}(e.filter,r.doc,t);if("object"==typeof i)return i;if(i)return!1;if(e.include_docs){if(!e.attachments)for(var o in r.doc._attachments)
194
194
  /* istanbul ignore else */
195
- r.doc._attachments.hasOwnProperty(i)&&(r.doc._attachments[i].stub=!0)}else delete r.doc;return!0}}function ee(e){for(var t=[],n=0,r=e.length;n<r;n++)t=t.concat(e[n]);return t}
195
+ r.doc._attachments.hasOwnProperty(o)&&(r.doc._attachments[o].stub=!0)}else delete r.doc;return!0}}function ee(e){for(var t=[],n=0,r=e.length;n<r;n++)t=t.concat(e[n]);return t}
196
196
  // shim for Function.prototype.name,
197
197
  // Determine id an ID is valid
198
198
  // - invalid IDs begin with an underescore that does not begin '_design' or
@@ -204,21 +204,21 @@ function te(e){var t;if(e?"string"!=typeof e?t=H(M):/^_/.test(e)&&!/^_(design|lo
204
204
  function ne(e){return"boolean"==typeof e._remote?e._remote:
205
205
  /* istanbul ignore next */
206
206
  "function"==typeof e.type&&(C("warn","db.type() is deprecated and will be removed in a future version of PouchDB"),"http"===e.type()
207
- /* istanbul ignore next */)}function re(e){if(!e)return null;var t=e.split("/");return 2===t.length?t:1===t.length?[e,e]:null}function oe(e){var t=re(e);return t?t.join("/"):null}
207
+ /* istanbul ignore next */)}function re(e){if(!e)return null;var t=e.split("/");return 2===t.length?t:1===t.length?[e,e]:null}function ie(e){var t=re(e);return t?t.join("/"):null}
208
208
  // originally parseUri 1.2.2, now patched by us
209
209
  // (c) Steven Levithan <stevenlevithan.com>
210
210
  // MIT License
211
- new D(413,"invalid_url","Provided URL is invalid");var ie=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],se="queryKey",ue=/(?:^|&)([^&=]*)=?([^&]*)/g,ae=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;function ce(e){for(var t=ae.exec(e),n={},r=14;r--;){var o=ie[r],i=t[r]||"",s=-1!==["user","password"].indexOf(o);n[o]=s?decodeURIComponent(i):i}return n[se]={},n[ie[12]].replace(ue,(function(e,t,r){t&&(n[se][t]=r)})),n}
211
+ new D(413,"invalid_url","Provided URL is invalid");var oe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],se="queryKey",ue=/(?:^|&)([^&=]*)=?([^&]*)/g,ae=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;function ce(e){for(var t=ae.exec(e),n={},r=14;r--;){var i=oe[r],o=t[r]||"",s=-1!==["user","password"].indexOf(i);n[i]=s?decodeURIComponent(o):o}return n[se]={},n[oe[12]].replace(ue,(function(e,t,r){t&&(n[se][t]=r)})),n}
212
212
  // Based on https://github.com/alexdavid/scope-eval v0.0.3
213
213
  // (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js)
214
214
  // This is basically just a wrapper around new Function()
215
- function fe(e,t){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&(n.push(o),r.push(t[o]));return n.push(e),Function.apply(null,n).apply(null,r)}
215
+ function fe(e,t){var n=[],r=[];for(var i in t)t.hasOwnProperty(i)&&(n.push(i),r.push(t[i]));return n.push(e),Function.apply(null,n).apply(null,r)}
216
216
  // this is essentially the "update sugar" function from daleharvey/pouchdb#1388
217
217
  // the diffFun tells us what delta to apply to the doc. it either returns
218
218
  // the doc, or false if it doesn't need to do an update after all
219
- function le(e,t,n){return new Promise((function(r,o){e.get(t,(function(i,s){if(i){
219
+ function le(e,t,n){return new Promise((function(r,i){e.get(t,(function(o,s){if(o){
220
220
  /* istanbul ignore next */
221
- if(404!==i.status)return o(i);s={}}
221
+ if(404!==o.status)return i(o);s={}}
222
222
  // the user might change the _rev, so save it for posterity
223
223
  var u=s._rev,a=n(s);if(!a)
224
224
  // if the diffFun returns falsy, we short-circuit as
@@ -234,75 +234,75 @@ if(409!==r.status)throw r;return le(e,t._id,n)}))}(e,a,n))}))}))}var de=function
234
234
  // old QtWebKit versions, Android < 4.4).
235
235
  function pe(e,t){
236
236
  /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */
237
- e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}
237
+ e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}
238
238
  // From http://stackoverflow.com/questions/14967647/ (continues on next line)
239
239
  // encode-decode-image-with-base64-breaks-image (2013-04-21)
240
- function ve(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o);return n}function ye(e,t){return pe([ve(e)],{type:t})}function ge(e,t){return ye(de(e),t)}
240
+ function ve(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}function ye(e,t){return pe([ve(e)],{type:t})}function ge(e,t){return ye(de(e),t)}
241
241
  //Can't find original post, but this is close
242
242
  //http://stackoverflow.com/questions/6965107/ (continues on next line)
243
243
  //converting-between-strings-and-arraybuffers
244
244
  // shim for browsers that don't support it
245
- function _e(e,t){var n=new FileReader,r="function"==typeof n.readAsBinaryString;n.onloadend=function(e){var n=e.target.result||"";if(r)return t(n);t(function(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=0;o<r;o++)t+=String.fromCharCode(n[o]);return t}(n))},r?n.readAsBinaryString(e):n.readAsArrayBuffer(e)}function me(e,t){_e(e,(function(e){t(e)}))}function be(e,t){me(e,(function(e){t(he(e))}))}
245
+ function _e(e,t){var n=new FileReader,r="function"==typeof n.readAsBinaryString;n.onloadend=function(e){var n=e.target.result||"";if(r)return t(n);t(function(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i<r;i++)t+=String.fromCharCode(n[i]);return t}(n))},r?n.readAsBinaryString(e):n.readAsArrayBuffer(e)}function me(e,t){_e(e,(function(e){t(e)}))}function be(e,t){me(e,(function(e){t(he(e))}))}
246
246
  // simplified API. universal browser support is assumed
247
247
  // this is not used in the browser
248
- var we=self.setImmediate||self.setTimeout;function ke(e,t,n,r,o){(n>0||r<t.size)&&(
248
+ var we=self.setImmediate||self.setTimeout;function ke(e,t,n,r,i){(n>0||r<t.size)&&(
249
249
  // only slice blob if we really need to
250
- t=function(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.slice(t,n)}(t,n,r)),function(e,t){var n=new FileReader;n.onloadend=function(e){var n=e.target.result||new ArrayBuffer(0);t(n)},n.readAsArrayBuffer(e)}(t,(function(t){e.append(t),o()}))}function je(e,t,n,r,o){(n>0||r<t.length)&&(
250
+ t=function(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.slice(t,n)}(t,n,r)),function(e,t){var n=new FileReader;n.onloadend=function(e){var n=e.target.result||new ArrayBuffer(0);t(n)},n.readAsArrayBuffer(e)}(t,(function(t){e.append(t),i()}))}function je(e,t,n,r,i){(n>0||r<t.length)&&(
251
251
  // only create a substring if we really need to
252
- t=t.substring(n,r)),e.appendBinary(t),o()}function Oe(e,t){var n="string"==typeof e,r=n?e.length:e.size,o=Math.min(32768,r),i=Math.ceil(r/o),s=0,u=n?new a:new a.ArrayBuffer,c=n?je:ke;function f(){we(d)}function l(){var e=function(e){return he(e)}(u.end(!0));t(e),u.destroy()}function d(){var t=s*o;s++,c(u,e,t,t+o,s<i?f:l)}d()}function Se(e){return a.hash(e)}function Pe(e,t){var n=w(e);return t?(delete n._rev_tree,Se(JSON.stringify(n))):u.v4().replace(/-/g,"").toLowerCase()}var Ae=u.v4;// mimic old import, only v4 is ever used elsewhere
252
+ t=t.substring(n,r)),e.appendBinary(t),i()}function Oe(e,t){var n="string"==typeof e,r=n?e.length:e.size,i=Math.min(32768,r),o=Math.ceil(r/i),s=0,u=n?new a:new a.ArrayBuffer,c=n?je:ke;function f(){we(d)}function l(){var e=function(e){return he(e)}(u.end(!0));t(e),u.destroy()}function d(){var t=s*i;s++,c(u,e,t,t+i,s<o?f:l)}d()}function Se(e){return a.hash(e)}function Pe(e,t){var n=w(e);return t?(delete n._rev_tree,Se(JSON.stringify(n))):u.v4().replace(/-/g,"").toLowerCase()}var Ae=u.v4;// mimic old import, only v4 is ever used elsewhere
253
253
  // We fetch all leafs of the revision tree, and sort them based on tree length
254
254
  // and whether they were deleted, undeleted documents with the longest revision
255
255
  // tree (most edits) win
256
256
  // The final sort algorithm is slightly documented in a sidebar here:
257
257
  // http://guide.couchdb.org/draft/conflicts.html
258
- function xe(e){for(var t,n,r,o,i=e.rev_tree.slice();o=i.pop();){var s=o.ids,u=s[2],a=o.pos;if(u.length)// non-leaf
259
- for(var c=0,f=u.length;c<f;c++)i.push({pos:a+1,ids:u[c]});else{var l=!!s[1].deleted,d=s[0];
258
+ function xe(e){for(var t,n,r,i,o=e.rev_tree.slice();i=o.pop();){var s=i.ids,u=s[2],a=i.pos;if(u.length)// non-leaf
259
+ for(var c=0,f=u.length;c<f;c++)o.push({pos:a+1,ids:u[c]});else{var l=!!s[1].deleted,d=s[0];
260
260
  // sort by deleted, then pos, then id
261
261
  t&&!(r!==l?r:n!==a?n<a:t<d)||(t=d,n=a,r=l)}}return n+"-"+t}
262
262
  // Pretty much all below can be combined into a higher order function to
263
263
  // traverse revisions
264
264
  // The return value from the callback will be passed as context to all
265
265
  // children of that node
266
- function qe(e,t){for(var n,r=e.slice();n=r.pop();)for(var o=n.pos,i=n.ids,s=i[2],u=t(0===s.length,o,i[0],n.ctx,i[1]),a=0,c=s.length;a<c;a++)r.push({pos:o+1,ids:s[a],ctx:u})}function Ee(e,t){return e.pos-t.pos}function Ce(e){var t=[];qe(e,(function(e,n,r,o,i){e&&t.push({rev:n+"-"+r,pos:n,opts:i})})),t.sort(Ee).reverse();for(var n=0,r=t.length;n<r;n++)delete t[n].pos;return t}
266
+ function qe(e,t){for(var n,r=e.slice();n=r.pop();)for(var i=n.pos,o=n.ids,s=o[2],u=t(0===s.length,i,o[0],n.ctx,o[1]),a=0,c=s.length;a<c;a++)r.push({pos:i+1,ids:s[a],ctx:u})}function Ee(e,t){return e.pos-t.pos}function Ce(e){var t=[];qe(e,(function(e,n,r,i,o){e&&t.push({rev:n+"-"+r,pos:n,opts:o})})),t.sort(Ee).reverse();for(var n=0,r=t.length;n<r;n++)delete t[n].pos;return t}
267
267
  // returns revs of all conflicts that is leaves such that
268
268
  // 1. are not deleted and
269
269
  // 2. are different than winning revision
270
- function Be(e){for(var t=xe(e),n=Ce(e.rev_tree),r=[],o=0,i=n.length;o<i;o++){var s=n[o];s.rev===t||s.opts.deleted||r.push(s.rev)}return r}
270
+ function Be(e){for(var t=xe(e),n=Ce(e.rev_tree),r=[],i=0,o=n.length;i<o;i++){var s=n[i];s.rev===t||s.opts.deleted||r.push(s.rev)}return r}
271
271
  // compact a tree by marking its non-leafs as missing,
272
272
  // and return a list of revs to delete
273
273
  // build up a list of all the paths to the leafs in this revision tree
274
- function $e(e){for(var t,n=[],r=e.slice();t=r.pop();){var o=t.pos,i=t.ids,s=i[0],u=i[1],a=i[2],c=0===a.length,f=t.history?t.history.slice():[];f.push({id:s,opts:u}),c&&n.push({pos:o+1-f.length,ids:f});for(var l=0,d=a.length;l<d;l++)r.push({pos:o+1,ids:a[l],history:f})}return n.reverse()}
274
+ function $e(e){for(var t,n=[],r=e.slice();t=r.pop();){var i=t.pos,o=t.ids,s=o[0],u=o[1],a=o[2],c=0===a.length,f=t.history?t.history.slice():[];f.push({id:s,opts:u}),c&&n.push({pos:i+1-f.length,ids:f});for(var l=0,d=a.length;l<d;l++)r.push({pos:i+1,ids:a[l],history:f})}return n.reverse()}
275
275
  // for a better overview of what this is doing, read:
276
276
  function Te(e,t){return e.pos-t.pos}
277
277
  // classic binary search
278
278
  // assuming the arr is sorted, insert the item in the proper place
279
- function De(e,t,n){var r=function(e,t,n){for(var r,o=0,i=e.length;o<i;)n(e[r=o+i>>>1],t)<0?o=r+1:i=r;return o}(e,t,n);e.splice(r,0,t)}
279
+ function De(e,t,n){var r=function(e,t,n){for(var r,i=0,o=e.length;i<o;)n(e[r=i+o>>>1],t)<0?i=r+1:o=r;return i}(e,t,n);e.splice(r,0,t)}
280
280
  // Turn a path as a flat array into a tree with a single branch.
281
281
  // If any should be stemmed from the beginning of the array, that's passed
282
282
  // in as the second argument
283
- function Le(e,t){for(var n,r,o=t,i=e.length;o<i;o++){var s=e[o],u=[s.id,s.opts,[]];r?(r[2].push(u),r=u):n=r=u}return n}
283
+ function Le(e,t){for(var n,r,i=t,o=e.length;i<o;i++){var s=e[i],u=[s.id,s.opts,[]];r?(r[2].push(u),r=u):n=r=u}return n}
284
284
  // compare the IDs of two trees
285
285
  function Ie(e,t){return e[0]<t[0]?-1:1}
286
286
  // Merge two trees together
287
287
  // The roots of tree1 and tree2 must be the same revision
288
- function Re(e,t){for(var n=[{tree1:e,tree2:t}],r=!1;n.length>0;){var o=n.pop(),i=o.tree1,s=o.tree2;(i[1].status||s[1].status)&&(i[1].status="available"===i[1].status||"available"===s[1].status?"available":"missing");for(var u=0;u<s[2].length;u++)if(i[2][0]){for(var a=!1,c=0;c<i[2].length;c++)i[2][c][0]===s[2][u][0]&&(n.push({tree1:i[2][c],tree2:s[2][u]}),a=!0);a||(r="new_branch",De(i[2],s[2][u],Ie))}else r="new_leaf",i[2][0]=s[2][u]}return{conflicts:r,tree:e}}function Me(e,t,n){var r,o=[],i=!1,s=!1;if(!e.length)return{tree:[t],conflicts:"new_leaf"};for(var u=0,a=e.length;u<a;u++){var c=e[u];if(c.pos===t.pos&&c.ids[0]===t.ids[0])
288
+ function Re(e,t){for(var n=[{tree1:e,tree2:t}],r=!1;n.length>0;){var i=n.pop(),o=i.tree1,s=i.tree2;(o[1].status||s[1].status)&&(o[1].status="available"===o[1].status||"available"===s[1].status?"available":"missing");for(var u=0;u<s[2].length;u++)if(o[2][0]){for(var a=!1,c=0;c<o[2].length;c++)o[2][c][0]===s[2][u][0]&&(n.push({tree1:o[2][c],tree2:s[2][u]}),a=!0);a||(r="new_branch",De(o[2],s[2][u],Ie))}else r="new_leaf",o[2][0]=s[2][u]}return{conflicts:r,tree:e}}function Me(e,t,n){var r,i=[],o=!1,s=!1;if(!e.length)return{tree:[t],conflicts:"new_leaf"};for(var u=0,a=e.length;u<a;u++){var c=e[u];if(c.pos===t.pos&&c.ids[0]===t.ids[0])
289
289
  // Paths start at the same position and have the same root, so they need
290
290
  // merged
291
- r=Re(c.ids,t.ids),o.push({pos:c.pos,ids:r.tree}),i=i||r.conflicts,s=!0;else if(!0!==n){
291
+ r=Re(c.ids,t.ids),i.push({pos:c.pos,ids:r.tree}),o=o||r.conflicts,s=!0;else if(!0!==n){
292
292
  // The paths start at a different position, take the earliest path and
293
293
  // traverse up until it as at the same point from root as the path we
294
294
  // want to merge. If the keys match we return the longer path with the
295
295
  // other merged After stemming we dont want to expand the trees
296
- var f=c.pos<t.pos?c:t,l=c.pos<t.pos?t:c,d=l.pos-f.pos,h=[],p=[];for(p.push({ids:f.ids,diff:d,parent:null,parentIdx:null});p.length>0;){var v=p.pop();if(0!==v.diff)for(var y=v.ids[2],g=0,_=y.length;g<_;g++)p.push({ids:y[g],diff:v.diff-1,parent:v.ids,parentIdx:g});else v.ids[0]===l.ids[0]&&h.push(v)}var m=h[0];m?(r=Re(m.ids,l.ids),m.parent[2][m.parentIdx]=r.tree,o.push({pos:f.pos,ids:f.ids}),i=i||r.conflicts,s=!0):o.push(c)}else o.push(c)}
296
+ var f=c.pos<t.pos?c:t,l=c.pos<t.pos?t:c,d=l.pos-f.pos,h=[],p=[];for(p.push({ids:f.ids,diff:d,parent:null,parentIdx:null});p.length>0;){var v=p.pop();if(0!==v.diff)for(var y=v.ids[2],g=0,_=y.length;g<_;g++)p.push({ids:y[g],diff:v.diff-1,parent:v.ids,parentIdx:g});else v.ids[0]===l.ids[0]&&h.push(v)}var m=h[0];m?(r=Re(m.ids,l.ids),m.parent[2][m.parentIdx]=r.tree,i.push({pos:f.pos,ids:f.ids}),o=o||r.conflicts,s=!0):i.push(c)}else i.push(c)}
297
297
  // We didnt find
298
- return s||o.push(t),o.sort(Te),{tree:o,conflicts:i||"internal_node"}}
298
+ return s||i.push(t),i.sort(Te),{tree:i,conflicts:o||"internal_node"}}
299
299
  // To ensure we dont grow the revision tree infinitely, we stem old revisions
300
- function Ne(e,t,n){var r=Me(e,t),o=function(e,t){for(
300
+ function Ne(e,t,n){var r=Me(e,t),i=function(e,t){for(
301
301
  // First we break out the tree into a complete list of root to leaf paths
302
- var n,r,o=$e(e),i=0,s=o.length;i<s;i++){
302
+ var n,r,i=$e(e),o=0,s=i.length;o<s;o++){
303
303
  // Then for each path, we cut off the start of the path based on the
304
304
  // `depth` to stem to, and generate a new set of flat trees
305
- var u,a=o[i],c=a.ids;if(c.length>t){
305
+ var u,a=i[o],c=a.ids;if(c.length>t){
306
306
  // only do the stemming work if we actually need to stem
307
307
  n||(n={});var f=c.length-t;u={pos:a.pos+f,ids:Le(c,f)};for(var l=0;l<f;l++){var d=a.pos+l+"-"+c[l].id;n[d]=!0}}else// no need to actually stem
308
308
  u={pos:a.pos,ids:Le(c,0)};
@@ -312,19 +312,19 @@ r=r?Me(r,u,!0).tree:[u]}
312
312
  // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed
313
313
  return n&&qe(r,(function(e,t,r){
314
314
  // some revisions may have been removed in a branch but not in another
315
- delete n[t+"-"+r]})),{tree:r,revs:n?Object.keys(n):[]}}(r.tree,n);return{tree:o.tree,stemmedRevs:o.revs,conflicts:r.conflicts}}
315
+ delete n[t+"-"+r]})),{tree:r,revs:n?Object.keys(n):[]}}(r.tree,n);return{tree:i.tree,stemmedRevs:i.revs,conflicts:r.conflicts}}
316
316
  // return true if a rev exists in the rev tree, false otherwise
317
317
  function Ke(e){return e.ids}
318
318
  // check if a specific revision of a doc has been deleted
319
319
  // - metadata: the metadata object from the doc store
320
320
  // - rev: (optional) the revision to check. defaults to winning revision
321
- function Ue(e,t){t||(t=xe(e));for(var n,r=t.substring(t.indexOf("-")+1),o=e.rev_tree.map(Ke);n=o.pop();){if(n[0]===r)return!!n[1].deleted;o=o.concat(n[2])}}function Fe(e){return/^_local/.test(e)}
321
+ function Ue(e,t){t||(t=xe(e));for(var n,r=t.substring(t.indexOf("-")+1),i=e.rev_tree.map(Ke);n=i.pop();){if(n[0]===r)return!!n[1].deleted;i=i.concat(n[2])}}function Fe(e){return/^_local/.test(e)}
322
322
  // returns the current leaf node for a given revision
323
- function Je(e,t,n){d.call(this);var r=this;this.db=e;var o=(t=t?w(t):{}).complete=k((function(t,n){var o,s;t?(s="error",("listenerCount"in(o=r)?o.listenerCount(s):d.listenerCount(o,s))>0&&r.emit("error",t)):r.emit("complete",n),r.removeAllListeners(),e.removeListener("destroyed",i)}));function i(){r.cancel()}n&&(r.on("complete",(function(e){n(null,e)})),r.on("error",n)),e.once("destroyed",i),t.onChange=function(e,t,n){
323
+ function Je(e,t,n){d.call(this);var r=this;this.db=e;var i=(t=t?w(t):{}).complete=k((function(t,n){var i,s;t?(s="error",("listenerCount"in(i=r)?i.listenerCount(s):d.listenerCount(i,s))>0&&r.emit("error",t)):r.emit("complete",n),r.removeAllListeners(),e.removeListener("destroyed",o)}));function o(){r.cancel()}n&&(r.on("complete",(function(e){n(null,e)})),r.on("error",n)),e.once("destroyed",o),t.onChange=function(e,t,n){
324
324
  /* istanbul ignore if */
325
325
  r.isCancelled||function(e,t,n,r){
326
326
  // isolate try/catches to avoid V8 deoptimizations
327
- try{e.emit("change",t,n,r)}catch(e){C("error",'Error in .on("change", function):',e)}}(r,e,t,n)};var s=new Promise((function(e,n){t.complete=function(t,r){t?n(t):e(r)}}));r.once("cancel",(function(){e.removeListener("destroyed",i),t.complete(null,{status:"cancelled"})})),this.then=s.then.bind(s),this.catch=s.catch.bind(s),this.then((function(e){o(null,e)}),o),e.taskqueue.isReady?r.validateChanges(t):e.taskqueue.addTask((function(e){e?t.complete(e):r.isCancelled?r.emit("cancel"):r.validateChanges(t)}))}function Ve(e,t,n){var r=[{rev:e._rev}];"all_docs"===n.style&&(r=Ce(t.rev_tree).map((function(e){return{rev:e.rev}})));var o={id:t.id,changes:r,doc:e};return Ue(t,e._rev)&&(o.deleted=!0),n.conflicts&&(o.doc._conflicts=Be(t),o.doc._conflicts.length||delete o.doc._conflicts),o}
327
+ try{e.emit("change",t,n,r)}catch(e){C("error",'Error in .on("change", function):',e)}}(r,e,t,n)};var s=new Promise((function(e,n){t.complete=function(t,r){t?n(t):e(r)}}));r.once("cancel",(function(){e.removeListener("destroyed",o),t.complete(null,{status:"cancelled"})})),this.then=s.then.bind(s),this.catch=s.catch.bind(s),this.then((function(e){i(null,e)}),i),e.taskqueue.isReady?r.validateChanges(t):e.taskqueue.addTask((function(e){e?t.complete(e):r.isCancelled?r.emit("cancel"):r.validateChanges(t)}))}function Ve(e,t,n){var r=[{rev:e._rev}];"all_docs"===n.style&&(r=Ce(t.rev_tree).map((function(e){return{rev:e.rev}})));var i={id:t.id,changes:r,doc:e};return Ue(t,e._rev)&&(i.deleted=!0),n.conflicts&&(i.doc._conflicts=Be(t),i.doc._conflicts.length||delete i.doc._conflicts),i}
328
328
  /*
329
329
  * A generic pouch adapter
330
330
  */function ze(e,t){return e<t?-1:e>t?1:0}
@@ -347,12 +347,12 @@ for(var e in d.call(this),Ye.prototype)"function"==typeof this[e]&&(this[e]=this
347
347
  /* istanbul ignore if */
348
348
  if(!(this instanceof Xe))return new Xe(e,t);var n=this;if(t=t||{},e&&"object"==typeof e&&(e=(t=e).name,delete t.name),void 0===t.deterministic_revs&&(t.deterministic_revs=!0),this.__opts=t=w(t),n.auto_compaction=t.auto_compaction,n.prefix=Xe.prefix,"string"!=typeof e)throw new Error("Missing/invalid DB name");var r=function(e,t){var n=e.match(/([a-z-]*):\/\/(.*)/);if(n)
349
349
  // the http adapter expects the fully qualified name
350
- return{name:/https?/.test(n[1])?n[1]+"://"+n[2]:n[2],adapter:n[1]};var r=Xe.adapters,o=Xe.preferredAdapters,i=Xe.prefix,s=t.adapter;if(!s)// automatically determine adapter
351
- for(var u=0;u<o.length&&"idb"===(s=o[u])&&"websql"in r&&q()&&localStorage["_pouch__websqldb_"+i+e];++u)
350
+ return{name:/https?/.test(n[1])?n[1]+"://"+n[2]:n[2],adapter:n[1]};var r=Xe.adapters,i=Xe.preferredAdapters,o=Xe.prefix,s=t.adapter;if(!s)// automatically determine adapter
351
+ for(var u=0;u<i.length&&"idb"===(s=i[u])&&"websql"in r&&q()&&localStorage["_pouch__websqldb_"+o+e];++u)
352
352
  // log it, because this can be confusing during development
353
353
  C("log",'PouchDB is downgrading "'+e+'" to WebSQL to avoid data loss, because it was already opened with WebSQL.');var a=r[s];
354
354
  // if adapter is invalid, then an error will be thrown later
355
- return{name:a&&"use_prefix"in a&&!a.use_prefix?e:i+e,adapter:s}}
355
+ return{name:a&&"use_prefix"in a&&!a.use_prefix?e:o+e,adapter:s}}
356
356
  // OK, so here's the deal. Consider this code:
357
357
  // var db1 = new PouchDB('foo');
358
358
  // var db2 = new PouchDB('foo');
@@ -371,32 +371,32 @@ l(Je,d),Je.prototype.cancel=function(){this.isCancelled=!0,this.db.taskqueue.isR
371
371
  /* istanbul ignore else */){if(Xe._changesFilterPlugin){if(Xe._changesFilterPlugin.normalize(e),Xe._changesFilterPlugin.shouldFilter(this,e))return Xe._changesFilterPlugin.filter(this,e)}else["doc_ids","filter","selector","view"].forEach((function(t){t in e&&C("warn",'The "'+t+'" option was passed in to changes/replicate, but pouchdb-changes-filter plugin is not installed, so it was ignored. Please install the plugin to enable filtering.')}));"descending"in e||(e.descending=!1),
372
372
  // 0 and 1 should return 1 document
373
373
  e.limit=0===e.limit?1:e.limit,e.complete=n;var r=this.db._changes(e);
374
- /* istanbul ignore else */if(r&&"function"==typeof r.cancel){var o=t.cancel;t.cancel=f((function(e){r.cancel(),o.apply(this,e)}))}}else this.db.info().then((function(r){
374
+ /* istanbul ignore else */if(r&&"function"==typeof r.cancel){var i=t.cancel;t.cancel=f((function(e){r.cancel(),i.apply(this,e)}))}}else this.db.info().then((function(r){
375
375
  /* istanbul ignore if */
376
- t.isCancelled?n(null,{status:"cancelled"}):(e.since=r.update_seq,t.doChanges(e))}),n)},l(Ye,d),Ye.prototype.post=O("post",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(H(G));this.bulkDocs({docs:[e]},t,Ge(n,e._id))})),Ye.prototype.put=O("put",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(H(G));if(te(e._id),Fe(e._id)&&"function"==typeof this._putLocal)return e._deleted?this._removeLocal(e,n):this._putLocal(e,n);var r,o,i,s,u=this;function a(n){"function"==typeof u._put&&!1!==t.new_edits?u._put(e,t,n):u.bulkDocs({docs:[e]},t,Ge(n,e._id))}t.force&&e._rev?(o=(r=e._rev.split("-"))[1],i=parseInt(r[0],10)+1,s=Pe(),e._revisions={start:i,ids:[s,o]},e._rev=i+"-"+s,t.new_edits=!1,a((function(t){var r=t?null:{ok:!0,id:e._id,rev:e._rev};n(t,r)}))):a(n)})),Ye.prototype.putAttachment=O("putAttachment",(function(e,t,n,r,o){var i=this;function s(e){var n="_rev"in e?parseInt(e._rev,10):0;return e._attachments=e._attachments||{},e._attachments[t]={content_type:o,data:r,revpos:++n},i.put(e)}return"function"==typeof o&&(o=r,r=n,n=null),
376
+ t.isCancelled?n(null,{status:"cancelled"}):(e.since=r.update_seq,t.doChanges(e))}),n)},l(Ye,d),Ye.prototype.post=O("post",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(H(G));this.bulkDocs({docs:[e]},t,Ge(n,e._id))})),Ye.prototype.put=O("put",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(H(G));if(te(e._id),Fe(e._id)&&"function"==typeof this._putLocal)return e._deleted?this._removeLocal(e,n):this._putLocal(e,n);var r,i,o,s,u=this;function a(n){"function"==typeof u._put&&!1!==t.new_edits?u._put(e,t,n):u.bulkDocs({docs:[e]},t,Ge(n,e._id))}t.force&&e._rev?(i=(r=e._rev.split("-"))[1],o=parseInt(r[0],10)+1,s=Pe(),e._revisions={start:o,ids:[s,i]},e._rev=o+"-"+s,t.new_edits=!1,a((function(t){var r=t?null:{ok:!0,id:e._id,rev:e._rev};n(t,r)}))):a(n)})),Ye.prototype.putAttachment=O("putAttachment",(function(e,t,n,r,i){var o=this;function s(e){var n="_rev"in e?parseInt(e._rev,10):0;return e._attachments=e._attachments||{},e._attachments[t]={content_type:i,data:r,revpos:++n},o.put(e)}return"function"==typeof i&&(i=r,r=n,n=null),
377
377
  // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267
378
378
  /* istanbul ignore if */
379
- void 0===o&&(o=r,r=n,n=null),o||C("warn","Attachment",t,"on document",e,"is missing content_type"),i.get(e).then((function(e){if(e._rev!==n)throw H(R);return s(e)}),(function(t){
379
+ void 0===i&&(i=r,r=n,n=null),i||C("warn","Attachment",t,"on document",e,"is missing content_type"),o.get(e).then((function(e){if(e._rev!==n)throw H(R);return s(e)}),(function(t){
380
380
  // create new doc
381
381
  /* istanbul ignore else */
382
- if(t.reason===I.message)return s({_id:e});throw t}))})),Ye.prototype.removeAttachment=O("removeAttachment",(function(e,t,n,r){var o=this;o.get(e,(function(e,i){
382
+ if(t.reason===I.message)return s({_id:e});throw t}))})),Ye.prototype.removeAttachment=O("removeAttachment",(function(e,t,n,r){var i=this;i.get(e,(function(e,o){
383
383
  /* istanbul ignore if */
384
- if(e)r(e);else if(i._rev===n){
384
+ if(e)r(e);else if(o._rev===n){
385
385
  /* istanbul ignore if */
386
- if(!i._attachments)return r();delete i._attachments[t],0===Object.keys(i._attachments).length&&delete i._attachments,o.put(i,r)}else r(H(R))}))})),Ye.prototype.remove=O("remove",(function(e,t,n,r){var o;"string"==typeof t?(
386
+ if(!o._attachments)return r();delete o._attachments[t],0===Object.keys(o._attachments).length&&delete o._attachments,i.put(o,r)}else r(H(R))}))})),Ye.prototype.remove=O("remove",(function(e,t,n,r){var i;"string"==typeof t?(
387
387
  // id, rev, opts, callback style
388
- o={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
388
+ i={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
389
389
  // doc, opts, callback style
390
- o=e,"function"==typeof t?(r=t,n={}):(r=n,n=t)),(n=n||{}).was_delete=!0;var i={_id:o._id,_rev:o._rev||n.rev,_deleted:!0};if(Fe(i._id)&&"function"==typeof this._removeLocal)return this._removeLocal(o,r);this.bulkDocs({docs:[i]},n,Ge(r,i._id))})),Ye.prototype.revsDiff=O("revsDiff",(function(e,t,n){"function"==typeof t&&(n=t,t={});var r=Object.keys(e);if(!r.length)return n(null,{});var o=0,s=new i;function u(e,t){s.has(e)||s.set(e,{missing:[]}),s.get(e).missing.push(t)}r.map((function(t){this._getRevisionTree(t,(function(i,a){if(i&&404===i.status&&"missing"===i.message)s.set(t,{missing:e[t]});else{if(i)
390
+ i=e,"function"==typeof t?(r=t,n={}):(r=n,n=t)),(n=n||{}).was_delete=!0;var o={_id:i._id,_rev:i._rev||n.rev,_deleted:!0};if(Fe(o._id)&&"function"==typeof this._removeLocal)return this._removeLocal(i,r);this.bulkDocs({docs:[o]},n,Ge(r,o._id))})),Ye.prototype.revsDiff=O("revsDiff",(function(e,t,n){"function"==typeof t&&(n=t,t={});var r=Object.keys(e);if(!r.length)return n(null,{});var i=0,s=new o;function u(e,t){s.has(e)||s.set(e,{missing:[]}),s.get(e).missing.push(t)}r.map((function(t){this._getRevisionTree(t,(function(o,a){if(o&&404===o.status&&"missing"===o.message)s.set(t,{missing:e[t]});else{if(o)
391
391
  /* istanbul ignore next */
392
- return n(i);!function(t,n){
392
+ return n(o);!function(t,n){
393
393
  // Is this fast enough? Maybe we should switch to a set simulated by a map
394
- var r=e[t].slice(0);qe(n,(function(e,n,o,i,s){var a=n+"-"+o,c=r.indexOf(a);-1!==c&&(r.splice(c,1),
394
+ var r=e[t].slice(0);qe(n,(function(e,n,i,o,s){var a=n+"-"+i,c=r.indexOf(a);-1!==c&&(r.splice(c,1),
395
395
  /* istanbul ignore if */
396
396
  "available"!==s.status&&u(t,a))})),
397
397
  // Traversing the tree is synchronous, so now `missingForId` contains
398
398
  // revisions that were not found in the tree
399
- r.forEach((function(e){u(t,e)}))}(t,a)}if(++o===r.length){
399
+ r.forEach((function(e){u(t,e)}))}(t,a)}if(++i===r.length){
400
400
  // convert LazyMap to object
401
401
  var c={};return s.forEach((function(e,t){c[t]=e})),n(null,c)}}))}),this)})),
402
402
  // _bulk_get API for faster replication, as described in
@@ -410,35 +410,35 @@ Ye.prototype.bulkGet=O("bulkGet",(function(e,t){x(this,e,t)})),
410
410
  // compact one document and fire callback
411
411
  // by compacting we mean removing all revisions which
412
412
  // are further from the leaf in revision tree than max_height
413
- Ye.prototype.compactDocument=O("compactDocument",(function(e,t,n){var r=this;this._getRevisionTree(e,(function(o,i){
413
+ Ye.prototype.compactDocument=O("compactDocument",(function(e,t,n){var r=this;this._getRevisionTree(e,(function(i,o){
414
414
  /* istanbul ignore if */
415
- if(o)return n(o);var s=function(e){var t={},n=[];return qe(e,(function(e,r,o,i){var s=r+"-"+o;return e&&(t[s]=0),void 0!==i&&n.push({from:i,to:s}),s})),n.reverse(),n.forEach((function(e){void 0===t[e.from]?t[e.from]=1+t[e.to]:t[e.from]=Math.min(t[e.from],1+t[e.to])})),t}(i),u=[],a=[];Object.keys(s).forEach((function(e){s[e]>t&&u.push(e)})),qe(i,(function(e,t,n,r,o){var i=t+"-"+n;"available"===o.status&&-1!==u.indexOf(i)&&a.push(i)})),r._doCompaction(e,a,n)}))})),
415
+ if(i)return n(i);var s=function(e){var t={},n=[];return qe(e,(function(e,r,i,o){var s=r+"-"+i;return e&&(t[s]=0),void 0!==o&&n.push({from:o,to:s}),s})),n.reverse(),n.forEach((function(e){void 0===t[e.from]?t[e.from]=1+t[e.to]:t[e.from]=Math.min(t[e.from],1+t[e.to])})),t}(o),u=[],a=[];Object.keys(s).forEach((function(e){s[e]>t&&u.push(e)})),qe(o,(function(e,t,n,r,i){var o=t+"-"+n;"available"===i.status&&-1!==u.indexOf(o)&&a.push(o)})),r._doCompaction(e,a,n)}))})),
416
416
  // compact the whole database using single document
417
417
  // compaction
418
- Ye.prototype.compact=O("compact",(function(e,t){"function"==typeof e&&(t=e,e={});var n=this;e=e||{},n._compactionQueue=n._compactionQueue||[],n._compactionQueue.push({opts:e,callback:t}),1===n._compactionQueue.length&&We(n)})),Ye.prototype._compact=function(e,t){var n=this,r={return_docs:!1,last_seq:e.last_seq||0},o=[];n.changes(r).on("change",(function(e){o.push(n.compactDocument(e.id,0))})).on("complete",(function(e){var r=e.last_seq;Promise.all(o).then((function(){return le(n,"_local/compaction",(function(e){return(!e.last_seq||e.last_seq<r)&&(e.last_seq=r,e)}))})).then((function(){t(null,{ok:!0})})).catch(t)})).on("error",t)},
418
+ Ye.prototype.compact=O("compact",(function(e,t){"function"==typeof e&&(t=e,e={});var n=this;e=e||{},n._compactionQueue=n._compactionQueue||[],n._compactionQueue.push({opts:e,callback:t}),1===n._compactionQueue.length&&We(n)})),Ye.prototype._compact=function(e,t){var n=this,r={return_docs:!1,last_seq:e.last_seq||0},i=[];n.changes(r).on("change",(function(e){i.push(n.compactDocument(e.id,0))})).on("complete",(function(e){var r=e.last_seq;Promise.all(i).then((function(){return le(n,"_local/compaction",(function(e){return(!e.last_seq||e.last_seq<r)&&(e.last_seq=r,e)}))})).then((function(){t(null,{ok:!0})})).catch(t)})).on("error",t)},
419
419
  /* Begin api wrappers. Specific functionality to storage belongs in the
420
420
  _[method] */
421
- Ye.prototype.get=O("get",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"string"!=typeof e)return n(H(M));if(Fe(e)&&"function"==typeof this._getLocal)return this._getLocal(e,n);var r=[],o=this;function i(){var i=[],s=r.length;
422
- /* istanbul ignore if */if(!s)return n(null,i);
421
+ Ye.prototype.get=O("get",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"string"!=typeof e)return n(H(M));if(Fe(e)&&"function"==typeof this._getLocal)return this._getLocal(e,n);var r=[],i=this;function o(){var o=[],s=r.length;
422
+ /* istanbul ignore if */if(!s)return n(null,o);
423
423
  // order with open_revs is unspecified
424
- r.forEach((function(r){o.get(e,{rev:r,revs:t.revs,latest:t.latest,attachments:t.attachments,binary:t.binary},(function(e,t){if(e)i.push({missing:r});else{for(
424
+ r.forEach((function(r){i.get(e,{rev:r,revs:t.revs,latest:t.latest,attachments:t.attachments,binary:t.binary},(function(e,t){if(e)o.push({missing:r});else{for(
425
425
  // using latest=true can produce duplicates
426
- var o,u=0,a=i.length;u<a;u++)if(i[u].ok&&i[u].ok._rev===t._rev){o=!0;break}o||i.push({ok:t})}--s||n(null,i)}))}))}if(!t.open_revs)return this._get(e,t,(function(r,i){if(r)return r.docId=e,n(r);var s=i.doc,u=i.metadata,a=i.ctx;if(t.conflicts){var c=Be(u);c.length&&(s._conflicts=c)}if(Ue(u,s._rev)&&(s._deleted=!0),t.revs||t.revs_info){for(var f=s._rev.split("-"),l=parseInt(f[0],10),d=f[1],h=$e(u.rev_tree),p=null,v=0;v<h.length;v++){var y=h[v],g=y.ids.map((function(e){return e.id})).indexOf(d);(g===l-1||!p&&-1!==g)&&(p=y)}
426
+ var i,u=0,a=o.length;u<a;u++)if(o[u].ok&&o[u].ok._rev===t._rev){i=!0;break}i||o.push({ok:t})}--s||n(null,o)}))}))}if(!t.open_revs)return this._get(e,t,(function(r,o){if(r)return r.docId=e,n(r);var s=o.doc,u=o.metadata,a=o.ctx;if(t.conflicts){var c=Be(u);c.length&&(s._conflicts=c)}if(Ue(u,s._rev)&&(s._deleted=!0),t.revs||t.revs_info){for(var f=s._rev.split("-"),l=parseInt(f[0],10),d=f[1],h=$e(u.rev_tree),p=null,v=0;v<h.length;v++){var y=h[v],g=y.ids.map((function(e){return e.id})).indexOf(d);(g===l-1||!p&&-1!==g)&&(p=y)}
427
427
  /* istanbul ignore if */if(!p)return(r=new Error("invalid rev tree")).docId=e,n(r);var _=p.ids.map((function(e){return e.id})).indexOf(s._rev.split("-")[1])+1,m=p.ids.length-_;if(p.ids.splice(_,m),p.ids.reverse(),t.revs&&(s._revisions={start:p.pos+p.ids.length-1,ids:p.ids.map((function(e){return e.id}))}),t.revs_info){var b=p.pos+p.ids.length;s._revs_info=p.ids.map((function(e){return{rev:--b+"-"+e.id,status:e.opts.status}}))}}if(t.attachments&&s._attachments){var w=s._attachments,k=Object.keys(w).length;if(0===k)return n(null,s);Object.keys(w).forEach((function(e){this._getAttachment(s._id,e,w[e],{
428
428
  // Previously the revision handling was done in adapter.js
429
429
  // getAttachment, however since idb-next doesnt we need to
430
430
  // pass the rev through
431
- rev:s._rev,binary:t.binary,ctx:a},(function(t,r){var o=s._attachments[e];o.data=r,delete o.stub,delete o.length,--k||n(null,s)}))}),o)}else{if(s._attachments)for(var j in s._attachments)
431
+ rev:s._rev,binary:t.binary,ctx:a},(function(t,r){var i=s._attachments[e];i.data=r,delete i.stub,delete i.length,--k||n(null,s)}))}),i)}else{if(s._attachments)for(var j in s._attachments)
432
432
  /* istanbul ignore else */
433
433
  s._attachments.hasOwnProperty(j)&&(s._attachments[j].stub=!0);n(null,s)}}));if("all"===t.open_revs)this._getRevisionTree(e,(function(e,t){
434
434
  /* istanbul ignore if */
435
- if(e)return n(e);r=Ce(t).map((function(e){return e.rev})),i()}));else{if(!Array.isArray(t.open_revs))return n(H(U,"function_clause"));r=t.open_revs;for(var s=0;s<r.length;s++){var u=r[s];
435
+ if(e)return n(e);r=Ce(t).map((function(e){return e.rev})),o()}));else{if(!Array.isArray(t.open_revs))return n(H(U,"function_clause"));r=t.open_revs;for(var s=0;s<r.length;s++){var u=r[s];
436
436
  // looks like it's the only thing couchdb checks
437
- if("string"!=typeof u||!/^\d+-/.test(u))return n(H(W))}i()}})),
437
+ if("string"!=typeof u||!/^\d+-/.test(u))return n(H(W))}o()}})),
438
438
  // TODO: I dont like this, it forces an extra read for every
439
439
  // attachment read and enforces a confusing api between
440
440
  // adapter.js and the adapter implementation
441
- Ye.prototype.getAttachment=O("getAttachment",(function(e,t,n,r){var o=this;n instanceof Function&&(r=n,n={}),this._get(e,n,(function(i,s){return i?r(i):s.doc._attachments&&s.doc._attachments[t]?(n.ctx=s.ctx,n.binary=!0,void o._getAttachment(e,t,s.doc._attachments[t],n,r)):r(H(I))}))})),Ye.prototype.allDocs=O("allDocs",(function(e,t){if("function"==typeof e&&(t=e,e={}),e.skip=void 0!==e.skip?e.skip:0,e.start_key&&(e.startkey=e.start_key),e.end_key&&(e.endkey=e.end_key),"keys"in e){if(!Array.isArray(e.keys))return t(new TypeError("options.keys must be an array"));var n=["startkey","endkey","key"].filter((function(t){return t in e}))[0];if(n)return void t(H(J,"Query parameter `"+n+"` is not compatible with multi-get"));if(!ne(this)&&(function(e){var t="limit"in e?e.keys.slice(e.skip,e.limit+e.skip):e.skip>0?e.keys.slice(e.skip):e.keys;e.keys=t,e.skip=0,delete e.limit,e.descending&&(t.reverse(),e.descending=!1)}(e),0===e.keys.length))return this._allDocs({limit:0},t)}return this._allDocs(e,t)})),Ye.prototype.changes=function(e,t){return"function"==typeof e&&(t=e,e={}),
441
+ Ye.prototype.getAttachment=O("getAttachment",(function(e,t,n,r){var i=this;n instanceof Function&&(r=n,n={}),this._get(e,n,(function(o,s){return o?r(o):s.doc._attachments&&s.doc._attachments[t]?(n.ctx=s.ctx,n.binary=!0,void i._getAttachment(e,t,s.doc._attachments[t],n,r)):r(H(I))}))})),Ye.prototype.allDocs=O("allDocs",(function(e,t){if("function"==typeof e&&(t=e,e={}),e.skip=void 0!==e.skip?e.skip:0,e.start_key&&(e.startkey=e.start_key),e.end_key&&(e.endkey=e.end_key),"keys"in e){if(!Array.isArray(e.keys))return t(new TypeError("options.keys must be an array"));var n=["startkey","endkey","key"].filter((function(t){return t in e}))[0];if(n)return void t(H(J,"Query parameter `"+n+"` is not compatible with multi-get"));if(!ne(this)&&(function(e){var t="limit"in e?e.keys.slice(e.skip,e.limit+e.skip):e.skip>0?e.keys.slice(e.skip):e.keys;e.keys=t,e.skip=0,delete e.limit,e.descending&&(t.reverse(),e.descending=!1)}(e),0===e.keys.length))return this._allDocs({limit:0},t)}return this._allDocs(e,t)})),Ye.prototype.changes=function(e,t){return"function"==typeof e&&(t=e,e={}),
442
442
  // By default set return_docs to false if the caller has opts.live = true,
443
443
  // this will prevent us from collecting the set of changes indefinitely
444
444
  // resulting in growing memory
@@ -446,13 +446,13 @@ Ye.prototype.getAttachment=O("getAttachment",(function(e,t,n,r){var o=this;n ins
446
446
  // assume we know better than the adapter, unless it informs us
447
447
  r.db_name=r.db_name||t.name,r.auto_compaction=!(!t.auto_compaction||ne(t)),r.adapter=t.adapter,e(null,r)}))})),Ye.prototype.id=O("id",(function(e){return this._id(e)})),
448
448
  /* istanbul ignore next */
449
- Ye.prototype.type=function(){return"function"==typeof this._type?this._type():this.adapter},Ye.prototype.bulkDocs=O("bulkDocs",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),t=t||{},Array.isArray(e)&&(e={docs:e}),!e||!e.docs||!Array.isArray(e.docs))return n(H(L));for(var r=0;r<e.docs.length;++r)if("object"!=typeof e.docs[r]||Array.isArray(e.docs[r]))return n(H(G));var o;if(e.docs.forEach((function(e){e._attachments&&Object.keys(e._attachments).forEach((function(t){o=o||function(e){return"_"===e.charAt(0)&&e+" is not a valid attachment name, attachment names cannot start with '_'"}(t),e._attachments[t].content_type||C("warn","Attachment",t,"on document",e._id,"is missing content_type")}))})),o)return n(H(z,o));"new_edits"in t||(t.new_edits=!("new_edits"in e)||e.new_edits);var i=this;t.new_edits||ne(i)||
449
+ Ye.prototype.type=function(){return"function"==typeof this._type?this._type():this.adapter},Ye.prototype.bulkDocs=O("bulkDocs",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),t=t||{},Array.isArray(e)&&(e={docs:e}),!e||!e.docs||!Array.isArray(e.docs))return n(H(L));for(var r=0;r<e.docs.length;++r)if("object"!=typeof e.docs[r]||Array.isArray(e.docs[r]))return n(H(G));var i;if(e.docs.forEach((function(e){e._attachments&&Object.keys(e._attachments).forEach((function(t){i=i||function(e){return"_"===e.charAt(0)&&e+" is not a valid attachment name, attachment names cannot start with '_'"}(t),e._attachments[t].content_type||C("warn","Attachment",t,"on document",e._id,"is missing content_type")}))})),i)return n(H(z,i));"new_edits"in t||(t.new_edits=!("new_edits"in e)||e.new_edits);var o=this;t.new_edits||ne(o)||
450
450
  // ensure revisions of the same doc are sorted, so that
451
451
  // the local adapter processes them correctly (#2935)
452
452
  e.docs.sort(Qe),function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n._deleted)delete n._attachments;// ignore atts for deleted docs
453
453
  else if(n._attachments)for(
454
454
  // filter out extraneous keys from _attachments
455
- var r=Object.keys(n._attachments),o=0;o<r.length;o++){var i=r[o];n._attachments[i]=S(n._attachments[i],["data","digest","content_type","length","revpos","stub"])}}}(e.docs);
455
+ var r=Object.keys(n._attachments),i=0;i<r.length;i++){var o=r[i];n._attachments[o]=S(n._attachments[o],["data","digest","content_type","length","revpos","stub"])}}}(e.docs);
456
456
  // in the case of conflicts, we want to return the _ids to the user
457
457
  // however, the underlying adapter may destroy the docs array, so
458
458
  // create a copy here
@@ -460,29 +460,29 @@ var s=e.docs.map((function(e){return e._id}));return this._bulkDocs(e,t,(functio
460
460
  // add ids for error/conflict responses (not required for CouchDB)
461
461
  if(t.new_edits||(
462
462
  // this is what couch does when new_edits is false
463
- r=r.filter((function(e){return e.error}))),!ne(i))for(var o=0,u=r.length;o<u;o++)r[o].id=r[o].id||s[o];n(null,r)}))})),Ye.prototype.registerDependentDatabase=O("registerDependentDatabase",(function(e,t){var n=new this.constructor(e,this.__opts);le(this,"_local/_pouch_dependentDbs",(function(t){return t.dependentDbs=t.dependentDbs||{},!t.dependentDbs[e]&&(t.dependentDbs[e]=!0,t)})).then((function(){t(null,{db:n})})).catch(t)})),Ye.prototype.destroy=O("destroy",(function(e,t){"function"==typeof e&&(t=e,e={});var n=this,r=!("use_prefix"in n)||n.use_prefix;function o(){
463
+ r=r.filter((function(e){return e.error}))),!ne(o))for(var i=0,u=r.length;i<u;i++)r[i].id=r[i].id||s[i];n(null,r)}))})),Ye.prototype.registerDependentDatabase=O("registerDependentDatabase",(function(e,t){var n=new this.constructor(e,this.__opts);le(this,"_local/_pouch_dependentDbs",(function(t){return t.dependentDbs=t.dependentDbs||{},!t.dependentDbs[e]&&(t.dependentDbs[e]=!0,t)})).then((function(){t(null,{db:n})})).catch(t)})),Ye.prototype.destroy=O("destroy",(function(e,t){"function"==typeof e&&(t=e,e={});var n=this,r=!("use_prefix"in n)||n.use_prefix;function i(){
464
464
  // call destroy method of the particular adaptor
465
465
  n._destroy(e,(function(e,r){if(e)return t(e);n._destroyed=!0,n.emit("destroyed"),t(null,r||{ok:!0})}))}if(ne(n))
466
466
  // no need to check for dependent DBs if it's a remote DB
467
- return o();n.get("_local/_pouch_dependentDbs",(function(e,i){if(e)
467
+ return i();n.get("_local/_pouch_dependentDbs",(function(e,o){if(e)
468
468
  /* istanbul ignore if */
469
- return 404!==e.status?t(e):o();var s=i.dependentDbs,u=n.constructor,a=Object.keys(s).map((function(e){
469
+ return 404!==e.status?t(e):i();var s=o.dependentDbs,u=n.constructor,a=Object.keys(s).map((function(e){
470
470
  // use_prefix is only false in the browser
471
471
  /* istanbul ignore next */
472
- var t=r?e.replace(new RegExp("^"+u.prefix),""):e;return new u(t,n.__opts).destroy()}));Promise.all(a).then(o,t)}))})),He.prototype.execute=function(){var e;if(this.failed)for(;e=this.queue.shift();)e(this.failed);else for(;e=this.queue.shift();)e()},He.prototype.fail=function(e){this.failed=e,this.execute()},He.prototype.ready=function(e){this.isReady=!0,this.db=e,this.execute()},He.prototype.addTask=function(e){this.queue.push(e),this.failed&&this.execute()},l(Xe,Ye);var Ze="undefined"!=typeof AbortController?AbortController:function(){return{abort:function(){}}},et=fetch,tt=Headers;Xe.adapters={},Xe.preferredAdapters=[],Xe.prefix="_pouch_";var nt=new d;
472
+ var t=r?e.replace(new RegExp("^"+u.prefix),""):e;return new u(t,n.__opts).destroy()}));Promise.all(a).then(i,t)}))})),He.prototype.execute=function(){var e;if(this.failed)for(;e=this.queue.shift();)e(this.failed);else for(;e=this.queue.shift();)e()},He.prototype.fail=function(e){this.failed=e,this.execute()},He.prototype.ready=function(e){this.isReady=!0,this.db=e,this.execute()},He.prototype.addTask=function(e){this.queue.push(e),this.failed&&this.execute()},l(Xe,Ye);var Ze="undefined"!=typeof AbortController?AbortController:function(){return{abort:function(){}}},et=fetch,tt=Headers;Xe.adapters={},Xe.preferredAdapters=[],Xe.prefix="_pouch_";var nt=new d;
473
473
  // this would just be "return doc[field]", but fields
474
474
  // can be "deep" due to dot notation
475
- function rt(e,t){for(var n=e,r=0,o=t.length;r<o&&(n=n[t[r]]);r++);return n}
475
+ function rt(e,t){for(var n=e,r=0,i=t.length;r<i&&(n=n[t[r]]);r++);return n}
476
476
  // Converts a string in dot notation to an array of its components, with backslash escaping
477
- function ot(e){for(
477
+ function it(e){for(
478
478
  // fields may be deep (e.g. "foo.bar.baz"), so parse
479
- var t=[],n="",r=0,o=e.length;r<o;r++){var i=e[r];"."===i?r>0&&"\\"===e[r-1]?// escaped delimiter
479
+ var t=[],n="",r=0,i=e.length;r<i;r++){var o=e[r];"."===o?r>0&&"\\"===e[r-1]?// escaped delimiter
480
480
  n=n.substring(0,n.length-1)+".":(// not escaped, so delimiter
481
481
  t.push(n),n=""):// normal character
482
- n+=i}return t.push(n),t}!function(e){Object.keys(d.prototype).forEach((function(t){"function"==typeof d.prototype[t]&&(e[t]=nt[t].bind(nt))}));
482
+ n+=o}return t.push(n),t}!function(e){Object.keys(d.prototype).forEach((function(t){"function"==typeof d.prototype[t]&&(e[t]=nt[t].bind(nt))}));
483
483
  // these are created in constructor.js, and allow us to notify each DB with
484
484
  // the same name that it was destroyed, via the constructor object
485
- var t=e._destructionListeners=new i;e.on("ref",(function(e){t.has(e.name)||t.set(e.name,[]),t.get(e.name).push(e)})),e.on("unref",(function(e){if(t.has(e.name)){var n=t.get(e.name),r=n.indexOf(e);r<0||(n.splice(r,1),n.length>1?
485
+ var t=e._destructionListeners=new o;e.on("ref",(function(e){t.has(e.name)||t.set(e.name,[]),t.get(e.name).push(e)})),e.on("unref",(function(e){if(t.has(e.name)){var n=t.get(e.name),r=n.indexOf(e);r<0||(n.splice(r,1),n.length>1?
486
486
  /* istanbul ignore next */
487
487
  t.set(e.name,n):t.delete(e.name))}})),e.on("destroyed",(function(e){if(t.has(e)){var n=t.get(e);t.delete(e),n.forEach((function(e){e.emit("destroyed",!0)}))}}))}(Xe),Xe.adapter=function(e,t,n){
488
488
  /* istanbul ignore else */
@@ -491,13 +491,13 @@ e(Xe);else{if("object"!=typeof e||0===Object.keys(e).length)throw new Error('Inv
491
491
  Xe.prototype[t]=e[t]}))}return this.__defaults&&(Xe.__defaults=T({},this.__defaults)),Xe},Xe.defaults=function(e){function t(e,n){if(!(this instanceof t))return new t(e,n);n=n||{},e&&"object"==typeof e&&(e=(n=e).name,delete n.name),n=T({},t.__defaults,n),Xe.call(this,e,n)}return l(t,Xe),t.preferredAdapters=Xe.preferredAdapters.slice(),Object.keys(Xe).forEach((function(e){e in t||(t[e]=Xe[e])})),
492
492
  // make default options transitive
493
493
  // https://github.com/pouchdb/pouchdb/issues/5922
494
- t.__defaults=T({},this.__defaults,e),t},Xe.fetch=function(e,t){return et(e,t)};var it=["$or","$nor","$not"];function st(e){return it.indexOf(e)>-1}function ut(e){return Object.keys(e)[0]}
494
+ t.__defaults=T({},this.__defaults,e),t},Xe.fetch=function(e,t){return et(e,t)};var ot=["$or","$nor","$not"];function st(e){return ot.indexOf(e)>-1}function ut(e){return Object.keys(e)[0]}
495
495
  // flatten an array of selectors joined by an $and operator
496
496
  function at(e){
497
497
  // sort to ensure that e.g. if the user specified
498
498
  // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into
499
499
  // just {$gt: 'b'}
500
- var t={};return e.forEach((function(e){Object.keys(e).forEach((function(n){var r=e[n];if("object"!=typeof r&&(r={$eq:r}),st(n))t[n]=r instanceof Array?r.map((function(e){return at([e])})):at([r]);else{var o=t[n]=t[n]||{};Object.keys(r).forEach((function(e){var t=r[e];return"$gt"===e||"$gte"===e?
500
+ var t={};return e.forEach((function(e){Object.keys(e).forEach((function(n){var r=e[n];if("object"!=typeof r&&(r={$eq:r}),st(n))t[n]=r instanceof Array?r.map((function(e){return at([e])})):at([r]);else{var i=t[n]=t[n]||{};Object.keys(r).forEach((function(e){var t=r[e];return"$gt"===e||"$gte"===e?
501
501
  // collapse logically equivalent gt/gte values
502
502
  function(e,t,n){void 0===n.$eq&&(// do nothing
503
503
  void 0!==n.$gte?"$gte"===e?t>n.$gte&&(// more specificity
@@ -508,7 +508,7 @@ delete n.$gt,n.$gte=t):// operator === '$gt'
508
508
  t>n.$gt&&(// more specificity
509
509
  n.$gt=t):n[e]=t)}
510
510
  // collapse logically equivalent lt/lte values
511
- (e,t,o):"$lt"===e||"$lte"===e?function(e,t,n){void 0===n.$eq&&(// do nothing
511
+ (e,t,i):"$lt"===e||"$lte"===e?function(e,t,n){void 0===n.$eq&&(// do nothing
512
512
  void 0!==n.$lte?"$lte"===e?t<n.$lte&&(// more specificity
513
513
  n.$lte=t):// operator === '$gt'
514
514
  t<=n.$lte&&(// more specificity
@@ -517,17 +517,17 @@ delete n.$lt,n.$lte=t):// operator === '$gt'
517
517
  t<n.$lt&&(// more specificity
518
518
  n.$lt=t):n[e]=t)}
519
519
  // combine $ne values into one array
520
- (e,t,o):"$ne"===e?function(e,t){"$ne"in t?
520
+ (e,t,i):"$ne"===e?function(e,t){"$ne"in t?
521
521
  // there are many things this could "not" be
522
522
  t.$ne.push(e):// doesn't exist yet
523
523
  t.$ne=[e]}
524
524
  // add $eq into the mix
525
- (t,o):"$eq"===e?function(e,t){
525
+ (t,i):"$eq"===e?function(e,t){
526
526
  // these all have less specificity than the $eq
527
527
  // TODO: check for user errors here
528
528
  delete t.$gt,delete t.$gte,delete t.$lt,delete t.$lte,delete t.$ne,t.$eq=e}
529
529
  //#7458: execute function mergeAndedSelectors on nested $and
530
- (t,o):void(o[e]=t)}))}}))})),t}function ct(e){for(var t in e){if(Array.isArray(e))for(var n in e)e[n].$and&&(e[n]=at(e[n].$and));var r=e[t];"object"==typeof r&&ct(r)}return e}
530
+ (t,i):void(i[e]=t)}))}}))})),t}function ct(e){for(var t in e){if(Array.isArray(e))for(var n in e)e[n].$and&&(e[n]=at(e[n].$and));var r=e[t];"object"==typeof r&&ct(r)}return e}
531
531
  //#7458: determine id $and is present in selector (at any level)
532
532
  function ft(e,t){for(var n in e){"$and"===n&&(t=!0);var r=e[n];"object"==typeof r&&(t=ft(r,t))}return t}
533
533
  // normalize the selector
@@ -536,23 +536,23 @@ function lt(e){var t=w(e),n=!1;
536
536
  ft(t,!1)&&("$and"in(t=ct(t))&&(t=at(t.$and)),n=!0),["$or","$nor"].forEach((function(e){e in t&&
537
537
  // message each individual selector
538
538
  // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}}
539
- t[e].forEach((function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var r=t[n],o=e[r];"object"==typeof o&&null!==o||(e[r]={$eq:o})}}))})),"$not"in t&&(
539
+ t[e].forEach((function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var r=t[n],i=e[r];"object"==typeof i&&null!==i||(e[r]={$eq:i})}}))})),"$not"in t&&(
540
540
  //This feels a little like forcing, but it will work for now,
541
541
  //I would like to come back to this and make the merging of selectors a little more generic
542
- t.$not=at([t.$not]));for(var r=Object.keys(t),o=0;o<r.length;o++){var i=r[o],s=t[i];"object"!=typeof s||null===s?s={$eq:s}:"$ne"in s&&!n&&(
542
+ t.$not=at([t.$not]));for(var r=Object.keys(t),i=0;i<r.length;i++){var o=r[i],s=t[o];"object"!=typeof s||null===s?s={$eq:s}:"$ne"in s&&!n&&(
543
543
  // I put these in an array, since there may be more than one
544
544
  // but in the "mergeAnded" operation, I already take care of that
545
- s.$ne=[s.$ne]),t[i]=s}return t}// verified by -Number.MIN_VALUE
545
+ s.$ne=[s.$ne]),t[o]=s}return t}// verified by -Number.MIN_VALUE
546
546
  // set to '_' for easier debugging
547
547
  function dt(e,t){if(e===t)return 0;e=ht(e),t=ht(t);var n=gt(e),r=gt(t);if(n-r!=0)return n-r;switch(typeof e){case"number":return e-t;case"boolean":return e<t?-1:1;case"string":return function(e,t){
548
548
  // See: https://github.com/daleharvey/pouchdb/issues/40
549
549
  // This is incompatible with the CouchDB implementation, but its the
550
550
  // best we can do for now
551
- return e===t?0:e>t?1:-1}(e,t)}return Array.isArray(e)?function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var o=dt(e[r],t[r]);if(0!==o)return o}return e.length===t.length?0:e.length>t.length?1:-1}(e,t):function(e,t){for(var n=Object.keys(e),r=Object.keys(t),o=Math.min(n.length,r.length),i=0;i<o;i++){
551
+ return e===t?0:e>t?1:-1}(e,t)}return Array.isArray(e)?function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var i=dt(e[r],t[r]);if(0!==i)return i}return e.length===t.length?0:e.length>t.length?1:-1}(e,t):function(e,t){for(var n=Object.keys(e),r=Object.keys(t),i=Math.min(n.length,r.length),o=0;o<i;o++){
552
552
  // First sort the keys
553
- var s=dt(n[i],r[i]);if(0!==s)return s;
553
+ var s=dt(n[o],r[o]);if(0!==s)return s;
554
554
  // if the keys are equal sort the values
555
- if(0!==(s=dt(e[n[i]],t[r[i]])))return s}return n.length===r.length?0:n.length>r.length?1:-1}
555
+ if(0!==(s=dt(e[n[o]],t[r[o]])))return s}return n.length===r.length?0:n.length>r.length?1:-1}
556
556
  // The collation is defined by erlangs ordered terms
557
557
  // the atoms null, true, false come first, then numbers, strings,
558
558
  // arrays, then objects
@@ -561,8 +561,8 @@ if(0!==(s=dt(e[n[i]],t[r[i]])))return s}return n.length===r.length?0:n.length>r.
561
561
  // couch considers null/NaN/Infinity/-Infinity === undefined,
562
562
  // for the purposes of mapreduce indexes. also, dates get stringified.
563
563
  function ht(e){switch(typeof e){case"undefined":return null;case"number":return e===1/0||e===-1/0||isNaN(e)?null:e;case"object":var t=e;if(Array.isArray(e)){var n=e.length;e=new Array(n);for(var r=0;r<n;r++)e[r]=ht(t[r]);
564
- /* istanbul ignore next */}else{if(e instanceof Date)return e.toJSON();if(null!==e)for(var o in// generic object
565
- e={},t)if(t.hasOwnProperty(o)){var i=t[o];void 0!==i&&(e[o]=ht(i))}}}return e}
564
+ /* istanbul ignore next */}else{if(e instanceof Date)return e.toJSON();if(null!==e)for(var i in// generic object
565
+ e={},t)if(t.hasOwnProperty(i)){var o=t[i];void 0!==o&&(e[i]=ht(o))}}}return e}
566
566
  // convert the given key to a string that would be appropriate
567
567
  // for lexical sorting, e.g. within a database, where the
568
568
  // sorting is the same given by the collate() function.
@@ -575,12 +575,12 @@ function pt(e){return gt(e=ht(e))+""+function(e){if(null!==e)switch(typeof e){ca
575
575
  return function(e){if(0===e)return"1";
576
576
  // convert number to exponential format for easier and
577
577
  // more succinct string sorting
578
- var t,n,r=e.toExponential().split(/e\+?/),o=parseInt(r[1],10),i=e<0,s=i?"0":"2",u=(n=function(e,t,n){
578
+ var t,n,r=e.toExponential().split(/e\+?/),i=parseInt(r[1],10),o=e<0,s=o?"0":"2",u=(n=function(e,t,n){
579
579
  /* istanbul ignore next */
580
- for(var r="",o=3-e.length;r.length<o;)r+="0";return r}(t=((i?-o:o)- -324).toString()),n+t);s+=""+u;
580
+ for(var r="",i=3-e.length;r.length<i;)r+="0";return r}(t=((o?-i:i)- -324).toString()),n+t);s+=""+u;
581
581
  // then sort by the factor
582
582
  var a=Math.abs(parseFloat(r[0]));// [1..10)
583
- /* istanbul ignore next */i&&(// for negative reverse ordering
583
+ /* istanbul ignore next */o&&(// for negative reverse ordering
584
584
  a=10-a);var c=a.toFixed(20);
585
585
  // strip zeros from the end
586
586
  return s+""+c.replace(/\.?0+$/,"")}
@@ -593,10 +593,10 @@ return s+""+c.replace(/\.?0+$/,"")}
593
593
  // 2 -> 2, 2
594
594
  /* eslint-disable no-control-regex */
595
595
  return e.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"");
596
- /* eslint-enable no-control-regex */case"object":var t=Array.isArray(e),n=t?e:Object.keys(e),r=-1,o=n.length,i="";if(t)for(;++r<o;)i+=pt(n[r]);else for(;++r<o;){var s=n[r];i+=pt(s)+pt(e[s])}return i}return""}(e)+"\0"}function vt(e,t){var n,r=t;if("1"===e[t])n=0,t++;else{var o="0"===e[t];t++;var i="",s=e.substring(t,t+3),u=parseInt(s,10)+-324;for(
596
+ /* eslint-enable no-control-regex */case"object":var t=Array.isArray(e),n=t?e:Object.keys(e),r=-1,i=n.length,o="";if(t)for(;++r<i;)o+=pt(n[r]);else for(;++r<i;){var s=n[r];o+=pt(s)+pt(e[s])}return o}return""}(e)+"\0"}function vt(e,t){var n,r=t;if("1"===e[t])n=0,t++;else{var i="0"===e[t];t++;var o="",s=e.substring(t,t+3),u=parseInt(s,10)+-324;for(
597
597
  /* istanbul ignore next */
598
- o&&(u=-u),t+=3;;){var a=e[t];if("\0"===a)break;i+=a,t++}n=1===(i=i.split(".")).length?parseInt(i,10):parseFloat(i[0]+"."+i[1])
599
- /* istanbul ignore next */,o&&(n-=10
598
+ i&&(u=-u),t+=3;;){var a=e[t];if("\0"===a)break;o+=a,t++}n=1===(o=o.split(".")).length?parseInt(o,10):parseFloat(o[0]+"."+o[1])
599
+ /* istanbul ignore next */,i&&(n-=10
600
600
  /* istanbul ignore next */),0!==u&&(
601
601
  // parseFloat is more reliable than pow due to rounding errors
602
602
  // e.g. Number.MAX_VALUE would return Infinity if we did
@@ -606,40 +606,40 @@ n=parseFloat(n+"e"+u))}return{num:n,length:t-r}}
606
606
  // this function moved outside of parseIndexableString for performance
607
607
  function yt(e,t){var n=e.pop();if(t.length){var r=t[t.length-1];n===r.element&&(
608
608
  // popping a meta-element, e.g. an object whose value is another object
609
- t.pop(),r=t[t.length-1]);var o=r.element,i=r.index;Array.isArray(o)?o.push(n):i===e.length-2?o[e.pop()]=n:e.push(n);// obj with key only
609
+ t.pop(),r=t[t.length-1]);var i=r.element,o=r.index;Array.isArray(i)?i.push(n):o===e.length-2?i[e.pop()]=n:e.push(n);// obj with key only
610
610
  }}function gt(e){var t=["boolean","number","string","object"].indexOf(typeof e);
611
611
  //false if -1 otherwise true, but fast!!!!1
612
612
  return~t?null===e?1:Array.isArray(e)?5:t<3?t+2:t+3:
613
613
  /* istanbul ignore next */
614
- Array.isArray(e)?5:void 0}function _t(e,t,n){return n.every((function(n){var r=t[n],o=ot(n),i=rt(e,o);return st(n)?function(e,t,n){return"$or"===e?t.some((function(e){return _t(n,e,Object.keys(e))})):"$not"===e?!_t(n,t,Object.keys(t)):!t.find((function(e){return _t(n,e,Object.keys(e))}))}(n,r,e):mt(r,e,o,i)}))}function mt(e,t,n,r){return!e||(
614
+ Array.isArray(e)?5:void 0}function _t(e,t,n){return n.every((function(n){var r=t[n],i=it(n),o=rt(e,i);return st(n)?function(e,t,n){return"$or"===e?t.some((function(e){return _t(n,e,Object.keys(e))})):"$not"===e?!_t(n,t,Object.keys(t)):!t.find((function(e){return _t(n,e,Object.keys(e))}))}(n,r,e):mt(r,e,i,o)}))}function mt(e,t,n,r){return!e||(
615
615
  // is matcher an object, if so continue recursion
616
- "object"==typeof e?Object.keys(e).every((function(o){var i=e[o];return function(e,t,n,r,o){if(!jt[e])throw new Error('unknown operator "'+e+'" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, $nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all');return jt[e](t,n,r,o)}(o,t,i,n,r)})):e===r)}function bt(e){return null!=e}function wt(e){return void 0!==e}function kt(e,t){return t.some((function(t){return e instanceof Array?e.indexOf(t)>-1:e===t}))}var jt={$elemMatch:function(e,t,n,r){return!!Array.isArray(r)&&0!==r.length&&("object"==typeof r[0]?r.some((function(e){return _t(e,t,Object.keys(t))})):r.some((function(r){return mt(t,e,n,r)})))},$allMatch:function(e,t,n,r){return!!Array.isArray(r)&&
616
+ "object"==typeof e?Object.keys(e).every((function(i){var o=e[i];return function(e,t,n,r,i){if(!jt[e])throw new Error('unknown operator "'+e+'" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, $nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all');return jt[e](t,n,r,i)}(i,t,o,n,r)})):e===r)}function bt(e){return null!=e}function wt(e){return void 0!==e}function kt(e,t){return t.some((function(t){return e instanceof Array?e.indexOf(t)>-1:e===t}))}var jt={$elemMatch:function(e,t,n,r){return!!Array.isArray(r)&&0!==r.length&&("object"==typeof r[0]?r.some((function(e){return _t(e,t,Object.keys(t))})):r.some((function(r){return mt(t,e,n,r)})))},$allMatch:function(e,t,n,r){return!!Array.isArray(r)&&
617
617
  /* istanbul ignore next */
618
618
  0!==r.length&&("object"==typeof r[0]?r.every((function(e){return _t(e,t,Object.keys(t))})):r.every((function(r){return mt(t,e,n,r)})))},$eq:function(e,t,n,r){return wt(r)&&0===dt(r,t)},$gte:function(e,t,n,r){return wt(r)&&dt(r,t)>=0},$gt:function(e,t,n,r){return wt(r)&&dt(r,t)>0},$lte:function(e,t,n,r){return wt(r)&&dt(r,t)<=0},$lt:function(e,t,n,r){return wt(r)&&dt(r,t)<0},$exists:function(e,t,n,r){
619
619
  //a field that is null is still considered to exist
620
620
  return t?wt(r):!wt(r)},$mod:function(e,t,n,r){return bt(r)&&function(e,t){var n=t[0],r=t[1];if(0===n)throw new Error("Bad divisor, cannot divide by zero");if(parseInt(n,10)!==n)throw new Error("Divisor is not an integer");if(parseInt(r,10)!==r)throw new Error("Modulus is not an integer");return parseInt(e,10)===e&&e%n===r}(r,t)},$ne:function(e,t,n,r){return t.every((function(e){return 0!==dt(r,e)}))},$in:function(e,t,n,r){return bt(r)&&kt(r,t)},$nin:function(e,t,n,r){return bt(r)&&!kt(r,t)},$size:function(e,t,n,r){return bt(r)&&function(e,t){return e.length===t}(r,t)},$all:function(e,t,n,r){return Array.isArray(r)&&function(e,t){return t.every((function(t){return e.indexOf(t)>-1}))}(r,t)},$regex:function(e,t,n,r){return bt(r)&&function(e,t){return new RegExp(t).test(e)}(r,t)},$type:function(e,t,n,r){return function(e,t){switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"number":return"number"==typeof e;case"string":return"string"==typeof e;case"array":return e instanceof Array;case"object":return"[object Object]"==={}.toString.call(e)}throw new Error(t+" not supported as a type.Please use one of object, string, array, number, boolean or null.")}(r,t)}};
621
621
  // return true if the given doc matches the supplied selector
622
- function Ot(e,t){if(e.selector&&e.filter&&"_selector"!==e.filter){var n="string"==typeof e.filter?e.filter:"function";return t(new Error('selector invalid for filter "'+n+'"'))}t()}function St(e){e.view&&!e.filter&&(e.filter="_view"),e.selector&&!e.filter&&(e.filter="_selector"),e.filter&&"string"==typeof e.filter&&("_view"===e.filter?e.view=oe(e.view):e.filter=oe(e.filter))}function Pt(e,t){return t.filter&&"string"==typeof t.filter&&!t.doc_ids&&!ne(e.db)}function At(e,t){var n=t.complete;if("_view"===t.filter){if(!t.view||"string"!=typeof t.view){var r=H(z,"`view` filter parameter not found or invalid.");return n(r)}
622
+ function Ot(e,t){if(e.selector&&e.filter&&"_selector"!==e.filter){var n="string"==typeof e.filter?e.filter:"function";return t(new Error('selector invalid for filter "'+n+'"'))}t()}function St(e){e.view&&!e.filter&&(e.filter="_view"),e.selector&&!e.filter&&(e.filter="_selector"),e.filter&&"string"==typeof e.filter&&("_view"===e.filter?e.view=ie(e.view):e.filter=ie(e.filter))}function Pt(e,t){return t.filter&&"string"==typeof t.filter&&!t.doc_ids&&!ne(e.db)}function At(e,t){var n=t.complete;if("_view"===t.filter){if(!t.view||"string"!=typeof t.view){var r=H(z,"`view` filter parameter not found or invalid.");return n(r)}
623
623
  // fetch a view from a design doc, make it behave like a filter
624
- var o=re(t.view);e.db.get("_design/"+o[0],(function(r,i){
624
+ var i=re(t.view);e.db.get("_design/"+i[0],(function(r,o){
625
625
  /* istanbul ignore if */
626
626
  if(e.isCancelled)return n(null,{status:"cancelled"});
627
- /* istanbul ignore next */if(r)return n(X(r));var s=i&&i.views&&i.views[o[1]]&&i.views[o[1]].map;if(!s)return n(H(I,i.views?"missing json key: "+o[1]:"missing json key: views"));t.filter=fe(["return function(doc) {",' "use strict";'," var emitted = false;"," var emit = function (a, b) {"," emitted = true;"," };"," var view = "+s+";"," view(doc);"," if (emitted) {"," return true;"," }","};"].join("\n"),{}),e.doChanges(t)}))}else if(t.selector)t.filter=function(e){return function(e,t){
627
+ /* istanbul ignore next */if(r)return n(X(r));var s=o&&o.views&&o.views[i[1]]&&o.views[i[1]].map;if(!s)return n(H(I,o.views?"missing json key: "+i[1]:"missing json key: views"));t.filter=fe(["return function(doc) {",' "use strict";'," var emitted = false;"," var emit = function (a, b) {"," emitted = true;"," };"," var view = "+s+";"," view(doc);"," if (emitted) {"," return true;"," }","};"].join("\n"),{}),e.doChanges(t)}))}else if(t.selector)t.filter=function(e){return function(e,t){
628
628
  /* istanbul ignore if */
629
629
  if("object"!=typeof t)
630
630
  // match the CouchDB error message
631
631
  throw new Error("Selector error: expected a JSON object");var n=function(e,t,n){if(e=e.filter((function(e){return _t(e.doc,t.selector,n)})),t.sort){
632
632
  // in-memory sort
633
- var r=function(e){function t(t){return e.map((function(e){var n=ot(ut(e));return rt(t,n)}))}return function(e,n){var r,o,i=dt(t(e.doc),t(n.doc));return 0!==i?i:(r=e.doc._id)<(o=n.doc._id)?-1:r>o?1:0;
633
+ var r=function(e){function t(t){return e.map((function(e){var n=it(ut(e));return rt(t,n)}))}return function(e,n){var r,i,o=dt(t(e.doc),t(n.doc));return 0!==o?o:(r=e.doc._id)<(i=n.doc._id)?-1:r>i?1:0;
634
634
  // this is what mango seems to do
635
- }}(t.sort);e=e.sort(r),"string"!=typeof t.sort[0]&&"desc"===(o=t.sort[0])[ut(o)]&&(e=e.reverse())}var o;if("limit"in t||"skip"in t){
635
+ }}(t.sort);e=e.sort(r),"string"!=typeof t.sort[0]&&"desc"===(i=t.sort[0])[ut(i)]&&(e=e.reverse())}var i;if("limit"in t||"skip"in t){
636
636
  // have to do the limit in-memory
637
- var i=t.skip||0,s=("limit"in t?t.limit:e.length)+i;e=e.slice(i,s)}return e}([{doc:e}],{selector:t=lt(t)},Object.keys(t));return n&&1===n.length}(e,t.selector)},e.doChanges(t);else{
637
+ var o=t.skip||0,s=("limit"in t?t.limit:e.length)+o;e=e.slice(o,s)}return e}([{doc:e}],{selector:t=lt(t)},Object.keys(t));return n&&1===n.length}(e,t.selector)},e.doChanges(t);else{
638
638
  // fetch a filter from a design doc
639
- var i=re(t.filter);e.db.get("_design/"+i[0],(function(r,o){
639
+ var o=re(t.filter);e.db.get("_design/"+o[0],(function(r,i){
640
640
  /* istanbul ignore if */
641
641
  if(e.isCancelled)return n(null,{status:"cancelled"});
642
- /* istanbul ignore next */if(r)return n(X(r));var s=o&&o.filters&&o.filters[i[1]];if(!s)return n(H(I,o&&o.filters?"missing json key: "+i[1]:"missing json key: filters"));t.filter=fe('"use strict";\nreturn '+s+";",{}),e.doChanges(t)}))}}function xt(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})}
642
+ /* istanbul ignore next */if(r)return n(X(r));var s=i&&i.filters&&i.filters[o[1]];if(!s)return n(H(I,i&&i.filters?"missing json key: "+o[1]:"missing json key: filters"));t.filter=fe('"use strict";\nreturn '+s+";",{}),e.doChanges(t)}))}}function xt(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})}
643
643
  // List of top level reserved words for doc
644
644
  // TODO: remove from pouchdb-core (breaking)
645
645
  Xe.plugin((function(e){e._changesFilterPlugin={validate:Ot,normalize:St,shouldFilter:Pt,filter:At}})),Xe.version="7.2.2";var qt=xt(["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree",
@@ -653,31 +653,31 @@ Xe.plugin((function(e){e._changesFilterPlugin={validate:Ot,normalize:St,shouldFi
653
653
  function Ct(e){if(!/^\d+-/.test(e))return H(W);var t=e.indexOf("-"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:parseInt(n,10),id:r}}
654
654
  // Preprocess documents, parse their revisions, assign an id and a
655
655
  // revision for new writes that are missing them, etc
656
- function Bt(e,t,n){var r,o,i;n||(n={deterministic_revs:!0});var s={status:"available"};if(e._deleted&&(s.deleted=!0),t)if(e._id||(e._id=Ae()),o=Pe(e,n.deterministic_revs),e._rev){if((i=Ct(e._rev)).error)return i;e._rev_tree=[{pos:i.prefix,ids:[i.id,{status:"missing"},[[o,s,[]]]]}],r=i.prefix+1}else e._rev_tree=[{pos:1,ids:[o,s,[]]}],r=1;else if(e._revisions&&(e._rev_tree=function(e,t){for(var n=e.start-e.ids.length+1,r=e.ids,o=[r[0],t,[]],i=1,s=r.length;i<s;i++)o=[r[i],{status:"missing"},[o]];return[{pos:n,ids:o}]}(e._revisions,s),r=e._revisions.start,o=e._revisions.ids[0]),!e._rev_tree){if((i=Ct(e._rev)).error)return i;r=i.prefix,o=i.id,e._rev_tree=[{pos:r,ids:[o,s,[]]}]}te(e._id),e._rev=r+"-"+o;var u={metadata:{},data:{}};for(var a in e)
656
+ function Bt(e,t,n){var r,i,o;n||(n={deterministic_revs:!0});var s={status:"available"};if(e._deleted&&(s.deleted=!0),t)if(e._id||(e._id=Ae()),i=Pe(e,n.deterministic_revs),e._rev){if((o=Ct(e._rev)).error)return o;e._rev_tree=[{pos:o.prefix,ids:[o.id,{status:"missing"},[[i,s,[]]]]}],r=o.prefix+1}else e._rev_tree=[{pos:1,ids:[i,s,[]]}],r=1;else if(e._revisions&&(e._rev_tree=function(e,t){for(var n=e.start-e.ids.length+1,r=e.ids,i=[r[0],t,[]],o=1,s=r.length;o<s;o++)i=[r[o],{status:"missing"},[i]];return[{pos:n,ids:i}]}(e._revisions,s),r=e._revisions.start,i=e._revisions.ids[0]),!e._rev_tree){if((o=Ct(e._rev)).error)return o;r=o.prefix,i=o.id,e._rev_tree=[{pos:r,ids:[i,s,[]]}]}te(e._id),e._rev=r+"-"+i;var u={metadata:{},data:{}};for(var a in e)
657
657
  /* istanbul ignore else */
658
658
  if(Object.prototype.hasOwnProperty.call(e,a)){var c="_"===a[0];if(c&&!qt[a]){var f=H(V,a);throw f.message=V.message+": "+a,f}c&&!Et[a]?u.metadata[a.slice(1)]=e[a]:u.data[a]=e[a]}return u}function $t(e,t,n){if(e.stub)return n();"string"==typeof e.data?// input is a base64 string
659
659
  function(e,t,n){var r=function(e){try{return de(e)}catch(e){return{error:H(F,"Attachment is not a valid base64 string")}}}(e.data);if(r.error)return n(r.error);e.length=r.length,e.data="blob"===t?ye(r,e.content_type):"base64"===t?he(r):r,Oe(r,(function(t){e.digest="md5-"+t,n()}))}(e,t,n):// input is a blob
660
660
  function(e,t,n){Oe(e.data,(function(r){e.digest="md5-"+r,
661
661
  // size is for blobs (browser), length is for buffers (node)
662
- e.length=e.data.size||e.data.length||0,"binary"===t?me(e.data,(function(t){e.data=t,n()})):"base64"===t?be(e.data,(function(t){e.data=t,n()})):n()}))}(e,t,n)}function Tt(e,t,n,r,o,s,u,a,c){
662
+ e.length=e.data.size||e.data.length||0,"binary"===t?me(e.data,(function(t){e.data=t,n()})):"base64"===t?be(e.data,(function(t){e.data=t,n()})):n()}))}(e,t,n)}function Tt(e,t,n,r,i,s,u,a,c){
663
663
  // Default to 1000 locally
664
- e=e||1e3;var f=a.new_edits,l=new i,d=0,h=t.length;function p(){++d===h&&c&&c()}t.forEach((function(e,t){if(e._id&&Fe(e._id)){var r=e._deleted?"_removeLocal":"_putLocal";n[r](e,{ctx:o},(function(e,n){s[t]=e||n,p()}))}else{var i=e.metadata.id;l.has(i)?(h--,// duplicate
665
- l.get(i).push([e,t])):l.set(i,[[e,t]])}})),
664
+ e=e||1e3;var f=a.new_edits,l=new o,d=0,h=t.length;function p(){++d===h&&c&&c()}t.forEach((function(e,t){if(e._id&&Fe(e._id)){var r=e._deleted?"_removeLocal":"_putLocal";n[r](e,{ctx:i},(function(e,n){s[t]=e||n,p()}))}else{var o=e.metadata.id;l.has(o)?(h--,// duplicate
665
+ l.get(o).push([e,t])):l.set(o,[[e,t]])}})),
666
666
  // in the case of new_edits, the user can provide multiple docs
667
667
  // with the same id. these need to be processed sequentially
668
- l.forEach((function(t,n){var o=0;function i(){++o<t.length?c():p()}function c(){var c=t[o],l=c[0],d=c[1];if(r.has(n))!function(e,t,n,r,o,i,s,u){if(function(e,t){for(var n,r=e.slice(),o=t.split("-"),i=parseInt(o[0],10),s=o[1];n=r.pop();){if(n.pos===i&&n.ids[0]===s)return!0;for(var u=n.ids[2],a=0,c=u.length;a<c;a++)r.push({pos:n.pos+1,ids:u[a]})}return!1}(t.rev_tree,n.metadata.rev)&&!u)return r[o]=n,i();
668
+ l.forEach((function(t,n){var i=0;function o(){++i<t.length?c():p()}function c(){var c=t[i],l=c[0],d=c[1];if(r.has(n))!function(e,t,n,r,i,o,s,u){if(function(e,t){for(var n,r=e.slice(),i=t.split("-"),o=parseInt(i[0],10),s=i[1];n=r.pop();){if(n.pos===o&&n.ids[0]===s)return!0;for(var u=n.ids[2],a=0,c=u.length;a<c;a++)r.push({pos:n.pos+1,ids:u[a]})}return!1}(t.rev_tree,n.metadata.rev)&&!u)return r[i]=n,o();
669
669
  // sometimes this is pre-calculated. historically not always
670
- var a=t.winningRev||xe(t),c="deleted"in t?t.deleted:Ue(t,a),f="deleted"in n.metadata?n.metadata.deleted:Ue(n.metadata),l=/^1-/.test(n.metadata.rev);if(c&&!f&&u&&l){var d=n.data;d._rev=a,d._id=n.metadata.id,n=Bt(d,u)}var h=Ne(t.rev_tree,n.metadata.rev_tree[0],e);if(u&&(c&&f&&"new_leaf"!==h.conflicts||!c&&"new_leaf"!==h.conflicts||c&&!f&&"new_branch"===h.conflicts)){var p=H(R);return r[o]=p,i()}var v=n.metadata.rev;n.metadata.rev_tree=h.tree,n.stemmedRevs=h.stemmedRevs||[],
670
+ var a=t.winningRev||xe(t),c="deleted"in t?t.deleted:Ue(t,a),f="deleted"in n.metadata?n.metadata.deleted:Ue(n.metadata),l=/^1-/.test(n.metadata.rev);if(c&&!f&&u&&l){var d=n.data;d._rev=a,d._id=n.metadata.id,n=Bt(d,u)}var h=Ne(t.rev_tree,n.metadata.rev_tree[0],e);if(u&&(c&&f&&"new_leaf"!==h.conflicts||!c&&"new_leaf"!==h.conflicts||c&&!f&&"new_branch"===h.conflicts)){var p=H(R);return r[i]=p,o()}var v=n.metadata.rev;n.metadata.rev_tree=h.tree,n.stemmedRevs=h.stemmedRevs||[],
671
671
  /* istanbul ignore else */
672
672
  t.rev_map&&(n.metadata.rev_map=t.rev_map);
673
673
  // recalculate
674
- var y=xe(n.metadata),g=Ue(n.metadata,y),_=c===g?0:c<g?-1:1;s(n,y,g,v===y?g:Ue(n.metadata,v),!0,_,o,i)}(e,r.get(n),l,s,d,i,u,f);else{
674
+ var y=xe(n.metadata),g=Ue(n.metadata,y),_=c===g?0:c<g?-1:1;s(n,y,g,v===y?g:Ue(n.metadata,v),!0,_,i,o)}(e,r.get(n),l,s,d,o,u,f);else{
675
675
  // Ensure stemming applies to new writes as well
676
676
  var h=Ne([],l.metadata.rev_tree[0],e);l.metadata.rev_tree=h.tree,l.stemmedRevs=h.stemmedRevs||[],function(e,t,n){
677
677
  // Cant insert new deleted documents
678
- var r=xe(e.metadata),o=Ue(e.metadata,r);if("was_delete"in a&&o)return s[t]=H(I,"deleted"),n();
678
+ var r=xe(e.metadata),i=Ue(e.metadata,r);if("was_delete"in a&&i)return s[t]=H(I,"deleted"),n();
679
679
  // 4712 - detect whether a new document was inserted with a _rev
680
- var i=f&&function(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}(e);if(i){var c=H(R);return s[t]=c,n()}u(e,r,o,o,!1,o?0:1,t,n)}(l,d,i)}}c()}))}
680
+ var o=f&&function(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}(e);if(o){var c=H(R);return s[t]=c,n()}u(e,r,i,i,!1,i?0:1,t,n)}(l,d,o)}}c()}))}
681
681
  // IndexedDB requires a versioned database structure, so we use the
682
682
  // version here to manage migrations.
683
683
  var Dt="document-store",Lt="by-sequence",It="attach-store",Rt="attach-seq-store",Mt="meta-store",Nt="local-store",Kt="detect-blob-support";
@@ -712,71 +712,71 @@ function Gt(e,t,n,r){n?// we have blob support
712
712
  r(e?"string"!=typeof e?e:ge(e,t):pe([""],{type:t})):// as base64 string
713
713
  e?"string"!=typeof e?// we have blob support
714
714
  _e(e,(function(e){r(he(e))})):// no blob support
715
- r(e):r("")}function Qt(e,t,n,r){var o=Object.keys(e._attachments||{});if(!o.length)return r&&r();var i=0;function s(){++i===o.length&&r&&r()}o.forEach((function(r){t.attachments&&t.include_docs?function(e,t){var r=e._attachments[t],o=r.digest;n.objectStore(It).get(o).onsuccess=function(e){r.body=e.target.result.body,s()}}(e,r):(e._attachments[r].stub=!0,s())}))}
715
+ r(e):r("")}function Qt(e,t,n,r){var i=Object.keys(e._attachments||{});if(!i.length)return r&&r();var o=0;function s(){++o===i.length&&r&&r()}i.forEach((function(r){t.attachments&&t.include_docs?function(e,t){var r=e._attachments[t],i=r.digest;n.objectStore(It).get(i).onsuccess=function(e){r.body=e.target.result.body,s()}}(e,r):(e._attachments[r].stub=!0,s())}))}
716
716
  // IDB-specific postprocessing necessary because
717
717
  // we don't know whether we stored a true Blob or
718
718
  // a base64-encoded string, and if it's a Blob it
719
719
  // needs to be read outside of the transaction context
720
- function Wt(e,t){return Promise.all(e.map((function(e){if(e.doc&&e.doc._attachments){var n=Object.keys(e.doc._attachments);return Promise.all(n.map((function(n){var r=e.doc._attachments[n];if("body"in r){var o=r.body,i=r.content_type;return new Promise((function(s){Gt(o,i,t,(function(t){e.doc._attachments[n]=T(S(r,["digest","content_type"]),{data:t}),s()}))}))}})))}})))}function Yt(e,t,n){var r=[],o=n.objectStore(Lt),i=n.objectStore(It),s=n.objectStore(Rt),u=e.length;function a(){--u||r.length&&r.forEach((function(e){s.index("digestSeq").count(IDBKeyRange.bound(e+"::",e+"::￿",!1,!1)).onsuccess=function(t){t.target.result||
720
+ function Wt(e,t){return Promise.all(e.map((function(e){if(e.doc&&e.doc._attachments){var n=Object.keys(e.doc._attachments);return Promise.all(n.map((function(n){var r=e.doc._attachments[n];if("body"in r){var i=r.body,o=r.content_type;return new Promise((function(s){Gt(i,o,t,(function(t){e.doc._attachments[n]=T(S(r,["digest","content_type"]),{data:t}),s()}))}))}})))}})))}function Yt(e,t,n){var r=[],i=n.objectStore(Lt),o=n.objectStore(It),s=n.objectStore(Rt),u=e.length;function a(){--u||r.length&&r.forEach((function(e){s.index("digestSeq").count(IDBKeyRange.bound(e+"::",e+"::￿",!1,!1)).onsuccess=function(t){t.target.result||
721
721
  // orphaned
722
- i.delete(e)}}))}e.forEach((function(e){var n=o.index("_doc_id_rev"),i=t+"::"+e;n.getKey(i).onsuccess=function(e){var t=e.target.result;if("number"!=typeof t)return a();o.delete(t),s.index("seq").openCursor(IDBKeyRange.only(t)).onsuccess=function(e){var t=e.target.result;if(t){var n=t.value.digestSeq.split("::")[0];r.push(n),s.delete(t.primaryKey),t.continue()}else// done
723
- a()}}}))}function Ht(e,t,n){try{return{txn:e.transaction(t,n)}}catch(e){return{error:e}}}var Xt=new E;function Zt(e,t,n,r,o,s){for(var u,a,c,f,l,d,h,p,v=t.docs,y=0,g=v.length;y<g;y++){var _=v[y];_._id&&Fe(_._id)||(_=v[y]=Bt(_,n.new_edits,e)).error&&!h&&(h=_)}if(h)return s(h);var m=!1,b=0,w=new Array(v.length),k=new i,j=!1,O=r._meta.blobSupport?"blob":"base64";function S(){m=!0,P()}function P(){p&&m&&(
722
+ o.delete(e)}}))}e.forEach((function(e){var n=i.index("_doc_id_rev"),o=t+"::"+e;n.getKey(o).onsuccess=function(e){var t=e.target.result;if("number"!=typeof t)return a();i.delete(t),s.index("seq").openCursor(IDBKeyRange.only(t)).onsuccess=function(e){var t=e.target.result;if(t){var n=t.value.digestSeq.split("::")[0];r.push(n),s.delete(t.primaryKey),t.continue()}else// done
723
+ a()}}}))}function Ht(e,t,n){try{return{txn:e.transaction(t,n)}}catch(e){return{error:e}}}var Xt=new E;function Zt(e,t,n,r,i,s){for(var u,a,c,f,l,d,h,p,v=t.docs,y=0,g=v.length;y<g;y++){var _=v[y];_._id&&Fe(_._id)||(_=v[y]=Bt(_,n.new_edits,e)).error&&!h&&(h=_)}if(h)return s(h);var m=!1,b=0,w=new Array(v.length),k=new o,j=!1,O=r._meta.blobSupport?"blob":"base64";function S(){m=!0,P()}function P(){p&&m&&(
724
724
  // caching the docCount saves a lot of time in allDocs() and
725
725
  // info(), which is why we go to all the trouble of doing this
726
- p.docCount+=b,d.put(p))}function A(){j||(Xt.notify(r._meta.name),s(null,w))}function x(e,t,n,r,o,i,s,u){e.metadata.winningRev=t,e.metadata.deleted=n;var a=e.data;if(a._id=e.metadata.id,a._rev=e.metadata.rev,r&&(a._deleted=!0),a._attachments&&Object.keys(a._attachments).length)return function(e,t,n,r,o,i){var s=e.data,u=0,a=Object.keys(s._attachments);function c(){u===a.length&&q(e,t,n,r,o,i)}function l(){u++,c()}a.forEach((function(n){var r=e.data._attachments[n];if(r.stub)u++,c();else{var o=r.data;delete r.data,r.revpos=parseInt(t,10),function(e,t,n){f.count(e).onsuccess=function(r){if(r.target.result)return n();// already exists
727
- var o={digest:e,body:t};f.put(o).onsuccess=n}}(r.digest,o,l)}}))}
726
+ p.docCount+=b,d.put(p))}function A(){j||(Xt.notify(r._meta.name),s(null,w))}function x(e,t,n,r,i,o,s,u){e.metadata.winningRev=t,e.metadata.deleted=n;var a=e.data;if(a._id=e.metadata.id,a._rev=e.metadata.rev,r&&(a._deleted=!0),a._attachments&&Object.keys(a._attachments).length)return function(e,t,n,r,i,o){var s=e.data,u=0,a=Object.keys(s._attachments);function c(){u===a.length&&q(e,t,n,r,i,o)}function l(){u++,c()}a.forEach((function(n){var r=e.data._attachments[n];if(r.stub)u++,c();else{var i=r.data;delete r.data,r.revpos=parseInt(t,10),function(e,t,n){f.count(e).onsuccess=function(r){if(r.target.result)return n();// already exists
727
+ var i={digest:e,body:t};f.put(i).onsuccess=n}}(r.digest,i,l)}}))}
728
728
  // map seqs to attachment digests, which
729
729
  // we will need later during compaction
730
- (e,t,n,o,s,u);b+=i,P(),q(e,t,n,o,s,u)}function q(e,t,n,o,i,s){var f=e.data,d=e.metadata;function h(i){var s=e.stemmedRevs||[];o&&r.auto_compaction&&(s=s.concat(function(e){var t=[];return qe(e.rev_tree,(function(e,n,r,o,i){"available"!==i.status||e||(t.push(n+"-"+r),i.status="missing")})),t}(e.metadata))),s&&s.length&&Yt(s,e.metadata.id,u),d.seq=i.target.result;
730
+ (e,t,n,i,s,u);b+=o,P(),q(e,t,n,i,s,u)}function q(e,t,n,i,o,s){var f=e.data,d=e.metadata;function h(o){var s=e.stemmedRevs||[];i&&r.auto_compaction&&(s=s.concat(function(e){var t=[];return qe(e.rev_tree,(function(e,n,r,i,o){"available"!==o.status||e||(t.push(n+"-"+r),o.status="missing")})),t}(e.metadata))),s&&s.length&&Yt(s,e.metadata.id,u),d.seq=o.target.result;
731
731
  // Current _rev is calculated from _rev_tree on read
732
732
  // delete metadata.rev;
733
- var c=Jt(d,t,n);a.put(c).onsuccess=p}function p(){w[i]={ok:!0,id:d.id,rev:d.rev},k.set(e.metadata.id,e.metadata),function(e,t,n){var r=0,o=Object.keys(e.data._attachments||{});if(!o.length)return n();function i(){++r===o.length&&n()}function s(n){var r=e.data._attachments[n].digest,o=l.put({seq:t,digestSeq:r+"::"+t});o.onsuccess=i,o.onerror=function(e){
733
+ var c=Jt(d,t,n);a.put(c).onsuccess=p}function p(){w[o]={ok:!0,id:d.id,rev:d.rev},k.set(e.metadata.id,e.metadata),function(e,t,n){var r=0,i=Object.keys(e.data._attachments||{});if(!i.length)return n();function o(){++r===i.length&&n()}function s(n){var r=e.data._attachments[n].digest,i=l.put({seq:t,digestSeq:r+"::"+t});i.onsuccess=o,i.onerror=function(e){
734
734
  // this callback is for a constaint error, which we ignore
735
735
  // because this docid/rev has already been associated with
736
736
  // the digest (e.g. when new_edits == false)
737
737
  e.preventDefault(),// avoid transaction abort
738
738
  e.stopPropagation(),// avoid transaction onerror
739
- i()}}for(var u=0;u<o.length;u++)s(o[u]);// do in parallel
739
+ o()}}for(var u=0;u<i.length;u++)s(i[u]);// do in parallel
740
740
  }(e,d.seq,s)}f._doc_id_rev=d.id+"::"+d.rev,delete f._id,delete f._rev;var v=c.put(f);v.onsuccess=h,v.onerror=function(e){
741
741
  // ConstraintError, need to update, not put (see #1638 for details)
742
742
  e.preventDefault(),// avoid transaction abort
743
- e.stopPropagation(),c.index("_doc_id_rev").getKey(f._doc_id_rev).onsuccess=function(e){c.put(f,e.target.result).onsuccess=h}}}!function(e,t,n){if(!e.length)return n();var r,o=0;function i(){o++,e.length===o&&(r?n(r):n())}e.forEach((function(e){var n=e.data&&e.data._attachments?Object.keys(e.data._attachments):[],o=0;if(!n.length)return i();function s(e){r=e,++o===n.length&&i()}for(var u in e.data._attachments)e.data._attachments.hasOwnProperty(u)&&$t(e.data._attachments[u],t,s)}))}(v,O,(function(t){if(t)return s(t);!function(){var t=Ht(o,[Dt,Lt,It,Nt,Rt,Mt],"readwrite");if(t.error)return s(t.error);(u=t.txn).onabort=Ft(s),u.ontimeout=Ft(s),u.oncomplete=A,a=u.objectStore(Dt),c=u.objectStore(Lt),f=u.objectStore(It),l=u.objectStore(Rt),(d=u.objectStore(Mt)).get(Mt).onsuccess=function(e){p=e.target.result,P()},function(e){var t=[];if(v.forEach((function(e){e.data&&e.data._attachments&&Object.keys(e.data._attachments).forEach((function(n){var r=e.data._attachments[n];r.stub&&t.push(r.digest)}))})),!t.length)return e();var n,r=0;function o(){++r===t.length&&e(n)}t.forEach((function(e){!function(e,t){f.get(e).onsuccess=function(n){if(n.target.result)t();else{var r=H(Y,"unknown stub attachment with digest "+e);r.status=412,t(r)}}}(e,(function(e){e&&!n&&(n=e),o()}))}))}((function(t){if(t)return j=!0,s(t);!function(){if(v.length)for(var t=0,o=0,i=v.length;o<i;o++){var s=v[o];s._id&&Fe(s._id)?c():a.get(s.metadata.id).onsuccess=f}function c(){++t===v.length&&Tt(e.revs_limit,v,r,k,u,w,x,n,S)}function f(e){var t=Vt(e.target.result);t&&k.set(t.id,t),c()}}()}))}()}))}
743
+ e.stopPropagation(),c.index("_doc_id_rev").getKey(f._doc_id_rev).onsuccess=function(e){c.put(f,e.target.result).onsuccess=h}}}!function(e,t,n){if(!e.length)return n();var r,i=0;function o(){i++,e.length===i&&(r?n(r):n())}e.forEach((function(e){var n=e.data&&e.data._attachments?Object.keys(e.data._attachments):[],i=0;if(!n.length)return o();function s(e){r=e,++i===n.length&&o()}for(var u in e.data._attachments)e.data._attachments.hasOwnProperty(u)&&$t(e.data._attachments[u],t,s)}))}(v,O,(function(t){if(t)return s(t);!function(){var t=Ht(i,[Dt,Lt,It,Nt,Rt,Mt],"readwrite");if(t.error)return s(t.error);(u=t.txn).onabort=Ft(s),u.ontimeout=Ft(s),u.oncomplete=A,a=u.objectStore(Dt),c=u.objectStore(Lt),f=u.objectStore(It),l=u.objectStore(Rt),(d=u.objectStore(Mt)).get(Mt).onsuccess=function(e){p=e.target.result,P()},function(e){var t=[];if(v.forEach((function(e){e.data&&e.data._attachments&&Object.keys(e.data._attachments).forEach((function(n){var r=e.data._attachments[n];r.stub&&t.push(r.digest)}))})),!t.length)return e();var n,r=0;function i(){++r===t.length&&e(n)}t.forEach((function(e){!function(e,t){f.get(e).onsuccess=function(n){if(n.target.result)t();else{var r=H(Y,"unknown stub attachment with digest "+e);r.status=412,t(r)}}}(e,(function(e){e&&!n&&(n=e),i()}))}))}((function(t){if(t)return j=!0,s(t);!function(){if(v.length)for(var t=0,i=0,o=v.length;i<o;i++){var s=v[i];s._id&&Fe(s._id)?c():a.get(s.metadata.id).onsuccess=f}function c(){++t===v.length&&Tt(e.revs_limit,v,r,k,u,w,x,n,S)}function f(e){var t=Vt(e.target.result);t&&k.set(t.id,t),c()}}()}))}()}))}
744
744
  // Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations
745
745
  // while falling back to a normal IDBCursor operation on browsers that don't support getAll() or
746
746
  // getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because
747
747
  // we're not processing each document one-at-a-time.
748
- function en(e,t,n,r,o){
748
+ function en(e,t,n,r,i){
749
749
  // Bail out of getAll()/getAllKeys() in the following cases:
750
750
  // 1) either method is unsupported - we need both
751
751
  // 2) batchSize is 1 (might as well use IDBCursor)
752
752
  // 3) descending – no real way to do this via getAll()/getAllKeys()
753
- var i,s,u;function a(e){s=e.target.result,i&&o(i,s,u)}function c(e){i=e.target.result,s&&o(i,s,u)}function f(e){var t=e.target.result;if(!t)// done
754
- return o();
753
+ var o,s,u;function a(e){s=e.target.result,o&&i(o,s,u)}function c(e){o=e.target.result,s&&i(o,s,u)}function f(e){var t=e.target.result;if(!t)// done
754
+ return i();
755
755
  // regular IDBCursor acts like a batch where batch size is always 1
756
- o([t.key],[t.value],t)}-1===r&&(r=1e3),"function"==typeof e.getAll&&"function"==typeof e.getAllKeys&&r>1&&!n?(u={continue:function(){if(!i.length)// no more results
757
- return o();
756
+ i([t.key],[t.value],t)}-1===r&&(r=1e3),"function"==typeof e.getAll&&"function"==typeof e.getAllKeys&&r>1&&!n?(u={continue:function(){if(!o.length)// no more results
757
+ return i();
758
758
  // fetch next batch, exclusive start
759
- var n,u=i[i.length-1];if(t&&t.upper)try{n=IDBKeyRange.bound(u,t.upper,!0,t.upperOpen)}catch(e){if("DataError"===e.name&&0===e.code)return o();// we're done, startkey and endkey are equal
760
- }else n=IDBKeyRange.lowerBound(u,!0);t=n,i=null,s=null,e.getAll(t,r).onsuccess=a,e.getAllKeys(t,r).onsuccess=c}},e.getAll(t,r).onsuccess=a,e.getAllKeys(t,r).onsuccess=c):n?e.openCursor(t,"prev").onsuccess=f:e.openCursor(t).onsuccess=f}
759
+ var n,u=o[o.length-1];if(t&&t.upper)try{n=IDBKeyRange.bound(u,t.upper,!0,t.upperOpen)}catch(e){if("DataError"===e.name&&0===e.code)return i();// we're done, startkey and endkey are equal
760
+ }else n=IDBKeyRange.lowerBound(u,!0);t=n,o=null,s=null,e.getAll(t,r).onsuccess=a,e.getAllKeys(t,r).onsuccess=c}},e.getAll(t,r).onsuccess=a,e.getAllKeys(t,r).onsuccess=c):n?e.openCursor(t,"prev").onsuccess=f:e.openCursor(t).onsuccess=f}
761
761
  // simple shim for objectStore.getAll(), falling back to IDBCursor
762
- function tn(e,t,n){var r,o,i="startkey"in e&&e.startkey,s="endkey"in e&&e.endkey,u="key"in e&&e.key,a="keys"in e&&e.keys,c=e.skip||0,f="number"==typeof e.limit?e.limit:-1,l=!1!==e.inclusive_end;if(!a&&(r=function(e,t,n,r,o){try{if(e&&t)return o?IDBKeyRange.bound(t,e,!n,!1):IDBKeyRange.bound(e,t,!1,!n);if(e)return o?IDBKeyRange.upperBound(e):IDBKeyRange.lowerBound(e);if(t)return o?IDBKeyRange.lowerBound(t,!n):IDBKeyRange.upperBound(t,!n);if(r)return IDBKeyRange.only(r)}catch(e){return{error:e}}return null}(i,s,l,u,e.descending),(o=r&&r.error)&&("DataError"!==o.name||0!==o.code)))
762
+ function tn(e,t,n){var r,i,o="startkey"in e&&e.startkey,s="endkey"in e&&e.endkey,u="key"in e&&e.key,a="keys"in e&&e.keys,c=e.skip||0,f="number"==typeof e.limit?e.limit:-1,l=!1!==e.inclusive_end;if(!a&&(r=function(e,t,n,r,i){try{if(e&&t)return i?IDBKeyRange.bound(t,e,!n,!1):IDBKeyRange.bound(e,t,!1,!n);if(e)return i?IDBKeyRange.upperBound(e):IDBKeyRange.lowerBound(e);if(t)return i?IDBKeyRange.lowerBound(t,!n):IDBKeyRange.upperBound(t,!n);if(r)return IDBKeyRange.only(r)}catch(e){return{error:e}}return null}(o,s,l,u,e.descending),(i=r&&r.error)&&("DataError"!==i.name||0!==i.code)))
763
763
  // DataError with error code 0 indicates start is less than end, so
764
764
  // can just do an empty query. Else need to throw
765
- return n(H(Q,o.name,o.message));var d=[Dt,Lt,Mt];e.attachments&&d.push(It);var h=Ht(t,d,"readonly");if(h.error)return n(h.error);var p=h.txn;p.oncomplete=function(){e.attachments?Wt(w,e.binary).then(S):S()}
765
+ return n(H(Q,i.name,i.message));var d=[Dt,Lt,Mt];e.attachments&&d.push(It);var h=Ht(t,d,"readonly");if(h.error)return n(h.error);var p=h.txn;p.oncomplete=function(){e.attachments?Wt(w,e.binary).then(S):S()}
766
766
  // don't bother doing any requests if start > end or limit === 0
767
767
  ,p.onabort=Ft(n);var v,y,g=p.objectStore(Dt),_=p.objectStore(Lt),m=p.objectStore(Mt),b=_.index("_doc_id_rev"),w=[];function k(t,n){var r={id:n.id,key:n.id,value:{rev:t}};n.deleted?a&&(w.push(r),
768
768
  // deleted docs are okay with "keys" requests
769
769
  r.value.deleted=!0,r.doc=null):c--<=0&&(w.push(r),e.include_docs&&
770
770
  // if the user specifies include_docs=true, then we don't
771
771
  // want to block the main cursor while we're fetching the doc
772
- function(t,n,r){var o=t.id+"::"+r;b.get(o).onsuccess=function(r){if(n.doc=zt(r.target.result)||{},e.conflicts){var o=Be(t);o.length&&(n.doc._conflicts=o)}Qt(n.doc,e,p)}}(n,r,t))}function j(e){for(var t=0,n=e.length;t<n&&w.length!==f;t++){var r=e[t];if(r.error&&a)
772
+ function(t,n,r){var i=t.id+"::"+r;b.get(i).onsuccess=function(r){if(n.doc=zt(r.target.result)||{},e.conflicts){var i=Be(t);i.length&&(n.doc._conflicts=i)}Qt(n.doc,e,p)}}(n,r,t))}function j(e){for(var t=0,n=e.length;t<n&&w.length!==f;t++){var r=e[t];if(r.error&&a)
773
773
  // key was not found with "keys" requests
774
- w.push(r);else{var o=Vt(r);k(o.winningRev,o)}}}function O(e,t,n){n&&(j(t),w.length<f&&n.continue())}function S(){var t={total_rows:v,offset:e.skip,rows:w};
774
+ w.push(r);else{var i=Vt(r);k(i.winningRev,i)}}}function O(e,t,n){n&&(j(t),w.length<f&&n.continue())}function S(){var t={total_rows:v,offset:e.skip,rows:w};
775
775
  /* istanbul ignore if */e.update_seq&&void 0!==y&&(t.update_seq=y),n(null,t)}return m.get(Mt).onsuccess=function(e){v=e.target.result.docCount},
776
776
  /* istanbul ignore if */
777
- e.update_seq&&function(e,t){e.openCursor(null,"prev").onsuccess=function(e){var t=e.target.result,n=void 0;return t&&t.key&&(n=t.key),function(e){e.target.result&&e.target.result.length>0&&(y=e.target.result[0])}({target:{result:[n]}})}}(_),o||0===f?void 0:a?function(e,t,n){
777
+ e.update_seq&&function(e,t){e.openCursor(null,"prev").onsuccess=function(e){var t=e.target.result,n=void 0;return t&&t.key&&(n=t.key),function(e){e.target.result&&e.target.result.length>0&&(y=e.target.result[0])}({target:{result:[n]}})}}(_),i||0===f?void 0:a?function(e,t,n){
778
778
  // It's not guaranted to be returned in right order
779
- var r=new Array(e.length),o=0;e.forEach((function(i,s){t.get(i).onsuccess=function(t){t.target.result?r[s]=t.target.result:r[s]={key:i,error:"not_found"},++o===e.length&&n(e,r,{})}}))}(e.keys,g,O):-1===f?function(e,t,n){if("function"!=typeof e.getAll){
779
+ var r=new Array(e.length),i=0;e.forEach((function(o,s){t.get(o).onsuccess=function(t){t.target.result?r[s]=t.target.result:r[s]={key:o,error:"not_found"},++i===e.length&&n(e,r,{})}}))}(e.keys,g,O):-1===f?function(e,t,n){if("function"!=typeof e.getAll){
780
780
  // fall back to cursors
781
781
  var r=[];e.openCursor(t).onsuccess=function(e){var t=e.target.result;t?(r.push(t.value),t.continue()):n({target:{result:r}})}}else
782
782
  // use native getAll
@@ -793,48 +793,48 @@ void en(g,r,e.descending,f+c,O)}
793
793
  // 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916
794
794
  // FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836
795
795
  // This task queue ensures that IDB open calls are done in their own tick
796
- var nn=!1,rn=[];function on(){!nn&&rn.length&&(nn=!0,rn.shift()())}function sn(e,t,n,r){if((e=w(e)).continuous){var s=n+":"+Ae();return Xt.addListener(n,s,t,e),Xt.notify(n),{cancel:function(){Xt.removeListener(n,s)}}}var u=e.doc_ids&&new o(e.doc_ids);e.since=e.since||0;var a=e.since,c="limit"in e?e.limit:-1;0===c&&(c=1);var f,l,d,h,p=[],v=0,y=Z(e),g=new i;function _(e,t,n,r){if(n.seq!==t)
796
+ var nn=!1,rn=[];function on(){!nn&&rn.length&&(nn=!0,rn.shift()())}function sn(e,t,n,r){if((e=w(e)).continuous){var s=n+":"+Ae();return Xt.addListener(n,s,t,e),Xt.notify(n),{cancel:function(){Xt.removeListener(n,s)}}}var u=e.doc_ids&&new i(e.doc_ids);e.since=e.since||0;var a=e.since,c="limit"in e?e.limit:-1;0===c&&(c=1);var f,l,d,h,p=[],v=0,y=Z(e),g=new o;function _(e,t,n,r){if(n.seq!==t)
797
797
  // some other seq is later
798
798
  return r();if(n.winningRev===e._rev)
799
799
  // this is the winning doc
800
800
  return r(n,e);
801
801
  // fetch winning doc in separate request
802
- var o=e._id+"::"+n.winningRev;h.get(o).onsuccess=function(e){r(n,zt(e.target.result))}}function m(){e.complete(null,{results:p,last_seq:a})}var b=[Dt,Lt];e.attachments&&b.push(It);var k=Ht(r,b,"readonly");if(k.error)return e.complete(k.error);(f=k.txn).onabort=Ft(e.complete),f.oncomplete=function(){!e.continuous&&e.attachments?
802
+ var i=e._id+"::"+n.winningRev;h.get(i).onsuccess=function(e){r(n,zt(e.target.result))}}function m(){e.complete(null,{results:p,last_seq:a})}var b=[Dt,Lt];e.attachments&&b.push(It);var k=Ht(r,b,"readonly");if(k.error)return e.complete(k.error);(f=k.txn).onabort=Ft(e.complete),f.oncomplete=function(){!e.continuous&&e.attachments?
803
803
  // cannot guarantee that postProcessing was already done,
804
804
  // so do it again
805
- Wt(p).then(m):m()},l=f.objectStore(Lt),d=f.objectStore(Dt),h=l.index("_doc_id_rev"),en(l,e.since&&!e.descending?IDBKeyRange.lowerBound(e.since,!0):null,e.descending,c,(function(t,n,r){if(r&&t.length){var o=new Array(t.length),i=new Array(t.length),s=0;n.forEach((function(n,a){!function(e,t,n){if(u&&!u.has(e._id))return n();var r=g.get(e._id);if(r)// cached
805
+ Wt(p).then(m):m()},l=f.objectStore(Lt),d=f.objectStore(Dt),h=l.index("_doc_id_rev"),en(l,e.since&&!e.descending?IDBKeyRange.lowerBound(e.since,!0):null,e.descending,c,(function(t,n,r){if(r&&t.length){var i=new Array(t.length),o=new Array(t.length),s=0;n.forEach((function(n,a){!function(e,t,n){if(u&&!u.has(e._id))return n();var r=g.get(e._id);if(r)// cached
806
806
  return _(e,t,r,n);
807
807
  // metadata not cached, have to go fetch it
808
- d.get(e._id).onsuccess=function(o){r=Vt(o.target.result),g.set(e._id,r),_(e,t,r,n)}}(zt(n),t[a],(function(n,u){i[a]=n,o[a]=u,++s===t.length&&function(){for(var t=[],n=0,s=o.length;n<s&&v!==c;n++){var u=o[n];if(u){var a=i[n];t.push(l(a,u))}}Promise.all(t).then((function(t){for(var n=0,r=t.length;n<r;n++)t[n]&&e.onChange(t[n])})).catch(e.complete),v!==c&&r.continue()}
808
+ d.get(e._id).onsuccess=function(i){r=Vt(i.target.result),g.set(e._id,r),_(e,t,r,n)}}(zt(n),t[a],(function(n,u){o[a]=n,i[a]=u,++s===t.length&&function(){for(var t=[],n=0,s=i.length;n<s&&v!==c;n++){var u=i[n];if(u){var a=o[n];t.push(l(a,u))}}Promise.all(t).then((function(t){for(var n=0,r=t.length;n<r;n++)t[n]&&e.onChange(t[n])})).catch(e.complete),v!==c&&r.continue()}
809
809
  // Fetch all metadatas/winningdocs from this batch in parallel, then process
810
810
  // them all only once all data has been collected. This is done in parallel
811
811
  // because it's faster than doing it one-at-a-time.
812
- ()}))}))}function l(t,n){var r=e.processChange(n,t,e);a=r.seq=t.seq;var o=y(r);return"object"==typeof o?Promise.reject(o):o?(v++,e.return_docs&&p.push(r),
812
+ ()}))}))}function l(t,n){var r=e.processChange(n,t,e);a=r.seq=t.seq;var i=y(r);return"object"==typeof i?Promise.reject(i):i?(v++,e.return_docs&&p.push(r),
813
813
  // process the attachment immediately
814
814
  // for the benefit of live listeners
815
- e.attachments&&e.include_docs?new Promise((function(t){Qt(n,e,f,(function(){Wt([r],e.binary).then((function(){t(r)}))}))})):Promise.resolve(r)):Promise.resolve()}}))}var un,an=new i,cn=new i;function fn(e,t){var n=this;!function(e,t,n){rn.push((function(){e((function(e,r){!function(e,t,n,r){try{e(t,n)}catch(t){
815
+ e.attachments&&e.include_docs?new Promise((function(t){Qt(n,e,f,(function(){Wt([r],e.binary).then((function(){t(r)}))}))})):Promise.resolve(r)):Promise.resolve()}}))}var un,an=new o,cn=new o;function fn(e,t){var n=this;!function(e,t,n){rn.push((function(){e((function(e,r){!function(e,t,n,r){try{e(t,n)}catch(t){
816
816
  // Shouldn't happen, but in some odd cases
817
817
  // IndexedDB implementations might throw a sync
818
818
  // error, in which case this will at least log it.
819
- r.emit("error",t)}}(t,e,r,n),nn=!1,s((function(){on()}))}))})),on()}((function(t){!function(e,t,n){var r=t.name,o=null;
819
+ r.emit("error",t)}}(t,e,r,n),nn=!1,s((function(){on()}))}))})),on()}((function(t){!function(e,t,n){var r=t.name,i=null;
820
820
  // called when creating a fresh new database
821
821
  // migration to version 2
822
822
  // unfortunately "deletedOrLocal" is a misnomer now that we no longer
823
823
  // store local docs in the main doc-store, but whaddyagonnado
824
- function i(e,t){var n=e.objectStore(Dt);n.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=r.value,i=Ue(o);o.deletedOrLocal=i?"1":"0",n.put(o),r.continue()}else t()}}
824
+ function o(e,t){var n=e.objectStore(Dt);n.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var i=r.value,o=Ue(i);i.deletedOrLocal=o?"1":"0",n.put(i),r.continue()}else t()}}
825
825
  // migration to version 3 (part 1)
826
826
  // migration to version 3 (part 2)
827
- function u(e,t){var n=e.objectStore(Nt),r=e.objectStore(Dt),o=e.objectStore(Lt);r.openCursor().onsuccess=function(e){var i=e.target.result;if(i){var s=i.value,u=s.id,a=Fe(u),c=xe(s);if(a){var f=u+"::"+c,l=u+"::",d=u+"::~",h=o.index("_doc_id_rev"),p=IDBKeyRange.bound(l,d,!1,!1),v=h.openCursor(p);
827
+ function u(e,t){var n=e.objectStore(Nt),r=e.objectStore(Dt),i=e.objectStore(Lt);r.openCursor().onsuccess=function(e){var o=e.target.result;if(o){var s=o.value,u=s.id,a=Fe(u),c=xe(s);if(a){var f=u+"::"+c,l=u+"::",d=u+"::~",h=i.index("_doc_id_rev"),p=IDBKeyRange.bound(l,d,!1,!1),v=h.openCursor(p);
828
828
  // remove all seq entries
829
829
  // associated with this docId
830
- v.onsuccess=function(e){if(v=e.target.result){var t=v.value;t._doc_id_rev===f&&n.put(t),o.delete(v.primaryKey),v.continue()}else
830
+ v.onsuccess=function(e){if(v=e.target.result){var t=v.value;t._doc_id_rev===f&&n.put(t),i.delete(v.primaryKey),v.continue()}else
831
831
  // done
832
- r.delete(i.primaryKey),i.continue()}}else i.continue()}else t&&t()}}
832
+ r.delete(o.primaryKey),o.continue()}}else o.continue()}else t&&t()}}
833
833
  // migration to version 4 (part 1)
834
834
  // migration to version 4 (part 2)
835
- function a(e,t){var n=e.objectStore(Lt),r=e.objectStore(It),o=e.objectStore(Rt);r.count().onsuccess=function(e){if(!e.target.result)return t();// done
835
+ function a(e,t){var n=e.objectStore(Lt),r=e.objectStore(It),i=e.objectStore(Rt);r.count().onsuccess=function(e){if(!e.target.result)return t();// done
836
836
  n.openCursor().onsuccess=function(e){var n=e.target.result;if(!n)return t();// done
837
- for(var r=n.value,i=n.primaryKey,s=Object.keys(r._attachments||{}),u={},a=0;a<s.length;a++)u[r._attachments[s[a]].digest]=!0;var c=Object.keys(u);for(a=0;a<c.length;a++){var f=c[a];o.put({seq:i,digestSeq:f+"::"+i})}n.continue()}}}
837
+ for(var r=n.value,o=n.primaryKey,s=Object.keys(r._attachments||{}),u={},a=0;a<s.length;a++)u[r._attachments[s[a]].digest]=!0;var c=Object.keys(u);for(a=0;a<c.length;a++){var f=c[a];i.put({seq:o,digestSeq:f+"::"+o})}n.continue()}}}
838
838
  // migration to version 5
839
839
  // Instead of relying on on-the-fly migration of metadata,
840
840
  // this brings the doc-store to its modern form:
@@ -844,46 +844,46 @@ for(var r=n.value,i=n.primaryKey,s=Object.keys(r._attachments||{}),u={},a=0;a<s.
844
844
  function c(e){
845
845
  // ensure that every metadata has a winningRev and seq,
846
846
  // which was previously created on-the-fly but better to migrate
847
- var t=e.objectStore(Lt),n=e.objectStore(Dt);n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=function(e){return e.data?Vt(e):(
847
+ var t=e.objectStore(Lt),n=e.objectStore(Dt);n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var i=function(e){return e.data?Vt(e):(
848
848
  // old format, when we didn't store it stringified
849
- e.deleted="1"===e.deletedOrLocal,e)}(r.value);if(o.winningRev=o.winningRev||xe(o),o.seq)return i();!function(){
849
+ e.deleted="1"===e.deletedOrLocal,e)}(r.value);if(i.winningRev=i.winningRev||xe(i),i.seq)return o();!function(){
850
850
  // metadata.seq was added post-3.2.0, so if it's missing,
851
851
  // we need to fetch it manually
852
- var e=o.id+"::",n=o.id+"::￿",r=t.index("_doc_id_rev").openCursor(IDBKeyRange.bound(e,n)),s=0;r.onsuccess=function(e){var t=e.target.result;if(!t)return o.seq=s,i();var n=t.primaryKey;n>s&&(s=n),t.continue()}}()}function i(){var e=Jt(o,o.winningRev,o.deleted);n.put(e).onsuccess=function(){r.continue()}}}}e._meta=null,e._remote=!1,e.type=function(){return"idb"},e._id=j((function(t){t(null,e._meta.instanceId)})),e._bulkDocs=function(n,r,i){Zt(t,n,r,e,o,i)},
852
+ var e=i.id+"::",n=i.id+"::￿",r=t.index("_doc_id_rev").openCursor(IDBKeyRange.bound(e,n)),s=0;r.onsuccess=function(e){var t=e.target.result;if(!t)return i.seq=s,o();var n=t.primaryKey;n>s&&(s=n),t.continue()}}()}function o(){var e=Jt(i,i.winningRev,i.deleted);n.put(e).onsuccess=function(){r.continue()}}}}e._meta=null,e._remote=!1,e.type=function(){return"idb"},e._id=j((function(t){t(null,e._meta.instanceId)})),e._bulkDocs=function(n,r,o){Zt(t,n,r,e,i,o)},
853
853
  // First we look up the metadata in the ids database, then we fetch the
854
854
  // current revision(s) from the by sequence store
855
- e._get=function(e,t,n){var r,i,s,u=t.ctx;if(!u){var a=Ht(o,[Dt,Lt,It],"readonly");if(a.error)return n(a.error);u=a.txn}function c(){n(s,{doc:r,metadata:i,ctx:u})}u.objectStore(Dt).get(e).onsuccess=function(e){
855
+ e._get=function(e,t,n){var r,o,s,u=t.ctx;if(!u){var a=Ht(i,[Dt,Lt,It],"readonly");if(a.error)return n(a.error);u=a.txn}function c(){n(s,{doc:r,metadata:o,ctx:u})}u.objectStore(Dt).get(e).onsuccess=function(e){
856
856
  // we can determine the result here if:
857
857
  // 1. there is no such document
858
858
  // 2. the document is deleted and we don't ask about specific rev
859
859
  // When we ask with opts.rev we expect the answer to be either
860
860
  // doc (possibly with _deleted=true) or missing error
861
- if(!(i=Vt(e.target.result)))return s=H(I,"missing"),c();var n;if(t.rev)n=t.latest?function(e,t){for(var n,r=t.rev_tree.slice();n=r.pop();){var o=n.pos,i=n.ids,s=i[0],u=i[1],a=i[2],c=0===a.length,f=n.history?n.history.slice():[];if(f.push({id:s,pos:o,opts:u}),c)for(var l=0,d=f.length;l<d;l++){var h=f[l];if(h.pos+"-"+h.id===e)
861
+ if(!(o=Vt(e.target.result)))return s=H(I,"missing"),c();var n;if(t.rev)n=t.latest?function(e,t){for(var n,r=t.rev_tree.slice();n=r.pop();){var i=n.pos,o=n.ids,s=o[0],u=o[1],a=o[2],c=0===a.length,f=n.history?n.history.slice():[];if(f.push({id:s,pos:i,opts:u}),c)for(var l=0,d=f.length;l<d;l++){var h=f[l];if(h.pos+"-"+h.id===e)
862
862
  // return the rev of this leaf
863
- return o+"-"+s}for(var p=0,v=a.length;p<v;p++)r.push({pos:o+1,ids:a[p],history:f})}
864
- /* istanbul ignore next */throw new Error("Unable to resolve latest revision for id "+t.id+", rev "+e)}(t.rev,i):t.rev;else if(n=i.winningRev,Ue(i))return s=H(I,"deleted"),c();var o=u.objectStore(Lt),a=i.id+"::"+n;o.index("_doc_id_rev").get(a).onsuccess=function(e){if((r=e.target.result)&&(r=zt(r)),!r)return s=H(I,"missing"),c();c()}}},e._getAttachment=function(e,t,n,r,i){var s;if(r.ctx)s=r.ctx;else{var u=Ht(o,[Dt,Lt,It],"readonly");if(u.error)return i(u.error);s=u.txn}var a=n.digest,c=n.content_type;s.objectStore(It).get(a).onsuccess=function(e){Gt(e.target.result.body,c,r.binary,(function(e){i(null,e)}))}},e._info=function(t){var n,r,i=Ht(o,[Mt,Lt],"readonly");if(i.error)return t(i.error);var s=i.txn;s.objectStore(Mt).get(Mt).onsuccess=function(e){r=e.target.result.docCount},s.objectStore(Lt).openCursor(null,"prev").onsuccess=function(e){var t=e.target.result;n=t?t.key:0},s.oncomplete=function(){t(null,{doc_count:r,update_seq:n,
863
+ return i+"-"+s}for(var p=0,v=a.length;p<v;p++)r.push({pos:i+1,ids:a[p],history:f})}
864
+ /* istanbul ignore next */throw new Error("Unable to resolve latest revision for id "+t.id+", rev "+e)}(t.rev,o):t.rev;else if(n=o.winningRev,Ue(o))return s=H(I,"deleted"),c();var i=u.objectStore(Lt),a=o.id+"::"+n;i.index("_doc_id_rev").get(a).onsuccess=function(e){if((r=e.target.result)&&(r=zt(r)),!r)return s=H(I,"missing"),c();c()}}},e._getAttachment=function(e,t,n,r,o){var s;if(r.ctx)s=r.ctx;else{var u=Ht(i,[Dt,Lt,It],"readonly");if(u.error)return o(u.error);s=u.txn}var a=n.digest,c=n.content_type;s.objectStore(It).get(a).onsuccess=function(e){Gt(e.target.result.body,c,r.binary,(function(e){o(null,e)}))}},e._info=function(t){var n,r,o=Ht(i,[Mt,Lt],"readonly");if(o.error)return t(o.error);var s=o.txn;s.objectStore(Mt).get(Mt).onsuccess=function(e){r=e.target.result.docCount},s.objectStore(Lt).openCursor(null,"prev").onsuccess=function(e){var t=e.target.result;n=t?t.key:0},s.oncomplete=function(){t(null,{doc_count:r,update_seq:n,
865
865
  // for debugging
866
- idb_attachment_format:e._meta.blobSupport?"binary":"base64"})}},e._allDocs=function(e,t){tn(e,o,t)},e._changes=function(t){return sn(t,e,r,o)},e._close=function(e){
866
+ idb_attachment_format:e._meta.blobSupport?"binary":"base64"})}},e._allDocs=function(e,t){tn(e,i,t)},e._changes=function(t){return sn(t,e,r,i)},e._close=function(e){
867
867
  // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close
868
868
  // "Returns immediately and closes the connection in a separate thread..."
869
- o.close(),an.delete(r),e()},e._getRevisionTree=function(e,t){var n=Ht(o,[Dt],"readonly");if(n.error)return t(n.error);n.txn.objectStore(Dt).get(e).onsuccess=function(e){var n=Vt(e.target.result);n?t(null,n.rev_tree):t(H(I))}},
869
+ i.close(),an.delete(r),e()},e._getRevisionTree=function(e,t){var n=Ht(i,[Dt],"readonly");if(n.error)return t(n.error);n.txn.objectStore(Dt).get(e).onsuccess=function(e){var n=Vt(e.target.result);n?t(null,n.rev_tree):t(H(I))}},
870
870
  // This function removes revisions of document docId
871
871
  // which are listed in revs and sets this document
872
872
  // revision to to rev_tree
873
- e._doCompaction=function(e,t,n){var r=Ht(o,[Dt,Lt,It,Rt],"readwrite");if(r.error)return n(r.error);var i=r.txn;i.objectStore(Dt).get(e).onsuccess=function(n){var r=Vt(n.target.result);qe(r.rev_tree,(function(e,n,r,o,i){var s=n+"-"+r;-1!==t.indexOf(s)&&(i.status="missing")})),Yt(t,e,i);var o=r.winningRev,s=r.deleted;i.objectStore(Dt).put(Jt(r,o,s))},i.onabort=Ft(n),i.oncomplete=function(){n()}},e._getLocal=function(e,t){var n=Ht(o,[Nt],"readonly");if(n.error)return t(n.error);var r=n.txn.objectStore(Nt).get(e);r.onerror=Ft(t),r.onsuccess=function(e){var n=e.target.result;n?(delete n._doc_id_rev,// for backwards compat
873
+ e._doCompaction=function(e,t,n){var r=Ht(i,[Dt,Lt,It,Rt],"readwrite");if(r.error)return n(r.error);var o=r.txn;o.objectStore(Dt).get(e).onsuccess=function(n){var r=Vt(n.target.result);qe(r.rev_tree,(function(e,n,r,i,o){var s=n+"-"+r;-1!==t.indexOf(s)&&(o.status="missing")})),Yt(t,e,o);var i=r.winningRev,s=r.deleted;o.objectStore(Dt).put(Jt(r,i,s))},o.onabort=Ft(n),o.oncomplete=function(){n()}},e._getLocal=function(e,t){var n=Ht(i,[Nt],"readonly");if(n.error)return t(n.error);var r=n.txn.objectStore(Nt).get(e);r.onerror=Ft(t),r.onsuccess=function(e){var n=e.target.result;n?(delete n._doc_id_rev,// for backwards compat
874
874
  t(null,n)):t(H(I))}},e._putLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),delete e._revisions;// ignore this, trust the rev
875
- var r=e._rev,i=e._id;e._rev=r?"0-"+(parseInt(r.split("-")[1],10)+1):"0-1";var s,u=t.ctx;if(!u){var a=Ht(o,[Nt],"readwrite");if(a.error)return n(a.error);(u=a.txn).onerror=Ft(n),u.oncomplete=function(){s&&n(null,s)}}var c,f=u.objectStore(Nt);r?(c=f.get(i)).onsuccess=function(o){var i=o.target.result;i&&i._rev===r?f.put(e).onsuccess=function(){s={ok:!0,id:e._id,rev:e._rev},t.ctx&&// return immediately
875
+ var r=e._rev,o=e._id;e._rev=r?"0-"+(parseInt(r.split("-")[1],10)+1):"0-1";var s,u=t.ctx;if(!u){var a=Ht(i,[Nt],"readwrite");if(a.error)return n(a.error);(u=a.txn).onerror=Ft(n),u.oncomplete=function(){s&&n(null,s)}}var c,f=u.objectStore(Nt);r?(c=f.get(o)).onsuccess=function(i){var o=i.target.result;o&&o._rev===r?f.put(e).onsuccess=function(){s={ok:!0,id:e._id,rev:e._rev},t.ctx&&// return immediately
876
876
  n(null,s)}:n(H(R))}:(// new doc
877
877
  (c=f.add(e)).onerror=function(e){
878
878
  // constraint error, already exists
879
879
  n(H(R)),e.preventDefault(),// avoid transaction abort
880
880
  e.stopPropagation()},c.onsuccess=function(){s={ok:!0,id:e._id,rev:e._rev},t.ctx&&// return immediately
881
- n(null,s)})},e._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={});var r,i=t.ctx;if(!i){var s=Ht(o,[Nt],"readwrite");if(s.error)return n(s.error);(i=s.txn).oncomplete=function(){r&&n(null,r)}}var u=e._id,a=i.objectStore(Nt),c=a.get(u);c.onerror=Ft(n),c.onsuccess=function(o){var i=o.target.result;i&&i._rev===e._rev?(a.delete(u),r={ok:!0,id:u,rev:"0-0"},t.ctx&&// return immediately
881
+ n(null,s)})},e._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={});var r,o=t.ctx;if(!o){var s=Ht(i,[Nt],"readwrite");if(s.error)return n(s.error);(o=s.txn).oncomplete=function(){r&&n(null,r)}}var u=e._id,a=o.objectStore(Nt),c=a.get(u);c.onerror=Ft(n),c.onsuccess=function(i){var o=i.target.result;o&&o._rev===e._rev?(a.delete(u),r={ok:!0,id:u,rev:"0-0"},t.ctx&&// return immediately
882
882
  n(null,r)):n(H(I))}},e._destroy=function(e,t){Xt.removeAllListeners(r);
883
883
  //Close open request for "dbName" database to fix ie delay.
884
- var n=cn.get(r);n&&n.result&&(n.result.close(),an.delete(r));var o=indexedDB.deleteDatabase(r);o.onsuccess=function(){
884
+ var n=cn.get(r);n&&n.result&&(n.result.close(),an.delete(r));var i=indexedDB.deleteDatabase(r);i.onsuccess=function(){
885
885
  //Remove open request from the list.
886
- cn.delete(r),q()&&r in localStorage&&delete localStorage[r],t(null,{ok:!0})},o.onerror=Ft(t)};var f=an.get(r);if(f)return o=f.idb,e._meta=f.global,s((function(){n(null,e)}));var l=indexedDB.open(r,5);cn.set(r,l),l.onupgradeneeded=function(e){var t=e.target.result;if(e.oldVersion<1)return function(e){var t=e.createObjectStore(Dt,{keyPath:"id"});e.createObjectStore(Lt,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),e.createObjectStore(It,{keyPath:"digest"}),e.createObjectStore(Mt,{keyPath:"id",autoIncrement:!1}),e.createObjectStore(Kt),
886
+ cn.delete(r),q()&&r in localStorage&&delete localStorage[r],t(null,{ok:!0})},i.onerror=Ft(t)};var f=an.get(r);if(f)return i=f.idb,e._meta=f.global,s((function(){n(null,e)}));var l=indexedDB.open(r,5);cn.set(r,l),l.onupgradeneeded=function(e){var t=e.target.result;if(e.oldVersion<1)return function(e){var t=e.createObjectStore(Dt,{keyPath:"id"});e.createObjectStore(Lt,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),e.createObjectStore(It,{keyPath:"digest"}),e.createObjectStore(Mt,{keyPath:"id",autoIncrement:!1}),e.createObjectStore(Kt),
887
887
  // added in v2
888
888
  t.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),
889
889
  // added in v3
@@ -894,19 +894,19 @@ var n=e.createObjectStore(Rt,{autoIncrement:!0});n.createIndex("seq","seq"),n.cr
894
894
  var n=e.currentTarget.transaction;
895
895
  // these migrations have to be done in this function, before
896
896
  // control is returned to the event loop, because IndexedDB
897
- e.oldVersion<3&&function(e){e.createObjectStore(Nt,{keyPath:"_id"}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0})}(t),e.oldVersion<4&&function(e){var t=e.createObjectStore(Rt,{autoIncrement:!0});t.createIndex("seq","seq"),t.createIndex("digestSeq","digestSeq",{unique:!0})}(t);var r=[i,// v1 -> v2
897
+ e.oldVersion<3&&function(e){e.createObjectStore(Nt,{keyPath:"_id"}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0})}(t),e.oldVersion<4&&function(e){var t=e.createObjectStore(Rt,{autoIncrement:!0});t.createIndex("seq","seq"),t.createIndex("digestSeq","digestSeq",{unique:!0})}(t);var r=[o,// v1 -> v2
898
898
  u,// v2 -> v3
899
899
  a,// v3 -> v4
900
- c],o=e.oldVersion;!function e(){var t=r[o-1];o++,t&&t(n,e)}()},l.onsuccess=function(t){(o=t.target.result).onversionchange=function(){o.close(),an.delete(r)},o.onabort=function(e){C("error","Database has a global failure",e.target.error),o.close(),an.delete(r)};
900
+ c],i=e.oldVersion;!function e(){var t=r[i-1];i++,t&&t(n,e)}()},l.onsuccess=function(t){(i=t.target.result).onversionchange=function(){i.close(),an.delete(r)},i.onabort=function(e){C("error","Database has a global failure",e.target.error),i.close(),an.delete(r)};
901
901
  // Do a few setup operations (in parallel as much as possible):
902
902
  // 1. Fetch meta doc
903
903
  // 2. Check blob support
904
904
  // 3. Calculate docCount
905
905
  // 4. Generate an instanceId if necessary
906
906
  // 5. Store docCount and instanceId on meta doc
907
- var i,s,u,a,c=o.transaction([Mt,Kt,Dt],"readwrite"),f=!1;function l(){void 0!==u&&f&&(e._meta={name:r,instanceId:a,blobSupport:u},an.set(r,{idb:o,global:e._meta}),n(null,e))}function d(){if(void 0!==s&&void 0!==i){var e=r+"_id";e in i?a=i[e]:i[e]=a=Ae(),i.docCount=s,c.objectStore(Mt).put(i)}}
907
+ var o,s,u,a,c=i.transaction([Mt,Kt,Dt],"readwrite"),f=!1;function l(){void 0!==u&&f&&(e._meta={name:r,instanceId:a,blobSupport:u},an.set(r,{idb:i,global:e._meta}),n(null,e))}function d(){if(void 0!==s&&void 0!==o){var e=r+"_id";e in o?a=o[e]:o[e]=a=Ae(),o.docCount=s,c.objectStore(Mt).put(o)}}
908
908
  // fetch or generate the instanceId
909
- c.objectStore(Mt).get(Mt).onsuccess=function(e){i=e.target.result||{id:Mt},d()},
909
+ c.objectStore(Mt).get(Mt).onsuccess=function(e){o=e.target.result||{id:Mt},d()},
910
910
  // countDocs
911
911
  function(e,t){e.objectStore(Dt).index("deletedOrLocal").count(IDBKeyRange.only("0")).onsuccess=function(e){!function(e){s=e,d()}(e.target.result)}}(c),
912
912
  // check blob support
@@ -946,24 +946,24 @@ return e.protocol+"://"+e.host+(e.port?":"+e.port:"")+"/"+e.path+n+t}function _n
946
946
  // Implements the PouchDB API for dealing with CouchDB instances over HTTP
947
947
  function mn(e,t){
948
948
  // The functions that will be publicly available for HttpPouch
949
- var r=this,o=function(e,t){
949
+ var r=this,i=function(e,t){
950
950
  // encode db name if opts.prefix is a url (#5574)
951
951
  if(function(e){if(!e.prefix)return!1;var t=ce(e.prefix).protocol;return"http"===t||"https"===t}(t)){var n=t.name.substr(t.prefix.length);
952
952
  // Ensure prefix has a trailing slash
953
953
  e=t.prefix.replace(/\/?$/,"/")+encodeURIComponent(n)}var r=ce(e);(r.user||r.password)&&(r.auth={username:r.user,password:r.password});
954
954
  // Split the path part of the URI into parts using '/' as the delimiter
955
955
  // after removing any leading '/' and any trailing '/'
956
- var o=r.path.replace(/(^\/|\/$)/g,"").split("/");return r.db=o.pop(),
956
+ var i=r.path.replace(/(^\/|\/$)/g,"").split("/");return r.db=i.pop(),
957
957
  // Prevent double encoding of URI component
958
- -1===r.db.indexOf("%")&&(r.db=encodeURIComponent(r.db)),r.path=o.join("/"),r}(e.name,e),i=yn(o,"");e=w(e);var u,a=function(t,n){if((n=n||{}).headers=n.headers||new tt,n.credentials="include",e.auth||o.auth){var r=e.auth||o.auth,i=r.username+":"+r.password,s=he(unescape(encodeURIComponent(i)));n.headers.set("Authorization","Basic "+s)}var u=e.headers||{};return Object.keys(u).forEach((function(e){n.headers.append(e,u[e])})),
958
+ -1===r.db.indexOf("%")&&(r.db=encodeURIComponent(r.db)),r.path=i.join("/"),r}(e.name,e),o=yn(i,"");e=w(e);var u,a=function(t,n){if((n=n||{}).headers=n.headers||new tt,n.credentials="include",e.auth||i.auth){var r=e.auth||i.auth,o=r.username+":"+r.password,s=he(unescape(encodeURIComponent(o)));n.headers.set("Authorization","Basic "+s)}var u=e.headers||{};return Object.keys(u).forEach((function(e){n.headers.append(e,u[e])})),
959
959
  /* istanbul ignore if */
960
- function(e){var t="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",n=-1!==t.indexOf("msie"),r=-1!==t.indexOf("trident"),o=-1!==t.indexOf("edge"),i=!("method"in e)||"GET"===e.method;return(n||r||o)&&i}(n)&&(t+=(-1===t.indexOf("?")?"?":"&")+"_nonce="+Date.now()),(e.fetch||et)(t,n)};function c(e,t){return O(e,f((function(e){d().then((function(){return t.apply(this,e)})).catch((function(t){e.pop()(t)}))}))).bind(r)}function l(e,t,n){var r={};return(t=t||{}).headers=t.headers||new tt,t.headers.get("Content-Type")||t.headers.set("Content-Type","application/json"),t.headers.get("Accept")||t.headers.set("Accept","application/json"),a(e,t).then((function(e){return r.ok=e.ok,r.status=e.status,e.json()})).then((function(e){if(r.data=e,!r.ok){r.data.status=r.status;var t=X(r.data);if(n)return n(t);throw t}if(Array.isArray(r.data)&&(r.data=r.data.map((function(e){return e.error||e.missing?X(e):e}))),!n)return r;n(null,r.data)}))}function d(){return e.skip_setup?Promise.resolve():
960
+ function(e){var t="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",n=-1!==t.indexOf("msie"),r=-1!==t.indexOf("trident"),i=-1!==t.indexOf("edge"),o=!("method"in e)||"GET"===e.method;return(n||r||i)&&o}(n)&&(t+=(-1===t.indexOf("?")?"?":"&")+"_nonce="+Date.now()),(e.fetch||et)(t,n)};function c(e,t){return O(e,f((function(e){d().then((function(){return t.apply(this,e)})).catch((function(t){e.pop()(t)}))}))).bind(r)}function l(e,t,n){var r={};return(t=t||{}).headers=t.headers||new tt,t.headers.get("Content-Type")||t.headers.set("Content-Type","application/json"),t.headers.get("Accept")||t.headers.set("Accept","application/json"),a(e,t).then((function(e){return r.ok=e.ok,r.status=e.status,e.json()})).then((function(e){if(r.data=e,!r.ok){r.data.status=r.status;var t=X(r.data);if(n)return n(t);throw t}if(Array.isArray(r.data)&&(r.data=r.data.map((function(e){return e.error||e.missing?X(e):e}))),!n)return r;n(null,r.data)}))}function d(){return e.skip_setup?Promise.resolve():
961
961
  // If there is a setup in process or previous successful setup
962
962
  // done then we will use that
963
963
  // If previous setups have been rejected we will try again
964
- u||((u=l(i).catch((function(e){return e&&e.status&&404===e.status?(
964
+ u||((u=l(o).catch((function(e){return e&&e.status&&404===e.status?(
965
965
  // Doesnt exist, create it
966
- $(404,"PouchDB is just detecting if the remote exists."),l(i,{method:"PUT"})):Promise.reject(e)})).catch((function(e){
966
+ $(404,"PouchDB is just detecting if the remote exists."),l(o,{method:"PUT"})):Promise.reject(e)})).catch((function(e){
967
967
  // If we try to create a database that already exists, skipped in
968
968
  // istanbul since its catching a race condition.
969
969
  /* istanbul ignore if */
@@ -971,33 +971,33 @@ return!(!e||!e.status||412!==e.status)||Promise.reject(e)}))).catch((function(){
971
971
  // Get the attachment
972
972
  s((function(){t(null,r)})),r._remote=!0,
973
973
  /* istanbul ignore next */
974
- r.type=function(){return"http"},r.id=c("id",(function(e){a(gn(o,"")).then((function(e){return e.json()})).catch((function(){return{}})).then((function(t){
974
+ r.type=function(){return"http"},r.id=c("id",(function(e){a(gn(i,"")).then((function(e){return e.json()})).catch((function(){return{}})).then((function(t){
975
975
  // Bad response or missing `uuid` should not prevent ID generation.
976
- var n=t&&t.uuid?t.uuid+o.db:yn(o,"");e(null,n)}))})),
976
+ var n=t&&t.uuid?t.uuid+i.db:yn(i,"");e(null,n)}))})),
977
977
  // Sends a POST request to the host calling the couchdb _compact function
978
978
  // version: The version of CouchDB it is running
979
- r.compact=c("compact",(function(e,t){"function"==typeof e&&(t=e,e={}),e=w(e),l(yn(o,"_compact"),{method:"POST"}).then((function(){
979
+ r.compact=c("compact",(function(e,t){"function"==typeof e&&(t=e,e={}),e=w(e),l(yn(i,"_compact"),{method:"POST"}).then((function(){
980
980
  // Ping the http if it's finished compaction
981
- !function n(){r.info((function(r,o){
981
+ !function n(){r.info((function(r,i){
982
982
  // CouchDB may send a "compact_running:true" if it's
983
983
  // already compacting. PouchDB Server doesn't.
984
984
  /* istanbul ignore else */
985
- o&&!o.compact_running?t(null,{ok:!0}):setTimeout(n,e.interval||200)}))}()}))})),r.bulkGet=O("bulkGet",(function(e,t){var n=this;function r(t){var n={};e.revs&&(n.revs=!0),e.attachments&&(
986
- /* istanbul ignore next */n.attachments=!0),e.latest&&(n.latest=!0),l(yn(o,"_bulk_get"+_n(n)),{method:"POST",body:JSON.stringify({docs:e.docs})}).then((function(n){e.attachments&&e.binary&&n.data.results.forEach((function(e){e.docs.forEach(hn)})),t(null,n.data)})).catch(t)}
987
- /* istanbul ignore next */function i(){
985
+ i&&!i.compact_running?t(null,{ok:!0}):setTimeout(n,e.interval||200)}))}()}))})),r.bulkGet=O("bulkGet",(function(e,t){var n=this;function r(t){var n={};e.revs&&(n.revs=!0),e.attachments&&(
986
+ /* istanbul ignore next */n.attachments=!0),e.latest&&(n.latest=!0),l(yn(i,"_bulk_get"+_n(n)),{method:"POST",body:JSON.stringify({docs:e.docs})}).then((function(n){e.attachments&&e.binary&&n.data.results.forEach((function(e){e.docs.forEach(hn)})),t(null,n.data)})).catch(t)}
987
+ /* istanbul ignore next */function o(){
988
988
  // avoid "url too long error" by splitting up into multiple requests
989
- var r=Math.ceil(e.docs.length/50),o=0,i=new Array(r);function s(e){return function(n,s){
989
+ var r=Math.ceil(e.docs.length/50),i=0,o=new Array(r);function s(e){return function(n,s){
990
990
  // err is impossible because shim returns a list of errs in that case
991
- i[e]=s.results,++o===r&&t(null,{results:ee(i)})}}for(var u=0;u<r;u++){var a=S(e,["revs","attachments","binary","latest"]);a.docs=e.docs.slice(50*u,Math.min(e.docs.length,50*(u+1))),x(n,a,s(u))}}
991
+ o[e]=s.results,++i===r&&t(null,{results:ee(o)})}}for(var u=0;u<r;u++){var a=S(e,["revs","attachments","binary","latest"]);a.docs=e.docs.slice(50*u,Math.min(e.docs.length,50*(u+1))),x(n,a,s(u))}}
992
992
  // mark the whole database as either supporting or not supporting _bulk_get
993
- var s=gn(o,""),u=dn[s];
993
+ var s=gn(i,""),u=dn[s];
994
994
  /* istanbul ignore next */"boolean"!=typeof u?
995
995
  // check if this database supports _bulk_get
996
- r((function(e,n){e?(dn[s]=!1,$(e.status,"PouchDB is just detecting if the remote supports the _bulk_get API."),i()):(dn[s]=!0,t(null,n))})):u?r(t):i()})),
996
+ r((function(e,n){e?(dn[s]=!1,$(e.status,"PouchDB is just detecting if the remote supports the _bulk_get API."),o()):(dn[s]=!0,t(null,n))})):u?r(t):o()})),
997
997
  // Calls GET on the host, which gets back a JSON string containing
998
998
  // couchdb: A welcome string
999
999
  // version: The version of CouchDB it is running
1000
- r._info=function(e){d().then((function(){return a(yn(o,""))})).then((function(e){return e.json()})).then((function(t){t.host=yn(o,""),e(null,t)})).catch(e)},r.fetch=function(e,t){return d().then((function(){var n="/"===e.substring(0,1)?gn(o,e.substring(1)):yn(o,e);return a(n,t)}))},
1000
+ r._info=function(e){d().then((function(){return a(yn(i,""))})).then((function(e){return e.json()})).then((function(t){t.host=yn(i,""),e(null,t)})).catch(e)},r.fetch=function(e,t){return d().then((function(){var n="/"===e.substring(0,1)?gn(i,e.substring(1)):yn(i,e);return a(n,t)}))},
1001
1001
  // Get the document with the given id from the database given by host.
1002
1002
  // The id could be solely the _id in the database, or it may be a
1003
1003
  // _design/ID or _local/ID path
@@ -1005,39 +1005,39 @@ r.get=c("get",(function(e,t,n){
1005
1005
  // If no options were given, set the callback to the second parameter
1006
1006
  "function"==typeof t&&(n=t,t={});
1007
1007
  // List of parameters to add to the GET request
1008
- var r={};function i(e){var n=e._attachments,r=n&&Object.keys(n);if(n&&r.length)
1008
+ var r={};function o(e){var n=e._attachments,r=n&&Object.keys(n);if(n&&r.length)
1009
1009
  // This limits the number of parallel xhr requests to 5 any time
1010
1010
  // to avoid issues with maximum browser request limits
1011
1011
  // dead simple promise pool, inspired by https://github.com/timdp/es6-promise-pool
1012
1012
  // but much smaller in code size. limits the number of concurrent promises that are executed
1013
- return function(e,t){return new Promise((function(t,n){var r,o=0,i=0,s=0,u=e.length;function a(){++s===u?
1013
+ return function(e,t){return new Promise((function(t,n){var r,i=0,o=0,s=0,u=e.length;function a(){++s===u?
1014
1014
  /* istanbul ignore if */
1015
- r?n(r):t():l()}function c(){o--,a()}
1016
- /* istanbul ignore next */function f(e){o--,r=r||e,a()}function l(){for(;o<5&&i<u;)o++,e[i++]().then(c,f)}l()}))}(r.map((function(r){return function(){
1015
+ r?n(r):t():l()}function c(){i--,a()}
1016
+ /* istanbul ignore next */function f(e){i--,r=r||e,a()}function l(){for(;i<5&&o<u;)i++,e[o++]().then(c,f)}l()}))}(r.map((function(r){return function(){
1017
1017
  // we fetch these manually in separate XHRs, because
1018
1018
  // Sync Gateway would normally send it back as multipart/mixed,
1019
1019
  // which we cannot parse. Also, this is more efficient than
1020
1020
  // receiving attachments as base64-encoded strings.
1021
- return function(r){var i=n[r],s=pn(e._id)+"/"+h(r)+"?rev="+e._rev;return a(yn(o,s)).then((function(e){return"buffer"in e?e.buffer():e.blob()})).then((function(e){if(t.binary){var n=Object.getOwnPropertyDescriptor(e.__proto__,"type");return n&&!n.set||(e.type=i.content_type),e}return new Promise((function(t){be(e,t)}))})).then((function(e){delete i.stub,delete i.length,i.data=e}))}(r)}})))}(t=w(t)).revs&&(r.revs=!0),t.revs_info&&(r.revs_info=!0),t.latest&&(r.latest=!0),t.open_revs&&("all"!==t.open_revs&&(t.open_revs=JSON.stringify(t.open_revs)),r.open_revs=t.open_revs),t.rev&&(r.rev=t.rev),t.conflicts&&(r.conflicts=t.conflicts
1022
- /* istanbul ignore if */),t.update_seq&&(r.update_seq=t.update_seq),e=pn(e),l(yn(o,e+_n(r))).then((function(e){return Promise.resolve().then((function(){if(t.attachments)return n=e.data,Array.isArray(n)?Promise.all(n.map((function(e){if(e.ok)return i(e.ok)}))):i(n);var n})).then((function(){n(null,e.data)}))})).catch((function(t){t.docId=e,n(t)}))})),
1021
+ return function(r){var o=n[r],s=pn(e._id)+"/"+h(r)+"?rev="+e._rev;return a(yn(i,s)).then((function(e){return"buffer"in e?e.buffer():e.blob()})).then((function(e){if(t.binary){var n=Object.getOwnPropertyDescriptor(e.__proto__,"type");return n&&!n.set||(e.type=o.content_type),e}return new Promise((function(t){be(e,t)}))})).then((function(e){delete o.stub,delete o.length,o.data=e}))}(r)}})))}(t=w(t)).revs&&(r.revs=!0),t.revs_info&&(r.revs_info=!0),t.latest&&(r.latest=!0),t.open_revs&&("all"!==t.open_revs&&(t.open_revs=JSON.stringify(t.open_revs)),r.open_revs=t.open_revs),t.rev&&(r.rev=t.rev),t.conflicts&&(r.conflicts=t.conflicts
1022
+ /* istanbul ignore if */),t.update_seq&&(r.update_seq=t.update_seq),e=pn(e),l(yn(i,e+_n(r))).then((function(e){return Promise.resolve().then((function(){if(t.attachments)return n=e.data,Array.isArray(n)?Promise.all(n.map((function(e){if(e.ok)return o(e.ok)}))):o(n);var n})).then((function(){n(null,e.data)}))})).catch((function(t){t.docId=e,n(t)}))})),
1023
1023
  // Delete the document given by doc from the database given by host.
1024
- r.remove=c("remove",(function(e,t,n,r){var i;"string"==typeof t?(
1024
+ r.remove=c("remove",(function(e,t,n,r){var o;"string"==typeof t?(
1025
1025
  // id, rev, opts, callback style
1026
- i={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
1026
+ o={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
1027
1027
  // doc, opts, callback style
1028
- i=e,"function"==typeof t?(r=t,n={}):(r=n,n=t));var s=i._rev||n.rev;l(yn(o,pn(i._id))+"?rev="+s,{method:"DELETE"},r).catch(r)})),r.getAttachment=c("getAttachment",(function(e,t,r,i){"function"==typeof r&&(i=r,r={});var s,u=r.rev?"?rev="+r.rev:"",c=yn(o,pn(e))+"/"+h(t)+u;a(c,{method:"GET"}).then((function(e){if(s=e.headers.get("content-type"),e.ok)return void 0===n||n.browser||"function"!=typeof e.buffer?e.blob():e.buffer();throw e})).then((function(e){
1028
+ o=e,"function"==typeof t?(r=t,n={}):(r=n,n=t));var s=o._rev||n.rev;l(yn(i,pn(o._id))+"?rev="+s,{method:"DELETE"},r).catch(r)})),r.getAttachment=c("getAttachment",(function(e,t,r,o){"function"==typeof r&&(o=r,r={});var s,u=r.rev?"?rev="+r.rev:"",c=yn(i,pn(e))+"/"+h(t)+u;a(c,{method:"GET"}).then((function(e){if(s=e.headers.get("content-type"),e.ok)return void 0===n||n.browser||"function"!=typeof e.buffer?e.blob():e.buffer();throw e})).then((function(e){
1029
1029
  // TODO: also remove
1030
- void 0===n||n.browser||(e.type=s),i(null,e)})).catch((function(e){i(e)}))})),
1030
+ void 0===n||n.browser||(e.type=s),o(null,e)})).catch((function(e){o(e)}))})),
1031
1031
  // Remove the attachment given by the id and rev
1032
- r.removeAttachment=c("removeAttachment",(function(e,t,n,r){l(yn(o,pn(e)+"/"+h(t))+"?rev="+n,{method:"DELETE"},r).catch(r)})),
1032
+ r.removeAttachment=c("removeAttachment",(function(e,t,n,r){l(yn(i,pn(e)+"/"+h(t))+"?rev="+n,{method:"DELETE"},r).catch(r)})),
1033
1033
  // Add the attachment given by blob and its contentType property
1034
1034
  // to the document with the given id, the revision given by rev, and
1035
1035
  // add it to the database given by host.
1036
- r.putAttachment=c("putAttachment",(function(e,t,n,r,i,s){"function"==typeof i&&(s=i,i=r,r=n,n=null);var u=pn(e)+"/"+h(t),a=yn(o,u);if(n&&(a+="?rev="+n),"string"==typeof r){
1036
+ r.putAttachment=c("putAttachment",(function(e,t,n,r,o,s){"function"==typeof o&&(s=o,o=r,r=n,n=null);var u=pn(e)+"/"+h(t),a=yn(i,u);if(n&&(a+="?rev="+n),"string"==typeof r){
1037
1037
  // input is assumed to be a base64 string
1038
- var c;try{c=de(r)}catch(e){return s(H(F,"Attachment is not a valid base64 string"))}r=c?ye(c,i):""}
1038
+ var c;try{c=de(r)}catch(e){return s(H(F,"Attachment is not a valid base64 string"))}r=c?ye(c,o):""}
1039
1039
  // Add the attachment
1040
- l(a,{headers:new tt({"Content-Type":i}),method:"PUT",body:r},s).catch(s)})),
1040
+ l(a,{headers:new tt({"Content-Type":o}),method:"PUT",body:r},s).catch(s)})),
1041
1041
  // Update/create multiple documents given by req in the database
1042
1042
  // given by host.
1043
1043
  r._bulkDocs=function(e,t,n){
@@ -1046,17 +1046,17 @@ r._bulkDocs=function(e,t,n){
1046
1046
  // the old ones. This is used in database replication.
1047
1047
  e.new_edits=t.new_edits,d().then((function(){return Promise.all(e.docs.map(vn))})).then((function(){
1048
1048
  // Update/create the documents
1049
- return l(yn(o,"_bulk_docs"),{method:"POST",body:JSON.stringify(e)},n)})).catch(n)},
1049
+ return l(yn(i,"_bulk_docs"),{method:"POST",body:JSON.stringify(e)},n)})).catch(n)},
1050
1050
  // Update/create document
1051
- r._put=function(e,t,n){d().then((function(){return vn(e)})).then((function(){return l(yn(o,pn(e._id)),{method:"PUT",body:JSON.stringify(e)})})).then((function(e){n(null,e.data)})).catch((function(t){t.docId=e&&e._id,n(t)}))},
1051
+ r._put=function(e,t,n){d().then((function(){return vn(e)})).then((function(){return l(yn(i,pn(e._id)),{method:"PUT",body:JSON.stringify(e)})})).then((function(e){n(null,e.data)})).catch((function(t){t.docId=e&&e._id,n(t)}))},
1052
1052
  // Get a listing of the documents in the database given
1053
1053
  // by host and ordered by increasing id.
1054
1054
  r.allDocs=c("allDocs",(function(e,t){"function"==typeof e&&(t=e,e={});
1055
1055
  // List of parameters to add to the GET request
1056
- var n,r={},i="GET";(e=w(e)).conflicts&&(r.conflicts=!0
1056
+ var n,r={},o="GET";(e=w(e)).conflicts&&(r.conflicts=!0
1057
1057
  /* istanbul ignore if */),e.update_seq&&(r.update_seq=!0),e.descending&&(r.descending=!0),e.include_docs&&(r.include_docs=!0),
1058
1058
  // added in CouchDB 1.6.0
1059
- e.attachments&&(r.attachments=!0),e.key&&(r.key=JSON.stringify(e.key)),e.start_key&&(e.startkey=e.start_key),e.startkey&&(r.startkey=JSON.stringify(e.startkey)),e.end_key&&(e.endkey=e.end_key),e.endkey&&(r.endkey=JSON.stringify(e.endkey)),void 0!==e.inclusive_end&&(r.inclusive_end=!!e.inclusive_end),void 0!==e.limit&&(r.limit=e.limit),void 0!==e.skip&&(r.skip=e.skip);var s=_n(r);void 0!==e.keys&&(i="POST",n={keys:e.keys}),l(yn(o,"_all_docs"+s),{method:i,body:JSON.stringify(n)}).then((function(n){e.include_docs&&e.attachments&&e.binary&&n.data.rows.forEach(hn),t(null,n.data)})).catch(t)})),
1059
+ e.attachments&&(r.attachments=!0),e.key&&(r.key=JSON.stringify(e.key)),e.start_key&&(e.startkey=e.start_key),e.startkey&&(r.startkey=JSON.stringify(e.startkey)),e.end_key&&(e.endkey=e.end_key),e.endkey&&(r.endkey=JSON.stringify(e.endkey)),void 0!==e.inclusive_end&&(r.inclusive_end=!!e.inclusive_end),void 0!==e.limit&&(r.limit=e.limit),void 0!==e.skip&&(r.skip=e.skip);var s=_n(r);void 0!==e.keys&&(o="POST",n={keys:e.keys}),l(yn(i,"_all_docs"+s),{method:o,body:JSON.stringify(n)}).then((function(n){e.include_docs&&e.attachments&&e.binary&&n.data.rows.forEach(hn),t(null,n.data)})).catch(t)})),
1060
1060
  // Get a list of changes made to documents in the database given by host.
1061
1061
  // TODO According to the README, there should be two other methods here,
1062
1062
  // api.changes.addListener and api.changes.removeListener.
@@ -1068,7 +1068,7 @@ r._changes=function(e){
1068
1068
  var t="batch_size"in e?e.batch_size:25;(e=w(e)).continuous&&!("heartbeat"in e)&&(e.heartbeat=1e4);var n="timeout"in e?e.timeout:3e4;
1069
1069
  // ensure CHANGES_TIMEOUT_BUFFER applies
1070
1070
  "timeout"in e&&e.timeout&&n-e.timeout<ln&&(n=e.timeout+ln
1071
- /* istanbul ignore if */),"heartbeat"in e&&e.heartbeat&&n-e.heartbeat<ln&&(n=e.heartbeat+ln);var r={};"timeout"in e&&e.timeout&&(r.timeout=e.timeout);var i=void 0!==e.limit&&e.limit,u=i;
1071
+ /* istanbul ignore if */),"heartbeat"in e&&e.heartbeat&&n-e.heartbeat<ln&&(n=e.heartbeat+ln);var r={};"timeout"in e&&e.timeout&&(r.timeout=e.timeout);var o=void 0!==e.limit&&e.limit,u=o;
1072
1072
  // If opts.query_params exists, pass it through to the changes request.
1073
1073
  // These parameters may be used by the filter on the source database.
1074
1074
  if(e.style&&(r.style=e.style),(e.include_docs||e.filter&&"function"==typeof e.filter)&&(r.include_docs=!0),e.attachments&&(r.attachments=!0),e.continuous&&(r.feed="longpoll"),e.seq_interval&&(r.seq_interval=e.seq_interval),e.conflicts&&(r.conflicts=!0),e.descending&&(r.descending=!0
@@ -1082,15 +1082,15 @@ r.filter="_doc_ids",f="POST",c={doc_ids:e.doc_ids}):e.selector&&(
1082
1082
  r.filter="_selector",f="POST",c={selector:e.selector});var h,p=new Ze,v=function(n,s){if(!e.aborted){r.since=n,
1083
1083
  // "since" can be any kind of json object in Cloudant/CouchDB 2.x
1084
1084
  /* istanbul ignore next */
1085
- "object"==typeof r.since&&(r.since=JSON.stringify(r.since)),e.descending?i&&(r.limit=u):r.limit=!i||u>t?t:u;
1085
+ "object"==typeof r.since&&(r.since=JSON.stringify(r.since)),e.descending?o&&(r.limit=u):r.limit=!o||u>t?t:u;
1086
1086
  // Set the options for the ajax call
1087
- var a=yn(o,"_changes"+_n(r)),v={signal:p.signal,method:f,body:JSON.stringify(c)};h=n,
1087
+ var a=yn(i,"_changes"+_n(r)),v={signal:p.signal,method:f,body:JSON.stringify(c)};h=n,
1088
1088
  /* istanbul ignore if */
1089
1089
  e.aborted||
1090
1090
  // Get the changes
1091
- d().then((function(){return l(a,v,s)})).catch(s)}},y={results:[]},g=function(n,r){if(!e.aborted){var o=0;
1091
+ d().then((function(){return l(a,v,s)})).catch(s)}},y={results:[]},g=function(n,r){if(!e.aborted){var i=0;
1092
1092
  // If the result of the ajax call (res) contains changes (res.results)
1093
- if(r&&r.results){o=r.results.length,y.last_seq=r.last_seq;var a=null,c=null;
1093
+ if(r&&r.results){i=r.results.length,y.last_seq=r.last_seq;var a=null,c=null;
1094
1094
  // Attach 'pending' property if server supports it (CouchDB 2.0+)
1095
1095
  /* istanbul ignore if */"number"==typeof r.pending&&(a=r.pending),"string"!=typeof y.last_seq&&"number"!=typeof y.last_seq||(c=y.last_seq),e.query_params,r.results=r.results.filter((function(t){u--;var n=Z(e)(t);return n&&(e.include_docs&&e.attachments&&e.binary&&hn(t),e.return_docs&&y.results.push(t),e.onChange(t,a,c)),n}))}else if(n)
1096
1096
  // In case of an error, stop listening for changes and call
@@ -1098,7 +1098,7 @@ if(r&&r.results){o=r.results.length,y.last_seq=r.last_seq;var a=null,c=null;
1098
1098
  return e.aborted=!0,void e.complete(n);
1099
1099
  // The changes feed may have timed out with no results
1100
1100
  // if so reuse last update sequence
1101
- r&&r.last_seq&&(h=r.last_seq);var f=i&&u<=0||r&&o<t||e.descending;(!e.continuous||i&&u<=0)&&f?
1101
+ r&&r.last_seq&&(h=r.last_seq);var f=o&&u<=0||r&&i<t||e.descending;(!e.continuous||o&&u<=0)&&f?
1102
1102
  // We're done, call the callback
1103
1103
  e.complete(null,y):
1104
1104
  // Queue a call to fetch again with the newest sequence number
@@ -1112,18 +1112,18 @@ r.revsDiff=c("revsDiff",(function(e,t,n){
1112
1112
  // If no options were given, set the callback to be the second parameter
1113
1113
  "function"==typeof t&&(n=t,t={}),
1114
1114
  // Get the missing document/revision IDs
1115
- l(yn(o,"_revs_diff"),{method:"POST",body:JSON.stringify(e)},n).catch(n)})),r._close=function(e){e()},r._destroy=function(e,t){l(yn(o,""),{method:"DELETE"}).then((function(e){t(null,e)})).catch((function(e){
1115
+ l(yn(i,"_revs_diff"),{method:"POST",body:JSON.stringify(e)},n).catch(n)})),r._close=function(e){e()},r._destroy=function(e,t){l(yn(i,""),{method:"DELETE"}).then((function(e){t(null,e)})).catch((function(e){
1116
1116
  /* istanbul ignore if */
1117
1117
  404===e.status?t(null,{ok:!0}):t(e)}))}}
1118
1118
  // HttpPouch is a valid adapter.
1119
1119
  function bn(e){this.status=400,this.name="query_parse_error",this.message=e,this.error=!0;try{Error.captureStackTrace(this,bn)}catch(e){}}function wn(e){this.status=404,this.name="not_found",this.message=e,this.error=!0;try{Error.captureStackTrace(this,wn)}catch(e){}}function kn(e){this.status=500,this.name="invalid_value",this.message=e,this.error=!0;try{Error.captureStackTrace(this,kn)}catch(e){}}function jn(e,t){return t&&e.then((function(e){s((function(){t(null,e)}))}),(function(e){s((function(){t(e)}))})),e}function On(e,t){return function(){var n=arguments,r=this;return e.add((function(){return t.apply(r,n)}))}}
1120
1120
  // uniq an array of strings, order not guaranteed
1121
1121
  // similar to underscore/lodash _.uniq
1122
- function Sn(e){var t=new o(e),n=new Array(t.size),r=-1;return t.forEach((function(e){n[++r]=e})),n}function Pn(e){var t=new Array(e.size),n=-1;return e.forEach((function(e,r){t[++n]=r})),t}function An(e){return new kn("builtin "+e+" function requires map values to be numbers or number arrays")}function xn(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=e[n];if("number"!=typeof o){if(!Array.isArray(o))// not array/number
1122
+ function Sn(e){var t=new i(e),n=new Array(t.size),r=-1;return t.forEach((function(e){n[++r]=e})),n}function Pn(e){var t=new Array(e.size),n=-1;return e.forEach((function(e,r){t[++n]=r})),t}function An(e){return new kn("builtin "+e+" function requires map values to be numbers or number arrays")}function xn(e){for(var t=0,n=0,r=e.length;n<r;n++){var i=e[n];if("number"!=typeof i){if(!Array.isArray(i))// not array/number
1123
1123
  throw An("_sum");
1124
1124
  // lists of numbers are also allowed, sum them separately
1125
- t="number"==typeof t?[t]:t;for(var i=0,s=o.length;i<s;i++){var u=o[i];if("number"!=typeof u)throw An("_sum");void 0===t[i]?t.push(u):t[i]+=u}}else"number"==typeof t?t+=o:// add number to array
1126
- t[0]+=o}return t}mn.valid=function(){return!0},l(bn,Error),l(wn,Error),l(kn,Error);var qn=C.bind(null,"log"),En=Array.isArray,Cn=JSON.parse;function Bn(e,t){return fe("return ("+e.replace(/;\s*$/,"")+");",{emit:t,sum:xn,log:qn,isArray:En,toJSON:Cn})}
1125
+ t="number"==typeof t?[t]:t;for(var o=0,s=i.length;o<s;o++){var u=i[o];if("number"!=typeof u)throw An("_sum");void 0===t[o]?t.push(u):t[o]+=u}}else"number"==typeof t?t+=i:// add number to array
1126
+ t[0]+=i}return t}mn.valid=function(){return!0},l(bn,Error),l(wn,Error),l(kn,Error);var qn=C.bind(null,"log"),En=Array.isArray,Cn=JSON.parse;function Bn(e,t){return fe("return ("+e.replace(/;\s*$/,"")+");",{emit:t,sum:xn,log:qn,isArray:En,toJSON:Cn})}
1127
1127
  /*
1128
1128
  * Simple task queue to sequentialize actions. Assumes
1129
1129
  * callbacks will eventually fire (once).
@@ -1135,17 +1135,17 @@ switch(typeof e){case"function":case"string":
1135
1135
  return e.toString();default:
1136
1136
  // e.g. a JSON object in the case of mango queries
1137
1137
  return JSON.stringify(e)}}
1138
- /* create a string signature for a view so we can cache it and uniq it */function Dn(e,t,n,r,o,i){var s,u=function(e,t){
1138
+ /* create a string signature for a view so we can cache it and uniq it */function Dn(e,t,n,r,i,o){var s,u=function(e,t){
1139
1139
  // the "undefined" part is for backwards compatibility
1140
- return Tn(e)+Tn(t)+"undefined"}(n,r);if(!o&&
1140
+ return Tn(e)+Tn(t)+"undefined"}(n,r);if(!i&&
1141
1141
  // cache this to ensure we don't try to update the same view twice
1142
- (s=e._cachedViews=e._cachedViews||{})[u])return s[u];var a=e.info().then((function(a){var c=a.db_name+"-mrview-"+(o?"temp":Se(u));
1142
+ (s=e._cachedViews=e._cachedViews||{})[u])return s[u];var a=e.info().then((function(a){var c=a.db_name+"-mrview-"+(i?"temp":Se(u));
1143
1143
  // save the view name in the source db so it can be cleaned up if necessary
1144
1144
  // (e.g. when the _design doc is deleted, remove all associated view data)
1145
- return le(e,"_local/"+i,(function(e){e.views=e.views||{};var n=t;-1===n.indexOf("/")&&(n=t+"/"+t);var r=e.views[n]=e.views[n]||{};
1146
- /* istanbul ignore if */if(!r[c])return r[c]=!0,e})).then((function(){return e.registerDependentDatabase(c).then((function(t){var o=t.db;o.auto_compaction=!0;var i={name:c,db:o,sourceDB:e,adapter:e.adapter,mapFun:n,reduceFun:r};return i.db.get("_local/lastSeq").catch((function(e){
1145
+ return le(e,"_local/"+o,(function(e){e.views=e.views||{};var n=t;-1===n.indexOf("/")&&(n=t+"/"+t);var r=e.views[n]=e.views[n]||{};
1146
+ /* istanbul ignore if */if(!r[c])return r[c]=!0,e})).then((function(){return e.registerDependentDatabase(c).then((function(t){var i=t.db;i.auto_compaction=!0;var o={name:c,db:i,sourceDB:e,adapter:e.adapter,mapFun:n,reduceFun:r};return o.db.get("_local/lastSeq").catch((function(e){
1147
1147
  /* istanbul ignore if */
1148
- if(404!==e.status)throw e})).then((function(e){return i.seq=e?e.seq:0,s&&i.db.once("destroyed",(function(){delete s[u]})),i}))}))}))}));return s&&(s[u]=a),a}$n.prototype.add=function(e){return this.promise=this.promise.catch((function(){
1148
+ if(404!==e.status)throw e})).then((function(e){return o.seq=e?e.seq:0,s&&o.db.once("destroyed",(function(){delete s[u]})),o}))}))}))}));return s&&(s[u]=a),a}$n.prototype.add=function(e){return this.promise=this.promise.catch((function(){
1149
1149
  // just recover
1150
1150
  })).then((function(){return e()})),this.promise},$n.prototype.finish=function(){return this.promise};var Ln={},In=new $n;function Rn(e){
1151
1151
  // can be either 'ddocname/viewname' or just 'viewname'
@@ -1179,20 +1179,20 @@ return-1===e.indexOf("/")?[e,e]:e.split("/")}function Mn(e,t){try{e.emit("error"
1179
1179
  */}}var Nn=function(e,t){return xn(t)},Kn=function(e,t){return t.length},Un=function(e,t){return{sum:xn(t),min:Math.min.apply(null,t),max:Math.max.apply(null,t),count:t.length,sumsqr:
1180
1180
  // no need to implement rereduce=true, because Pouch
1181
1181
  // will never call it
1182
- function(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=e[n];t+=o*o}return t}(t)}},Fn=function(e,t,n,r){function u(e,t,n){
1182
+ function(e){for(var t=0,n=0,r=e.length;n<r;n++){var i=e[n];t+=i*i}return t}(t)}},Fn=function(e,t,n,r){function u(e,t,n){
1183
1183
  // emit an event if there was an error thrown by a map function.
1184
1184
  // putting try/catches in a single function also avoids deoptimizations.
1185
- try{t(n)}catch(t){Mn(e,t)}}function a(e,t,n,r,o){
1185
+ try{t(n)}catch(t){Mn(e,t)}}function a(e,t,n,r,i){
1186
1186
  // same as above, but returning the result or an error. there are two separate
1187
1187
  // functions to avoid extra memory allocations since the tryCode() case is used
1188
1188
  // for custom map functions (common) vs this function, which is only used for
1189
1189
  // custom reduce functions (rare)
1190
- try{return{output:t(n,r,o)}}catch(t){return Mn(e,t),{error:t}}}function c(e,t){var n=dt(e.key,t.key);return 0!==n?n:dt(e.value,t.value)}function l(e,t,n){return n=n||0,"number"==typeof t?e.slice(n,t+n):n>0?e.slice(n):e}function d(e){var t=e.value;
1190
+ try{return{output:t(n,r,i)}}catch(t){return Mn(e,t),{error:t}}}function c(e,t){var n=dt(e.key,t.key);return 0!==n?n:dt(e.value,t.value)}function l(e,t,n){return n=n||0,"number"==typeof t?e.slice(n,t+n):n>0?e.slice(n):e}function d(e){var t=e.value;
1191
1191
  // Users can explicitly specify a joined doc _id, or it
1192
1192
  // defaults to the doc _id that emitted the key/value.
1193
1193
  return t&&"object"==typeof t&&t._id||e.id}function h(e){return function(t){return e.include_docs&&e.attachments&&e.binary&&function(e){e.rows.forEach((function(e){var t=e.doc&&e.doc._attachments;t&&Object.keys(t).forEach((function(e){var n=t[e];t[e].data=ge(n.data,n.content_type)}))}))}(t),t}}function p(e,t,n,r){
1194
1194
  // add an http param from opts to params, optionally json-encoded
1195
- var o=t[e];void 0!==o&&(r&&(o=encodeURIComponent(JSON.stringify(o))),n.push(e+"="+o))}function v(e){if(void 0!==e){var t=Number(e);
1195
+ var i=t[e];void 0!==i&&(r&&(i=encodeURIComponent(JSON.stringify(i))),n.push(e+"="+i))}function v(e){if(void 0!==e){var t=Number(e);
1196
1196
  // prevents e.g. '1foo' or '1.1' being coerced to 1
1197
1197
  return isNaN(t)||t!==parseInt(e,10)?e:t}}function y(e,t){var n=e.descending?"endkey":"startkey",r=e.descending?"startkey":"endkey";if(void 0!==e[n]&&void 0!==e[r]&&dt(e[n],e[r])>0)throw new bn("No rows can match your key range, reverse your start_key and end_key or set {descending : true}");if(t.reduce&&!1!==e.reduce){if(e.include_docs)throw new bn("{include_docs:true} is invalid for reduce");if(e.keys&&e.keys.length>1&&!e.group&&!e.group_level)throw new bn("Multi-key fetches for reduce views must use {group: true}")}["group_level","limit","skip"].forEach((function(t){var n=function(e){if(e){if("number"!=typeof e)return new bn('Invalid value for integer: "'+e+'"');if(e<0)return new bn('Invalid value for positive integer: "'+e+'"')}}(e[t]);if(n)throw n}))}function g(e){return function(t){
1198
1198
  /* istanbul ignore else */
@@ -1200,24 +1200,24 @@ if(404===t.status)return e;throw t}}
1200
1200
  // returns a promise for a list of docs to update, based on the input docId.
1201
1201
  // the order doesn't matter, because post-3.2.0, bulkDocs
1202
1202
  // is an atomic operation in all three adapters.
1203
- function _(e,t,n){var r="_local/doc_"+e,i={_id:r,keys:[]},s=n.get(e),u=s[0];return(function(e){
1203
+ function _(e,t,n){var r="_local/doc_"+e,o={_id:r,keys:[]},s=n.get(e),u=s[0];return(function(e){
1204
1204
  // only return true if the current change is 1-
1205
1205
  // and there are no other leafs
1206
- return 1===e.length&&/^1-/.test(e[0].rev)}(s[1])?Promise.resolve(i):t.db.get(r).catch(g(i))).then((function(e){return function(e){return e.keys.length?t.db.allDocs({keys:e.keys,include_docs:!0}):Promise.resolve({rows:[]})}(e).then((function(t){return function(e,t){for(var n=[],r=new o,i=0,s=t.rows.length;i<s;i++){var a=t.rows[i].doc;if(a&&(n.push(a),r.add(a._id),a._deleted=!u.has(a._id),!a._deleted)){var c=u.get(a._id);"value"in c&&(a.value=c.value)}}var f=Pn(u);return f.forEach((function(e){if(!r.has(e)){
1206
+ return 1===e.length&&/^1-/.test(e[0].rev)}(s[1])?Promise.resolve(o):t.db.get(r).catch(g(o))).then((function(e){return function(e){return e.keys.length?t.db.allDocs({keys:e.keys,include_docs:!0}):Promise.resolve({rows:[]})}(e).then((function(t){return function(e,t){for(var n=[],r=new i,o=0,s=t.rows.length;o<s;o++){var a=t.rows[o].doc;if(a&&(n.push(a),r.add(a._id),a._deleted=!u.has(a._id),!a._deleted)){var c=u.get(a._id);"value"in c&&(a.value=c.value)}}var f=Pn(u);return f.forEach((function(e){if(!r.has(e)){
1207
1207
  // new doc
1208
- var t={_id:e},o=u.get(e);"value"in o&&(t.value=o.value),n.push(t)}})),e.keys=Sn(f.concat(e.keys)),n.push(e),n}(e,t)}))}))}
1208
+ var t={_id:e},i=u.get(e);"value"in i&&(t.value=i.value),n.push(t)}})),e.keys=Sn(f.concat(e.keys)),n.push(e),n}(e,t)}))}))}
1209
1209
  // updates all emitted key/value docs and metaDocs in the mrview database
1210
1210
  // for the given batch of documents from the source database
1211
1211
  function m(e){var t="string"==typeof e?e:e.name,n=Ln[t];return n||(n=Ln[t]=new $n),n}function b(e){return On(m(e),(function(){return function(e){
1212
1212
  // bind the emit function once
1213
1213
  var t,n;var r=function(e,t){
1214
1214
  // for temp_views one can use emit(doc, emit), see #38
1215
- if("function"==typeof e&&2===e.length){var n=e;return function(e){return n(e,t)}}return Bn(e.toString(),t)}(e.mapFun,(function(e,r){var o={id:n._id,key:ht(e)};
1215
+ if("function"==typeof e&&2===e.length){var n=e;return function(e){return n(e,t)}}return Bn(e.toString(),t)}(e.mapFun,(function(e,r){var i={id:n._id,key:ht(e)};
1216
1216
  // Don't explicitly store the value unless it's defined and non-null.
1217
1217
  // This saves on storage space, because often people don't use it.
1218
- null!=r&&(o.value=ht(r)),t.push(o)})),o=e.seq||0;function s(t,n){return function(){return function(e,t,n){var r="_local/lastSeq";return e.db.get(r).catch(g({_id:r,seq:0})).then((function(r){var o=Pn(t);return Promise.all(o.map((function(n){return _(n,e,t)}))).then((function(t){var o=ee(t);
1218
+ null!=r&&(i.value=ht(r)),t.push(i)})),i=e.seq||0;function s(t,n){return function(){return function(e,t,n){var r="_local/lastSeq";return e.db.get(r).catch(g({_id:r,seq:0})).then((function(r){var i=Pn(t);return Promise.all(i.map((function(n){return _(n,e,t)}))).then((function(t){var i=ee(t);
1219
1219
  // write all docs in a single operation, update the seq once
1220
- return r.seq=n,o.push(r),e.db.bulkDocs({docs:o})}))}))}(e,t,n)}}var a=new $n;function f(){return e.sourceDB.changes({return_docs:!0,conflicts:!0,include_docs:!0,style:"all_docs",since:o,limit:50}).then(l)}function l(e){var t=e.results;if(t.length){var n=d(t);if(a.add(s(n,o)),!(t.length<50))return f()}}function d(s){for(var a=new i,f=0,l=s.length;f<l;f++){var d=s[f];if("_"!==d.doc._id[0]){t=[],(n=d.doc)._deleted||u(e.sourceDB,r,n),t.sort(c);var p=h(t);a.set(d.doc._id,[p,d.changes])}o=d.seq}return a}function h(e){for(var t,n=new i,r=0,o=e.length;r<o;r++){var s=e[r],u=[s.key,s.id];r>0&&0===dt(s.key,t)&&u.push(r),n.set(pt(u),s),t=s.key}return n}return f().then((function(){return a.finish()})).then((function(){e.seq=o}))}(e)}))()}function w(e,t){return On(m(e),(function(){return function(e,t){var n,r=e.reduceFun&&!1!==t.reduce,o=t.skip||0;function s(t){return t.include_docs=!0,e.db.allDocs(t).then((function(e){return n=e.total_rows,e.rows.map((function(e){
1220
+ return r.seq=n,i.push(r),e.db.bulkDocs({docs:i})}))}))}(e,t,n)}}var a=new $n;function f(){return e.sourceDB.changes({return_docs:!0,conflicts:!0,include_docs:!0,style:"all_docs",since:i,limit:50}).then(l)}function l(e){var t=e.results;if(t.length){var n=d(t);if(a.add(s(n,i)),!(t.length<50))return f()}}function d(s){for(var a=new o,f=0,l=s.length;f<l;f++){var d=s[f];if("_"!==d.doc._id[0]){t=[],(n=d.doc)._deleted||u(e.sourceDB,r,n),t.sort(c);var p=h(t);a.set(d.doc._id,[p,d.changes])}i=d.seq}return a}function h(e){for(var t,n=new o,r=0,i=e.length;r<i;r++){var s=e[r],u=[s.key,s.id];r>0&&0===dt(s.key,t)&&u.push(r),n.set(pt(u),s),t=s.key}return n}return f().then((function(){return a.finish()})).then((function(){e.seq=i}))}(e)}))()}function w(e,t){return On(m(e),(function(){return function(e,t){var n,r=e.reduceFun&&!1!==t.reduce,i=t.skip||0;function s(t){return t.include_docs=!0,e.db.allDocs(t).then((function(e){return n=e.total_rows,e.rows.map((function(e){
1221
1221
  // implicit migration - in older versions of PouchDB,
1222
1222
  // we explicitly stored the doc as {id: ..., key: ..., value: ...}
1223
1223
  // this is tested in a migration test
@@ -1227,7 +1227,7 @@ if("value"in e.doc&&"object"==typeof e.doc.value&&null!==e.doc.value){var t=Obje
1227
1227
  // emitted a value which was an object with these 3 exact keys
1228
1228
  if(!(t<n||t>n))return e.doc.value}var r=function(e){
1229
1229
  /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
1230
- for(var t=[],n=[],r=0;;){var o=e[r++];if("\0"!==o)switch(o){case"1":t.push(null);break;case"2":t.push("1"===e[r]),r++;break;case"3":var i=vt(e,r);t.push(i.num),r+=i.length;break;case"4":
1230
+ for(var t=[],n=[],r=0;;){var i=e[r++];if("\0"!==i)switch(i){case"1":t.push(null);break;case"2":t.push("1"===e[r]),r++;break;case"3":var o=vt(e,r);t.push(o.num),r+=o.length;break;case"4":
1231
1231
  /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
1232
1232
  for(var s="";;){var u=e[r];if("\0"===u)break;s+=u,r++}
1233
1233
  // perform the reverse of the order-preserving replacement
@@ -1235,32 +1235,32 @@ for(var s="";;){var u=e[r];if("\0"===u)break;s+=u,r++}
1235
1235
  /* eslint-disable no-control-regex */s=s.replace(/\u0001\u0001/g,"\0").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,""),
1236
1236
  /* eslint-enable no-control-regex */
1237
1237
  t.push(s);break;case"5":var a={element:[],index:t.length};t.push(a.element),n.push(a);break;case"6":var c={element:{},index:t.length};t.push(c.element),n.push(c);break;
1238
- /* istanbul ignore next */default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+o)}else{if(1===t.length)return t.pop();yt(t,n)}}}(e.doc._id);return{key:r[0],id:r[1],value:"value"in e.doc?e.doc.value:null}}))}))}function u(s){var u;if(u=r?function(e,t,n){0===n.group_level&&delete n.group_level;var r=n.group||n.group_level,o=function(e){var t=e.toString(),n=function(e){if(/^_sum/.test(e))return Nn;if(/^_count/.test(e))return Kn;if(/^_stats/.test(e))return Un;if(/^_/.test(e))throw new Error(e+" is not a supported reduce function.")}(t);return n||Bn(t)}(e.reduceFun),i=[],s=isNaN(n.group_level)?Number.POSITIVE_INFINITY:n.group_level;t.forEach((function(e){var t=i[i.length-1],n=r?e.key:null;if(
1238
+ /* istanbul ignore next */default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+i)}else{if(1===t.length)return t.pop();yt(t,n)}}}(e.doc._id);return{key:r[0],id:r[1],value:"value"in e.doc?e.doc.value:null}}))}))}function u(s){var u;if(u=r?function(e,t,n){0===n.group_level&&delete n.group_level;var r=n.group||n.group_level,i=function(e){var t=e.toString(),n=function(e){if(/^_sum/.test(e))return Nn;if(/^_count/.test(e))return Kn;if(/^_stats/.test(e))return Un;if(/^_/.test(e))throw new Error(e+" is not a supported reduce function.")}(t);return n||Bn(t)}(e.reduceFun),o=[],s=isNaN(n.group_level)?Number.POSITIVE_INFINITY:n.group_level;t.forEach((function(e){var t=o[o.length-1],n=r?e.key:null;if(
1239
1239
  // only set group_level for array keys
1240
- r&&Array.isArray(n)&&(n=n.slice(0,s)),t&&0===dt(t.groupKey,n))return t.keys.push([e.key,e.id]),void t.values.push(e.value);i.push({keys:[[e.key,e.id]],values:[e.value],groupKey:n})})),t=[];for(var u=0,c=i.length;u<c;u++){var f=i[u],d=a(e.sourceDB,o,f.keys,f.values,!1);if(d.error&&d.error instanceof kn)
1240
+ r&&Array.isArray(n)&&(n=n.slice(0,s)),t&&0===dt(t.groupKey,n))return t.keys.push([e.key,e.id]),void t.values.push(e.value);o.push({keys:[[e.key,e.id]],values:[e.value],groupKey:n})})),t=[];for(var u=0,c=o.length;u<c;u++){var f=o[u],d=a(e.sourceDB,i,f.keys,f.values,!1);if(d.error&&d.error instanceof kn)
1241
1241
  // CouchDB returns an error if a built-in errors out
1242
1242
  throw d.error;t.push({
1243
1243
  // CouchDB just sets the value to null if a non-built-in errors out
1244
1244
  value:d.error?null:d.output,key:f.groupKey})}
1245
1245
  // no total_rows/offset when reducing
1246
- return{rows:l(t,n.limit,n.skip)}}(e,s,t):{total_rows:n,offset:o,rows:s}
1247
- /* istanbul ignore if */,t.update_seq&&(u.update_seq=e.seq),t.include_docs){var c=Sn(s.map(d));return e.sourceDB.allDocs({keys:c,include_docs:!0,conflicts:t.conflicts,attachments:t.attachments,binary:t.binary}).then((function(e){var t=new i;return e.rows.forEach((function(e){t.set(e.id,e.doc)})),s.forEach((function(e){var n=d(e),r=t.get(n);r&&(e.doc=r)})),u}))}return u}if(void 0===t.keys||t.keys.length||(
1246
+ return{rows:l(t,n.limit,n.skip)}}(e,s,t):{total_rows:n,offset:i,rows:s}
1247
+ /* istanbul ignore if */,t.update_seq&&(u.update_seq=e.seq),t.include_docs){var c=Sn(s.map(d));return e.sourceDB.allDocs({keys:c,include_docs:!0,conflicts:t.conflicts,attachments:t.attachments,binary:t.binary}).then((function(e){var t=new o;return e.rows.forEach((function(e){t.set(e.id,e.doc)})),s.forEach((function(e){var n=d(e),r=t.get(n);r&&(e.doc=r)})),u}))}return u}if(void 0===t.keys||t.keys.length||(
1248
1248
  // equivalent query
1249
1249
  t.limit=0,delete t.keys),void 0!==t.keys){var c=t.keys.map((function(e){var n={startkey:pt([e]),endkey:pt([e,{}])};
1250
1250
  /* istanbul ignore if */return t.update_seq&&(n.update_seq=!0),s(n)}));return Promise.all(c).then(ee).then(u)}// normal query, no 'keys'
1251
1251
  var f,h,p={descending:t.descending};
1252
- /* istanbul ignore if */if(t.update_seq&&(p.update_seq=!0),"start_key"in t&&(f=t.start_key),"startkey"in t&&(f=t.startkey),"end_key"in t&&(h=t.end_key),"endkey"in t&&(h=t.endkey),void 0!==f&&(p.startkey=t.descending?pt([f,{}]):pt([f])),void 0!==h){var v=!1!==t.inclusive_end;t.descending&&(v=!v),p.endkey=pt(v?[h,{}]:[h])}if(void 0!==t.key){var y=pt([t.key]),g=pt([t.key,{}]);p.descending?(p.endkey=y,p.startkey=g):(p.startkey=y,p.endkey=g)}return r||("number"==typeof t.limit&&(p.limit=t.limit),p.skip=o),s(p).then(u)}(e,t)}))()}function k(t,n,r){
1252
+ /* istanbul ignore if */if(t.update_seq&&(p.update_seq=!0),"start_key"in t&&(f=t.start_key),"startkey"in t&&(f=t.startkey),"end_key"in t&&(h=t.end_key),"endkey"in t&&(h=t.endkey),void 0!==f&&(p.startkey=t.descending?pt([f,{}]):pt([f])),void 0!==h){var v=!1!==t.inclusive_end;t.descending&&(v=!v),p.endkey=pt(v?[h,{}]:[h])}if(void 0!==t.key){var y=pt([t.key]),g=pt([t.key,{}]);p.descending?(p.endkey=y,p.startkey=g):(p.startkey=y,p.endkey=g)}return r||("number"==typeof t.limit&&(p.limit=t.limit),p.skip=i),s(p).then(u)}(e,t)}))()}function k(t,n,r){
1253
1253
  /* istanbul ignore next */
1254
1254
  if("function"==typeof t._query)
1255
1255
  // custom adapters can define their own api._query
1256
1256
  // and override the default behavior
1257
1257
  /* istanbul ignore next */
1258
- return function(e,t,n){return new Promise((function(r,o){e._query(t,n,(function(e,t){if(e)return o(e);r(t)}))}))}
1258
+ return function(e,t,n){return new Promise((function(r,i){e._query(t,n,(function(e,t){if(e)return i(e);r(t)}))}))}
1259
1259
  // custom adapters can define their own api._viewCleanup
1260
1260
  // and override the default behavior
1261
1261
  /* istanbul ignore next */(t,n,r);if(ne(t))return function(e,t,n){
1262
1262
  // List of parameters to add to the PUT request
1263
- var r,o,i,s=[],u="GET";
1263
+ var r,i,o,s=[],u="GET";
1264
1264
  // If keys are supplied, issue a POST to circumvent GET query string limits
1265
1265
  // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
1266
1266
  if(
@@ -1279,13 +1279,13 @@ a.length+s.length+1<=2e3?
1279
1279
  s+=("?"===s[0]?"&":"?")+a:(u="POST","string"==typeof t?r={keys:n.keys}:// fun is {map : mapfun}, so append to this
1280
1280
  t.keys=n.keys)}
1281
1281
  // We are referencing a query defined in the design doc
1282
- if("string"==typeof t){var c=Rn(t);return e.fetch("_design/"+c[0]+"/_view/"+c[1]+s,{headers:new tt({"Content-Type":"application/json"}),method:u,body:JSON.stringify(r)}).then((function(e){return o=e.ok,i=e.status,e.json()})).then((function(e){if(!o)throw e.status=i,X(e);
1282
+ if("string"==typeof t){var c=Rn(t);return e.fetch("_design/"+c[0]+"/_view/"+c[1]+s,{headers:new tt({"Content-Type":"application/json"}),method:u,body:JSON.stringify(r)}).then((function(e){return i=e.ok,o=e.status,e.json()})).then((function(e){if(!i)throw e.status=o,X(e);
1283
1283
  // fail the entire request if the result contains an error
1284
1284
  return e.rows.forEach((function(e){
1285
1285
  /* istanbul ignore if */
1286
1286
  if(e.value&&e.value.error&&"builtin_reduce_error"===e.value.error)throw new Error(e.reason)})),e})).then(h(n))}
1287
1287
  // We are using a temporary view, terrible for performance, good for testing
1288
- return r=r||{},Object.keys(t).forEach((function(e){Array.isArray(t[e])?r[e]=t[e]:r[e]=t[e].toString()})),e.fetch("_temp_view"+s,{headers:new tt({"Content-Type":"application/json"}),method:"POST",body:JSON.stringify(r)}).then((function(e){return o=e.ok,i=e.status,e.json()})).then((function(e){if(!o)throw e.status=i,X(e);return e})).then(h(n))}(t,n,r);if("string"!=typeof n)
1288
+ return r=r||{},Object.keys(t).forEach((function(e){Array.isArray(t[e])?r[e]=t[e]:r[e]=t[e].toString()})),e.fetch("_temp_view"+s,{headers:new tt({"Content-Type":"application/json"}),method:"POST",body:JSON.stringify(r)}).then((function(e){return i=e.ok,o=e.status,e.json()})).then((function(e){if(!i)throw e.status=o,X(e);return e})).then(h(n))}(t,n,r);if("string"!=typeof n)
1289
1289
  // temp_view
1290
1290
  return y(r,n),In.add((function(){return Dn(
1291
1291
  /* sourceDB */t,
@@ -1297,40 +1297,40 @@ return y(r,n),In.add((function(){return Dn(
1297
1297
  // Promise finally util similar to Q.finally
1298
1298
  var t,n}))})),In.finish();
1299
1299
  // persistent view
1300
- var o=n,i=Rn(o),u=i[0],a=i[1];return t.get("_design/"+u).then((function(n){var i=n.views&&n.views[a];if(!i)
1300
+ var i=n,o=Rn(i),u=o[0],a=o[1];return t.get("_design/"+u).then((function(n){var o=n.views&&n.views[a];if(!o)
1301
1301
  // basic validator; it's assumed that every subclass would want this
1302
- throw new wn("ddoc "+n._id+" has no view named "+a);return function(e,t){var n=e.views&&e.views[t];if("string"!=typeof n.map)throw new wn("ddoc "+e._id+" has no string view named "+t+", instead found object of type: "+typeof n.map)}(n,a),y(r,i),Dn(
1302
+ throw new wn("ddoc "+n._id+" has no view named "+a);return function(e,t){var n=e.views&&e.views[t];if("string"!=typeof n.map)throw new wn("ddoc "+e._id+" has no string view named "+t+", instead found object of type: "+typeof n.map)}(n,a),y(r,o),Dn(
1303
1303
  /* sourceDB */t,
1304
- /* viewName */o,
1305
- /* mapFun */i.map,
1306
- /* reduceFun */i.reduce,
1304
+ /* viewName */i,
1305
+ /* mapFun */o.map,
1306
+ /* reduceFun */o.reduce,
1307
1307
  /* temporary */!1,
1308
- /* localDocName */e).then((function(e){return"ok"===r.stale||"update_after"===r.stale?("update_after"===r.stale&&s((function(){b(e)})),w(e,r)):b(e).then((function(){return w(e,r)}))}))}))}var j;return{query:function(e,t,n){var r=this;"function"==typeof t&&(n=t,t={}),t=t?function(e){return e.group_level=v(e.group_level),e.limit=v(e.limit),e.skip=v(e.skip),e}(t):{},"function"==typeof e&&(e={map:e});var o=Promise.resolve().then((function(){return k(r,e,t)}));return jn(o,n),o},viewCleanup:(j=function(){var t=this;
1309
- /* istanbul ignore next */return"function"==typeof t._viewCleanup?function(e){return new Promise((function(t,n){e._viewCleanup((function(e,r){if(e)return n(e);t(r)}))}))}(t):ne(t)?function(e){return e.fetch("_view_cleanup",{headers:new tt({"Content-Type":"application/json"}),method:"POST"}).then((function(e){return e.json()}))}(t):function(t){return t.get("_local/"+e).then((function(e){var n=new i;Object.keys(e.views).forEach((function(e){var t=Rn(e),r="_design/"+t[0],i=t[1],s=n.get(r);s||(s=new o,n.set(r,s)),s.add(i)}));var r={keys:Pn(n),include_docs:!0};return t.allDocs(r).then((function(r){var o={};r.rows.forEach((function(t){var r=t.key.substring(8);// cuts off '_design/'
1310
- n.get(t.key).forEach((function(n){var i=r+"/"+n;
1311
- /* istanbul ignore if */e.views[i]||(
1308
+ /* localDocName */e).then((function(e){return"ok"===r.stale||"update_after"===r.stale?("update_after"===r.stale&&s((function(){b(e)})),w(e,r)):b(e).then((function(){return w(e,r)}))}))}))}var j;return{query:function(e,t,n){var r=this;"function"==typeof t&&(n=t,t={}),t=t?function(e){return e.group_level=v(e.group_level),e.limit=v(e.limit),e.skip=v(e.skip),e}(t):{},"function"==typeof e&&(e={map:e});var i=Promise.resolve().then((function(){return k(r,e,t)}));return jn(i,n),i},viewCleanup:(j=function(){var t=this;
1309
+ /* istanbul ignore next */return"function"==typeof t._viewCleanup?function(e){return new Promise((function(t,n){e._viewCleanup((function(e,r){if(e)return n(e);t(r)}))}))}(t):ne(t)?function(e){return e.fetch("_view_cleanup",{headers:new tt({"Content-Type":"application/json"}),method:"POST"}).then((function(e){return e.json()}))}(t):function(t){return t.get("_local/"+e).then((function(e){var n=new o;Object.keys(e.views).forEach((function(e){var t=Rn(e),r="_design/"+t[0],o=t[1],s=n.get(r);s||(s=new i,n.set(r,s)),s.add(o)}));var r={keys:Pn(n),include_docs:!0};return t.allDocs(r).then((function(r){var i={};r.rows.forEach((function(t){var r=t.key.substring(8);// cuts off '_design/'
1310
+ n.get(t.key).forEach((function(n){var o=r+"/"+n;
1311
+ /* istanbul ignore if */e.views[o]||(
1312
1312
  // new format, without slashes, to support PouchDB 2.2.0
1313
1313
  // migration test in pouchdb's browser.migration.js verifies this
1314
- i=n);var s=Object.keys(e.views[i]),u=t.doc&&t.doc.views&&t.doc.views[n];
1314
+ o=n);var s=Object.keys(e.views[o]),u=t.doc&&t.doc.views&&t.doc.views[n];
1315
1315
  // design doc deleted, or view function nonexistent
1316
- s.forEach((function(e){o[e]=o[e]||u}))}))}));var i=Object.keys(o).filter((function(e){return!o[e]})).map((function(e){return On(m(e),(function(){return new t.constructor(e,t.__opts).destroy()}))()}));return Promise.all(i).then((function(){return{ok:!0}}))}))}),g({ok:!0}))}(t)},f((function(e){var t=e.pop(),n=j.apply(this,e);return"function"==typeof t&&jn(n,t),n})))}}("mrviews"),Jn={query:function(e,t,n){return Fn.query.call(this,e,t,n)},viewCleanup:function(e){return Fn.viewCleanup.call(this,e)}};function Vn(e){return/^1-/.test(e)}function zn(e,t){var n=Object.keys(t._attachments);return Promise.all(n.map((function(n){return e.getAttachment(t._id,n,{rev:t._rev})})))}
1316
+ s.forEach((function(e){i[e]=i[e]||u}))}))}));var o=Object.keys(i).filter((function(e){return!i[e]})).map((function(e){return On(m(e),(function(){return new t.constructor(e,t.__opts).destroy()}))()}));return Promise.all(o).then((function(){return{ok:!0}}))}))}),g({ok:!0}))}(t)},f((function(e){var t=e.pop(),n=j.apply(this,e);return"function"==typeof t&&jn(n,t),n})))}}("mrviews"),Jn={query:function(e,t,n){return Fn.query.call(this,e,t,n)},viewCleanup:function(e){return Fn.viewCleanup.call(this,e)}};function Vn(e){return/^1-/.test(e)}function zn(e,t){var n=Object.keys(t._attachments);return Promise.all(n.map((function(n){return e.getAttachment(t._id,n,{rev:t._rev})})))}
1317
1317
  // Fetch all the documents from the src as described in the "diffs",
1318
1318
  // which is a mapping of docs IDs to revisions. If the state ever
1319
1319
  // changes to "cancelled", then the returned promise will be rejected.
1320
1320
  // Else it will be resolved with a list of fetched documents.
1321
- var Gn="pouchdb";function Qn(e,t,n,r,o){return e.get(t).catch((function(n){if(404===n.status)return"http"!==e.adapter&&"https"!==e.adapter||$(404,"PouchDB is just checking if a remote checkpoint exists."),{session_id:r,_id:t,history:[],replicator:Gn,version:1};throw n})).then((function(i){if(!o.cancelled&&i.last_seq!==n)
1321
+ var Gn="pouchdb";function Qn(e,t,n,r,i){return e.get(t).catch((function(n){if(404===n.status)return"http"!==e.adapter&&"https"!==e.adapter||$(404,"PouchDB is just checking if a remote checkpoint exists."),{session_id:r,_id:t,history:[],replicator:Gn,version:1};throw n})).then((function(o){if(!i.cancelled&&o.last_seq!==n)
1322
1322
  // Filter out current entry for this replication
1323
- return i.history=(i.history||[]).filter((function(e){return e.session_id!==r})),
1323
+ return o.history=(o.history||[]).filter((function(e){return e.session_id!==r})),
1324
1324
  // Add the latest checkpoint to history
1325
- i.history.unshift({last_seq:n,session_id:r}),
1325
+ o.history.unshift({last_seq:n,session_id:r}),
1326
1326
  // Just take the last pieces in history, to
1327
1327
  // avoid really big checkpoint docs.
1328
1328
  // see comment on history size above
1329
- i.history=i.history.slice(0,5),i.version=1,i.replicator=Gn,i.session_id=r,i.last_seq=n,e.put(i).catch((function(i){if(409===i.status)
1329
+ o.history=o.history.slice(0,5),o.version=1,o.replicator=Gn,o.session_id=r,o.last_seq=n,e.put(o).catch((function(o){if(409===o.status)
1330
1330
  // retry; someone is trying to write a checkpoint simultaneously
1331
- return Qn(e,t,n,r,o);throw i}));
1331
+ return Qn(e,t,n,r,i);throw o}));
1332
1332
  // if the checkpoint has not changed, do not update
1333
- }))}function Wn(e,t,n,r,o){this.src=e,this.target=t,this.id=n,this.returnValue=r,this.opts=o||{}}Wn.prototype.writeCheckpoint=function(e,t){var n=this;return this.updateTarget(e,t).then((function(){return n.updateSource(e,t)}))},Wn.prototype.updateTarget=function(e,t){return this.opts.writeTargetCheckpoint?Qn(this.target,this.id,e,t,this.returnValue):Promise.resolve(!0)},Wn.prototype.updateSource=function(e,t){if(this.opts.writeSourceCheckpoint){var n=this;return Qn(this.src,this.id,e,t,this.returnValue).catch((function(e){if(Zn(e))return n.opts.writeSourceCheckpoint=!1,!0;throw e}))}return Promise.resolve(!0)};var Yn={undefined:function(e,t){
1333
+ }))}function Wn(e,t,n,r,i){this.src=e,this.target=t,this.id=n,this.returnValue=r,this.opts=i||{}}Wn.prototype.writeCheckpoint=function(e,t){var n=this;return this.updateTarget(e,t).then((function(){return n.updateSource(e,t)}))},Wn.prototype.updateTarget=function(e,t){return this.opts.writeTargetCheckpoint?Qn(this.target,this.id,e,t,this.returnValue):Promise.resolve(!0)},Wn.prototype.updateSource=function(e,t){if(this.opts.writeSourceCheckpoint){var n=this;return Qn(this.src,this.id,e,t,this.returnValue).catch((function(e){if(Zn(e))return n.opts.writeSourceCheckpoint=!1,!0;throw e}))}return Promise.resolve(!0)};var Yn={undefined:function(e,t){
1334
1334
  // This is the previous comparison function
1335
1335
  return 0===dt(e.last_seq,t.last_seq)?t.last_seq:0
1336
1336
  /* istanbul ignore next */},1:function(e,t){
@@ -1341,29 +1341,29 @@ return 0===dt(e.last_seq,t.last_seq)?t.last_seq:0
1341
1341
  return function(e,t){return e.session_id===t.session_id?{last_seq:e.last_seq,history:e.history}:Hn(e.history,t.history)}(t,e).last_seq}};function Hn(e,t){
1342
1342
  // the erlang loop via function arguments is not so easy to repeat in JS
1343
1343
  // therefore, doing this as recursion
1344
- var n=e[0],r=e.slice(1),o=t[0],i=t.slice(1);return n&&0!==t.length?
1344
+ var n=e[0],r=e.slice(1),i=t[0],o=t.slice(1);return n&&0!==t.length?
1345
1345
  /* istanbul ignore if */
1346
- Xn(n.session_id,t)?{last_seq:n.last_seq,history:e}:Xn(o.session_id,r)?{last_seq:o.last_seq,history:i}:Hn(r,i):{last_seq:0,history:[]}}function Xn(e,t){var n=t[0],r=t.slice(1);return!(!e||0===t.length)&&(e===n.session_id||Xn(e,r))}function Zn(e){return"number"==typeof e.status&&4===Math.floor(e.status/100)}function er(e,t,n,r,o){var i,u,a,c=[],f={seq:0,changes:[],docs:[]},l=!1,d=!1,h=!1,p=0,v=n.continuous||n.live||!1,y=n.batch_size||100,g=n.batches_limit||10,_=!1,m=n.doc_ids,b=n.selector,k=[],j=Ae();// list of batches to be processed
1347
- o=o||{ok:!0,start_time:(new Date).toISOString(),docs_read:0,docs_written:0,doc_write_failures:0,errors:[]};var O={};function S(){return a?Promise.resolve():
1346
+ Xn(n.session_id,t)?{last_seq:n.last_seq,history:e}:Xn(i.session_id,r)?{last_seq:i.last_seq,history:o}:Hn(r,o):{last_seq:0,history:[]}}function Xn(e,t){var n=t[0],r=t.slice(1);return!(!e||0===t.length)&&(e===n.session_id||Xn(e,r))}function Zn(e){return"number"==typeof e.status&&4===Math.floor(e.status/100)}function er(e,t,n,r,i){var o,u,a,c=[],f={seq:0,changes:[],docs:[]},l=!1,d=!1,h=!1,p=0,v=n.continuous||n.live||!1,y=n.batch_size||100,g=n.batches_limit||10,_=!1,m=n.doc_ids,b=n.selector,k=[],j=Ae();// list of batches to be processed
1347
+ i=i||{ok:!0,start_time:(new Date).toISOString(),docs_read:0,docs_written:0,doc_write_failures:0,errors:[]};var O={};function S(){return a?Promise.resolve():
1348
1348
  // Generate a unique id particular to this replication.
1349
1349
  // Not guaranteed to align perfectly with CouchDB's rep ids.
1350
- function(e,t,n){var r=n.doc_ids?n.doc_ids.sort(dt):"",o=n.filter?n.filter.toString():"",i="",s="",u="";
1350
+ function(e,t,n){var r=n.doc_ids?n.doc_ids.sort(dt):"",i=n.filter?n.filter.toString():"",o="",s="",u="";
1351
1351
  // possibility for checkpoints to be lost here as behaviour of
1352
1352
  // JSON.stringify is not stable (see #6226)
1353
- /* istanbul ignore if */return n.selector&&(u=JSON.stringify(n.selector)),n.filter&&n.query_params&&(i=JSON.stringify(function(e){return Object.keys(e).sort(dt).reduce((function(t,n){return t[n]=e[n],t}),{})}(n.query_params))),n.filter&&"_view"===n.filter&&(s=n.view.toString()),Promise.all([e.id(),t.id()]).then((function(e){var t=e[0]+e[1]+o+s+i+r+u;return new Promise((function(e){Oe(t,e)}))})).then((function(e){return"_local/"+e.replace(/\//g,".").replace(/\+/g,"_")}))}(e,t,n).then((function(o){u=o;var i;i=!1===n.checkpoint?{writeSourceCheckpoint:!1,writeTargetCheckpoint:!1}:"source"===n.checkpoint?{writeSourceCheckpoint:!0,writeTargetCheckpoint:!1}:"target"===n.checkpoint?{writeSourceCheckpoint:!1,writeTargetCheckpoint:!0}:{writeSourceCheckpoint:!0,writeTargetCheckpoint:!0},a=new Wn(e,t,u,r,i)}))}function P(){if(k=[],0!==i.docs.length){var e=i.docs,s={timeout:n.timeout};return t.bulkDocs({docs:e,new_edits:!1},s).then((function(t){
1353
+ /* istanbul ignore if */return n.selector&&(u=JSON.stringify(n.selector)),n.filter&&n.query_params&&(o=JSON.stringify(function(e){return Object.keys(e).sort(dt).reduce((function(t,n){return t[n]=e[n],t}),{})}(n.query_params))),n.filter&&"_view"===n.filter&&(s=n.view.toString()),Promise.all([e.id(),t.id()]).then((function(e){var t=e[0]+e[1]+i+s+o+r+u;return new Promise((function(e){Oe(t,e)}))})).then((function(e){return"_local/"+e.replace(/\//g,".").replace(/\+/g,"_")}))}(e,t,n).then((function(i){u=i;var o;o=!1===n.checkpoint?{writeSourceCheckpoint:!1,writeTargetCheckpoint:!1}:"source"===n.checkpoint?{writeSourceCheckpoint:!0,writeTargetCheckpoint:!1}:"target"===n.checkpoint?{writeSourceCheckpoint:!1,writeTargetCheckpoint:!0}:{writeSourceCheckpoint:!0,writeTargetCheckpoint:!0},a=new Wn(e,t,u,r,o)}))}function P(){if(k=[],0!==o.docs.length){var e=o.docs,s={timeout:n.timeout};return t.bulkDocs({docs:e,new_edits:!1},s).then((function(t){
1354
1354
  /* istanbul ignore if */
1355
1355
  if(r.cancelled)throw $(),new Error("cancelled");
1356
1356
  // `res` doesn't include full documents (which live in `docs`), so we create a map of
1357
1357
  // (id -> error), and check for errors while iterating over `docs`
1358
- var n=Object.create(null);t.forEach((function(e){e.error&&(n[e.id]=e)}));var i=Object.keys(n).length;o.doc_write_failures+=i,o.docs_written+=e.length-i,e.forEach((function(e){var t=n[e._id];if(t){o.errors.push(t);
1358
+ var n=Object.create(null);t.forEach((function(e){e.error&&(n[e.id]=e)}));var o=Object.keys(n).length;i.doc_write_failures+=o,i.docs_written+=e.length-o,e.forEach((function(e){var t=n[e._id];if(t){i.errors.push(t);
1359
1359
  // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
1360
- var i=(t.name||"").toLowerCase();if("unauthorized"!==i&&"forbidden"!==i)throw t;r.emit("denied",w(t))}else k.push(e)}))}),(function(t){throw o.doc_write_failures+=e.length,t}))}}function A(){if(i.error)throw new Error("There was a problem getting docs.");o.last_seq=p=i.seq;var e=w(o);return k.length&&(e.docs=k,
1360
+ var o=(t.name||"").toLowerCase();if("unauthorized"!==o&&"forbidden"!==o)throw t;r.emit("denied",w(t))}else k.push(e)}))}),(function(t){throw i.doc_write_failures+=e.length,t}))}}function A(){if(o.error)throw new Error("There was a problem getting docs.");i.last_seq=p=o.seq;var e=w(i);return k.length&&(e.docs=k,
1361
1361
  // Attach 'pending' property if server supports it (CouchDB 2.0+)
1362
1362
  /* istanbul ignore if */
1363
- "number"==typeof i.pending&&(e.pending=i.pending,delete i.pending),r.emit("change",e)),l=!0,a.writeCheckpoint(i.seq,j).then((function(){
1363
+ "number"==typeof o.pending&&(e.pending=o.pending,delete o.pending),r.emit("change",e)),l=!0,a.writeCheckpoint(o.seq,j).then((function(){
1364
1364
  /* istanbul ignore if */
1365
- if(l=!1,r.cancelled)throw $(),new Error("cancelled");i=void 0,I()})).catch((function(e){throw M(e),e}))}function x(){return function(e,t,n,r){n=w(n);// we do not need to modify this
1366
- var o=[],i=!0;function s(t){
1365
+ if(l=!1,r.cancelled)throw $(),new Error("cancelled");o=void 0,I()})).catch((function(e){throw M(e),e}))}function x(){return function(e,t,n,r){n=w(n);// we do not need to modify this
1366
+ var i=[],o=!0;function s(t){
1367
1367
  // Optimization: fetch gen-1 docs and attachments in
1368
1368
  // a single request using _all_docs
1369
1369
  return e.allDocs({keys:t,include_docs:!0,conflicts:!0}).then((function(e){if(r.cancelled)throw new Error("cancelled");e.rows.forEach((function(e){var t;e.deleted||!e.doc||!Vn(e.value.rev)||(t=e.doc)._attachments&&Object.keys(t._attachments).length>0||function(e){return e._conflicts&&e._conflicts.length>0}(e.doc)||(
@@ -1371,7 +1371,7 @@ return e.allDocs({keys:t,include_docs:!0,conflicts:!0}).then((function(e){if(r.c
1371
1371
  /* istanbul ignore if */
1372
1372
  e.doc._conflicts&&delete e.doc._conflicts,
1373
1373
  // the doc we got back from allDocs() is sufficient
1374
- o.push(e.doc),delete n[e.id])}))}))}return Promise.resolve().then((function(){
1374
+ i.push(e.doc),delete n[e.id])}))}))}return Promise.resolve().then((function(){
1375
1375
  // filter out the generation 1 docs and get them
1376
1376
  // leaving the non-generation one docs to be got otherwise
1377
1377
  var e=Object.keys(n).filter((function(e){var t=n[e].missing;return 1===t.length&&Vn(t[0])}));if(e.length>0)return s(e)})).then((function(){var s=function(e){var t=[];return Object.keys(e).forEach((function(n){e[n].missing.forEach((function(e){t.push({id:n,rev:e})}))})),{docs:t,revs:!0,latest:!0}}(n);if(s.docs.length)return e.bulkGet(s).then((function(n){
@@ -1379,38 +1379,38 @@ var e=Object.keys(n).filter((function(e){var t=n[e].missing;return 1===t.length&
1379
1379
  if(r.cancelled)throw new Error("cancelled");return Promise.all(n.results.map((function(n){return Promise.all(n.docs.map((function(n){var r=n.ok;return n.error&&(
1380
1380
  // when AUTO_COMPACTION is set, docs can be returned which look
1381
1381
  // like this: {"missing":"1-7c3ac256b693c462af8442f992b83696"}
1382
- i=!1),r&&r._attachments?function(e,t,n){var r=ne(t)&&!ne(e),o=Object.keys(n._attachments);return r?e.get(n._id).then((function(r){return Promise.all(o.map((function(o){return function(e,t,n){return!e._attachments||!e._attachments[n]||e._attachments[n].digest!==t._attachments[n].digest}(r,n,o)?t.getAttachment(n._id,o):e.getAttachment(r._id,o)})))})).catch((function(e){
1382
+ o=!1),r&&r._attachments?function(e,t,n){var r=ne(t)&&!ne(e),i=Object.keys(n._attachments);return r?e.get(n._id).then((function(r){return Promise.all(i.map((function(i){return function(e,t,n){return!e._attachments||!e._attachments[n]||e._attachments[n].digest!==t._attachments[n].digest}(r,n,i)?t.getAttachment(n._id,i):e.getAttachment(r._id,i)})))})).catch((function(e){
1383
1383
  /* istanbul ignore if */
1384
- if(404!==e.status)throw e;return zn(t,n)})):zn(t,n)}(t,e,r).then((function(e){var t=Object.keys(r._attachments);return e.forEach((function(e,n){var o=r._attachments[t[n]];delete o.stub,delete o.length,o.data=e})),r})):r})))}))).then((function(e){o=o.concat(ee(e).filter(Boolean))}))}))})).then((function(){return{ok:i,docs:o}}))}(e,t,i.diffs,r).then((function(e){i.error=!e.ok,e.docs.forEach((function(e){delete i.diffs[e._id],o.docs_read++,i.docs.push(e)}))}))}function q(){var e;r.cancelled||i||(0!==c.length?(i=c.shift(),(e={},i.changes.forEach((function(t){
1384
+ if(404!==e.status)throw e;return zn(t,n)})):zn(t,n)}(t,e,r).then((function(e){var t=Object.keys(r._attachments);return e.forEach((function(e,n){var i=r._attachments[t[n]];delete i.stub,delete i.length,i.data=e})),r})):r})))}))).then((function(e){i=i.concat(ee(e).filter(Boolean))}))}))})).then((function(){return{ok:o,docs:i}}))}(e,t,o.diffs,r).then((function(e){o.error=!e.ok,e.docs.forEach((function(e){delete o.diffs[e._id],i.docs_read++,o.docs.push(e)}))}))}function q(){var e;r.cancelled||o||(0!==c.length?(o=c.shift(),(e={},o.changes.forEach((function(t){
1385
1385
  // Couchbase Sync Gateway emits these, but we can ignore them
1386
1386
  /* istanbul ignore if */
1387
1387
  "_user/"!==t.id&&(e[t.id]=t.changes.map((function(e){return e.rev})))})),t.revsDiff(e).then((function(e){
1388
1388
  /* istanbul ignore if */
1389
1389
  if(r.cancelled)throw $(),new Error("cancelled");
1390
1390
  // currentBatch.diffs elements are deleted as the documents are written
1391
- i.diffs=e}))).then(x).then(P).then(A).then(q).catch((function(e){C("batch processing terminated with error",e)}))):E(!0))}function E(e){0!==f.changes.length?(e||d||f.changes.length>=y)&&(c.push(f),f={seq:0,changes:[],docs:[]},"pending"!==r.state&&"stopped"!==r.state||(r.state="active",r.emit("active")),q()):0!==c.length||i||((v&&O.live||d)&&(r.state="pending",r.emit("paused")),d&&$())}function C(e,t){h||(t.message||(t.message=e),o.ok=!1,o.status="aborting",c=[],f={seq:0,changes:[],docs:[]},$(t))}function $(i){if(!(h||r.cancelled&&(o.status="cancelled",l)))if(o.status=o.status||"complete",o.end_time=(new Date).toISOString(),o.last_seq=p,h=!0,i){
1391
+ o.diffs=e}))).then(x).then(P).then(A).then(q).catch((function(e){C("batch processing terminated with error",e)}))):E(!0))}function E(e){0!==f.changes.length?(e||d||f.changes.length>=y)&&(c.push(f),f={seq:0,changes:[],docs:[]},"pending"!==r.state&&"stopped"!==r.state||(r.state="active",r.emit("active")),q()):0!==c.length||o||((v&&O.live||d)&&(r.state="pending",r.emit("paused")),d&&$())}function C(e,t){h||(t.message||(t.message=e),i.ok=!1,i.status="aborting",c=[],f={seq:0,changes:[],docs:[]},$(t))}function $(o){if(!(h||r.cancelled&&(i.status="cancelled",l)))if(i.status=i.status||"complete",i.end_time=(new Date).toISOString(),i.last_seq=p,h=!0,o){
1392
1392
  // need to extend the error because Firefox considers ".result" read-only
1393
- (i=H(i)).result=o;
1393
+ (o=H(o)).result=i;
1394
1394
  // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
1395
- var s=(i.name||"").toLowerCase();"unauthorized"===s||"forbidden"===s?(r.emit("error",i),r.removeAllListeners()):function(e,t,n,r){if(!1===e.retry)return t.emit("error",n),void t.removeAllListeners();
1396
- /* istanbul ignore if */if("function"!=typeof e.back_off_function&&(e.back_off_function=B),t.emit("requestError",n),"active"===t.state||"pending"===t.state){t.emit("paused",n),t.state="stopped";var o=function(){e.current_back_off=0};t.once("paused",(function(){t.removeListener("active",o)})),t.once("active",o)}e.current_back_off=e.current_back_off||0,e.current_back_off=e.back_off_function(e.current_back_off),setTimeout(r,e.current_back_off)}(n,r,i,(function(){er(e,t,n,r)}))}else r.emit("complete",o),r.removeAllListeners();
1397
- /* istanbul ignore if */}function T(e,t,o){
1395
+ var s=(o.name||"").toLowerCase();"unauthorized"===s||"forbidden"===s?(r.emit("error",o),r.removeAllListeners()):function(e,t,n,r){if(!1===e.retry)return t.emit("error",n),void t.removeAllListeners();
1396
+ /* istanbul ignore if */if("function"!=typeof e.back_off_function&&(e.back_off_function=B),t.emit("requestError",n),"active"===t.state||"pending"===t.state){t.emit("paused",n),t.state="stopped";var i=function(){e.current_back_off=0};t.once("paused",(function(){t.removeListener("active",i)})),t.once("active",i)}e.current_back_off=e.current_back_off||0,e.current_back_off=e.back_off_function(e.current_back_off),setTimeout(r,e.current_back_off)}(n,r,o,(function(){er(e,t,n,r)}))}else r.emit("complete",i),r.removeAllListeners();
1397
+ /* istanbul ignore if */}function T(e,t,i){
1398
1398
  /* istanbul ignore if */
1399
1399
  if(r.cancelled)return $();
1400
1400
  // Attach 'pending' property if server supports it (CouchDB 2.0+)
1401
- /* istanbul ignore if */"number"==typeof t&&(f.pending=t),Z(n)(e)&&(f.seq=e.seq||o,f.changes.push(e),s((function(){E(0===c.length&&O.live)})))}function D(e){
1401
+ /* istanbul ignore if */"number"==typeof t&&(f.pending=t),Z(n)(e)&&(f.seq=e.seq||i,f.changes.push(e),s((function(){E(0===c.length&&O.live)})))}function D(e){
1402
1402
  /* istanbul ignore if */
1403
1403
  if(_=!1,r.cancelled)return $();
1404
1404
  // if no results were returned then we're done,
1405
1405
  // else fetch more
1406
1406
  if(e.results.length>0)O.since=e.results[e.results.length-1].seq,I(),E(!0);else{var t=function(){v?(O.live=!0,I()):d=!0,E(!0)};
1407
1407
  // update the checkpoint so we start from the right seq next time
1408
- i||0!==e.results.length?t():(l=!0,a.writeCheckpoint(e.last_seq,j).then((function(){l=!1,o.last_seq=p=e.last_seq,t()})).catch(M))}}function L(e){
1408
+ o||0!==e.results.length?t():(l=!0,a.writeCheckpoint(e.last_seq,j).then((function(){l=!1,i.last_seq=p=e.last_seq,t()})).catch(M))}}function L(e){
1409
1409
  /* istanbul ignore if */
1410
1410
  if(_=!1,r.cancelled)return $();C("changes rejected",e)}function I(){if(!_&&!d&&c.length<g){_=!0,r._changes&&(// remove old changes() and listeners
1411
- r.removeListener("cancel",r._abortChanges),r._changes.cancel()),r.once("cancel",o);var t=e.changes(O).on("change",T);t.then(i,i),t.then(D).catch(L),n.retry&&(
1411
+ r.removeListener("cancel",r._abortChanges),r._changes.cancel()),r.once("cancel",i);var t=e.changes(O).on("change",T);t.then(o,o),t.then(D).catch(L),n.retry&&(
1412
1412
  // save for later so we can cancel if necessary
1413
- r._changes=t,r._abortChanges=o)}function o(){t.cancel()}function i(){r.removeListener("cancel",o)}}function R(){S().then((function(){
1413
+ r._changes=t,r._abortChanges=i)}function i(){t.cancel()}function o(){r.removeListener("cancel",i)}}function R(){S().then((function(){
1414
1414
  /* istanbul ignore if */
1415
1415
  if(!r.cancelled)return a.getCheckpoint().then((function(e){O={since:p=e,limit:y,batch_size:y,style:"all_docs",doc_ids:m,selector:b,return_docs:!0},n.filter&&("string"!=typeof n.filter?
1416
1416
  // required for the client-side filter in onChange
@@ -1428,27 +1428,27 @@ function tr(){d.call(this),this.cancelled=!1,this.state="pending";var e=this,t=n
1428
1428
  // put a stub in here so that rejecting never throws UnhandledError.
1429
1429
  e.catch((function(){}))}function nr(e,t){var n=t.PouchConstructor;return"string"==typeof e?new n(e,t):e}function rr(e,t,n,r){if("function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),n.doc_ids&&!Array.isArray(n.doc_ids))throw H(z,"`doc_ids` filter parameter is not a list.");n.complete=r,(n=w(n)).continuous=n.continuous||n.live,n.retry="retry"in n&&n.retry,
1430
1430
  /*jshint validthis:true */
1431
- n.PouchConstructor=n.PouchConstructor||this;var o=new tr(n);return er(nr(e,n),nr(t,n),n,o),o}function or(e,t,n,r){return"function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),
1431
+ n.PouchConstructor=n.PouchConstructor||this;var i=new tr(n);return er(nr(e,n),nr(t,n),n,i),i}function ir(e,t,n,r){return"function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),
1432
1432
  /*jshint validthis:true */
1433
- (n=w(n)).PouchConstructor=n.PouchConstructor||this,new ir(e=nr(e,n),t=nr(t,n),n,r)}function ir(e,t,n,r){var o=this;this.canceled=!1;var i=n.push?T({},n,n.push):n,s=n.pull?T({},n,n.pull):n;function u(e){o.emit("change",{direction:"pull",change:e})}function a(e){o.emit("change",{direction:"push",change:e})}function c(e){o.emit("denied",{direction:"push",doc:e})}function f(e){o.emit("denied",{direction:"pull",doc:e})}function l(){o.pushPaused=!0,
1433
+ (n=w(n)).PouchConstructor=n.PouchConstructor||this,new or(e=nr(e,n),t=nr(t,n),n,r)}function or(e,t,n,r){var i=this;this.canceled=!1;var o=n.push?T({},n,n.push):n,s=n.pull?T({},n,n.pull):n;function u(e){i.emit("change",{direction:"pull",change:e})}function a(e){i.emit("change",{direction:"push",change:e})}function c(e){i.emit("denied",{direction:"push",doc:e})}function f(e){i.emit("denied",{direction:"pull",doc:e})}function l(){i.pushPaused=!0,
1434
1434
  /* istanbul ignore if */
1435
- o.pullPaused&&o.emit("paused")}function d(){o.pullPaused=!0,
1435
+ i.pullPaused&&i.emit("paused")}function d(){i.pullPaused=!0,
1436
1436
  /* istanbul ignore if */
1437
- o.pushPaused&&o.emit("paused")}function h(){o.pushPaused=!1,
1437
+ i.pushPaused&&i.emit("paused")}function h(){i.pushPaused=!1,
1438
1438
  /* istanbul ignore if */
1439
- o.pullPaused&&o.emit("active",{direction:"push"})}function p(){o.pullPaused=!1,
1439
+ i.pullPaused&&i.emit("active",{direction:"push"})}function p(){i.pullPaused=!1,
1440
1440
  /* istanbul ignore if */
1441
- o.pushPaused&&o.emit("active",{direction:"pull"})}this.push=rr(e,t,i),this.pull=rr(t,e,s),this.pushPaused=!0,this.pullPaused=!0;var v={};function y(e){// type is 'push' or 'pull'
1441
+ i.pushPaused&&i.emit("active",{direction:"pull"})}this.push=rr(e,t,o),this.pull=rr(t,e,s),this.pushPaused=!0,this.pullPaused=!0;var v={};function y(e){// type is 'push' or 'pull'
1442
1442
  return function(t,n){("change"===t&&(n===u||n===a)||"denied"===t&&(n===f||n===c)||"paused"===t&&(n===d||n===l)||"active"===t&&(n===p||n===h))&&(t in v||(v[t]={}),v[t][e]=!0,2===Object.keys(v[t]).length&&
1443
1443
  // both push and pull have asked to be removed
1444
- o.removeAllListeners(t))}}function g(e,t,n){-1==e.listeners(t).indexOf(n)&&e.on(t,n)}n.live&&(this.push.on("complete",o.pull.cancel.bind(o.pull)),this.pull.on("complete",o.push.cancel.bind(o.push))),this.on("newListener",(function(e){"change"===e?(g(o.pull,"change",u),g(o.push,"change",a)):"denied"===e?(g(o.pull,"denied",f),g(o.push,"denied",c)):"active"===e?(g(o.pull,"active",p),g(o.push,"active",h)):"paused"===e&&(g(o.pull,"paused",d),g(o.push,"paused",l))})),this.on("removeListener",(function(e){"change"===e?(o.pull.removeListener("change",u),o.push.removeListener("change",a)):"denied"===e?(o.pull.removeListener("denied",f),o.push.removeListener("denied",c)):"active"===e?(o.pull.removeListener("active",p),o.push.removeListener("active",h)):"paused"===e&&(o.pull.removeListener("paused",d),o.push.removeListener("paused",l))})),this.pull.on("removeListener",y("pull")),this.push.on("removeListener",y("push"));var _=Promise.all([this.push,this.pull]).then((function(e){var t={push:e[0],pull:e[1]};return o.emit("complete",t),r&&r(null,t),o.removeAllListeners(),t}),(function(e){if(o.cancel(),r?
1444
+ i.removeAllListeners(t))}}function g(e,t,n){-1==e.listeners(t).indexOf(n)&&e.on(t,n)}n.live&&(this.push.on("complete",i.pull.cancel.bind(i.pull)),this.pull.on("complete",i.push.cancel.bind(i.push))),this.on("newListener",(function(e){"change"===e?(g(i.pull,"change",u),g(i.push,"change",a)):"denied"===e?(g(i.pull,"denied",f),g(i.push,"denied",c)):"active"===e?(g(i.pull,"active",p),g(i.push,"active",h)):"paused"===e&&(g(i.pull,"paused",d),g(i.push,"paused",l))})),this.on("removeListener",(function(e){"change"===e?(i.pull.removeListener("change",u),i.push.removeListener("change",a)):"denied"===e?(i.pull.removeListener("denied",f),i.push.removeListener("denied",c)):"active"===e?(i.pull.removeListener("active",p),i.push.removeListener("active",h)):"paused"===e&&(i.pull.removeListener("paused",d),i.push.removeListener("paused",l))})),this.pull.on("removeListener",y("pull")),this.push.on("removeListener",y("push"));var _=Promise.all([this.push,this.pull]).then((function(e){var t={push:e[0],pull:e[1]};return i.emit("complete",t),r&&r(null,t),i.removeAllListeners(),t}),(function(e){if(i.cancel(),r?
1445
1445
  // if there's a callback, then the callback can receive
1446
1446
  // the error event
1447
1447
  r(e):
1448
1448
  // if there's no callback, then we're safe to emit an error
1449
1449
  // event, which would otherwise throw an unhandled error
1450
1450
  // due to 'error' being a special event in EventEmitters
1451
- o.emit("error",e),o.removeAllListeners(),r)
1451
+ i.emit("error",e),i.removeAllListeners(),r)
1452
1452
  // no sense throwing if we're already emitting an 'error' event
1453
1453
  throw e}));this.then=function(e,t){return _.then(e,t)},this.catch=function(e){return _.catch(e)}}Wn.prototype.getCheckpoint=function(){var e=this;return e.opts&&e.opts.writeSourceCheckpoint&&!e.opts.writeTargetCheckpoint?e.src.get(e.id).then((function(e){return e.last_seq||0})).catch((function(e){
1454
1454
  /* istanbul ignore if */
@@ -1458,113 +1458,9 @@ if(404!==e.status)throw e;return 0})):e.target.get(e.id).then((function(t){retur
1458
1458
  /* istanbul ignore if */
1459
1459
  return t.version!==e.version?0:(n=t.version?t.version.toString():"undefined")in Yn?Yn[n](t,e):0
1460
1460
  /* istanbul ignore next */;var n}),(function(n){if(404===n.status&&t.last_seq)return e.src.put({_id:e.id,last_seq:0}).then((function(){return 0}),(function(n){return Zn(n)?(e.opts.writeSourceCheckpoint=!1,t.last_seq):0
1461
- /* istanbul ignore next */}));throw n}))})).catch((function(e){if(404!==e.status)throw e;return 0}))},l(tr,d),tr.prototype.cancel=function(){this.cancelled=!0,this.state="cancelled",this.emit("cancel")},tr.prototype.ready=function(e,t){var n=this;function r(){n.cancel()}n._readyCalled||(n._readyCalled=!0,e.once("destroyed",r),t.once("destroyed",r),n.once("complete",(function(){e.removeListener("destroyed",r),t.removeListener("destroyed",r)})))},l(ir,d),ir.prototype.cancel=function(){this.canceled||(this.canceled=!0,this.push.cancel(),this.pull.cancel())},Xe.plugin((function(e){e.adapter("idb",fn,!0)})).plugin((function(e){e.adapter("http",mn,!1),e.adapter("https",mn,!1)})).plugin(Jn).plugin((function(e){e.replicate=rr,e.sync=or,Object.defineProperty(e.prototype,"replicate",{get:function(){var e=this;return void 0===this.replicateMethods&&(this.replicateMethods={from:function(t,n,r){return e.constructor.replicate(t,e,n,r)},to:function(t,n,r){return e.constructor.replicate(e,t,n,r)}}),this.replicateMethods}}),e.prototype.sync=function(e,t,n){return this.constructor.sync(this,e,t,n)}})),t.exports=Xe}).call(this,e("_process"))},{_process:22,argsarray:1,events:3,immediate:4,inherits:10,"spark-md5":23,uuid:13,vuvuzela:24}],12:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;
1462
- /**
1463
- * Convert array of 16 byte values to UUID string format of the form:
1464
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1465
- */
1466
- const r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).substr(1));n.default=function(e,t){const n=t||0,o=r;// Note: Be careful editing this code! It's been tuned for performance
1467
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1468
- return(o[e[n+0]]+o[e[n+1]]+o[e[n+2]]+o[e[n+3]]+"-"+o[e[n+4]]+o[e[n+5]]+"-"+o[e[n+6]]+o[e[n+7]]+"-"+o[e[n+8]]+o[e[n+9]]+"-"+o[e[n+10]]+o[e[n+11]]+o[e[n+12]]+o[e[n+13]]+o[e[n+14]]+o[e[n+15]]).toLowerCase()}},{}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return s.default}});var r=u(e("./v1.js")),o=u(e("./v3.js")),i=u(e("./v4.js")),s=u(e("./v5.js"));function u(e){return e&&e.__esModule?e:{default:e}}},{"./v1.js":17,"./v3.js":18,"./v4.js":20,"./v5.js":21}],14:[function(e,t,n){"use strict";
1469
- /**
1470
- * Calculate output length with padding and bit length
1471
- */function r(e){return 14+(e+64>>>9<<4)+1}
1472
- /*
1473
- * Calculate the MD5 of an array of little-endian words, and a bit length.
1474
- */
1475
- /*
1476
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
1477
- * to work around bugs in some JS interpreters.
1478
- */function o(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}
1479
- /*
1480
- * Bitwise rotate a 32-bit number to the left.
1481
- */
1482
- /*
1483
- * These functions implement the four basic operations the algorithm uses.
1484
- */function i(e,t,n,r,i,s){return o((u=o(o(t,e),o(r,s)))<<(a=i)|u>>>32-a,n);var u,a}function s(e,t,n,r,o,s,u){return i(t&n|~t&r,e,t,o,s,u)}function u(e,t,n,r,o,s,u){return i(t&r|n&~r,e,t,o,s,u)}function a(e,t,n,r,o,s,u){return i(t^n^r,e,t,o,s,u)}function c(e,t,n,r,o,s,u){return i(n^(t|~r),e,t,o,s,u)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=
1485
- /*
1486
- * Browser-compatible JavaScript MD5
1487
- *
1488
- * Modification of JavaScript MD5
1489
- * https://github.com/blueimp/JavaScript-MD5
1490
- *
1491
- * Copyright 2011, Sebastian Tschan
1492
- * https://blueimp.net
1493
- *
1494
- * Licensed under the MIT license:
1495
- * https://opensource.org/licenses/MIT
1496
- *
1497
- * Based on
1498
- * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
1499
- * Digest Algorithm, as defined in RFC 1321.
1500
- * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
1501
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
1502
- * Distributed under the BSD License
1503
- * See http://pajhome.org.uk/crypt/md5 for more info.
1504
- */
1505
- function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));// UTF8 escape
1506
- e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}
1507
- /*
1508
- * Convert an array of little-endian words to an array of bytes
1509
- */return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(i)}return t}(function(e,t){
1510
- /* append padding */
1511
- e[t>>5]|=128<<t%32,e[r(t)-1]=t;let n=1732584193,i=-271733879,f=-1732584194,l=271733878;for(let t=0;t<e.length;t+=16){const r=n,d=i,h=f,p=l;n=s(n,i,f,l,e[t],7,-680876936),l=s(l,n,i,f,e[t+1],12,-389564586),f=s(f,l,n,i,e[t+2],17,606105819),i=s(i,f,l,n,e[t+3],22,-1044525330),n=s(n,i,f,l,e[t+4],7,-176418897),l=s(l,n,i,f,e[t+5],12,1200080426),f=s(f,l,n,i,e[t+6],17,-1473231341),i=s(i,f,l,n,e[t+7],22,-45705983),n=s(n,i,f,l,e[t+8],7,1770035416),l=s(l,n,i,f,e[t+9],12,-1958414417),f=s(f,l,n,i,e[t+10],17,-42063),i=s(i,f,l,n,e[t+11],22,-1990404162),n=s(n,i,f,l,e[t+12],7,1804603682),l=s(l,n,i,f,e[t+13],12,-40341101),f=s(f,l,n,i,e[t+14],17,-1502002290),i=s(i,f,l,n,e[t+15],22,1236535329),n=u(n,i,f,l,e[t+1],5,-165796510),l=u(l,n,i,f,e[t+6],9,-1069501632),f=u(f,l,n,i,e[t+11],14,643717713),i=u(i,f,l,n,e[t],20,-373897302),n=u(n,i,f,l,e[t+5],5,-701558691),l=u(l,n,i,f,e[t+10],9,38016083),f=u(f,l,n,i,e[t+15],14,-660478335),i=u(i,f,l,n,e[t+4],20,-405537848),n=u(n,i,f,l,e[t+9],5,568446438),l=u(l,n,i,f,e[t+14],9,-1019803690),f=u(f,l,n,i,e[t+3],14,-187363961),i=u(i,f,l,n,e[t+8],20,1163531501),n=u(n,i,f,l,e[t+13],5,-1444681467),l=u(l,n,i,f,e[t+2],9,-51403784),f=u(f,l,n,i,e[t+7],14,1735328473),i=u(i,f,l,n,e[t+12],20,-1926607734),n=a(n,i,f,l,e[t+5],4,-378558),l=a(l,n,i,f,e[t+8],11,-2022574463),f=a(f,l,n,i,e[t+11],16,1839030562),i=a(i,f,l,n,e[t+14],23,-35309556),n=a(n,i,f,l,e[t+1],4,-1530992060),l=a(l,n,i,f,e[t+4],11,1272893353),f=a(f,l,n,i,e[t+7],16,-155497632),i=a(i,f,l,n,e[t+10],23,-1094730640),n=a(n,i,f,l,e[t+13],4,681279174),l=a(l,n,i,f,e[t],11,-358537222),f=a(f,l,n,i,e[t+3],16,-722521979),i=a(i,f,l,n,e[t+6],23,76029189),n=a(n,i,f,l,e[t+9],4,-640364487),l=a(l,n,i,f,e[t+12],11,-421815835),f=a(f,l,n,i,e[t+15],16,530742520),i=a(i,f,l,n,e[t+2],23,-995338651),n=c(n,i,f,l,e[t],6,-198630844),l=c(l,n,i,f,e[t+7],10,1126891415),f=c(f,l,n,i,e[t+14],15,-1416354905),i=c(i,f,l,n,e[t+5],21,-57434055),n=c(n,i,f,l,e[t+12],6,1700485571),l=c(l,n,i,f,e[t+3],10,-1894986606),f=c(f,l,n,i,e[t+10],15,-1051523),i=c(i,f,l,n,e[t+1],21,-2054922799),n=c(n,i,f,l,e[t+8],6,1873313359),l=c(l,n,i,f,e[t+15],10,-30611744),f=c(f,l,n,i,e[t+6],15,-1560198380),i=c(i,f,l,n,e[t+13],21,1309151649),n=c(n,i,f,l,e[t+4],6,-145523070),l=c(l,n,i,f,e[t+11],10,-1120210379),f=c(f,l,n,i,e[t+2],15,718787259),i=c(i,f,l,n,e[t+9],21,-343485551),n=o(n,r),i=o(i,d),f=o(f,h),l=o(l,p)}return[n,i,f,l]}
1512
- /*
1513
- * Convert an array bytes to an array of little-endian words
1514
- * Characters >255 have their high-byte silently ignored.
1515
- */(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}},{}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)};
1516
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1517
- // require the crypto API and do not support built-in fallback to lower quality random number
1518
- // generators (like Math.random()).
1519
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
1520
- // find the complete implementation of crypto (msCrypto) on IE11.
1521
- const r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16)},{}],16:[function(e,t,n){"use strict";
1522
- // Adapted from Chris Veness' SHA1 code at
1523
- // http://www.movable-type.co.uk/scripts/sha1.html
1524
- function r(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function o(e,t){return e<<t|e>>>32-t}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));// UTF8 escape
1525
- e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}e.push(128);const i=e.length/4+2,s=Math.ceil(i/16),u=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];u[t]=n}u[s-1][14]=8*(e.length-1)/Math.pow(2,32),u[s-1][14]=Math.floor(u[s-1][14]),u[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const i=new Uint32Array(80);for(let t=0;t<16;++t)i[t]=u[e][t];for(let e=16;e<80;++e)i[e]=o(i[e-3]^i[e-8]^i[e-14]^i[e-16],1);let s=n[0],a=n[1],c=n[2],f=n[3],l=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),u=o(s,5)+r(n,a,c,f)+l+t[n]+i[e]>>>0;l=f,f=c,c=o(a,30)>>>0,a=s,s=u}n[0]=n[0]+s>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+f>>>0,n[4]=n[4]+l>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}},{}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./rng.js")),o=i(e("./bytesToUuid.js"));function i(e){return e&&e.__esModule?e:{default:e}}
1526
- // **`v1()` - Generate time-based UUID**
1527
- // Inspired by https://github.com/LiosK/UUID.js
1528
- // and http://docs.python.org/library/uuid.html
1529
- let s,u,a=0,c=0;n.default=// See https://github.com/uuidjs/uuid for API details
1530
- function(e,t,n){let i=t&&n||0;const f=t||[];let l=(e=e||{}).node||s,d=void 0!==e.clockseq?e.clockseq:u;// node and clockseq need to be initialized to random values if they're not
1531
- // specified. We do this lazily to minimize issues related to insufficient
1532
- // system entropy. See #189
1533
- if(null==l||null==d){const t=e.random||(e.rng||r.default)();null==l&&(
1534
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
1535
- l=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==d&&(
1536
- // Per 4.2.2, randomize (14 bit) clockseq
1537
- d=u=16383&(t[6]<<8|t[7]))}// UUID timestamps are 100 nano-second units since the Gregorian epoch,
1538
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
1539
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
1540
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
1541
- let h=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:c+1;// Per 4.2.1.2, use count of uuid's generated during the current clock
1542
- // cycle to simulate higher resolution clock
1543
- // Time since last uuid creation (in msecs)
1544
- const v=h-a+(p-c)/1e4;// Per 4.2.1.2, Bump clockseq on clock regression
1545
- // Per 4.2.1.2 Throw error if too many uuids are requested
1546
- if(v<0&&void 0===e.clockseq&&(d=d+1&16383),// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
1547
- // time interval
1548
- (v<0||h>a)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,c=p,u=d,// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
1549
- h+=122192928e5;// `time_low`
1550
- const y=(1e4*(268435455&h)+p)%4294967296;f[i++]=y>>>24&255,f[i++]=y>>>16&255,f[i++]=y>>>8&255,f[i++]=255&y;// `time_mid`
1551
- const g=h/4294967296*1e4&268435455;f[i++]=g>>>8&255,f[i++]=255&g,// `time_high_and_version`
1552
- f[i++]=g>>>24&15|16,// include version
1553
- f[i++]=g>>>16&255,// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
1554
- f[i++]=d>>>8|128,// `clock_seq_low`
1555
- f[i++]=255&d;// `node`
1556
- for(let e=0;e<6;++e)f[i+e]=l[e];return t||(0,o.default)(f)}},{"./bytesToUuid.js":12,"./rng.js":15}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./v35.js")),o=i(e("./md5.js"));function i(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,o.default);n.default=s},{"./md5.js":14,"./v35.js":19}],19:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){function r(e,r,i,s){const u=i&&s||0;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));// UTF8 escape
1557
- const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=function(e){
1558
- // Note: We assume we're being passed a valid uuid string
1559
- const t=[];return e.replace(/[a-fA-F0-9]{2}/g,(function(e){t.push(parseInt(e,16))})),t}(r)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(r)||16!==r.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");// Per 4.3
1560
- const a=n(r.concat(e));if(a[6]=15&a[6]|t,a[8]=63&a[8]|128,i)for(let e=0;e<16;++e)i[u+e]=a[e];return i||(0,o.default)(a)}// Function#name is not settable on some platforms (#270)
1561
- try{r.name=e;// eslint-disable-next-line no-empty
1562
- }catch(e){}// For CommonJS default export support
1563
- return r.DNS=i,r.URL=s,r},n.URL=n.DNS=void 0;var r,o=(r=e("./bytesToUuid.js"))&&r.__esModule?r:{default:r};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";n.DNS=i;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";n.URL=s},{"./bytesToUuid.js":12}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./rng.js")),o=i(e("./bytesToUuid.js"));function i(e){return e&&e.__esModule?e:{default:e}}n.default=function(e,t,n){"string"==typeof e&&(t="binary"===e?new Uint8Array(16):null,e=null);const i=(e=e||{}).random||(e.rng||r.default)();// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1564
- // Copy bytes to buffer, if provided
1565
- if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){const e=n||0;for(let n=0;n<16;++n)t[e+n]=i[n];return t}return(0,o.default)(i)}},{"./bytesToUuid.js":12,"./rng.js":15}],21:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./v35.js")),o=i(e("./sha1.js"));function i(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,o.default);n.default=s},{"./sha1.js":16,"./v35.js":19}],22:[function(e,t,n){
1461
+ /* istanbul ignore next */}));throw n}))})).catch((function(e){if(404!==e.status)throw e;return 0}))},l(tr,d),tr.prototype.cancel=function(){this.cancelled=!0,this.state="cancelled",this.emit("cancel")},tr.prototype.ready=function(e,t){var n=this;function r(){n.cancel()}n._readyCalled||(n._readyCalled=!0,e.once("destroyed",r),t.once("destroyed",r),n.once("complete",(function(){e.removeListener("destroyed",r),t.removeListener("destroyed",r)})))},l(or,d),or.prototype.cancel=function(){this.canceled||(this.canceled=!0,this.push.cancel(),this.pull.cancel())},Xe.plugin((function(e){e.adapter("idb",fn,!0)})).plugin((function(e){e.adapter("http",mn,!1),e.adapter("https",mn,!1)})).plugin(Jn).plugin((function(e){e.replicate=rr,e.sync=ir,Object.defineProperty(e.prototype,"replicate",{get:function(){var e=this;return void 0===this.replicateMethods&&(this.replicateMethods={from:function(t,n,r){return e.constructor.replicate(t,e,n,r)},to:function(t,n,r){return e.constructor.replicate(e,t,n,r)}}),this.replicateMethods}}),e.prototype.sync=function(e,t,n){return this.constructor.sync(this,e,t,n)}})),t.exports=Xe}).call(this)}).call(this,e("_process"))},{_process:12,argsarray:1,events:3,immediate:4,inherits:10,"spark-md5":13,uuid:15,vuvuzela:24}],12:[function(e,t,n){
1566
1462
  // shim for using process in browser
1567
- var r,o,i=t.exports={};
1463
+ var r,i,o=t.exports={};
1568
1464
  // cached from whatever global is present so that test runners that stub it
1569
1465
  // don't break things. But we need to wrap it in a try catch in case it is
1570
1466
  // wrapped in strict mode code which doesn't define any globals. It's inside a
@@ -1579,21 +1475,21 @@ return r(e,0)}catch(t){try{
1579
1475
  // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
1580
1476
  return r.call(null,e,0)}catch(t){
1581
1477
  // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
1582
- return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(e){o=u}}();var c,f=[],l=!1,d=-1;function h(){l&&c&&(l=!1,c.length?f=c.concat(f):d=-1,f.length&&p())}function p(){if(!l){var e=a(h);l=!0;for(var t=f.length;t;){for(c=f,f=[];++d<t;)c&&c[d].run();d=-1,t=f.length}c=null,l=!1,function(e){if(o===clearTimeout)
1478
+ return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{i="function"==typeof clearTimeout?clearTimeout:u}catch(e){i=u}}();var c,f=[],l=!1,d=-1;function h(){l&&c&&(l=!1,c.length?f=c.concat(f):d=-1,f.length&&p())}function p(){if(!l){var e=a(h);l=!0;for(var t=f.length;t;){for(c=f,f=[];++d<t;)c&&c[d].run();d=-1,t=f.length}c=null,l=!1,function(e){if(i===clearTimeout)
1583
1479
  //normal enviroments in sane situations
1584
1480
  return clearTimeout(e);
1585
1481
  // if clearTimeout wasn't available but was latter defined
1586
- if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{
1482
+ if((i===u||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{
1587
1483
  // when when somebody has screwed with setTimeout but no I.E. maddness
1588
- o(e)}catch(t){try{
1484
+ i(e)}catch(t){try{
1589
1485
  // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
1590
- return o.call(null,e)}catch(t){
1486
+ return i.call(null,e)}catch(t){
1591
1487
  // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
1592
1488
  // Some versions of I.E. have different rules for clearTimeout vs setTimeout
1593
- return o.call(this,e)}}}(e)}}
1489
+ return i.call(this,e)}}}(e)}}
1594
1490
  // v8 likes predictible objects
1595
- function v(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new v(e,t)),1!==f.length||l||a(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",// empty string to avoid regexp issues
1596
- i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],23:[function(e,t,n){!function(e){if("object"==typeof n)
1491
+ function v(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new v(e,t)),1!==f.length||l||a(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",// empty string to avoid regexp issues
1492
+ o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],13:[function(e,t,n){!function(e){if("object"==typeof n)
1597
1493
  // Node/CommonJS
1598
1494
  t.exports=e();else{
1599
1495
  // Browser globals (with support for web workers)
@@ -1609,9 +1505,9 @@ var r;try{r=window}catch(e){r=self}r.SparkMD5=e()}}((function(e){"use strict";
1609
1505
  so if possible we use it. Some IEs
1610
1506
  are the only ones I know of that
1611
1507
  need the idiotic second function,
1612
- generated by an if clause. */var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],r=e[1],o=e[2],i=e[3];r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&o)+t[1]-389564586|0)<<12|i>>>20)+n|0)&n|~i&r)+t[2]+606105819|0)<<17|o>>>15)+i|0)&i|~o&n)+t[3]-1044525330|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&o)+t[5]+1200080426|0)<<12|i>>>20)+n|0)&n|~i&r)+t[6]-1473231341|0)<<17|o>>>15)+i|0)&i|~o&n)+t[7]-45705983|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&o)+t[9]-1958414417|0)<<12|i>>>20)+n|0)&n|~i&r)+t[10]-42063|0)<<17|o>>>15)+i|0)&i|~o&n)+t[11]-1990404162|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&o)+t[13]-40341101|0)<<12|i>>>20)+n|0)&n|~i&r)+t[14]-1502002290|0)<<17|o>>>15)+i|0)&i|~o&n)+t[15]+1236535329|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[1]-165796510|0)<<5|n>>>27)+r|0)&o|r&~o)+t[6]-1069501632|0)<<9|i>>>23)+n|0)&r|n&~r)+t[11]+643717713|0)<<14|o>>>18)+i|0)&n|i&~n)+t[0]-373897302|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[5]-701558691|0)<<5|n>>>27)+r|0)&o|r&~o)+t[10]+38016083|0)<<9|i>>>23)+n|0)&r|n&~r)+t[15]-660478335|0)<<14|o>>>18)+i|0)&n|i&~n)+t[4]-405537848|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[9]+568446438|0)<<5|n>>>27)+r|0)&o|r&~o)+t[14]-1019803690|0)<<9|i>>>23)+n|0)&r|n&~r)+t[3]-187363961|0)<<14|o>>>18)+i|0)&n|i&~n)+t[8]+1163531501|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[13]-1444681467|0)<<5|n>>>27)+r|0)&o|r&~o)+t[2]-51403784|0)<<9|i>>>23)+n|0)&r|n&~r)+t[7]+1735328473|0)<<14|o>>>18)+i|0)&n|i&~n)+t[12]-1926607734|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[5]-378558|0)<<4|n>>>28)+r|0)^r^o)+t[8]-2022574463|0)<<11|i>>>21)+n|0)^n^r)+t[11]+1839030562|0)<<16|o>>>16)+i|0)^i^n)+t[14]-35309556|0)<<23|r>>>9)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[1]-1530992060|0)<<4|n>>>28)+r|0)^r^o)+t[4]+1272893353|0)<<11|i>>>21)+n|0)^n^r)+t[7]-155497632|0)<<16|o>>>16)+i|0)^i^n)+t[10]-1094730640|0)<<23|r>>>9)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[13]+681279174|0)<<4|n>>>28)+r|0)^r^o)+t[0]-358537222|0)<<11|i>>>21)+n|0)^n^r)+t[3]-722521979|0)<<16|o>>>16)+i|0)^i^n)+t[6]+76029189|0)<<23|r>>>9)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[9]-640364487|0)<<4|n>>>28)+r|0)^r^o)+t[12]-421815835|0)<<11|i>>>21)+n|0)^n^r)+t[15]+530742520|0)<<16|o>>>16)+i|0)^i^n)+t[2]-995338651|0)<<23|r>>>9)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[0]-198630844|0)<<6|n>>>26)+r|0)|~o))+t[7]+1126891415|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[14]-1416354905|0)<<15|o>>>17)+i|0)|~n))+t[5]-57434055|0)<<21|r>>>11)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[12]+1700485571|0)<<6|n>>>26)+r|0)|~o))+t[3]-1894986606|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[10]-1051523|0)<<15|o>>>17)+i|0)|~n))+t[1]-2054922799|0)<<21|r>>>11)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[8]+1873313359|0)<<6|n>>>26)+r|0)|~o))+t[15]-30611744|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[6]-1560198380|0)<<15|o>>>17)+i|0)|~n))+t[13]+1309151649|0)<<21|r>>>11)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[4]-145523070|0)<<6|n>>>26)+r|0)|~o))+t[11]-1120210379|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[2]+718787259|0)<<15|o>>>17)+i|0)|~n))+t[9]-343485551|0)<<21|r>>>11)+o|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=o+e[2]|0,e[3]=i+e[3]|0}function r(e){var t,n=[];/* Andy King said do it this way. */for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function o(e){var t,n=[];/* Andy King said do it this way. */for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function i(e){var t,o,i,s,u,a,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(f,r(e.substring(t-64,t)));for(o=(e=e.substring(t-64)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<o;t+=1)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(n(f,i),t=0;t<16;t+=1)i[t]=0;
1508
+ generated by an if clause. */var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],r=e[1],i=e[2],o=e[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+t[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+t[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+t[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+t[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+t[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+t[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+t[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+t[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+t[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+t[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+t[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+t[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+t[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+t[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+t[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+t[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+t[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+t[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+t[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+t[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+t[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+t[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+t[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+t[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+t[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+t[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+t[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+t[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+t[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+t[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+t[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+t[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+t[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+t[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+t[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+t[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+t[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+t[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+t[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+t[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+t[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+t[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+t[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+t[9]-343485551|0)<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=o+e[3]|0}function r(e){var t,n=[];/* Andy King said do it this way. */for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function i(e){var t,n=[];/* Andy King said do it this way. */for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function o(e){var t,i,o,s,u,a,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(f,r(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)o[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(n(f,o),t=0;t<16;t+=1)o[t]=0;
1613
1509
  // Beware that the final length might not fit in 32 bits so we take care of that
1614
- return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,i[14]=u,i[15]=a,n(f,i),f}function s(e){var n,r="";for(n=0;n<4;n+=1)r+=t[e>>8*n+4&15]+t[e>>8*n&15];return r}function u(e){var t;for(t=0;t<e.length;t+=1)e[t]=s(e[t]);return e.join("")}
1510
+ return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,o[14]=u,o[15]=a,n(f,o),f}function s(e){var n,r="";for(n=0;n<4;n+=1)r+=t[e>>8*n+4&15]+t[e>>8*n&15];return r}function u(e){var t;for(t=0;t<e.length;t+=1)e[t]=s(e[t]);return e.join("")}
1615
1511
  // In some cases the fast add32 function cannot be used..
1616
1512
  // ---------------------------------------------------
1617
1513
  /**
@@ -1633,14 +1529,14 @@ this.reset()}
1633
1529
  * @param {String} str The string to be appended
1634
1530
  *
1635
1531
  * @return {SparkMD5} The instance itself
1636
- */return u(i("hello")),
1532
+ */return u(o("hello")),
1637
1533
  // ---------------------------------------------------
1638
1534
  /**
1639
1535
  * ArrayBuffer slice polyfill.
1640
1536
  *
1641
1537
  * @see https://github.com/ttaubert/node-arraybuffer-slice
1642
1538
  */
1643
- "undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,r){var o,i,s,u,a=this.byteLength,c=t(n,a),f=a;return r!==e&&(f=t(r,a)),c>f?new ArrayBuffer(0):(o=f-c,i=new ArrayBuffer(o),s=new Uint8Array(i),u=new Uint8Array(this,c,o),s.set(u),i)}}(),f.prototype.append=function(e){
1539
+ "undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,r){var i,o,s,u,a=this.byteLength,c=t(n,a),f=a;return r!==e&&(f=t(r,a)),c>f?new ArrayBuffer(0):(i=f-c,o=new ArrayBuffer(i),s=new Uint8Array(o),u=new Uint8Array(this,c,i),s.set(u),o)}}(),f.prototype.append=function(e){
1644
1540
  // Converts the string to utf8 bytes if necessary
1645
1541
  // Then append as binary
1646
1542
  return this.appendBinary(a(e)),this
@@ -1650,7 +1546,7 @@ return this.appendBinary(a(e)),this
1650
1546
  * @param {String} contents The binary string to be appended
1651
1547
  *
1652
1548
  * @return {SparkMD5} The instance itself
1653
- */},f.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,o=this._buff.length;for(t=64;t<=o;t+=64)n(this._hash,r(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this
1549
+ */},f.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)n(this._hash,r(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this
1654
1550
  /**
1655
1551
  * Finishes the incremental computation, reseting the internal state and
1656
1552
  * returning the result.
@@ -1658,7 +1554,7 @@ return this.appendBinary(a(e)),this
1658
1554
  * @param {Boolean} raw True to get the raw string, false to get the hex string
1659
1555
  *
1660
1556
  * @return {String} The result
1661
- */},f.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(i,o),n=u(this._hash),e&&(n=c(n)),this.reset(),n
1557
+ */},f.prototype.end=function(e){var t,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)o[t>>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(o,i),n=u(this._hash),e&&(n=c(n)),this.reset(),n
1662
1558
  /**
1663
1559
  * Resets the internal state of the computation.
1664
1560
  *
@@ -1686,10 +1582,10 @@ f.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,
1686
1582
  *
1687
1583
  * @param {Array} tail The tail (will be modified)
1688
1584
  * @param {Number} length The length of the remaining buffer
1689
- */},f.prototype._finish=function(e,t){var r,o,i,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;
1585
+ */},f.prototype._finish=function(e,t){var r,i,o,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;
1690
1586
  // Do the final computation based on the tail and length
1691
1587
  // Beware that the final length may not fit in 32 bits so we take care of that
1692
- r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(r[2],16),i=parseInt(r[1],16)||0,e[14]=o,e[15]=i,n(this._hash,e)},
1588
+ r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,e[14]=i,e[15]=o,n(this._hash,e)},
1693
1589
  /**
1694
1590
  * Performs the md5 hash on a string.
1695
1591
  * A conversion will be applied if utf8 string is detected.
@@ -1711,7 +1607,7 @@ return f.hashBinary(a(e),t)},
1711
1607
  *
1712
1608
  * @return {String} The result
1713
1609
  */
1714
- f.hashBinary=function(e,t){var n=u(i(e));return t?c(n):n},
1610
+ f.hashBinary=function(e,t){var n=u(o(e));return t?c(n):n},
1715
1611
  // ---------------------------------------------------
1716
1612
  /**
1717
1613
  * SparkMD5 OOP implementation for array buffers.
@@ -1728,7 +1624,7 @@ this.reset()},
1728
1624
  *
1729
1625
  * @return {SparkMD5.ArrayBuffer} The instance itself
1730
1626
  */
1731
- f.ArrayBuffer.prototype.append=function(e){var t,r,i,s,u=(r=this._buff.buffer,i=e,!0,(s=new Uint8Array(r.byteLength+i.byteLength)).set(new Uint8Array(r)),s.set(new Uint8Array(i),r.byteLength),s),a=u.length;for(this._length+=e.byteLength,t=64;t<=a;t+=64)n(this._hash,o(u.subarray(t-64,t)));return this._buff=t-64<a?new Uint8Array(u.buffer.slice(t-64)):new Uint8Array(0),this
1627
+ f.ArrayBuffer.prototype.append=function(e){var t,r,o,s,u=(r=this._buff.buffer,o=e,!0,(s=new Uint8Array(r.byteLength+o.byteLength)).set(new Uint8Array(r)),s.set(new Uint8Array(o),r.byteLength),s),a=u.length;for(this._length+=e.byteLength,t=64;t<=a;t+=64)n(this._hash,i(u.subarray(t-64,t)));return this._buff=t-64<a?new Uint8Array(u.buffer.slice(t-64)):new Uint8Array(0),this
1732
1628
  /**
1733
1629
  * Finishes the incremental computation, reseting the internal state and
1734
1630
  * returning the result.
@@ -1736,7 +1632,7 @@ f.ArrayBuffer.prototype.append=function(e){var t,r,i,s,u=(r=this._buff.buffer,i=
1736
1632
  * @param {Boolean} raw True to get the raw string, false to get the hex string
1737
1633
  *
1738
1634
  * @return {String} The result
1739
- */},f.ArrayBuffer.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=r[t]<<(t%4<<3);return this._finish(i,o),n=u(this._hash),e&&(n=c(n)),this.reset(),n
1635
+ */},f.ArrayBuffer.prototype.end=function(e){var t,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)o[t>>2]|=r[t]<<(t%4<<3);return this._finish(o,i),n=u(this._hash),e&&(n=c(n)),this.reset(),n
1740
1636
  /**
1741
1637
  * Resets the internal state of the computation.
1742
1638
  *
@@ -1757,7 +1653,7 @@ return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t
1757
1653
  * @return {SparkMD5.ArrayBuffer} The instance itself
1758
1654
  */},f.ArrayBuffer.prototype.setState=function(e){
1759
1655
  // Convert string to buffer
1760
- return e.buff=function(e,t){var n,r=e.length,o=new ArrayBuffer(r),i=new Uint8Array(o);for(n=0;n<r;n+=1)i[n]=e.charCodeAt(n);return i}(e.buff),f.prototype.setState.call(this,e)},f.ArrayBuffer.prototype.destroy=f.prototype.destroy,f.ArrayBuffer.prototype._finish=f.prototype._finish,
1656
+ return e.buff=function(e,t){var n,r=e.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n<r;n+=1)o[n]=e.charCodeAt(n);return o}(e.buff),f.prototype.setState.call(this,e)},f.ArrayBuffer.prototype.destroy=f.prototype.destroy,f.ArrayBuffer.prototype._finish=f.prototype._finish,
1761
1657
  /**
1762
1658
  * Performs the md5 hash on an array buffer.
1763
1659
  *
@@ -1766,14 +1662,118 @@ return e.buff=function(e,t){var n,r=e.length,o=new ArrayBuffer(r),i=new Uint8Arr
1766
1662
  *
1767
1663
  * @return {String} The result
1768
1664
  */
1769
- f.ArrayBuffer.hash=function(e,t){var r=u(function(e){var t,r,i,s,u,a,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(f,o(e.subarray(t-64,t)));
1665
+ f.ArrayBuffer.hash=function(e,t){var r=u(function(e){var t,r,o,s,u,a,c=e.length,f=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(f,i(e.subarray(t-64,t)));
1770
1666
  // Not sure if it is a bug, however IE10 will always produce a sub array of length 1
1771
1667
  // containing the last element of the parent array if the sub array specified starts
1772
1668
  // beyond the length of the parent array - weird.
1773
1669
  // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
1774
- for(r=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)i[t>>2]|=e[t]<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(n(f,i),t=0;t<16;t+=1)i[t]=0;
1670
+ for(r=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)o[t>>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(n(f,o),t=0;t<16;t+=1)o[t]=0;
1775
1671
  // Beware that the final length might not fit in 32 bits so we take care of that
1776
- return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,i[14]=u,i[15]=a,n(f,i),f}(new Uint8Array(e)));return t?c(r):r},f}))},{}],24:[function(e,t,n){"use strict";
1672
+ return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=parseInt(s[1],16)||0,o[14]=u,o[15]=a,n(f,o),f}(new Uint8Array(e)));return t?c(r):r},f}))},{}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;
1673
+ /**
1674
+ * Convert array of 16 byte values to UUID string format of the form:
1675
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1676
+ */
1677
+ const r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).substr(1));n.default=function(e,t){const n=t||0,i=r;// Note: Be careful editing this code! It's been tuned for performance
1678
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1679
+ return(i[e[n+0]]+i[e[n+1]]+i[e[n+2]]+i[e[n+3]]+"-"+i[e[n+4]]+i[e[n+5]]+"-"+i[e[n+6]]+i[e[n+7]]+"-"+i[e[n+8]]+i[e[n+9]]+"-"+i[e[n+10]]+i[e[n+11]]+i[e[n+12]]+i[e[n+13]]+i[e[n+14]]+i[e[n+15]]).toLowerCase()}},{}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return s.default}});var r=u(e("./v1.js")),i=u(e("./v3.js")),o=u(e("./v4.js")),s=u(e("./v5.js"));function u(e){return e&&e.__esModule?e:{default:e}}},{"./v1.js":19,"./v3.js":20,"./v4.js":22,"./v5.js":23}],16:[function(e,t,n){"use strict";
1680
+ /**
1681
+ * Calculate output length with padding and bit length
1682
+ */function r(e){return 14+(e+64>>>9<<4)+1}
1683
+ /*
1684
+ * Calculate the MD5 of an array of little-endian words, and a bit length.
1685
+ */
1686
+ /*
1687
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
1688
+ * to work around bugs in some JS interpreters.
1689
+ */function i(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}
1690
+ /*
1691
+ * Bitwise rotate a 32-bit number to the left.
1692
+ */
1693
+ /*
1694
+ * These functions implement the four basic operations the algorithm uses.
1695
+ */function o(e,t,n,r,o,s){return i((u=i(i(t,e),i(r,s)))<<(a=o)|u>>>32-a,n);var u,a}function s(e,t,n,r,i,s,u){return o(t&n|~t&r,e,t,i,s,u)}function u(e,t,n,r,i,s,u){return o(t&r|n&~r,e,t,i,s,u)}function a(e,t,n,r,i,s,u){return o(t^n^r,e,t,i,s,u)}function c(e,t,n,r,i,s,u){return o(n^(t|~r),e,t,i,s,u)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=
1696
+ /*
1697
+ * Browser-compatible JavaScript MD5
1698
+ *
1699
+ * Modification of JavaScript MD5
1700
+ * https://github.com/blueimp/JavaScript-MD5
1701
+ *
1702
+ * Copyright 2011, Sebastian Tschan
1703
+ * https://blueimp.net
1704
+ *
1705
+ * Licensed under the MIT license:
1706
+ * https://opensource.org/licenses/MIT
1707
+ *
1708
+ * Based on
1709
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
1710
+ * Digest Algorithm, as defined in RFC 1321.
1711
+ * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
1712
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
1713
+ * Distributed under the BSD License
1714
+ * See http://pajhome.org.uk/crypt/md5 for more info.
1715
+ */
1716
+ function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));// UTF8 escape
1717
+ e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}
1718
+ /*
1719
+ * Convert an array of little-endian words to an array of bytes
1720
+ */return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){
1721
+ /* append padding */
1722
+ e[t>>5]|=128<<t%32,e[r(t)-1]=t;let n=1732584193,o=-271733879,f=-1732584194,l=271733878;for(let t=0;t<e.length;t+=16){const r=n,d=o,h=f,p=l;n=s(n,o,f,l,e[t],7,-680876936),l=s(l,n,o,f,e[t+1],12,-389564586),f=s(f,l,n,o,e[t+2],17,606105819),o=s(o,f,l,n,e[t+3],22,-1044525330),n=s(n,o,f,l,e[t+4],7,-176418897),l=s(l,n,o,f,e[t+5],12,1200080426),f=s(f,l,n,o,e[t+6],17,-1473231341),o=s(o,f,l,n,e[t+7],22,-45705983),n=s(n,o,f,l,e[t+8],7,1770035416),l=s(l,n,o,f,e[t+9],12,-1958414417),f=s(f,l,n,o,e[t+10],17,-42063),o=s(o,f,l,n,e[t+11],22,-1990404162),n=s(n,o,f,l,e[t+12],7,1804603682),l=s(l,n,o,f,e[t+13],12,-40341101),f=s(f,l,n,o,e[t+14],17,-1502002290),o=s(o,f,l,n,e[t+15],22,1236535329),n=u(n,o,f,l,e[t+1],5,-165796510),l=u(l,n,o,f,e[t+6],9,-1069501632),f=u(f,l,n,o,e[t+11],14,643717713),o=u(o,f,l,n,e[t],20,-373897302),n=u(n,o,f,l,e[t+5],5,-701558691),l=u(l,n,o,f,e[t+10],9,38016083),f=u(f,l,n,o,e[t+15],14,-660478335),o=u(o,f,l,n,e[t+4],20,-405537848),n=u(n,o,f,l,e[t+9],5,568446438),l=u(l,n,o,f,e[t+14],9,-1019803690),f=u(f,l,n,o,e[t+3],14,-187363961),o=u(o,f,l,n,e[t+8],20,1163531501),n=u(n,o,f,l,e[t+13],5,-1444681467),l=u(l,n,o,f,e[t+2],9,-51403784),f=u(f,l,n,o,e[t+7],14,1735328473),o=u(o,f,l,n,e[t+12],20,-1926607734),n=a(n,o,f,l,e[t+5],4,-378558),l=a(l,n,o,f,e[t+8],11,-2022574463),f=a(f,l,n,o,e[t+11],16,1839030562),o=a(o,f,l,n,e[t+14],23,-35309556),n=a(n,o,f,l,e[t+1],4,-1530992060),l=a(l,n,o,f,e[t+4],11,1272893353),f=a(f,l,n,o,e[t+7],16,-155497632),o=a(o,f,l,n,e[t+10],23,-1094730640),n=a(n,o,f,l,e[t+13],4,681279174),l=a(l,n,o,f,e[t],11,-358537222),f=a(f,l,n,o,e[t+3],16,-722521979),o=a(o,f,l,n,e[t+6],23,76029189),n=a(n,o,f,l,e[t+9],4,-640364487),l=a(l,n,o,f,e[t+12],11,-421815835),f=a(f,l,n,o,e[t+15],16,530742520),o=a(o,f,l,n,e[t+2],23,-995338651),n=c(n,o,f,l,e[t],6,-198630844),l=c(l,n,o,f,e[t+7],10,1126891415),f=c(f,l,n,o,e[t+14],15,-1416354905),o=c(o,f,l,n,e[t+5],21,-57434055),n=c(n,o,f,l,e[t+12],6,1700485571),l=c(l,n,o,f,e[t+3],10,-1894986606),f=c(f,l,n,o,e[t+10],15,-1051523),o=c(o,f,l,n,e[t+1],21,-2054922799),n=c(n,o,f,l,e[t+8],6,1873313359),l=c(l,n,o,f,e[t+15],10,-30611744),f=c(f,l,n,o,e[t+6],15,-1560198380),o=c(o,f,l,n,e[t+13],21,1309151649),n=c(n,o,f,l,e[t+4],6,-145523070),l=c(l,n,o,f,e[t+11],10,-1120210379),f=c(f,l,n,o,e[t+2],15,718787259),o=c(o,f,l,n,e[t+9],21,-343485551),n=i(n,r),o=i(o,d),f=i(f,h),l=i(l,p)}return[n,o,f,l]}
1723
+ /*
1724
+ * Convert an array bytes to an array of little-endian words
1725
+ * Characters >255 have their high-byte silently ignored.
1726
+ */(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}},{}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)};
1727
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
1728
+ // require the crypto API and do not support built-in fallback to lower quality random number
1729
+ // generators (like Math.random()).
1730
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
1731
+ // find the complete implementation of crypto (msCrypto) on IE11.
1732
+ const r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),i=new Uint8Array(16)},{}],18:[function(e,t,n){"use strict";
1733
+ // Adapted from Chris Veness' SHA1 code at
1734
+ // http://www.movable-type.co.uk/scripts/sha1.html
1735
+ function r(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function i(e,t){return e<<t|e>>>32-t}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));// UTF8 escape
1736
+ e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}e.push(128);const o=e.length/4+2,s=Math.ceil(o/16),u=new Array(s);for(let t=0;t<s;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];u[t]=n}u[s-1][14]=8*(e.length-1)/Math.pow(2,32),u[s-1][14]=Math.floor(u[s-1][14]),u[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=u[e][t];for(let e=16;e<80;++e)o[e]=i(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=n[0],a=n[1],c=n[2],f=n[3],l=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),u=i(s,5)+r(n,a,c,f)+l+t[n]+o[e]>>>0;l=f,f=c,c=i(a,30)>>>0,a=s,s=u}n[0]=n[0]+s>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+f>>>0,n[4]=n[4]+l>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}},{}],19:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./rng.js")),i=o(e("./bytesToUuid.js"));function o(e){return e&&e.__esModule?e:{default:e}}
1737
+ // **`v1()` - Generate time-based UUID**
1738
+ // Inspired by https://github.com/LiosK/UUID.js
1739
+ // and http://docs.python.org/library/uuid.html
1740
+ let s,u,a=0,c=0;n.default=// See https://github.com/uuidjs/uuid for API details
1741
+ function(e,t,n){let o=t&&n||0;const f=t||[];let l=(e=e||{}).node||s,d=void 0!==e.clockseq?e.clockseq:u;// node and clockseq need to be initialized to random values if they're not
1742
+ // specified. We do this lazily to minimize issues related to insufficient
1743
+ // system entropy. See #189
1744
+ if(null==l||null==d){const t=e.random||(e.rng||r.default)();null==l&&(
1745
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
1746
+ l=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==d&&(
1747
+ // Per 4.2.2, randomize (14 bit) clockseq
1748
+ d=u=16383&(t[6]<<8|t[7]))}// UUID timestamps are 100 nano-second units since the Gregorian epoch,
1749
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
1750
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
1751
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
1752
+ let h=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:c+1;// Per 4.2.1.2, use count of uuid's generated during the current clock
1753
+ // cycle to simulate higher resolution clock
1754
+ // Time since last uuid creation (in msecs)
1755
+ const v=h-a+(p-c)/1e4;// Per 4.2.1.2, Bump clockseq on clock regression
1756
+ // Per 4.2.1.2 Throw error if too many uuids are requested
1757
+ if(v<0&&void 0===e.clockseq&&(d=d+1&16383),// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
1758
+ // time interval
1759
+ (v<0||h>a)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,c=p,u=d,// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
1760
+ h+=122192928e5;// `time_low`
1761
+ const y=(1e4*(268435455&h)+p)%4294967296;f[o++]=y>>>24&255,f[o++]=y>>>16&255,f[o++]=y>>>8&255,f[o++]=255&y;// `time_mid`
1762
+ const g=h/4294967296*1e4&268435455;f[o++]=g>>>8&255,f[o++]=255&g,// `time_high_and_version`
1763
+ f[o++]=g>>>24&15|16,// include version
1764
+ f[o++]=g>>>16&255,// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
1765
+ f[o++]=d>>>8|128,// `clock_seq_low`
1766
+ f[o++]=255&d;// `node`
1767
+ for(let e=0;e<6;++e)f[o+e]=l[e];return t||(0,i.default)(f)}},{"./bytesToUuid.js":14,"./rng.js":17}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./v35.js")),i=o(e("./md5.js"));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,i.default);n.default=s},{"./md5.js":16,"./v35.js":21}],21:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){function r(e,r,o,s){const u=o&&s||0;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));// UTF8 escape
1768
+ const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=function(e){
1769
+ // Note: We assume we're being passed a valid uuid string
1770
+ const t=[];return e.replace(/[a-fA-F0-9]{2}/g,(function(e){t.push(parseInt(e,16))})),t}(r)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(r)||16!==r.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");// Per 4.3
1771
+ const a=n(r.concat(e));if(a[6]=15&a[6]|t,a[8]=63&a[8]|128,o)for(let e=0;e<16;++e)o[u+e]=a[e];return o||(0,i.default)(a)}// Function#name is not settable on some platforms (#270)
1772
+ try{r.name=e;// eslint-disable-next-line no-empty
1773
+ }catch(e){}// For CommonJS default export support
1774
+ return r.DNS=o,r.URL=s,r},n.URL=n.DNS=void 0;var r,i=(r=e("./bytesToUuid.js"))&&r.__esModule?r:{default:r};const o="6ba7b810-9dad-11d1-80b4-00c04fd430c8";n.DNS=o;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";n.URL=s},{"./bytesToUuid.js":14}],22:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./rng.js")),i=o(e("./bytesToUuid.js"));function o(e){return e&&e.__esModule?e:{default:e}}n.default=function(e,t,n){"string"==typeof e&&(t="binary"===e?new Uint8Array(16):null,e=null);const o=(e=e||{}).random||(e.rng||r.default)();// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1775
+ // Copy bytes to buffer, if provided
1776
+ if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){const e=n||0;for(let n=0;n<16;++n)t[e+n]=o[n];return t}return(0,i.default)(o)}},{"./bytesToUuid.js":14,"./rng.js":17}],23:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./v35.js")),i=o(e("./sha1.js"));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,i.default);n.default=s},{"./sha1.js":18,"./v35.js":21}],24:[function(e,t,n){"use strict";
1777
1777
  /**
1778
1778
  * Stringify/parse functions that don't operate
1779
1779
  * recursively, so they avoid call stack exceeded
@@ -1784,9 +1784,9 @@ return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),u=parseInt(s[2],16),a=pars
1784
1784
  // pouchCollate.parseIndexableString
1785
1785
  function r(e,t,n){var r=n[n.length-1];e===r.element&&(
1786
1786
  // popping a meta-element, e.g. an object whose value is another object
1787
- n.pop(),r=n[n.length-1]);var o=r.element,i=r.index;Array.isArray(o)?o.push(e):i===t.length-2?o[t.pop()]=e:t.push(e);// obj with key only
1788
- }n.stringify=function(e){var t=[];t.push({obj:e});for(var n,r,o,i,s,u,a,c,f,l,d="";n=t.pop();)if(r=n.obj,d+=n.prefix||"",o=n.val||"")d+=o;else if("object"!=typeof r)d+=void 0===r?null:JSON.stringify(r);else if(null===r)d+="null";else if(Array.isArray(r)){for(t.push({val:"]"}),i=r.length-1;i>=0;i--)s=0===i?"":",",t.push({obj:r[i],prefix:s});t.push({val:"["})}else{for(a in// object
1789
- u=[],r)r.hasOwnProperty(a)&&u.push(a);for(t.push({val:"}"}),i=u.length-1;i>=0;i--)f=r[c=u[i]],l=i>0?",":"",l+=JSON.stringify(c)+":",t.push({obj:f,prefix:l});t.push({val:"{"})}return d},n.parse=function(e){for(var t,n,o,i,s,u,a,c,f,l=[],d=[],h=0;;)if("}"!==(t=e[h++])&&"]"!==t&&void 0!==t)switch(t){case" ":case"\t":case"\n":case":":case",":break;case"n":h+=3,// 'ull'
1787
+ n.pop(),r=n[n.length-1]);var i=r.element,o=r.index;Array.isArray(i)?i.push(e):o===t.length-2?i[t.pop()]=e:t.push(e);// obj with key only
1788
+ }n.stringify=function(e){var t=[];t.push({obj:e});for(var n,r,i,o,s,u,a,c,f,l,d="";n=t.pop();)if(r=n.obj,d+=n.prefix||"",i=n.val||"")d+=i;else if("object"!=typeof r)d+=void 0===r?null:JSON.stringify(r);else if(null===r)d+="null";else if(Array.isArray(r)){for(t.push({val:"]"}),o=r.length-1;o>=0;o--)s=0===o?"":",",t.push({obj:r[o],prefix:s});t.push({val:"["})}else{for(a in// object
1789
+ u=[],r)r.hasOwnProperty(a)&&u.push(a);for(t.push({val:"}"}),o=u.length-1;o>=0;o--)f=r[c=u[o]],l=o>0?",":"",l+=JSON.stringify(c)+":",t.push({obj:f,prefix:l});t.push({val:"{"})}return d},n.parse=function(e){for(var t,n,i,o,s,u,a,c,f,l=[],d=[],h=0;;)if("}"!==(t=e[h++])&&"]"!==t&&void 0!==t)switch(t){case" ":case"\t":case"\n":case":":case",":break;case"n":h+=3,// 'ull'
1790
1790
  r(null,l,d);break;case"t":h+=3,// 'rue'
1791
1791
  r(!0,l,d);break;case"f":h+=4,// 'alse'
1792
- r(!1,l,d);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",h--;;){if(o=e[h++],!/[\d\.\-e\+]/.test(o)){h--;break}n+=o}r(parseFloat(n),l,d);break;case'"':for(i="",s=void 0,u=0;'"'!==(a=e[h++])||"\\"===s&&u%2==1;)i+=a,"\\"===(s=a)?u++:u=0;r(JSON.parse('"'+i+'"'),l,d);break;case"[":c={element:[],index:l.length},l.push(c.element),d.push(c);break;case"{":f={element:{},index:l.length},l.push(f.element),d.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();r(l.pop(),l,d)}}},{}]},{},[11])(11)})),define("persist/impl/pouchDBPersistenceStore",["../PersistenceStore","../impl/storageUtils","pouchdb","./logger"],(function(e,t,n,r){"use strict";var o=function(t){e.call(this,t)};(o.prototype=new e).Init=function(e){this._version=e&&e.version||"0";var t=this._name+this._version,o=e?e.adapter:null,i=this._extractDBOptions(e);if(o)try{o.plugin&&n.plugin(o.plugin),(i=i||{}).adapter=o.name,this._dbOptions=i,this._db=new n(t,i)}catch(e){return r.log("Error creating PouchDB instance with adapter "+o+": ",e.message),r.log("Please make sure the needed plugin and adapter are installed."),Promise.reject(e)}else i?(this._dbOptions=i,this._db=new n(t,i)):(this._dbOptions=null,this._db=new n(t));return e&&e.index&&(Array.isArray(e.index)?(this._index=e.index.filter((function(e){return"key"!==e})),0===this._index.length&&(this._index=null)):r.log("index must be an array")),this._createIndex()},o.prototype._extractDBOptions=function(e){var t=null;if(e){var n=this;Object.keys(e).forEach((function(r){n._isPersistenceStoreKey(r)||(t||(t={}),t[r]=e[r])}))}return t},o.prototype._isPersistenceStoreKey=function(e){return"version"===e||"adapter"===e||"index"===e||"skipMetadata"===e},o.prototype._createIndex=function(){if(this._index&&this._db.createIndex){var e=this,t=e._name+e._index.toString().replace(",","").replace(".",""),n={index:{fields:e._index,name:t}};return e._db.createIndex(n).catch((function(t){r.error("creating index on "+e._index.toString()+" failed with error "+t)}))}return Promise.resolve()},o.prototype.upsert=function(e,t,n,o){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsert() for key: "+e);var s=this,u=e.toString();return s._db.get(u).then((function(e){return i(o,e)?e:Promise.reject({status:409})})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)})).then((function(e){return s._put(u,t,n,o,e)}))},o.prototype._put=function(e,t,n,r,o){var i=[],s=this._prepareUpsert(n,i),u={_id:e,key:e,metadata:t,value:s?null:n};o&&(u._rev=o._rev);var a=this;return a._db.put(u).then((function(t){return a._addAttachments(e,t.rev,i)})).catch((function(e){if(409!==e.status)throw e}))};var i=function(e,t){return!e||t.metadata.versionIdentifier===e};o.prototype._addAttachments=function(e,t,n){if(n&&n.length){var o=this,i=n.map((function(n){var r;return r=n.value instanceof Blob?n.value:new Blob([n.value]),o._db.putAttachment(e,n.path,t,r,"binary")}),this);return Promise.all(i).catch((function(t){r.error("store: "+o._name+" failed add attachment for doc "+e)}))}return Promise.resolve()},o.prototype.upsertAll=function(e){if(r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsertAll()"),e&&e.length){var t=this,n={},o=e.map((function(e){var r=e.key.toString(),o=e.value,i=[],s=t._prepareUpsert(o,i);i.length>0&&(n[r]=i);var u={_id:r,key:e.key,metadata:e.metadata,value:s?null:o};return t._db.get(r).then((function(e){return u._rev=e._rev,u})).catch((function(e){if(404===e.status&&"missing"===e.message)return u;throw e}))}));return Promise.all(o).then((function(e){return t._db.bulkDocs(e)})).then((function(e){var o=[];if(e.forEach((function(e,i){if(e.ok){var s=n[e.id];s&&o.push(t._addAttachments(e.id,e.rev,s))}else 409===e.status&&r.log("conflict error")})),o.length>0)return Promise.all(o)})).catch((function(e){r.log("error in upsertAll")}))}return Promise.resolve()},o.prototype.find=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: find() for expression: "+JSON.stringify(e));var n=this;if(e=e||{},n._db.find){var o=n._prepareFind(e);return n._db.find(o).then((function(e){if(e&&e.docs&&e.docs.length){var t=e.docs.map(n._findResultCallback(o.fields),n);return Promise.all(t)}return[]})).catch((function(e){if(404===e.status&&"missing"===e.message)return[];throw e}))}return n._db.allDocs({include_docs:!0}).then((function(r){if(r&&r.rows&&r.rows.length){var o=r.rows.filter((function(n){var r=n.doc;return!(s(n)||!t.satisfy(e.selector,r))}));if(o.length){var i=o.map((function(e){return n._fixKey(e.doc),e.doc})),u=t.sortRows(i,e.sort).map((function(r){return n._fixBinaryValue(r).then((function(n){return e.fields?t.assembleObject(n,e.fields):n.value}))}));return Promise.all(u)}return[]}return[]})).catch((function(e){return r.log("error retrieving all documents from pouch db, returns empty list as find operation.",e),[]}))},o.prototype._findResultCallback=function(e){return function(t){return this._fixValue(t).then((function(t){return e?t:t.value}))}},o.prototype._fixValue=function(e){return this._fixKey(e),this._fixBinaryValue(e)},o.prototype._fixBinaryValue=function(e){var t=e._id||e.id||e.key,n=e._attachments;if(n){var o=this,i=Object.keys(n)[0];return o._db.getAttachment(t,i).then((function(t){if("rootpath"===i)e.value=t;else{for(var n=i.split("."),r=e.value,o=0;o<n.length-1;o++)r=r[n[o]];r[n[n.length-1]]=t}return e})).catch((function(e){r.error("store: "+o._name+" error getting attachment. ")}))}return Promise.resolve(e)},o.prototype.findByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: findByKey() for key: "+e);var t=this,n=e.toString();return t._db.get(n,{attachments:!0}).then((function(e){return t._fixBinaryValue(e)})).then((function(e){return e.value})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)}))},o.prototype.removeByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: removeByKey() for key: "+e);var t=this;if(!e)return Promise.resolve(!1);var n=e.toString();return t._db.get(n).then((function(e){return t._db.remove(e)})).then((function(){return!0})).catch((function(e){return(404!==e.status||"missing"!==e.message)&&Promise.reject(e)}))},o.prototype.delete=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: delete() for expression: "+JSON.stringify(e));var t=this;if(e){var o=e;return o.fields=["_id","_rev"],t.find(o).then((function(e){if(e&&e.length){var n=e.map((function(e){return{_id:e._id,_rev:e._rev,_deleted:!0}}));return t._db.bulkDocs(n)}})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))}return t._db.destroy().then((function(){var e=t._name+t._version;return t._dbOptions?t._db=new n(e,t._dbOptions):t._db=new n(e),t._createIndex()})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))},o.prototype.keys=function(){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: keys()");var e=this;return e._db.allDocs().then((function(e){var t=e.rows,n=[];if(t&&t.length)for(var r=0;r<t.length;r++)s(t[r])||n.push(t[r].id);return n})).catch((function(t){r.error("store: "+e._name+" error getting all the docs for keys ")}))},o.prototype._prepareFind=function(e){var t={},n=e.selector;n?n&&(t.selector=n):t.selector={_id:{$gt:null}};var r=e.fields;return r&&r.length&&(t.fields=r,-1!==r.indexOf("key")&&-1===r.indexOf("_id")&&t.fields.push("_id")),t},o.prototype._prepareUpsert=function(e,t){return!!e&&(e instanceof Blob||e instanceof ArrayBuffer?(t.push({path:"rootpath",value:e}),!0):(this._inspectValue("",e,t),!1))},o.prototype._inspectValue=function(e,t,n){for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(o&&"object"==typeof o)if(o instanceof Blob||o instanceof ArrayBuffer){var i=e;i.length>0&&(i+=".");var s={path:i+r,value:o};n.push(s),t.key=null}else if(void 0===o.length){var u=e;e.length>0&&(e+="."),e+=r,this._inspectValue(e,o,n),e=u}}},o.prototype.updateKey=function(e,t){r.log("Offline Persistence Toolkit PouchDBPersistenceStore: updateKey() with currentKey: "+e+" and new key: "+t);var n=this;return n._db.get(e).then((function(e){return e?n.upsert(t,e.metadata,e.value):Promise.reject("No existing key found to update")})).then((function(){return n.removeByKey(e)})).catch((function(){r.error("store: "+n._name+" error updating key")}))};var s=function(e){return e.id.startsWith("_design/")};return o.prototype._fixKey=function(e){var t=e._id||e.id||e.key;t&&(e.key=t)},o})),define("persist/pouchDBPersistenceStoreFactory",["./impl/pouchDBPersistenceStore"],(function(e){"use strict";return{createPersistenceStore:function(t,n){return function(t,n){var r=new e(t);return r.Init(n).then((function(){return r}))}(t,n)}}})),define("persist/impl/fileSystemPersistenceStore",["./keyValuePersistenceStore","../persistenceStoreManager","./logger"],(function(e,t,n){"use strict";var r=function(t){e.call(this,t),this._directoryName=f(t),this._directory=null};function o(e,t,n){return i().then((function(r){return r.upsert(e,n,{filename:t,metadata:n})}))}function i(){return t.openStore("fileIndex",{index:["key"],skipMetadata:!0})}function s(e,t){return new Promise((function(n,r){e._directory.getFile(t,{create:!1,exclusive:!1},(function(e){n(e)}),(function(e){e.code===FileError.NOT_FOUND_ERR||e.code===FileError.SYNTAX_ERR?n(null):r(e)}))}))}function u(e){return i().then((function(t){return t.findByKey(e)}))}function a(e){return i().then((function(t){return t.removeByKey(e)}))}function c(e,t){return s(e,t).then((function(e){return!!e&&new Promise((function(t,n){e.remove((function(){t(!0)}),(function(e){t(!1)}))}))}))}function f(e){var t=e.replace(/[<>\:"\/\\\|\?\*\~]/g,"").replace(/^\.+$/,"").replace(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,"").replace(/[\x00-\x1f\x80-\x9f]/g,"");return t.length>255?t.slice(0,255):t}return(r.prototype=new e).Init=function(t){var n=this;return e.prototype.Init.call(n,t).then((function(){return n._directoryName=f(n._name+n._version),new Promise((function(e,t){window.requestFileSystem(LocalFileSystem.PERSISTENT,0,(function(t){t.root.getDirectory(n._directoryName,{create:!0},(function(t){n._directory=t,e()}))}),(function(e){t(e)}))}))}))},r.prototype._insert=function(e,t,n){var r=this;return this.removeByKey(e).then((function(){n instanceof Blob?t.data_type="Blob":t.data_type="JSON";var i=r._directory.createReader();return new Promise((function(s,u){i.readEntries((function(i){for(var u=function(e){return i.filter((function(t){return t.name==e})).length>0},a=Math.floor(1e8*Math.random())+".pds";u(a);)a=Math.floor(1e8*Math.random())+".pds";(function(e,t,n,r,i){return new Promise((function(s,u){e._directory.getFile(t,{create:!0,exclusive:!1},(function(e){e.createWriter((function(e){e.onwriteend=function(){o(n,t,r).then((function(){s()}))},e.onerror=function(e){u(e)},"JSON"==r.data_type&&(i=JSON.stringify(i)),e.write(i)}))}))}))})(r,a,e,t,n).then((function(){s()}))}))}))}))},r.prototype.getItem=function(e){n.log("Offline Persistence Toolkit fileSystemPersistenceStore: getItem() with key: "+e);var t=this;return u(e).then((function(e){if(e){var n=e.filename,r=e.metadata;return s(t,n).then((function(e){if(e)return new Promise((function(t,n){e.file((function(e){var n=new FileReader;n.onloadend=function(e){var n,o,i=(n=this.result,0,o=new DataView(n.slice(0)),new Blob([o]));if("JSON"==r.data_type){var s=new FileReader;s.onloadend=function(){t({metadata:r,value:JSON.parse(this.result)})},s.readAsText(i)}else t({metadata:r,value:i})},n.readAsArrayBuffer(e)}),(function(e){n(e)}))}))}))}}))},r.prototype.removeByKey=function(e){n.log("Offline Persistence Toolkit fileSystemPersistenceStore: removeByKey() with key: "+e);var t=this;return u(e).then((function(n){return n?a(e).then((function(){return c(t,n.filename)})):Promise.resolve(!1)}))},r.prototype.keys=function(){return n.log("Offline Persistence Toolkit fileSystemPersistenceStore: keys()"),i().then((function(e){return e.keys()}))},r.prototype.deleteAll=function(){n.log("Offline Persistence Toolkit fileSystemPersistenceStore: deleteAll()");var e=this;return i().then((function(e){return e.delete()})).then((function(){var t=[],n=e._directory.createReader();return t.push(new Promise((function(r,o){n.readEntries((function(n){n.map((function(n){t.push(c(e,n.name))})),r()}))}))),Promise.all(t)}))},r.prototype.updateKey=function(e,t){return n.log("Offline Persistence Toolkit FileSystemPersistenceStore: updateKey() with currentKey: "+e+" and new key: "+t),u(e).then((function(e){if(e){var n=e.filename,r=e.metadata;return o(t,n,r)}return Promise.reject("No existing key found to update")})).then((function(){return a(e)}))},r})),define("persist/fileSystemPersistenceStoreFactory",["./impl/fileSystemPersistenceStore"],(function(e){"use strict";return{createPersistenceStore:function(t,n){return function(t,n){var r=new e(t);return r.Init(n).then((function(){return r}))}(t,n)}}})),define("persist/persistenceStoreFactory",[],(function(){"use strict";return{createPersistenceStore:function(e,t){}}}));
1792
+ r(!1,l,d);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",h--;;){if(i=e[h++],!/[\d\.\-e\+]/.test(i)){h--;break}n+=i}r(parseFloat(n),l,d);break;case'"':for(o="",s=void 0,u=0;'"'!==(a=e[h++])||"\\"===s&&u%2==1;)o+=a,"\\"===(s=a)?u++:u=0;r(JSON.parse('"'+o+'"'),l,d);break;case"[":c={element:[],index:l.length},l.push(c.element),d.push(c);break;case"{":f={element:{},index:l.length},l.push(f.element),d.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();r(l.pop(),l,d)}}},{}]},{},[11])(11)})),define("persist/impl/pouchDBPersistenceStore",["../PersistenceStore","../impl/storageUtils","pouchdb","./logger"],(function(e,t,n,r){"use strict";var i=function(t){e.call(this,t)};(i.prototype=new e).Init=function(e){this._version=e&&e.version||"0";var t=this._name+this._version,i=e?e.adapter:null,o=this._extractDBOptions(e);if(i)try{i.plugin&&n.plugin(i.plugin),(o=o||{}).adapter=i.name,this._dbOptions=o,this._db=new n(t,o)}catch(e){return r.log("Error creating PouchDB instance with adapter "+i+": ",e.message),r.log("Please make sure the needed plugin and adapter are installed."),Promise.reject(e)}else o?(this._dbOptions=o,this._db=new n(t,o)):(this._dbOptions=null,this._db=new n(t));return e&&e.index&&(Array.isArray(e.index)?(this._index=e.index.filter((function(e){return"key"!==e})),0===this._index.length&&(this._index=null)):r.log("index must be an array")),this._createIndex()},i.prototype._extractDBOptions=function(e){var t=null;if(e){var n=this;Object.keys(e).forEach((function(r){n._isPersistenceStoreKey(r)||(t||(t={}),t[r]=e[r])}))}return t},i.prototype._isPersistenceStoreKey=function(e){return"version"===e||"adapter"===e||"index"===e||"skipMetadata"===e},i.prototype._createIndex=function(){if(this._index&&this._db.createIndex){var e=this,t=e._name+e._index.toString().replace(",","").replace(".",""),n={index:{fields:e._index,name:t}};return e._db.createIndex(n).catch((function(t){r.error("creating index on "+e._index.toString()+" failed with error "+t)}))}return Promise.resolve()},i.prototype.upsert=function(e,t,n,i){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsert() for key: "+e);var s=this,u=e.toString();return s._db.get(u).then((function(e){return o(i,e)?e:Promise.reject({status:409})})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)})).then((function(e){return s._put(u,t,n,i,e)}))},i.prototype._put=function(e,t,n,r,i){var o=[],s=this._prepareUpsert(n,o),u={_id:e,key:e,metadata:t,value:s?null:n};i&&(u._rev=i._rev);var a=this;return a._db.put(u).then((function(t){return a._addAttachments(e,t.rev,o)})).catch((function(e){if(409!==e.status)throw e}))};var o=function(e,t){return!e||t.metadata.versionIdentifier===e};i.prototype._addAttachments=function(e,t,n){if(n&&n.length){var i=this,o=n.map((function(n){var r;return r=n.value instanceof Blob?n.value:new Blob([n.value]),i._db.putAttachment(e,n.path,t,r,"binary")}),this);return Promise.all(o).catch((function(t){r.error("store: "+i._name+" failed add attachment for doc "+e)}))}return Promise.resolve()},i.prototype.upsertAll=function(e){if(r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsertAll()"),e&&e.length){var t=this,n={},i=e.map((function(e){var r=e.key.toString(),i=e.value,o=[],s=t._prepareUpsert(i,o);o.length>0&&(n[r]=o);var u={_id:r,key:e.key,metadata:e.metadata,value:s?null:i};return t._db.get(r).then((function(e){return u._rev=e._rev,u})).catch((function(e){if(404===e.status&&"missing"===e.message)return u;throw e}))}));return Promise.all(i).then((function(e){return t._db.bulkDocs(e)})).then((function(e){var i=[];if(e.forEach((function(e,o){if(e.ok){var s=n[e.id];s&&i.push(t._addAttachments(e.id,e.rev,s))}else 409===e.status&&r.log("conflict error")})),i.length>0)return Promise.all(i)})).catch((function(e){r.log("error in upsertAll")}))}return Promise.resolve()},i.prototype.find=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: find() for expression: "+JSON.stringify(e));var n=this;if(e=e||{},n._db.find){var i=n._prepareFind(e);return n._db.find(i).then((function(e){if(e&&e.docs&&e.docs.length){var t=e.docs.map(n._findResultCallback(i.fields),n);return Promise.all(t)}return[]})).catch((function(e){if(404===e.status&&"missing"===e.message)return[];throw e}))}return n._db.allDocs({include_docs:!0}).then((function(r){if(r&&r.rows&&r.rows.length){var i=r.rows.filter((function(n){var r=n.doc;return!(s(n)||!t.satisfy(e.selector,r))}));if(i.length){var o=i.map((function(e){return n._fixKey(e.doc),e.doc})),u=t.sortRows(o,e.sort).map((function(r){return n._fixBinaryValue(r).then((function(n){return e.fields?t.assembleObject(n,e.fields):n.value}))}));return Promise.all(u)}return[]}return[]})).catch((function(e){return r.log("error retrieving all documents from pouch db, returns empty list as find operation.",e),[]}))},i.prototype._findResultCallback=function(e){return function(t){return this._fixValue(t).then((function(t){return e?t:t.value}))}},i.prototype._fixValue=function(e){return this._fixKey(e),this._fixBinaryValue(e)},i.prototype._fixBinaryValue=function(e){var t=e._id||e.id||e.key,n=e._attachments;if(n){var i=this,o=Object.keys(n)[0];return i._db.getAttachment(t,o).then((function(t){if("rootpath"===o)e.value=t;else{for(var n=o.split("."),r=e.value,i=0;i<n.length-1;i++)r=r[n[i]];r[n[n.length-1]]=t}return e})).catch((function(e){r.error("store: "+i._name+" error getting attachment. ")}))}return Promise.resolve(e)},i.prototype.findByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: findByKey() for key: "+e);var t=this,n=e.toString();return t._db.get(n,{attachments:!0}).then((function(e){return t._fixBinaryValue(e)})).then((function(e){return e.value})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)}))},i.prototype.removeByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: removeByKey() for key: "+e);var t=this;if(!e)return Promise.resolve(!1);var n=e.toString();return t._db.get(n).then((function(e){return t._db.remove(e)})).then((function(){return!0})).catch((function(e){return(404!==e.status||"missing"!==e.message)&&Promise.reject(e)}))},i.prototype.delete=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: delete() for expression: "+JSON.stringify(e));var t=this;if(e){var i=e;return i.fields=["_id","_rev"],t.find(i).then((function(e){if(e&&e.length){var n=e.map((function(e){return{_id:e._id,_rev:e._rev,_deleted:!0}}));return t._db.bulkDocs(n)}})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))}return t._db.destroy().then((function(){var e=t._name+t._version;return t._dbOptions?t._db=new n(e,t._dbOptions):t._db=new n(e),t._createIndex()})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))},i.prototype.keys=function(){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: keys()");var e=this;return e._db.allDocs().then((function(e){var t=e.rows,n=[];if(t&&t.length)for(var r=0;r<t.length;r++)s(t[r])||n.push(t[r].id);return n})).catch((function(t){r.error("store: "+e._name+" error getting all the docs for keys ")}))},i.prototype._prepareFind=function(e){var t={},n=e.selector;n?n&&(t.selector=n):t.selector={_id:{$gt:null}};var r=e.fields;return r&&r.length&&(t.fields=r,-1!==r.indexOf("key")&&-1===r.indexOf("_id")&&t.fields.push("_id")),t},i.prototype._prepareUpsert=function(e,t){return!!e&&(e instanceof Blob||e instanceof ArrayBuffer?(t.push({path:"rootpath",value:e}),!0):(this._inspectValue("",e,t),!1))},i.prototype._inspectValue=function(e,t,n){for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(i&&"object"==typeof i)if(i instanceof Blob||i instanceof ArrayBuffer){var o=e;o.length>0&&(o+=".");var s={path:o+r,value:i};n.push(s),t.key=null}else if(void 0===i.length){var u=e;e.length>0&&(e+="."),e+=r,this._inspectValue(e,i,n),e=u}}},i.prototype.updateKey=function(e,t){r.log("Offline Persistence Toolkit PouchDBPersistenceStore: updateKey() with currentKey: "+e+" and new key: "+t);var n=this;return n._db.get(e).then((function(e){return e?n.upsert(t,e.metadata,e.value):Promise.reject("No existing key found to update")})).then((function(){return n.removeByKey(e)})).catch((function(){r.error("store: "+n._name+" error updating key")}))};var s=function(e){return e.id.startsWith("_design/")};return i.prototype._fixKey=function(e){var t=e._id||e.id||e.key;t&&(e.key=t)},i})),define("persist/pouchDBPersistenceStoreFactory",["./impl/pouchDBPersistenceStore"],(function(e){"use strict";return{createPersistenceStore:function(t,n){return function(t,n){var r=new e(t);return r.Init(n).then((function(){return r}))}(t,n)}}})),define("persist/impl/fileSystemPersistenceStore",["./keyValuePersistenceStore","../persistenceStoreManager","./logger"],(function(e,t,n){"use strict";var r=function(t){e.call(this,t),this._directoryName=f(t),this._directory=null};function i(e,t,n){return o().then((function(r){return r.upsert(e,n,{filename:t,metadata:n})}))}function o(){return t.openStore("fileIndex",{index:["key"],skipMetadata:!0})}function s(e,t){return new Promise((function(n,r){e._directory.getFile(t,{create:!1,exclusive:!1},(function(e){n(e)}),(function(e){e.code===FileError.NOT_FOUND_ERR||e.code===FileError.SYNTAX_ERR?n(null):r(e)}))}))}function u(e){return o().then((function(t){return t.findByKey(e)}))}function a(e){return o().then((function(t){return t.removeByKey(e)}))}function c(e,t){return s(e,t).then((function(e){return!!e&&new Promise((function(t,n){e.remove((function(){t(!0)}),(function(e){t(!1)}))}))}))}function f(e){var t=e.replace(/[<>\:"\/\\\|\?\*\~]/g,"").replace(/^\.+$/,"").replace(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,"").replace(/[\x00-\x1f\x80-\x9f]/g,"");return t.length>255?t.slice(0,255):t}return(r.prototype=new e).Init=function(t){var n=this;return e.prototype.Init.call(n,t).then((function(){return n._directoryName=f(n._name+n._version),new Promise((function(e,t){window.requestFileSystem(LocalFileSystem.PERSISTENT,0,(function(t){t.root.getDirectory(n._directoryName,{create:!0},(function(t){n._directory=t,e()}))}),(function(e){t(e)}))}))}))},r.prototype._insert=function(e,t,n){var r=this;return this.removeByKey(e).then((function(){n instanceof Blob?t.data_type="Blob":t.data_type="JSON";var o=r._directory.createReader();return new Promise((function(s,u){o.readEntries((function(o){for(var u=function(e){return o.filter((function(t){return t.name==e})).length>0},a=Math.floor(1e8*Math.random())+".pds";u(a);)a=Math.floor(1e8*Math.random())+".pds";(function(e,t,n,r,o){return new Promise((function(s,u){e._directory.getFile(t,{create:!0,exclusive:!1},(function(e){e.createWriter((function(e){e.onwriteend=function(){i(n,t,r).then((function(){s()}))},e.onerror=function(e){u(e)},"JSON"==r.data_type&&(o=JSON.stringify(o)),e.write(o)}))}))}))})(r,a,e,t,n).then((function(){s()}))}))}))}))},r.prototype.getItem=function(e){n.log("Offline Persistence Toolkit fileSystemPersistenceStore: getItem() with key: "+e);var t=this;return u(e).then((function(e){if(e){var n=e.filename,r=e.metadata;return s(t,n).then((function(e){if(e)return new Promise((function(t,n){e.file((function(e){var n=new FileReader;n.onloadend=function(e){var n,i,o=(n=this.result,0,i=new DataView(n.slice(0)),new Blob([i]));if("JSON"==r.data_type){var s=new FileReader;s.onloadend=function(){t({metadata:r,value:JSON.parse(this.result)})},s.readAsText(o)}else t({metadata:r,value:o})},n.readAsArrayBuffer(e)}),(function(e){n(e)}))}))}))}}))},r.prototype.removeByKey=function(e){n.log("Offline Persistence Toolkit fileSystemPersistenceStore: removeByKey() with key: "+e);var t=this;return u(e).then((function(n){return n?a(e).then((function(){return c(t,n.filename)})):Promise.resolve(!1)}))},r.prototype.keys=function(){return n.log("Offline Persistence Toolkit fileSystemPersistenceStore: keys()"),o().then((function(e){return e.keys()}))},r.prototype.deleteAll=function(){n.log("Offline Persistence Toolkit fileSystemPersistenceStore: deleteAll()");var e=this;return o().then((function(e){return e.delete()})).then((function(){var t=[],n=e._directory.createReader();return t.push(new Promise((function(r,i){n.readEntries((function(n){n.map((function(n){t.push(c(e,n.name))})),r()}))}))),Promise.all(t)}))},r.prototype.updateKey=function(e,t){return n.log("Offline Persistence Toolkit FileSystemPersistenceStore: updateKey() with currentKey: "+e+" and new key: "+t),u(e).then((function(e){if(e){var n=e.filename,r=e.metadata;return i(t,n,r)}return Promise.reject("No existing key found to update")})).then((function(){return a(e)}))},r})),define("persist/fileSystemPersistenceStoreFactory",["./impl/fileSystemPersistenceStore"],(function(e){"use strict";return{createPersistenceStore:function(t,n){return function(t,n){var r=new e(t);return r.Init(n).then((function(){return r}))}(t,n)}}})),define("persist/persistenceStoreFactory",[],(function(){"use strict";return{createPersistenceStore:function(e,t){}}}));