@oracle/oraclejet 11.0.6 → 11.1.1

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 (934) hide show
  1. package/README.md +4 -4
  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 +5 -3
  6. package/dist/css/alta/oj-alta.css +5 -3
  7. package/dist/css/alta-android/oj-alta-min.css +1 -1
  8. package/dist/css/alta-android/oj-alta.css +5 -3
  9. package/dist/css/alta-ios/oj-alta-min.css +1 -1
  10. package/dist/css/alta-ios/oj-alta.css +5 -3
  11. package/dist/css/alta-windows/oj-alta-min.css +1 -1
  12. package/dist/css/alta-windows/oj-alta.css +5 -3
  13. package/dist/css/redwood/images/texture-dialog-144x20-opacity-08.png +0 -0
  14. package/dist/css/redwood/oj-redwood-min.css +1 -1
  15. package/dist/css/redwood/oj-redwood-notag-min.css +1 -1
  16. package/dist/css/redwood/oj-redwood-notag-novars-min.css +1 -1
  17. package/dist/css/redwood/oj-redwood-notag-novars.css +95 -58
  18. package/dist/css/redwood/oj-redwood-notag.css +109 -64
  19. package/dist/css/redwood/oj-redwood-novars-min.css +1 -1
  20. package/dist/css/redwood/oj-redwood-novars.css +95 -58
  21. package/dist/css/redwood/oj-redwood.css +109 -64
  22. package/dist/css/stable/oj-stable-min.css +1 -1
  23. package/dist/css/stable/oj-stable.css +103 -58
  24. package/dist/custom-tsc/JetTypeGenerator.js +14 -1
  25. package/dist/custom-tsc/metadataTransformer.js +14 -0
  26. package/dist/custom-tsc/templates/container.tmpl +14 -2
  27. package/dist/custom-tsc/templates/properties.tmpl +3 -3
  28. package/dist/custom-tsc/utils/MetadataEventUtils.js +28 -16
  29. package/dist/custom-tsc/utils/MetadataPropertyUtils.js +37 -10
  30. package/dist/custom-tsc/utils/MetadataSlotUtils.js +4 -5
  31. package/dist/custom-tsc/utils/MetadataTypeUtils.js +21 -14
  32. package/dist/custom-tsc/utils/MetadataTypes.d.ts +12 -0
  33. package/dist/custom-tsc/utils/MetadataUtils.d.ts +7 -2
  34. package/dist/custom-tsc/utils/MetadataUtils.js +214 -28
  35. package/dist/js/libs/oj/debug/ojarraydataprovider.js +58 -1
  36. package/dist/js/libs/oj/debug/ojbufferingdataprovider.js +19 -20
  37. package/dist/js/libs/oj/debug/ojchart-toolkit.js +7 -1
  38. package/dist/js/libs/oj/debug/ojchart.js +22 -16
  39. package/dist/js/libs/oj/debug/ojcheckboxset.js +10 -2
  40. package/dist/js/libs/oj/debug/ojcomponentcore.js +15 -2
  41. package/dist/js/libs/oj/debug/ojconfig.js +1 -1
  42. package/dist/js/libs/oj/debug/ojcontext.js +27 -10
  43. package/dist/js/libs/oj/debug/ojcore-base.js +16 -5
  44. package/dist/js/libs/oj/debug/ojdatagrid.js +99 -39
  45. package/dist/js/libs/oj/debug/ojdataprovider.js +18 -0
  46. package/dist/js/libs/oj/debug/ojdiagram.js +6 -6
  47. package/dist/js/libs/oj/debug/ojdrawerlayout.js +17 -8
  48. package/dist/js/libs/oj/debug/ojdrawerpopup.js +13 -2
  49. package/dist/js/libs/oj/debug/ojdvt-toolkit.js +11 -3
  50. package/dist/js/libs/oj/debug/ojdvttimecomponentscale.js +16 -0
  51. package/dist/js/libs/oj/debug/ojeditablevalue.js +48 -2
  52. package/dist/js/libs/oj/debug/ojgantt-toolkit.js +324 -142
  53. package/dist/js/libs/oj/debug/ojgantt.js +21 -11
  54. package/dist/js/libs/oj/debug/ojgauge.js +11 -11
  55. package/dist/js/libs/oj/debug/ojinputsearch.js +12 -0
  56. package/dist/js/libs/oj/debug/ojinputtext.js +16 -2
  57. package/dist/js/libs/oj/debug/ojlegend.js +12 -7
  58. package/dist/js/libs/oj/debug/ojlistview.js +13 -4
  59. package/dist/js/libs/oj/debug/ojmenu.js +5 -2
  60. package/dist/js/libs/oj/debug/ojmutablearraydataprovider.js +76 -19
  61. package/dist/js/libs/oj/debug/ojnbox.js +22 -22
  62. package/dist/js/libs/oj/debug/ojpictochart.js +2 -2
  63. package/dist/js/libs/oj/debug/ojpopupcore.js +3 -1
  64. package/dist/js/libs/oj/debug/ojpulltorefresh.js +7 -3
  65. package/dist/js/libs/oj/debug/ojradioset.js +11 -2
  66. package/dist/js/libs/oj/debug/ojrestdataprovider.js +41 -19
  67. package/dist/js/libs/oj/debug/ojresttreedataprovider.js +268 -0
  68. package/dist/js/libs/oj/debug/ojselectbase.js +65 -13
  69. package/dist/js/libs/oj/debug/ojselectcombobox.js +1 -1
  70. package/dist/js/libs/oj/debug/ojselectsingle.js +56 -31
  71. package/dist/js/libs/oj/debug/ojslider.js +3 -3
  72. package/dist/js/libs/oj/debug/ojstreamlist.js +2 -2
  73. package/dist/js/libs/oj/debug/ojsunburst.js +5 -5
  74. package/dist/js/libs/oj/debug/ojsuppressnodetreedataprovider.js +7 -0
  75. package/dist/js/libs/oj/debug/ojswitch.js +12 -2
  76. package/dist/js/libs/oj/debug/ojtable.js +369 -55
  77. package/dist/js/libs/oj/debug/ojtagcloud.js +3 -3
  78. package/dist/js/libs/oj/debug/ojtemplateengine.js +37 -10
  79. package/dist/js/libs/oj/debug/ojthematicmap.js +13 -13
  80. package/dist/js/libs/oj/debug/ojtimeaxis-toolkit.js +106 -22
  81. package/dist/js/libs/oj/debug/ojtimeaxis.js +13 -0
  82. package/dist/js/libs/oj/debug/ojtimeline-toolkit.js +1602 -361
  83. package/dist/js/libs/oj/debug/ojtimeline.js +131 -27
  84. package/dist/js/libs/oj/debug/ojtrace-event.js +10 -20
  85. package/dist/js/libs/oj/debug/ojtracer.js +96 -0
  86. package/dist/js/libs/oj/debug/ojtreemap.js +8 -9
  87. package/dist/js/libs/oj/debug/ojtreeview.js +45 -12
  88. package/dist/js/libs/oj/debug/ojvcomponent-template.js +64 -55
  89. package/dist/js/libs/oj/debug/ojwaterfalllayout.js +3 -3
  90. package/dist/js/libs/oj/debug_esm/ojarraydataprovider.js +58 -1
  91. package/dist/js/libs/oj/debug_esm/ojbufferingdataprovider.js +18 -19
  92. package/dist/js/libs/oj/debug_esm/ojchart-toolkit.js +7 -1
  93. package/dist/js/libs/oj/debug_esm/ojchart.js +22 -16
  94. package/dist/js/libs/oj/debug_esm/ojcheckboxset.js +10 -2
  95. package/dist/js/libs/oj/debug_esm/ojcomponentcore.js +15 -2
  96. package/dist/js/libs/oj/debug_esm/ojconfig.js +1 -1
  97. package/dist/js/libs/oj/debug_esm/ojcontext.js +27 -10
  98. package/dist/js/libs/oj/debug_esm/ojcore-base.js +17 -6
  99. package/dist/js/libs/oj/debug_esm/ojdatagrid.js +100 -40
  100. package/dist/js/libs/oj/debug_esm/ojdataprovider.js +18 -0
  101. package/dist/js/libs/oj/debug_esm/ojdiagram.js +6 -6
  102. package/dist/js/libs/oj/debug_esm/ojdrawerlayout.js +17 -8
  103. package/dist/js/libs/oj/debug_esm/ojdrawerpopup.js +13 -2
  104. package/dist/js/libs/oj/debug_esm/ojdvt-toolkit.js +11 -3
  105. package/dist/js/libs/oj/debug_esm/ojdvttimecomponentscale.js +16 -0
  106. package/dist/js/libs/oj/debug_esm/ojeditablevalue.js +48 -2
  107. package/dist/js/libs/oj/debug_esm/ojgantt-toolkit.js +324 -142
  108. package/dist/js/libs/oj/debug_esm/ojgantt.js +21 -11
  109. package/dist/js/libs/oj/debug_esm/ojgauge.js +11 -11
  110. package/dist/js/libs/oj/debug_esm/ojinputsearch.js +12 -0
  111. package/dist/js/libs/oj/debug_esm/ojinputtext.js +16 -2
  112. package/dist/js/libs/oj/debug_esm/ojlegend.js +12 -7
  113. package/dist/js/libs/oj/debug_esm/ojlistview.js +13 -4
  114. package/dist/js/libs/oj/debug_esm/ojmenu.js +5 -2
  115. package/dist/js/libs/oj/debug_esm/ojmutablearraydataprovider.js +76 -19
  116. package/dist/js/libs/oj/debug_esm/ojnbox.js +22 -22
  117. package/dist/js/libs/oj/debug_esm/ojpictochart.js +2 -2
  118. package/dist/js/libs/oj/debug_esm/ojpopupcore.js +3 -1
  119. package/dist/js/libs/oj/debug_esm/ojpulltorefresh.js +7 -3
  120. package/dist/js/libs/oj/debug_esm/ojradioset.js +11 -2
  121. package/dist/js/libs/oj/debug_esm/ojrestdataprovider.js +41 -19
  122. package/dist/js/libs/oj/debug_esm/ojresttreedataprovider.js +267 -0
  123. package/dist/js/libs/oj/debug_esm/ojselectbase.js +65 -13
  124. package/dist/js/libs/oj/debug_esm/ojselectcombobox.js +1 -1
  125. package/dist/js/libs/oj/debug_esm/ojselectsingle.js +56 -31
  126. package/dist/js/libs/oj/debug_esm/ojslider.js +3 -3
  127. package/dist/js/libs/oj/debug_esm/ojstreamlist.js +2 -2
  128. package/dist/js/libs/oj/debug_esm/ojsunburst.js +5 -5
  129. package/dist/js/libs/oj/debug_esm/ojsuppressnodetreedataprovider.js +7 -0
  130. package/dist/js/libs/oj/debug_esm/ojswitch.js +12 -2
  131. package/dist/js/libs/oj/debug_esm/ojtable.js +370 -55
  132. package/dist/js/libs/oj/debug_esm/ojtagcloud.js +3 -3
  133. package/dist/js/libs/oj/debug_esm/ojtemplateengine.js +36 -9
  134. package/dist/js/libs/oj/debug_esm/ojthematicmap.js +13 -13
  135. package/dist/js/libs/oj/debug_esm/ojtimeaxis-toolkit.js +106 -22
  136. package/dist/js/libs/oj/debug_esm/ojtimeaxis.js +13 -0
  137. package/dist/js/libs/oj/debug_esm/ojtimeline-toolkit.js +1603 -362
  138. package/dist/js/libs/oj/debug_esm/ojtimeline.js +131 -27
  139. package/dist/js/libs/oj/debug_esm/ojtrace-event.js +11 -19
  140. package/dist/js/libs/oj/debug_esm/ojtracer.js +95 -1
  141. package/dist/js/libs/oj/debug_esm/ojtreemap.js +8 -9
  142. package/dist/js/libs/oj/debug_esm/ojtreeview.js +46 -13
  143. package/dist/js/libs/oj/debug_esm/ojvcomponent-template.js +63 -55
  144. package/dist/js/libs/oj/debug_esm/ojwaterfalllayout.js +3 -3
  145. package/dist/js/libs/oj/main-template.js +3 -3
  146. package/dist/js/libs/oj/min/ojarraydataprovider.js.map +1 -1
  147. package/dist/js/libs/oj/min/ojbufferingdataprovider.js +2 -2
  148. package/dist/js/libs/oj/min/ojbufferingdataprovider.js.map +1 -1
  149. package/dist/js/libs/oj/min/ojchart-toolkit.js +1 -1
  150. package/dist/js/libs/oj/min/ojchart-toolkit.js.map +1 -1
  151. package/dist/js/libs/oj/min/ojchart.js.map +1 -1
  152. package/dist/js/libs/oj/min/ojcheckboxset.js +1 -1
  153. package/dist/js/libs/oj/min/ojcheckboxset.js.map +1 -1
  154. package/dist/js/libs/oj/min/ojcomponentcore.js +1 -1
  155. package/dist/js/libs/oj/min/ojcomponentcore.js.map +1 -1
  156. package/dist/js/libs/oj/min/ojcontext.js +1 -1
  157. package/dist/js/libs/oj/min/ojcontext.js.map +1 -1
  158. package/dist/js/libs/oj/min/ojcore-base.js +2 -2
  159. package/dist/js/libs/oj/min/ojcore-base.js.map +1 -1
  160. package/dist/js/libs/oj/min/ojdatagrid.js +1 -1
  161. package/dist/js/libs/oj/min/ojdatagrid.js.map +1 -1
  162. package/dist/js/libs/oj/min/ojdataprovider.js.map +1 -1
  163. package/dist/js/libs/oj/min/ojdrawerlayout.js +1 -1
  164. package/dist/js/libs/oj/min/ojdrawerlayout.js.map +1 -1
  165. package/dist/js/libs/oj/min/ojdrawerpopup.js +1 -1
  166. package/dist/js/libs/oj/min/ojdrawerpopup.js.map +1 -1
  167. package/dist/js/libs/oj/min/ojdvt-toolkit.js +1 -1
  168. package/dist/js/libs/oj/min/ojdvt-toolkit.js.map +1 -1
  169. package/dist/js/libs/oj/min/ojeditablevalue.js +1 -1
  170. package/dist/js/libs/oj/min/ojeditablevalue.js.map +1 -1
  171. package/dist/js/libs/oj/min/ojgantt-toolkit.js +1 -1
  172. package/dist/js/libs/oj/min/ojgantt-toolkit.js.map +1 -1
  173. package/dist/js/libs/oj/min/ojgantt.js +1 -1
  174. package/dist/js/libs/oj/min/ojgantt.js.map +1 -1
  175. package/dist/js/libs/oj/min/ojinputsearch.js +1 -1
  176. package/dist/js/libs/oj/min/ojinputsearch.js.map +1 -1
  177. package/dist/js/libs/oj/min/ojinputtext.js +1 -1
  178. package/dist/js/libs/oj/min/ojinputtext.js.map +1 -1
  179. package/dist/js/libs/oj/min/ojlegend.js.map +1 -1
  180. package/dist/js/libs/oj/min/ojlistview.js +1 -1
  181. package/dist/js/libs/oj/min/ojlistview.js.map +1 -1
  182. package/dist/js/libs/oj/min/ojmenu.js +1 -1
  183. package/dist/js/libs/oj/min/ojmenu.js.map +1 -1
  184. package/dist/js/libs/oj/min/ojmutablearraydataprovider.js.map +1 -1
  185. package/dist/js/libs/oj/min/ojpopupcore.js +1 -1
  186. package/dist/js/libs/oj/min/ojpopupcore.js.map +1 -1
  187. package/dist/js/libs/oj/min/ojpulltorefresh.js +1 -1
  188. package/dist/js/libs/oj/min/ojpulltorefresh.js.map +1 -1
  189. package/dist/js/libs/oj/min/ojradioset.js +1 -1
  190. package/dist/js/libs/oj/min/ojradioset.js.map +1 -1
  191. package/dist/js/libs/oj/min/ojrestdataprovider.js +1 -1
  192. package/dist/js/libs/oj/min/ojrestdataprovider.js.map +1 -1
  193. package/dist/js/libs/oj/min/ojresttreedataprovider.js +9 -0
  194. package/dist/js/libs/oj/min/ojresttreedataprovider.js.map +1 -0
  195. package/dist/js/libs/oj/min/ojselectbase.js +1 -1
  196. package/dist/js/libs/oj/min/ojselectbase.js.map +1 -1
  197. package/dist/js/libs/oj/min/ojselectcombobox.js +1 -1
  198. package/dist/js/libs/oj/min/ojselectcombobox.js.map +1 -1
  199. package/dist/js/libs/oj/min/ojselectsingle.js +1 -1
  200. package/dist/js/libs/oj/min/ojselectsingle.js.map +1 -1
  201. package/dist/js/libs/oj/min/ojslider.js +1 -1
  202. package/dist/js/libs/oj/min/ojslider.js.map +1 -1
  203. package/dist/js/libs/oj/min/ojstreamlist.js +1 -1
  204. package/dist/js/libs/oj/min/ojstreamlist.js.map +1 -1
  205. package/dist/js/libs/oj/min/ojsuppressnodetreedataprovider.js +1 -1
  206. package/dist/js/libs/oj/min/ojsuppressnodetreedataprovider.js.map +1 -1
  207. package/dist/js/libs/oj/min/ojswitch.js +1 -1
  208. package/dist/js/libs/oj/min/ojswitch.js.map +1 -1
  209. package/dist/js/libs/oj/min/ojtable.js +1 -1
  210. package/dist/js/libs/oj/min/ojtable.js.map +1 -1
  211. package/dist/js/libs/oj/min/ojtemplateengine.js +1 -1
  212. package/dist/js/libs/oj/min/ojtemplateengine.js.map +1 -1
  213. package/dist/js/libs/oj/min/ojtimeaxis-toolkit.js +1 -1
  214. package/dist/js/libs/oj/min/ojtimeaxis-toolkit.js.map +1 -1
  215. package/dist/js/libs/oj/min/ojtimeaxis.js +1 -1
  216. package/dist/js/libs/oj/min/ojtimeaxis.js.map +1 -1
  217. package/dist/js/libs/oj/min/ojtimeline-toolkit.js +1 -1
  218. package/dist/js/libs/oj/min/ojtimeline-toolkit.js.map +1 -1
  219. package/dist/js/libs/oj/min/ojtimeline.js +1 -1
  220. package/dist/js/libs/oj/min/ojtimeline.js.map +1 -1
  221. package/dist/js/libs/oj/min/ojtrace-event.js +1 -1
  222. package/dist/js/libs/oj/min/ojtrace-event.js.map +1 -1
  223. package/dist/js/libs/oj/min/ojtracer.js +1 -1
  224. package/dist/js/libs/oj/min/ojtracer.js.map +1 -1
  225. package/dist/js/libs/oj/min/ojtreeview.js +1 -1
  226. package/dist/js/libs/oj/min/ojtreeview.js.map +1 -1
  227. package/dist/js/libs/oj/min/ojvcomponent-template.js +1 -1
  228. package/dist/js/libs/oj/min/ojvcomponent-template.js.map +1 -1
  229. package/dist/js/libs/oj/min/ojwaterfalllayout.js +1 -1
  230. package/dist/js/libs/oj/min/ojwaterfalllayout.js.map +1 -1
  231. package/dist/js/libs/oj/resources/nls/ar/ojtranslations.js +1 -1
  232. package/dist/js/libs/oj/resources/nls/ar-XB/ojtranslations.js +1 -1
  233. package/dist/js/libs/oj/resources/nls/bg/ojtranslations.js +1 -1
  234. package/dist/js/libs/oj/resources/nls/bs/ojtranslations.js +1 -1
  235. package/dist/js/libs/oj/resources/nls/bs-Cyrl/ojtranslations.js +1 -1
  236. package/dist/js/libs/oj/resources/nls/cs/ojtranslations.js +1 -1
  237. package/dist/js/libs/oj/resources/nls/da/ojtranslations.js +1 -1
  238. package/dist/js/libs/oj/resources/nls/de/ojtranslations.js +1 -1
  239. package/dist/js/libs/oj/resources/nls/el/ojtranslations.js +1 -1
  240. package/dist/js/libs/oj/resources/nls/en-XA/ojtranslations.js +1 -1
  241. package/dist/js/libs/oj/resources/nls/en-XC/ojtranslations.js +1 -1
  242. package/dist/js/libs/oj/resources/nls/es/ojtranslations.js +1 -1
  243. package/dist/js/libs/oj/resources/nls/et/ojtranslations.js +1 -1
  244. package/dist/js/libs/oj/resources/nls/fi/ojtranslations.js +1 -1
  245. package/dist/js/libs/oj/resources/nls/fr/ojtranslations.js +1 -1
  246. package/dist/js/libs/oj/resources/nls/fr-CA/ojtranslations.js +1 -1
  247. package/dist/js/libs/oj/resources/nls/he/ojtranslations.js +1 -1
  248. package/dist/js/libs/oj/resources/nls/hr/ojtranslations.js +1 -1
  249. package/dist/js/libs/oj/resources/nls/hu/ojtranslations.js +1 -1
  250. package/dist/js/libs/oj/resources/nls/is/ojtranslations.js +1 -1
  251. package/dist/js/libs/oj/resources/nls/it/ojtranslations.js +1 -1
  252. package/dist/js/libs/oj/resources/nls/ja/ojtranslations.js +1 -1
  253. package/dist/js/libs/oj/resources/nls/ko/ojtranslations.js +1 -1
  254. package/dist/js/libs/oj/resources/nls/lt/ojtranslations.js +1 -1
  255. package/dist/js/libs/oj/resources/nls/lv/ojtranslations.js +1 -1
  256. package/dist/js/libs/oj/resources/nls/ms/ojtranslations.js +1 -1
  257. package/dist/js/libs/oj/resources/nls/nl/ojtranslations.js +1 -1
  258. package/dist/js/libs/oj/resources/nls/no/ojtranslations.js +1 -1
  259. package/dist/js/libs/oj/resources/nls/ojtranslations.js +1 -1
  260. package/dist/js/libs/oj/resources/nls/pl/ojtranslations.js +1 -1
  261. package/dist/js/libs/oj/resources/nls/pseudo/ojtranslations.js +1 -1
  262. package/dist/js/libs/oj/resources/nls/pt/ojtranslations.js +1 -1
  263. package/dist/js/libs/oj/resources/nls/pt-PT/ojtranslations.js +1 -1
  264. package/dist/js/libs/oj/resources/nls/ro/ojtranslations.js +1 -1
  265. package/dist/js/libs/oj/resources/nls/ru/ojtranslations.js +1 -1
  266. package/dist/js/libs/oj/resources/nls/sk/ojtranslations.js +1 -1
  267. package/dist/js/libs/oj/resources/nls/sl/ojtranslations.js +1 -1
  268. package/dist/js/libs/oj/resources/nls/sr/ojtranslations.js +1 -1
  269. package/dist/js/libs/oj/resources/nls/sr-Latn/ojtranslations.js +1 -1
  270. package/dist/js/libs/oj/resources/nls/sv/ojtranslations.js +1 -1
  271. package/dist/js/libs/oj/resources/nls/th/ojtranslations.js +1 -1
  272. package/dist/js/libs/oj/resources/nls/tr/ojtranslations.js +1 -1
  273. package/dist/js/libs/oj/resources/nls/uk/ojtranslations.js +1 -1
  274. package/dist/js/libs/oj/resources/nls/vi/ojtranslations.js +1 -1
  275. package/dist/js/libs/oj/resources/nls/zh-Hans/ojtranslations.js +1 -1
  276. package/dist/js/libs/oj/resources/nls/zh-Hant/ojtranslations.js +1 -1
  277. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-arraystore-1.5.4.js → offline-persistence-toolkit-arraystore-1.5.5.js} +0 -0
  278. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-core-1.5.4.js → offline-persistence-toolkit-core-1.5.5.js} +116 -22
  279. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-filesystemstore-1.5.4.js → offline-persistence-toolkit-filesystemstore-1.5.5.js} +0 -0
  280. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-localstore-1.5.4.js → offline-persistence-toolkit-localstore-1.5.5.js} +0 -0
  281. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-pouchdbstore-1.5.4.js → offline-persistence-toolkit-pouchdbstore-1.5.5.js} +0 -0
  282. package/dist/js/libs/persist/debug/{offline-persistence-toolkit-responseproxy-1.5.4.js → offline-persistence-toolkit-responseproxy-1.5.5.js} +0 -0
  283. package/dist/js/libs/persist/debug/persistenceManager.js +114 -21
  284. package/dist/js/libs/persist/debug/persistenceUtils.js +2 -1
  285. package/dist/js/libs/persist/min/impl/PersistenceSyncManager.js +1 -1
  286. package/dist/js/libs/persist/min/impl/PersistenceXMLHttpRequest.js +1 -1
  287. package/dist/js/libs/persist/min/impl/sql-where-parser.min.js +1 -1
  288. package/dist/js/libs/persist/min/{offline-persistence-toolkit-arraystore-1.5.4.js → offline-persistence-toolkit-arraystore-1.5.5.js} +0 -0
  289. package/dist/js/libs/persist/min/{offline-persistence-toolkit-core-1.5.4.js → offline-persistence-toolkit-core-1.5.5.js} +330 -330
  290. package/dist/js/libs/persist/min/{offline-persistence-toolkit-filesystemstore-1.5.4.js → offline-persistence-toolkit-filesystemstore-1.5.5.js} +330 -330
  291. package/dist/js/libs/persist/min/{offline-persistence-toolkit-localstore-1.5.4.js → offline-persistence-toolkit-localstore-1.5.5.js} +0 -0
  292. package/dist/js/libs/persist/min/{offline-persistence-toolkit-pouchdbstore-1.5.4.js → offline-persistence-toolkit-pouchdbstore-1.5.5.js} +330 -330
  293. package/dist/js/libs/persist/min/{offline-persistence-toolkit-responseproxy-1.5.4.js → offline-persistence-toolkit-responseproxy-1.5.5.js} +331 -331
  294. package/dist/js/libs/persist/min/persistenceManager.js +1 -1
  295. package/dist/js/libs/persist/min/persistenceUtils.js +1 -1
  296. package/dist/js/libs/persist/min/pouchdb-browser-7.2.2.js +330 -330
  297. package/dist/js/libs/persist/min/pouchdb.find.js +1 -1
  298. package/dist/js/libs/persist/min/queryHandlers.js +1 -1
  299. package/dist/metadata/components/allComponents.json +1019 -905
  300. package/dist/metadata/components/schemas/component-schema.json +10 -0
  301. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/accordion/themes/base/_oj-accordion.scss +0 -0
  302. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/accordion/themes/redwood/_oj-accordion.cssvars.scss +0 -0
  303. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/accordion/themes/redwood/oj-accordion.scss +0 -0
  304. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/accordion/themes/stable/_oj-accordion.cssvars.scss +0 -0
  305. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/accordion/themes/stable/oj-accordion.scss +0 -0
  306. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/action-card/themes/base/_oj-action-card.scss +0 -0
  307. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/action-card/themes/redwood/_oj-action-card.cssvars.scss +0 -0
  308. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/action-card/themes/redwood/oj-action-card.scss +0 -0
  309. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/action-card/themes/stable/_oj-action-card.cssvars.scss +0 -0
  310. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/action-card/themes/stable/oj-action-card.scss +0 -0
  311. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/base/_oj.common.servervars.scss +0 -0
  312. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/base/oj.common.settings.cssvariables.css +0 -1
  313. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/redwood/_oj-all-components-common.scss +0 -0
  314. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/redwood/_oj-all-components-notag.scss +0 -0
  315. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/redwood/_oj-all-components.scss +0 -0
  316. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/redwood/_oj.redwood.settings.scss +0 -0
  317. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/redwood/oj.redwood.cssvars.settings.css +0 -1
  318. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/stable/_oj-all-components-common.scss +0 -0
  319. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/stable/_oj-all-components-notag.scss +0 -0
  320. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/stable/_oj-all-components.scss +0 -0
  321. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/stable/_oj.stable.settings.scss +0 -0
  322. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/all-components/themes/stable/oj.stable.cssvars.settings.css +0 -1
  323. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/animation/themes/base/_oj-animation.scss +0 -0
  324. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/animation/themes/redwood/_oj-animation.cssvars.scss +0 -0
  325. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/animation/themes/redwood/_oj-animation.servervars.scss +0 -0
  326. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/animation/themes/redwood/oj-animation.scss +0 -0
  327. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/animation/themes/stable/_oj-animation.cssvars.scss +0 -0
  328. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/animation/themes/stable/_oj-animation.servervars.scss +0 -0
  329. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/animation/themes/stable/oj-animation.scss +0 -0
  330. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout/themes/base/_oj-app-layout.scss +0 -0
  331. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout/themes/redwood/_oj-app-layout.cssvars.scss +0 -0
  332. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout/themes/redwood/_oj-app-layout.scss +0 -0
  333. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout/themes/stable/_oj-app-layout.cssvars.scss +0 -0
  334. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout/themes/stable/_oj-app-layout.scss +0 -0
  335. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-hybrid/themes/base/_oj-app-layout-hybrid.scss +0 -0
  336. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-hybrid/themes/redwood/_oj-app-layout-hybrid.cssvars.scss +0 -0
  337. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-hybrid/themes/redwood/oj-app-layout-hybrid.scss +0 -0
  338. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-hybrid/themes/stable/_oj-app-layout-hybrid.cssvars.scss +0 -0
  339. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-hybrid/themes/stable/oj-app-layout-hybrid.scss +0 -0
  340. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-web/themes/base/_oj-app-layout-web.scss +0 -0
  341. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-web/themes/redwood/_oj-app-layout-web.cssvars.scss +0 -0
  342. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-web/themes/redwood/oj-app-layout-web.scss +0 -0
  343. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-web/themes/stable/_oj-app-layout-web.cssvars.scss +0 -0
  344. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/app-layout-web/themes/stable/oj-app-layout-web.scss +0 -0
  345. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/avatar/themes/base/_oj-avatar.scss +0 -0
  346. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/avatar/themes/redwood/_oj-avatar-scoped.cssvars.scss +0 -0
  347. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/avatar/themes/redwood/_oj-avatar.cssvars.scss +0 -0
  348. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/avatar/themes/redwood/oj-avatar.scss +0 -0
  349. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/avatar/themes/stable/_oj-avatar-scoped.cssvars.scss +0 -0
  350. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/avatar/themes/stable/_oj-avatar.cssvars.scss +0 -0
  351. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/avatar/themes/stable/oj-avatar.scss +0 -0
  352. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/badge/themes/base/_oj-badge.scss +0 -0
  353. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/badge/themes/redwood/_oj-badge-scoped.cssvars.scss +0 -0
  354. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/badge/themes/redwood/_oj-badge.cssvars.scss +0 -0
  355. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/badge/themes/redwood/oj-badge.scss +0 -0
  356. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/badge/themes/stable/_oj-badge-scoped.cssvars.scss +0 -0
  357. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/badge/themes/stable/_oj-badge.cssvars.scss +0 -0
  358. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/badge/themes/stable/oj-badge.scss +0 -0
  359. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/base/_oj-button.scss +0 -0
  360. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/redwood/_oj-button-ignore.scoped.cssvars.scss +0 -0
  361. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/redwood/_oj-button-scoped.cssvars.scss +0 -0
  362. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/redwood/_oj-button.cssvars.scss +0 -0
  363. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/redwood/oj-button.scss +0 -0
  364. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/stable/_oj-button-ignore.scoped.cssvars.scss +0 -0
  365. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/stable/_oj-button.cssvars.scss +0 -0
  366. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/button/themes/stable/oj-button.scss +0 -0
  367. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset/themes/base/_oj-buttonset.scss +0 -0
  368. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset/themes/redwood/_oj-buttonset-scoped.cssvars.scss +0 -0
  369. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset/themes/redwood/_oj-buttonset.cssvars.scss +0 -0
  370. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset/themes/redwood/_oj-buttonset.scss +0 -0
  371. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset/themes/stable/_oj-buttonset-scoped.cssvars.scss +0 -0
  372. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset/themes/stable/_oj-buttonset.cssvars.scss +0 -0
  373. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset/themes/stable/_oj-buttonset.scss +0 -0
  374. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset-many/themes/redwood/oj-buttonset-many.scss +0 -0
  375. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset-many/themes/stable/oj-buttonset-many.scss +0 -0
  376. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset-one/themes/redwood/oj-buttonset-one.scss +0 -0
  377. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/buttonset-one/themes/stable/oj-buttonset-one.scss +0 -0
  378. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/chart/themes/base/_oj-chart.scss +0 -0
  379. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/chart/themes/redwood/_oj-chart.cssvars.scss +0 -0
  380. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/chart/themes/redwood/oj-chart.scss +0 -0
  381. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/chart/themes/stable/_oj-chart.cssvars.scss +0 -0
  382. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/chart/themes/stable/oj-chart.scss +0 -0
  383. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/checkboxset/themes/redwood/_oj-checkboxset.cssvars.scss +0 -0
  384. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/checkboxset/themes/redwood/oj-checkboxset.scss +0 -0
  385. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/checkboxset/themes/stable/_oj-checkboxset.cssvars.scss +0 -0
  386. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/checkboxset/themes/stable/oj-checkboxset.scss +0 -0
  387. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/collapsible/themes/base/_oj-collapsible.scss +0 -0
  388. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/collapsible/themes/redwood/_oj-collapsible.cssvars.scss +0 -0
  389. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/collapsible/themes/redwood/oj-collapsible.scss +0 -0
  390. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/collapsible/themes/stable/_oj-collapsible.cssvars.scss +0 -0
  391. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/collapsible/themes/stable/oj-collapsible.scss +0 -0
  392. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/collection/themes/redwood/_oj-collection.cssvars.scss +0 -0
  393. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/collection/themes/stable/_oj-collection.cssvars.scss +0 -0
  394. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-palette/themes/base/_oj-color-palette.scss +0 -0
  395. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-palette/themes/redwood/_oj-color-palette.cssvars.scss +0 -0
  396. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-palette/themes/redwood/oj-color-palette.scss +0 -0
  397. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-palette/themes/stable/_oj-color-palette.cssvars.scss +0 -0
  398. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-palette/themes/stable/oj-color-palette.scss +0 -0
  399. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-spectrum/themes/base/_oj-color-spectrum.scss +0 -0
  400. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-spectrum/themes/redwood/_oj-color-spectrum.cssvars.scss +0 -0
  401. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-spectrum/themes/redwood/oj-color-spectrum.scss +0 -0
  402. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-spectrum/themes/stable/_oj-color-spectrum.cssvars.scss +0 -0
  403. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/color-spectrum/themes/stable/oj-color-spectrum.scss +0 -0
  404. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox/themes/base/_oj-combobox.scss +2 -2
  405. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox/themes/redwood/_oj-combobox.cssvars.scss +0 -0
  406. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox/themes/redwood/_oj-combobox.scss +0 -0
  407. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox/themes/stable/_oj-combobox.cssvars.scss +0 -0
  408. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox/themes/stable/_oj-combobox.scss +0 -0
  409. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox-many/themes/redwood/oj-combobox-many.scss +0 -0
  410. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox-many/themes/stable/oj-combobox-many.scss +0 -0
  411. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox-one/themes/redwood/oj-combobox-one.scss +0 -0
  412. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/combobox-one/themes/stable/oj-combobox-one.scss +0 -0
  413. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/conveyor-belt/themes/base/_oj-conveyor-belt.scss +0 -0
  414. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/conveyor-belt/themes/redwood/_oj-conveyor-belt.cssvars.scss +0 -0
  415. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/conveyor-belt/themes/redwood/oj-conveyor-belt.scss +0 -0
  416. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/conveyor-belt/themes/stable/_oj-conveyor-belt.cssvars.scss +0 -0
  417. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/conveyor-belt/themes/stable/oj-conveyor-belt.scss +0 -0
  418. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/core/themes/redwood/_oj-core-ignore.scoped.cssvars.scss +0 -0
  419. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/core/themes/redwood/_oj-core-scoped.cssvars.scss +0 -0
  420. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/core/themes/redwood/_oj-core.cssvars.scss +0 -0
  421. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/core/themes/stable/_oj-core.cssvars.scss +0 -0
  422. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/data-grid/themes/base/_oj-data-grid.scss +0 -0
  423. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/data-grid/themes/redwood/_oj-data-grid.cssvars.scss +0 -0
  424. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/data-grid/themes/redwood/oj-data-grid.scss +0 -0
  425. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/data-grid/themes/stable/_oj-data-grid.cssvars.scss +0 -0
  426. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/data-grid/themes/stable/oj-data-grid.scss +0 -0
  427. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-picker/themes/redwood/oj-date-picker.scss +0 -0
  428. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-picker/themes/stable/oj-date-picker.scss +0 -0
  429. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-time-picker/themes/base/_oj-date-time-picker.scss +0 -0
  430. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.cssvars.scss +0 -0
  431. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.servervars.scss +0 -0
  432. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-time-picker/themes/redwood/oj-date-time-picker.scss +0 -0
  433. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-time-picker/themes/stable/_oj-date-time-picker.cssvars.scss +0 -0
  434. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-time-picker/themes/stable/_oj-date-time-picker.servervars.scss +0 -0
  435. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/date-time-picker/themes/stable/oj-date-time-picker.scss +0 -0
  436. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/diagram/themes/base/_oj-diagram.scss +0 -0
  437. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/diagram/themes/redwood/_oj-diagram.cssvars.scss +0 -0
  438. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/diagram/themes/redwood/oj-diagram.scss +0 -0
  439. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/diagram/themes/stable/_oj-diagram.cssvars.scss +0 -0
  440. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/diagram/themes/stable/oj-diagram.scss +0 -0
  441. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/base/_oj-dialog.scss +0 -0
  442. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/redwood/_oj-dialog-scoped.cssvars.scss +0 -0
  443. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/redwood/_oj-dialog.cssvars.scss +0 -0
  444. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/redwood/_oj-dialog.servervars.scss +0 -0
  445. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/redwood/oj-dialog.scss +0 -0
  446. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/stable/_oj-dialog-scoped.cssvars.scss +0 -0
  447. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/stable/_oj-dialog.cssvars.scss +0 -0
  448. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/stable/_oj-dialog.servervars.scss +0 -0
  449. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dialog/themes/stable/oj-dialog.scss +0 -0
  450. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-layout/themes/base/_oj-drawer-layout.scss +0 -0
  451. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-layout/themes/redwood/_oj-drawer-layout.cssvars.scss +0 -0
  452. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-layout/themes/redwood/oj-drawer-layout.scss +0 -0
  453. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-layout/themes/stable/_oj-drawer-layout.cssvars.scss +0 -0
  454. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-layout/themes/stable/oj-drawer-layout.scss +0 -0
  455. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-popup/themes/base/_oj-drawer-popup.scss +0 -0
  456. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-popup/themes/redwood/_oj-drawer-popup.cssvars.scss +0 -0
  457. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-popup/themes/redwood/oj-drawer-popup.scss +0 -0
  458. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-popup/themes/stable/_oj-drawer-popup.cssvars.scss +0 -0
  459. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/drawer-popup/themes/stable/oj-drawer-popup.scss +0 -0
  460. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dvt/themes/base/_oj-dvt.scss +0 -0
  461. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dvt/themes/redwood/_oj-dvt.cssvars.scss +0 -0
  462. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dvt/themes/redwood/_oj-dvt.scss +0 -0
  463. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dvt/themes/stable/_oj-dvt.cssvars.scss +0 -0
  464. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/dvt/themes/stable/_oj-dvt.scss +0 -0
  465. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/file-picker/themes/base/_oj-file-picker.scss +0 -0
  466. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/file-picker/themes/redwood/_oj-file-picker.cssvars.scss +0 -0
  467. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/file-picker/themes/redwood/oj-file-picker.scss +0 -0
  468. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/file-picker/themes/stable/_oj-file-picker.cssvars.scss +0 -0
  469. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/file-picker/themes/stable/oj-file-picker.scss +0 -0
  470. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/film-strip/themes/base/_oj-film-strip.scss +0 -0
  471. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/film-strip/themes/redwood/_oj-film-strip.cssvars.scss +0 -0
  472. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/film-strip/themes/redwood/oj-film-strip.scss +0 -0
  473. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/film-strip/themes/stable/_oj-film-strip.cssvars.scss +0 -0
  474. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/film-strip/themes/stable/oj-film-strip.scss +0 -0
  475. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/flex/themes/base/_oj-flex.scss +0 -0
  476. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/flex/themes/redwood/oj-flex.scss +0 -0
  477. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/flex/themes/stable/oj-flex.scss +0 -0
  478. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/base/_oj-form-control.mixins.scss +0 -0
  479. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/base/_oj-form-control.scss +17 -13
  480. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/base/_oj-messaging.scss +0 -0
  481. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/redwood/_oj-form-control.cssvars.scss +0 -0
  482. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/redwood/_oj-form-control.scss +0 -0
  483. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/redwood/_oj-messaging.scss +0 -0
  484. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/redwood/_oj-messaging.servervars.scss +0 -0
  485. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/stable/_oj-form-control.cssvars.scss +0 -0
  486. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/stable/_oj-form-control.scss +0 -0
  487. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/stable/_oj-messaging.scss +0 -0
  488. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-control/themes/stable/_oj-messaging.servervars.scss +0 -0
  489. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-layout/themes/base/_oj-form-layout.scss +4 -5
  490. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-layout/themes/redwood/_oj-form-layout.cssvars.scss +0 -0
  491. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-layout/themes/redwood/_oj-form-layout.servervars.scss +0 -0
  492. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-layout/themes/redwood/oj-form-layout.scss +0 -0
  493. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-layout/themes/stable/_oj-form-layout.cssvars.scss +0 -0
  494. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-layout/themes/stable/_oj-form-layout.servervars.scss +0 -0
  495. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/form-layout/themes/stable/oj-form-layout.scss +0 -0
  496. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gantt/themes/base/_oj-gantt.scss +37 -15
  497. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gantt/themes/redwood/_oj-gantt.cssvars.scss +14 -7
  498. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gantt/themes/redwood/oj-gantt.scss +0 -0
  499. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gantt/themes/stable/_oj-gantt.cssvars.scss +12 -5
  500. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gantt/themes/stable/oj-gantt.scss +0 -0
  501. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gauge/themes/base/_oj-gauge.scss +0 -0
  502. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gauge/themes/redwood/_oj-gauge.cssvars.scss +0 -0
  503. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gauge/themes/redwood/oj-gauge.scss +0 -0
  504. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gauge/themes/stable/_oj-gauge.cssvars.scss +0 -0
  505. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/gauge/themes/stable/oj-gauge.scss +0 -0
  506. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/grid/themes/base/_oj-grid.scss +0 -0
  507. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/grid/themes/redwood/oj-grid.scss +0 -0
  508. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/grid/themes/stable/oj-grid.scss +0 -0
  509. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/base/_oj-helpers.scss +1 -1
  510. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/base/_oj-responsive-helpers.scss +0 -0
  511. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/redwood/_oj-theme.servervars.scss +0 -0
  512. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/redwood/oj-helpers.scss +0 -0
  513. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/redwood/oj-responsive.helpers.scss +0 -0
  514. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/stable/_oj-theme.servervars.scss +0 -0
  515. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/stable/oj-helpers.scss +0 -0
  516. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/helpers/themes/stable/oj-responsive.helpers.scss +0 -0
  517. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/highlight-text/themes/base/_oj-highlight-text.scss +0 -0
  518. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/highlight-text/themes/redwood/oj-highlight-text.scss +0 -0
  519. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/highlight-text/themes/stable/oj-highlight-text.scss +0 -0
  520. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icon-circle/themes/base/_oj-icon-circle.scss +0 -0
  521. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icon-circle/themes/redwood/_oj-icon-circle-ignore.scoped.cssvars.scss +0 -0
  522. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icon-circle/themes/redwood/_oj-icon-circle.cssvars.scss +0 -0
  523. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icon-circle/themes/redwood/oj-icon-circle.scss +0 -0
  524. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/base/_oj-icons.scss +0 -0
  525. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/redwood/_oj-icon-font.scss +0 -0
  526. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/redwood/_oj-icons-ignore.scoped.cssvars.scss +0 -0
  527. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/redwood/_oj-icons.cssvars.scss +0 -0
  528. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/redwood/oj-icons.scss +0 -0
  529. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/stable/_oj-icon-font.scss +0 -0
  530. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/stable/_oj-icons.cssvars.scss +0 -0
  531. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/icons/themes/stable/oj-icons.scss +0 -0
  532. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/indexer/themes/base/_oj-indexer.scss +0 -0
  533. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/indexer/themes/redwood/_oj-indexer.cssvars.scss +0 -0
  534. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/indexer/themes/redwood/oj-indexer.scss +0 -0
  535. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/indexer/themes/stable/_oj-indexer.cssvars.scss +0 -0
  536. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/indexer/themes/stable/oj-indexer.scss +0 -0
  537. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-date/themes/redwood/oj-input-date.scss +0 -0
  538. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-date/themes/stable/oj-input-date.scss +0 -0
  539. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-date-time/themes/redwood/oj-input-date-time.scss +0 -0
  540. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-date-time/themes/stable/oj-input-date-time.scss +0 -0
  541. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-number/themes/base/_oj-input-number.scss +0 -0
  542. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-number/themes/redwood/_oj-input-number.cssvars.scss +0 -0
  543. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-number/themes/redwood/oj-input-number.scss +0 -0
  544. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-number/themes/stable/_oj-input-number.cssvars.scss +0 -0
  545. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-number/themes/stable/oj-input-number.scss +0 -0
  546. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-password/themes/redwood/oj-input-password.scss +0 -0
  547. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-password/themes/stable/oj-input-password.scss +0 -0
  548. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-search/themes/base/_oj-input-search.scss +0 -0
  549. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-search/themes/redwood/_oj-input-search-scoped.cssvars.scss +0 -0
  550. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-search/themes/redwood/_oj-input-search.cssvars.scss +0 -0
  551. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-search/themes/redwood/_oj-input-search.scss +0 -0
  552. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-search/themes/stable/_oj-input-search-scoped.cssvars.scss +0 -0
  553. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-search/themes/stable/_oj-input-search.cssvars.scss +0 -0
  554. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-search/themes/stable/_oj-input-search.scss +0 -0
  555. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-text/themes/base/_oj-input-text.scss +0 -0
  556. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-text/themes/redwood/_oj-input-text.cssvars.scss +0 -0
  557. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-text/themes/redwood/oj-input-text.scss +0 -0
  558. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-text/themes/stable/_oj-input-text.cssvars.scss +0 -0
  559. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-text/themes/stable/oj-input-text.scss +0 -0
  560. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-time/themes/redwood/oj-input-time.scss +0 -0
  561. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/input-time/themes/stable/oj-input-time.scss +0 -0
  562. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label/themes/base/_oj-label.scss +0 -0
  563. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label/themes/redwood/_oj-label-scoped.cssvars.scss +0 -0
  564. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label/themes/redwood/_oj-label.cssvars.scss +0 -0
  565. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label/themes/redwood/oj-label.scss +0 -0
  566. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label/themes/stable/_oj-label.cssvars.scss +0 -0
  567. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label/themes/stable/oj-label.scss +0 -0
  568. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label-value/themes/base/_oj-label-value.scss +0 -0
  569. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label-value/themes/redwood/_oj-label-value.scss +0 -0
  570. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/label-value/themes/stable/_oj-label-value.scss +0 -0
  571. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/led-gauge/themes/base/_oj-led-gauge.scss +0 -0
  572. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/led-gauge/themes/redwood/_oj-led-gauge.cssvars.scss +0 -0
  573. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/led-gauge/themes/redwood/oj-led-gauge.scss +0 -0
  574. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/led-gauge/themes/stable/_oj-led-gauge.cssvars.scss +0 -0
  575. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/led-gauge/themes/stable/oj-led-gauge.scss +0 -0
  576. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/legend/themes/base/_oj-legend.scss +0 -0
  577. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/legend/themes/redwood/_oj-legend.cssvars.scss +0 -0
  578. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/legend/themes/redwood/oj-legend.scss +0 -0
  579. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/legend/themes/stable/_oj-legend.cssvars.scss +0 -0
  580. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/legend/themes/stable/oj-legend.scss +0 -0
  581. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-box/themes/base/_oj-list-box.scss +0 -0
  582. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-box/themes/redwood/_oj-list-box.cssvars.scss +0 -0
  583. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-box/themes/redwood/_oj-list-box.scss +0 -0
  584. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-box/themes/stable/_oj-list-box.cssvars.scss +0 -0
  585. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-box/themes/stable/_oj-list-box.scss +0 -0
  586. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-item-layout/themes/base/_oj-list-item-layout.scss +0 -0
  587. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-item-layout/themes/redwood/_oj-list-item-layout.cssvars.scss +0 -0
  588. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-item-layout/themes/redwood/oj-list-item-layout.scss +0 -0
  589. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-item-layout/themes/stable/_oj-list-item-layout.cssvars.scss +0 -0
  590. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-item-layout/themes/stable/oj-list-item-layout.scss +0 -0
  591. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-view/themes/base/_oj-list-view.scss +0 -0
  592. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-view/themes/redwood/_oj-list-view.cssvars.scss +0 -0
  593. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-view/themes/redwood/oj-list-view.scss +0 -0
  594. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-view/themes/stable/_oj-list-view.cssvars.scss +0 -0
  595. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/list-view/themes/stable/oj-list-view.scss +0 -0
  596. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/masonry-layout/themes/base/_oj-masonry-layout.scss +0 -0
  597. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.cssvars.scss +0 -0
  598. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.servervars.scss +0 -0
  599. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/masonry-layout/themes/redwood/oj-masonry-layout.scss +0 -0
  600. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/masonry-layout/themes/stable/_oj-masonry-layout.cssvars.scss +0 -0
  601. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/masonry-layout/themes/stable/_oj-masonry-layout.servervars.scss +0 -0
  602. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/masonry-layout/themes/stable/oj-masonry-layout.scss +0 -0
  603. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu/themes/base/_oj-menu.scss +0 -0
  604. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu/themes/redwood/_oj-menu.cssvars.scss +0 -0
  605. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu/themes/redwood/oj-menu.scss +0 -0
  606. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu/themes/stable/_oj-menu.cssvars.scss +0 -0
  607. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu/themes/stable/oj-menu.scss +0 -0
  608. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-button/themes/base/_oj-menu-button.scss +0 -0
  609. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-button/themes/redwood/_oj-menu-button.cssvars.scss +0 -0
  610. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-button/themes/redwood/_oj-menu-button.servervars.scss +0 -0
  611. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-button/themes/redwood/oj-menu-button.scss +0 -0
  612. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-button/themes/stable/_oj-menu-button.cssvars.scss +0 -0
  613. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-button/themes/stable/_oj-menu-button.servervars.scss +0 -0
  614. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-button/themes/stable/oj-menu-button.scss +0 -0
  615. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-select-many/themes/base/_oj-menu-select-many.scss +0 -0
  616. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-select-many/themes/redwood/_oj-menu-select-many.cssvars.scss +0 -0
  617. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-select-many/themes/redwood/oj-menu-select-many.scss +0 -0
  618. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-select-many/themes/stable/_oj-menu-select-many.cssvars.scss +0 -0
  619. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/menu-select-many/themes/stable/oj-menu-select-many.scss +0 -0
  620. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/base/_oj-message.scss +0 -0
  621. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/redwood/_oj-message-ignore.scoped.cssvars.scss +0 -0
  622. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/redwood/_oj-message.cssvars.scss +0 -0
  623. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/redwood/_oj-message.servervars.scss +0 -0
  624. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/redwood/oj-message.scss +0 -0
  625. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/stable/_oj-message.cssvars.scss +0 -0
  626. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/stable/_oj-message.servervars.scss +0 -0
  627. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/message/themes/stable/oj-message.scss +0 -0
  628. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/messages/themes/base/_oj-messages.scss +0 -0
  629. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/messages/themes/redwood/_oj-messages.cssvars.scss +0 -0
  630. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/messages/themes/redwood/_oj-messages.servervars.scss +0 -0
  631. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/messages/themes/redwood/oj-messages.scss +0 -0
  632. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/messages/themes/stable/_oj-messages.cssvars.scss +0 -0
  633. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/messages/themes/stable/_oj-messages.servervars.scss +0 -0
  634. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/messages/themes/stable/oj-messages.scss +0 -0
  635. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/module/themes/base/_oj-module.scss +0 -0
  636. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/module/themes/redwood/oj-module.scss +0 -0
  637. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/module/themes/stable/oj-module.scss +0 -0
  638. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/n-box/themes/base/_oj-n-box.scss +0 -0
  639. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/n-box/themes/redwood/_oj-n-box.cssvars.scss +0 -0
  640. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/n-box/themes/redwood/oj-n-box.scss +0 -0
  641. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/n-box/themes/stable/_oj-n-box.cssvars.scss +0 -0
  642. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/n-box/themes/stable/oj-n-box.scss +0 -0
  643. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/navigation-list/themes/base/_oj-navigation-list.scss +0 -0
  644. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/navigation-list/themes/redwood/_oj-navigation-list-scoped.cssvars.scss +0 -0
  645. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/navigation-list/themes/redwood/_oj-navigation-list.cssvars.scss +0 -0
  646. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/navigation-list/themes/redwood/oj-navigation-list.scss +0 -0
  647. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/navigation-list/themes/stable/_oj-navigation-list-scoped.cssvars.scss +0 -0
  648. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/navigation-list/themes/stable/_oj-navigation-list.cssvars.scss +0 -0
  649. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/navigation-list/themes/stable/oj-navigation-list.scss +0 -0
  650. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/off-canvas/themes/base/_oj-off-canvas.scss +0 -0
  651. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/off-canvas/themes/redwood/_oj-off-canvas.cssvars.scss +0 -0
  652. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/off-canvas/themes/redwood/oj-off-canvas.scss +0 -0
  653. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/off-canvas/themes/stable/_oj-off-canvas.cssvars.scss +0 -0
  654. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/off-canvas/themes/stable/oj-off-canvas.scss +0 -0
  655. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/optgroup/themes/base/_oj-optgroup.scss +0 -0
  656. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/optgroup/themes/redwood/oj-optgroup.scss +0 -0
  657. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/optgroup/themes/stable/oj-optgroup.scss +0 -0
  658. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/option/themes/base/_oj-option.scss +0 -0
  659. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/option/themes/redwood/oj-option.scss +0 -0
  660. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/option/themes/stable/oj-option.scss +0 -0
  661. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/paging-control/themes/base/_oj-paging-control.scss +0 -0
  662. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/paging-control/themes/redwood/_oj-paging-control.cssvars.scss +0 -0
  663. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/paging-control/themes/redwood/oj-paging-control.scss +0 -0
  664. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/paging-control/themes/stable/_oj-paging-control.cssvars.scss +0 -0
  665. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/paging-control/themes/stable/oj-paging-control.scss +0 -0
  666. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/palette/themes/redwood/_oj-palette-scoped.cssvars.scss +0 -0
  667. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/palette/themes/redwood/_oj-palette.cssvars.scss +0 -0
  668. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/palette/themes/stable/_oj-palette.cssvars.scss +0 -0
  669. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/panel/themes/base/_oj-panel.scss +0 -0
  670. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/panel/themes/redwood/_oj-panel-scoped.cssvars.scss +0 -0
  671. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/panel/themes/redwood/_oj-panel.cssvars.scss +0 -0
  672. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/panel/themes/redwood/oj-panel.scss +0 -0
  673. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/panel/themes/stable/_oj-panel.cssvars.scss +0 -0
  674. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/panel/themes/stable/oj-panel.scss +0 -0
  675. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/picto-chart/themes/base/_oj-picto-chart.scss +0 -0
  676. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/picto-chart/themes/redwood/_oj-picto-chart.cssvars.scss +0 -0
  677. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/picto-chart/themes/redwood/oj-picto-chart.scss +0 -0
  678. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/picto-chart/themes/stable/_oj-picto-chart.cssvars.scss +0 -0
  679. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/picto-chart/themes/stable/oj-picto-chart.scss +0 -0
  680. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/base/_oj-layer.scss +0 -0
  681. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/base/_oj-popup.scss +0 -0
  682. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/redwood/_oj-layer.scss +0 -0
  683. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/redwood/_oj-popup.cssvars.scss +0 -0
  684. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/redwood/oj-popup.scss +0 -0
  685. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/stable/_oj-layer.scss +0 -0
  686. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/stable/_oj-popup.cssvars.scss +0 -0
  687. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/popup/themes/stable/oj-popup.scss +0 -0
  688. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/base/_oj-progress-bar.scss +0 -0
  689. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/redwood/_oj-progress-bar-scoped.cssvars.scss +0 -0
  690. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/redwood/_oj-progress-bar.cssvars.scss +0 -0
  691. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/redwood/_oj-progress-bar.servervars.scss +0 -0
  692. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/redwood/oj-progress-bar.scss +0 -0
  693. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/stable/_oj-progress-bar.cssvars.scss +0 -0
  694. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/stable/_oj-progress-bar.servervars.scss +0 -0
  695. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-bar/themes/stable/oj-progress-bar.scss +0 -0
  696. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/base/_oj-progress-circle.scss +0 -0
  697. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/redwood/_oj-progress-circle-scoped.cssvars.scss +0 -0
  698. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/redwood/_oj-progress-circle.cssvars.scss +0 -0
  699. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/redwood/_oj-progress-circle.servervars.scss +0 -0
  700. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/redwood/oj-progress-circle.scss +0 -0
  701. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/stable/_oj-progress-circle.cssvars.scss +0 -0
  702. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/stable/_oj-progress-circle.servervars.scss +0 -0
  703. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/progress-circle/themes/stable/oj-progress-circle.scss +0 -0
  704. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radio-checkbox/themes/base/_oj-radiocheckbox.scss +0 -0
  705. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox-scoped.cssvars.scss +0 -0
  706. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.cssvars.scss +0 -0
  707. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.servervars.scss +0 -0
  708. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.cssvars.scss +0 -0
  709. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.servervars.scss +0 -0
  710. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radioset/themes/redwood/_oj-radioset.cssvars.scss +0 -0
  711. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radioset/themes/redwood/oj-radioset.scss +0 -0
  712. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radioset/themes/stable/_oj-radioset.cssvars.scss +0 -0
  713. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/radioset/themes/stable/oj-radioset.scss +0 -0
  714. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rangeslider/themes/redwood/_oj-rangeslider.cssvars.scss +0 -0
  715. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rangeslider/themes/redwood/oj-rangeslider.scss +0 -0
  716. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rangeslider/themes/stable/_oj-rangeslider.cssvars.scss +0 -0
  717. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rangeslider/themes/stable/oj-rangeslider.scss +0 -0
  718. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rating-gauge/themes/base/_oj-rating-gauge.scss +0 -0
  719. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rating-gauge/themes/redwood/_oj-rating-gauge.cssvars.scss +0 -0
  720. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rating-gauge/themes/redwood/oj-rating-gauge.scss +0 -0
  721. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rating-gauge/themes/stable/_oj-rating-gauge.cssvars.scss +0 -0
  722. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/rating-gauge/themes/stable/oj-rating-gauge.scss +0 -0
  723. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/refresher/themes/base/_oj-refresher.scss +0 -0
  724. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/refresher/themes/redwood/_oj-refresher.cssvars.scss +0 -0
  725. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/refresher/themes/redwood/_oj-refresher.servervars.scss +0 -0
  726. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/refresher/themes/redwood/oj-refresher.scss +0 -0
  727. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/refresher/themes/stable/_oj-refresher.cssvars.scss +0 -0
  728. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/refresher/themes/stable/_oj-refresher.servervars.scss +0 -0
  729. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/refresher/themes/stable/oj-refresher.scss +0 -0
  730. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/resizable/themes/base/_oj-resizable.scss +0 -0
  731. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/resizable/themes/redwood/_oj-resizable.scss +0 -0
  732. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/resizable/themes/stable/_oj-resizable.scss +0 -0
  733. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/row-expander/themes/base/_oj-row-expander.scss +0 -0
  734. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/row-expander/themes/redwood/_oj-row-expander.cssvars.scss +0 -0
  735. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/row-expander/themes/redwood/oj-row-expander.scss +0 -0
  736. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/row-expander/themes/stable/_oj-row-expander.cssvars.scss +0 -0
  737. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/row-expander/themes/stable/oj-row-expander.scss +0 -0
  738. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/scrollbar/themes/base/_oj-scrollbar.scss +0 -0
  739. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/scrollbar/themes/redwood/_oj-scrollbar-scoped.cssvars.scss +0 -0
  740. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/scrollbar/themes/redwood/_oj-scrollbar.cssvars.scss +0 -0
  741. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/scrollbar/themes/redwood/_oj-scrollbar.scss +0 -0
  742. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/scrollbar/themes/stable/_oj-scrollbar.cssvars.scss +0 -0
  743. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/scrollbar/themes/stable/_oj-scrollbar.scss +0 -0
  744. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select/themes/base/_oj-select.scss +0 -0
  745. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select/themes/redwood/_oj-select.cssvars.scss +0 -0
  746. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select/themes/redwood/_oj-select.scss +0 -0
  747. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select/themes/stable/_oj-select.cssvars.scss +0 -0
  748. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select/themes/stable/_oj-select.scss +0 -0
  749. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-many/themes/redwood/oj-select-many.scss +0 -0
  750. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-many/themes/stable/oj-select-many.scss +0 -0
  751. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-one/themes/redwood/oj-select-one.scss +0 -0
  752. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-original/themes/base/_oj-select-original.scss +5 -5
  753. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-original/themes/redwood/_oj-select-original.cssvars.scss +0 -0
  754. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-original/themes/redwood/_oj-select-original.scss +0 -0
  755. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-original/themes/stable/_oj-select-original.cssvars.scss +0 -0
  756. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-original/themes/stable/_oj-select-original.scss +0 -0
  757. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-single/themes/base/_oj-select-single.scss +0 -0
  758. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-single/themes/redwood/oj-select-single.scss +0 -0
  759. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/select-single/themes/stable/oj-select-single.scss +0 -0
  760. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/selector/themes/base/_oj-selector.scss +0 -0
  761. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/selector/themes/redwood/_oj-selector.cssvars.scss +0 -0
  762. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/selector/themes/redwood/oj-selector.scss +0 -0
  763. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/selector/themes/stable/_oj-selector.cssvars.scss +0 -0
  764. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/selector/themes/stable/oj-selector.scss +0 -0
  765. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/slider/themes/base/_oj-slider.scss +0 -0
  766. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/slider/themes/redwood/_oj-slider.cssvars.scss +0 -0
  767. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/slider/themes/redwood/oj-slider.scss +0 -0
  768. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/slider/themes/stable/_oj-slider.cssvars.scss +0 -0
  769. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/slider/themes/stable/oj-slider.scss +0 -0
  770. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/spark-chart/themes/base/_oj-spark-chart.scss +0 -0
  771. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/spark-chart/themes/redwood/oj-spark-chart.scss +0 -0
  772. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/spark-chart/themes/stable/oj-spark-chart.scss +0 -0
  773. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/status-meter-gauge/themes/base/_oj-status-meter-gauge.scss +0 -0
  774. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/status-meter-gauge/themes/redwood/_oj-status-meter-gauge.cssvars.scss +0 -0
  775. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/status-meter-gauge/themes/redwood/oj-status-meter-gauge.scss +0 -0
  776. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/status-meter-gauge/themes/stable/_oj-status-meter-gauge.cssvars.scss +0 -0
  777. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/status-meter-gauge/themes/stable/oj-status-meter-gauge.scss +0 -0
  778. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/stream-list/themes/base/_oj-stream-list.scss +0 -0
  779. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/stream-list/themes/redwood/_oj-stream-list.cssvars.scss +0 -0
  780. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/stream-list/themes/redwood/_oj-stream-list.servervars.scss +0 -0
  781. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/stream-list/themes/redwood/oj-stream-list.scss +0 -0
  782. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/stream-list/themes/stable/_oj-stream-list.cssvars.scss +0 -0
  783. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/stream-list/themes/stable/_oj-stream-list.servervars.scss +0 -0
  784. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/stream-list/themes/stable/oj-stream-list.scss +0 -0
  785. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/sunburst/themes/base/_oj-sunburst.scss +0 -0
  786. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/sunburst/themes/redwood/_oj-sunburst.cssvars.scss +0 -0
  787. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/sunburst/themes/redwood/oj-sunburst.scss +0 -0
  788. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/sunburst/themes/stable/_oj-sunburst.cssvars.scss +0 -0
  789. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/sunburst/themes/stable/oj-sunburst.scss +0 -0
  790. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/swipe-actions/themes/base/_oj-swipe-actions.scss +0 -0
  791. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/swipe-actions/themes/redwood/_oj-swipe-actions.cssvars.scss +0 -0
  792. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/swipe-actions/themes/redwood/oj-swipe-actions.scss +0 -0
  793. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/swipe-actions/themes/stable/_oj-swipe-actions.cssvars.scss +0 -0
  794. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/swipe-actions/themes/stable/oj-swipe-actions.scss +0 -0
  795. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switch/themes/base/_oj-switch.scss +0 -0
  796. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switch/themes/redwood/_oj-switch.cssvars.scss +0 -0
  797. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switch/themes/redwood/oj-switch.scss +0 -0
  798. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switch/themes/stable/_oj-switch.cssvars.scss +0 -0
  799. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switch/themes/stable/oj-switch.scss +0 -0
  800. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switcher/themes/base/_oj-switcher.scss +0 -0
  801. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switcher/themes/redwood/oj-switcher.scss +0 -0
  802. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/switcher/themes/stable/oj-switcher.scss +0 -0
  803. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tab-bar/themes/base/_oj-tab-bar.scss +0 -0
  804. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tab-bar/themes/redwood/_oj-tab-bar-scoped.cssvars.scss +0 -0
  805. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tab-bar/themes/redwood/_oj-tab-bar.cssvars.scss +0 -0
  806. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tab-bar/themes/redwood/oj-tab-bar.scss +0 -0
  807. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tab-bar/themes/stable/_oj-tab-bar-scoped.cssvars.scss +0 -0
  808. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tab-bar/themes/stable/_oj-tab-bar.cssvars.scss +0 -0
  809. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tab-bar/themes/stable/oj-tab-bar.scss +0 -0
  810. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/table/themes/base/_oj-table.scss +12 -1
  811. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/table/themes/redwood/_oj-table.cssvars.scss +0 -0
  812. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/table/themes/redwood/oj-table.scss +0 -0
  813. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/table/themes/stable/_oj-table.cssvars.scss +0 -0
  814. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/table/themes/stable/oj-table.scss +0 -0
  815. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tag-cloud/themes/base/_oj-tag-cloud.scss +0 -0
  816. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tag-cloud/themes/redwood/_oj-tag-cloud.cssvars.scss +0 -0
  817. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tag-cloud/themes/redwood/oj-tag-cloud.scss +0 -0
  818. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tag-cloud/themes/stable/_oj-tag-cloud.cssvars.scss +0 -0
  819. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tag-cloud/themes/stable/oj-tag-cloud.scss +0 -0
  820. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/base/_oj-notags.scss +0 -0
  821. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/base/_oj-tags.scss +0 -0
  822. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/redwood/_oj-tags-scoped.cssvars.scss +0 -0
  823. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/redwood/_oj-tags.cssvars.scss +0 -0
  824. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/redwood/oj-notags.scss +0 -0
  825. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/redwood/oj-tags.scss +0 -0
  826. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/stable/_oj-tags.cssvars.scss +0 -0
  827. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/stable/oj-notags.scss +0 -0
  828. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tags/themes/stable/oj-tags.scss +0 -0
  829. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-area/themes/base/_oj-text-area.scss +2 -2
  830. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-area/themes/redwood/_oj-text-area.cssvars.scss +0 -0
  831. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-area/themes/redwood/oj-text-area.scss +0 -0
  832. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-area/themes/stable/_oj-text-area.cssvars.scss +0 -0
  833. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-area/themes/stable/oj-text-area.scss +0 -0
  834. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-field/themes/base/_oj-text-field.cssvars.scss +0 -0
  835. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-field/themes/redwood/_oj-text-field-scoped.cssvars.scss +0 -0
  836. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-field/themes/redwood/_oj-text-field.cssvars.scss +0 -0
  837. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/text-field/themes/stable/_oj-text-field.cssvars.scss +0 -0
  838. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/thematic-map/themes/base/_oj-thematic-map.scss +0 -0
  839. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/thematic-map/themes/redwood/_oj-thematic-map.cssvars.scss +0 -0
  840. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/thematic-map/themes/redwood/oj-thematic-map.scss +0 -0
  841. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/thematic-map/themes/stable/_oj-thematic-map.cssvars.scss +0 -0
  842. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/thematic-map/themes/stable/oj-thematic-map.scss +0 -0
  843. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/time-axis/themes/base/_oj-time-axis.scss +0 -0
  844. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/time-axis/themes/redwood/_oj-time-axis.cssvars.scss +0 -0
  845. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/time-axis/themes/redwood/oj-time-axis.scss +0 -0
  846. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/time-axis/themes/stable/_oj-time-axis.cssvars.scss +0 -0
  847. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/time-axis/themes/stable/oj-time-axis.scss +0 -0
  848. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/timeline/themes/base/_oj-timeline.scss +15 -7
  849. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/timeline/themes/redwood/_oj-timeline.cssvars.scss +8 -5
  850. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/timeline/themes/redwood/oj-timeline.scss +0 -0
  851. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/timeline/themes/stable/_oj-timeline.cssvars.scss +5 -2
  852. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/timeline/themes/stable/oj-timeline.scss +0 -0
  853. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/toolbar/themes/base/_oj-toolbar.scss +0 -0
  854. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/toolbar/themes/redwood/_oj-toolbar.cssvars.scss +0 -0
  855. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/toolbar/themes/redwood/oj-toolbar.scss +0 -0
  856. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/toolbar/themes/stable/_oj-toolbar.cssvars.scss +0 -0
  857. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/toolbar/themes/stable/oj-toolbar.scss +0 -0
  858. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tooltip/themes/base/_oj-tooltip.scss +0 -0
  859. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tooltip/themes/redwood/_oj-tooltip.cssvars.scss +0 -0
  860. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tooltip/themes/redwood/oj-tooltip.scss +0 -0
  861. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tooltip/themes/stable/_oj-tooltip.cssvars.scss +0 -0
  862. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tooltip/themes/stable/oj-tooltip.scss +0 -0
  863. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/train/themes/base/_oj-train.scss +0 -0
  864. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/train/themes/redwood/_oj-train.cssvars.scss +0 -0
  865. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/train/themes/redwood/oj-train.scss +0 -0
  866. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/train/themes/stable/_oj-train.cssvars.scss +0 -0
  867. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/train/themes/stable/oj-train.scss +0 -0
  868. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tree-view/themes/base/_oj-tree-view.scss +0 -0
  869. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tree-view/themes/redwood/_oj-tree-view.cssvars.scss +0 -0
  870. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tree-view/themes/redwood/oj-tree-view.scss +0 -0
  871. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tree-view/themes/stable/_oj-tree-view.cssvars.scss +0 -0
  872. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/tree-view/themes/stable/oj-tree-view.scss +0 -0
  873. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/treemap/themes/base/_oj-treemap.scss +0 -0
  874. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/treemap/themes/redwood/_oj-treemap.cssvars.scss +0 -0
  875. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/treemap/themes/redwood/oj-treemap.scss +0 -0
  876. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/treemap/themes/stable/_oj-treemap.cssvars.scss +0 -0
  877. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/treemap/themes/stable/oj-treemap.scss +0 -0
  878. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/typography/themes/base/_oj-typography.scss +0 -0
  879. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/typography/themes/redwood/_oj-typography-scoped.cssvars.scss +0 -0
  880. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/typography/themes/redwood/_oj-typography.cssvars.scss +0 -0
  881. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/typography/themes/redwood/oj-typography.scss +0 -0
  882. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/typography/themes/stable/_oj-typography-scoped.cssvars.scss +0 -0
  883. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/typography/themes/stable/_oj-typography.cssvars.scss +0 -0
  884. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/typography/themes/stable/oj-typography.scss +0 -0
  885. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/utilities/_oj.utilities.bidi.scss +0 -0
  886. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/utilities/_oj.utilities.icons.scss +0 -0
  887. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/utilities/_oj.utilities.json.scss +0 -0
  888. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/utilities/_oj.utilities.masonrylayout.scss +0 -0
  889. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/utilities/_oj.utilities.modules.scss +0 -0
  890. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/validation-group/themes/base/_oj-validation-group.scss +0 -0
  891. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/validation-group/themes/redwood/oj-validation-group.scss +0 -0
  892. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/validation-group/themes/stable/oj-validation-group.scss +0 -0
  893. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/waterfall-layout/themes/base/_oj-waterfall-layout.scss +0 -0
  894. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/waterfall-layout/themes/redwood/_oj-waterfall-layout.cssvars.scss +0 -0
  895. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/waterfall-layout/themes/redwood/oj-waterfall-layout.scss +0 -0
  896. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/waterfall-layout/themes/stable/_oj-waterfall-layout.cssvars.scss +0 -0
  897. package/dist/pcss/oj/{v11.0.6 → v11.1.1}/oj/waterfall-layout/themes/stable/oj-waterfall-layout.scss +0 -0
  898. package/dist/scss/alta/_oj.alta.reset.deprecated.vars.scss +0 -1
  899. package/dist/scss/alta/_oj.alta.settings.scss +0 -1
  900. package/dist/scss/alta-android/_oj.alta.android.reset.deprecated.vars.scss +0 -1
  901. package/dist/scss/alta-android/_oj.alta.android.settings.scss +0 -1
  902. package/dist/scss/alta-ios/_oj.alta.ios.reset.deprecated.vars.scss +0 -1
  903. package/dist/scss/alta-ios/_oj.alta.ios.settings.scss +0 -1
  904. package/dist/scss/alta-windows/_oj.alta.windows.reset.deprecated.vars.scss +0 -1
  905. package/dist/scss/alta-windows/_oj.alta.windows.settings.scss +0 -1
  906. package/dist/scss/common/_oj.common.variables.scss +0 -1
  907. package/dist/scss/common/helpers/_oj.common.helpers.scss +1 -1
  908. package/dist/scss/common/widgets/_oj.common.dvt.gantt.scss +3 -5
  909. package/dist/scss/common/widgets/_oj.common.dvt.timeline.scss +1 -1
  910. package/dist/scss/common/widgets/_oj.common.table.scss +2 -2
  911. package/dist/types/ojchart/index.d.ts +81 -81
  912. package/dist/types/ojconfig/index.d.ts +1 -1
  913. package/dist/types/ojdiagram/index.d.ts +30 -30
  914. package/dist/types/ojdrawerlayout/ojdrawerlayout.d.ts +1 -1
  915. package/dist/types/ojdrawerpopup/ojdrawerpopup.d.ts +2 -0
  916. package/dist/types/ojdvttimecomponentscale/index.d.ts +1 -0
  917. package/dist/types/ojgantt/index.d.ts +34 -34
  918. package/dist/types/ojgauge/index.d.ts +22 -22
  919. package/dist/types/ojinputsearch/ojinputsearch.d.ts +2 -0
  920. package/dist/types/ojlegend/index.d.ts +19 -19
  921. package/dist/types/ojnbox/index.d.ts +44 -44
  922. package/dist/types/ojpictochart/index.d.ts +4 -4
  923. package/dist/types/ojrestdataprovider/index.d.ts +2 -1
  924. package/dist/types/ojresttreedataprovider/index.d.ts +93 -0
  925. package/dist/types/ojsunburst/index.d.ts +8 -8
  926. package/dist/types/ojtable/index.d.ts +8 -0
  927. package/dist/types/ojtagcloud/index.d.ts +6 -6
  928. package/dist/types/ojthematicmap/index.d.ts +24 -24
  929. package/dist/types/ojtimeline/index.d.ts +55 -29
  930. package/dist/types/ojtracer/index.d.ts +3 -0
  931. package/dist/types/ojtreemap/index.d.ts +13 -13
  932. package/dist/webpack-tools/4.x/webpack.config.js +3 -3
  933. package/dist/webpack-tools/webpack.config.js +3 -3
  934. package/package.json +1 -1
@@ -91,7 +91,7 @@ function(){if("undefined"==typeof Symbol||"undefined"==typeof Map||"undefined"==
91
91
  // based on https://github.com/montagejs/collections
92
92
  ()?(// prefer built-in Map/Set
93
93
  o=Set,i=Map):(// fall back to our polyfill
94
- o=y,i=v);var g,_=Function.prototype.toString,m=_.call(Object);function b(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]=b(e[n]);return t}
94
+ 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}
95
95
  // special case: to avoid inconsistencies between IndexedDB
96
96
  // and other backends, we automatically stringify Dates
97
97
  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);
@@ -102,55 +102,55 @@ return"function"==typeof e.slice?e.slice(0,t,n):e.webkitSlice(0,t,n);
102
102
  // PhantomJS slice() replacement
103
103
  }(e);if(!function(e){var t=Object.getPrototypeOf(e);
104
104
  /* istanbul ignore if */if(null===t)// not sure when this happens, but I guess it can
105
- return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==m}(e))return e;// don't clone objects like Workers
105
+ 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
106
106
  for(n in t={},e)
107
107
  /* istanbul ignore else */
108
- if(Object.prototype.hasOwnProperty.call(e,n)){var o=b(e[n]);void 0!==o&&(t[n]=o)}return t}function w(e){var t=!1;return f((function(n){
108
+ 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){
109
109
  /* istanbul ignore if */
110
110
  if(t)
111
111
  // this is a smoke test and should never actually happen
112
- throw new Error("once called more than once");t=!0,e.apply(this,n)}))}function k(e){
112
+ throw new Error("once called more than once");t=!0,e.apply(this,n)}))}function j(e){
113
113
  //create the function we will be returning
114
114
  return f((function(t){
115
115
  // Clone arguments
116
- t=b(t);var n=this,r="function"==typeof t[t.length-1]&&t.pop(),o=new Promise((function(r,o){var i;try{var s=w((function(e,t){e?o(e):r(t)}));
116
+ 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)}));
117
117
  // create a callback for this invocation
118
118
  // apply the function in the orig context
119
119
  t.push(s),(i=e.apply(n,t))&&"function"==typeof i.then&&r(i)}catch(e){o(e)}}));
120
120
  // if the last argument is a function, assume its a callback
121
121
  // if there is a callback, call it back
122
- return r&&o.then((function(e){r(null,e)}),r),o}))}function j(e,t){return k(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){
122
+ 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){
123
123
  /* istanbul ignore if */
124
124
  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);
125
125
  // override the callback itself to log the response
126
126
  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))}))}))})))}
127
127
  // like underscore/lodash _.pick()
128
- function O(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}
128
+ function A(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}
129
129
  // Most browsers throttle concurrent requests at 6, so it's silly
130
130
  // to shim _bulk_get by trying to launch potentially hundreds of requests
131
131
  // and then letting the majority time out. We can handle this ourselves.
132
- function A(e){return e}function q(e){return[{ok:e}]}
132
+ function q(e){return e}function S(e){return[{ok:e}]}
133
133
  // shim for P/CouchDB adapters that don't directly implement _bulk_get
134
- function S(e,t,n){var r=t.docs,o=new i;
134
+ function x(e,t,n){var r=t.docs,o=new i;
135
135
  // consolidate into one request per doc if possible
136
- r.forEach((function(e){o.has(e.id)?o.get(e.id).push(e):o.set(e.id,[e])}));var s=o.size,a=0,u=new Array(s);function c(){var e;++a===s&&(e=[],u.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 a=i+s,f=o.get(r),l=O(f[0],["atts_since","attachments"]);l.open_revs=f.map((function(e){
136
+ r.forEach((function(e){o.has(e.id)?o.get(e.id).push(e):o.set(e.id,[e])}));var s=o.size,a=0,u=new Array(s);function c(){var e;++a===s&&(e=[],u.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 a=i+s,f=o.get(r),l=A(f[0],["atts_since","attachments"]);l.open_revs=f.map((function(e){
137
137
  // rev is optional, open_revs disallowed
138
138
  return e.rev})),
139
139
  // remove falsey / undefined revisions
140
- l.open_revs=l.open_revs.filter(A);var d=A;0===l.open_revs.length&&(delete l.open_revs,
140
+ l.open_revs=l.open_revs.filter(q);var d=q;0===l.open_revs.length&&(delete l.open_revs,
141
141
  // when fetching only the "winning" leaf,
142
142
  // transform the result so it looks like an open_revs
143
143
  // request
144
- d=q),
144
+ d=S),
145
145
  // globally-supplied options
146
146
  ["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;
147
- /* istanbul ignore if */o=e?[{error:e}]:d(t),i=r,s=o,u[a]={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 x(){return g}
147
+ /* istanbul ignore if */o=e?[{error:e}]:d(t),i=r,s=o,u[a]={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 E(){return g}
148
148
  // Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We
149
- function E(){d.call(this),this._listeners={},
149
+ function C(){d.call(this),this._listeners={},
150
150
  /* istanbul ignore next */
151
- function(e){x()&&addEventListener("storage",(function(t){e.emit(t.key)}))}(this)}function C(e){
151
+ function(e){E()&&addEventListener("storage",(function(t){e.emit(t.key)}))}(this)}function P(e){
152
152
  /* istanbul ignore else */
153
- if("undefined"!=typeof console&&"function"==typeof console[e]){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}function P(e){var t=0;return e||(t=2e3),function(e,t){var n=6e5;// Hard-coded default of 10 minutes
153
+ if("undefined"!=typeof console&&"function"==typeof console[e]){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}function L(e){var t=0;return e||(t=2e3),function(e,t){var n=6e5;// Hard-coded default of 10 minutes
154
154
  return e=parseInt(e,10)||0,(t=parseInt(t,10))!=t||t<=e?t=(e||1)<<1:t+=1,
155
155
  // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout
156
156
  t>n&&(e=3e5,// divide by two
@@ -158,56 +158,56 @@ t=n),~~((t-e)*Math.random()+e);// ~~ coerces to an int, but fast.
158
158
  }(e,t)}
159
159
  // designed to give info to browser users, who are disturbed
160
160
  // when they see http errors in the console
161
- function L(e,t){C("info","The above "+e+" is totally normal. "+t)}l(E,d),E.prototype.addListener=function(e,t,n,r){
161
+ function D(e,t){P("info","The above "+e+" is totally normal. "+t)}l(C,d),C.prototype.addListener=function(e,t,n,r){
162
162
  /* istanbul ignore if */
163
163
  if(!this._listeners[t]){var o=this,i=!1;this._listeners[t]=a,this.on(e,a)}function a(){
164
164
  /* istanbul ignore if */
165
- if(o._listeners[t])if(i)i="waiting";else{i=!0;var e=O(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);
166
- /* 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(a),i=!1})).on("error",(function(){i=!1}))}}},E.prototype.removeListener=function(e,t){
165
+ if(o._listeners[t])if(i)i="waiting";else{i=!0;var e=A(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);
166
+ /* 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(a),i=!1})).on("error",(function(){i=!1}))}}},C.prototype.removeListener=function(e,t){
167
167
  /* istanbul ignore if */
168
168
  t in this._listeners&&(d.prototype.removeListener.call(this,e,this._listeners[t]),delete this._listeners[t])},
169
169
  /* istanbul ignore next */
170
- E.prototype.notifyLocalWindows=function(e){
170
+ C.prototype.notifyLocalWindows=function(e){
171
171
  //do a useless change on a storage thing
172
172
  //in order to get other windows's listeners to activate
173
- x()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},E.prototype.notify=function(e){this.emit(e),this.notifyLocalWindows(e)};var D="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
173
+ E()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},C.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
174
174
  for(var o in r)
175
175
  // Avoid bugs when hasOwnProperty is shadowed
176
- Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};function $(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}l($,Error),$.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})},new $(401,"unauthorized","Name or password is incorrect.");var I=new $(400,"bad_request","Missing JSON list of 'docs'"),T=new $(404,"not_found","missing"),B=new $(409,"conflict","Document update conflict"),M=new $(400,"bad_request","_id field must contain a string"),R=new $(412,"missing_id","_id is required for puts"),U=new $(400,"bad_request","Only reserved document ids may start with underscore."),N=(new $(412,"precondition_failed","Database not open"),new $(500,"unknown_error","Database encountered an unknown error")),F=new $(500,"badarg","Some query argument is invalid"),K=(new $(400,"invalid_request","Request was invalid"),new $(400,"query_parse_error","Some query parameter is invalid")),J=new $(500,"doc_validation","Bad special document member"),z=new $(400,"bad_request","Something wrong with the request"),V=new $(400,"bad_request","Document must be a JSON object"),G=(new $(404,"not_found","Database not found"),new $(500,"indexed_db_went_bad","unknown")),Q=(new $(500,"web_sql_went_bad","unknown"),new $(500,"levelDB_went_went_bad","unknown"),new $(403,"forbidden","Forbidden by design doc validate_doc_update function"),new $(400,"bad_request","Invalid rev format")),W=(new $(412,"file_exists","The database could not be created, the file already exists."),new $(412,"missing_stub","A pre-existing attachment stub wasn't found"));function Y(e,t){function n(t){for(
176
+ Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};var $=_;function I(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}l(I,Error),I.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})},new I(401,"unauthorized","Name or password is incorrect.");var T=new I(400,"bad_request","Missing JSON list of 'docs'"),B=new I(404,"not_found","missing"),M=new I(409,"conflict","Document update conflict"),R=new I(400,"bad_request","_id field must contain a string"),U=new I(412,"missing_id","_id is required for puts"),N=new I(400,"bad_request","Only reserved document ids may start with underscore."),F=(new I(412,"precondition_failed","Database not open"),new I(500,"unknown_error","Database encountered an unknown error")),K=new I(500,"badarg","Some query argument is invalid"),J=(new I(400,"invalid_request","Request was invalid"),new I(400,"query_parse_error","Some query parameter is invalid")),z=new I(500,"doc_validation","Bad special document member"),V=new I(400,"bad_request","Something wrong with the request"),G=new I(400,"bad_request","Document must be a JSON object"),Q=(new I(404,"not_found","Database not found"),new I(500,"indexed_db_went_bad","unknown")),W=(new I(500,"web_sql_went_bad","unknown"),new I(500,"levelDB_went_went_bad","unknown"),new I(403,"forbidden","Forbidden by design doc validate_doc_update function"),new I(400,"bad_request","Invalid rev format")),Y=(new I(412,"file_exists","The database could not be created, the file already exists."),new I(412,"missing_stub","A pre-existing attachment stub wasn't found"));function H(e,t){function n(t){for(
177
177
  // inherit error properties from our parent error manually
178
178
  // so as to allow proper JSON parsing.
179
179
  /* jshint ignore:start */
180
180
  var n=Object.getOwnPropertyNames(e),r=0,o=n.length;r<o;r++)"function"!=typeof e[n[r]]&&(this[n[r]]=e[n[r]]);
181
- /* jshint ignore:end */void 0!==t&&(this.reason=t)}return n.prototype=$.prototype,new n(t)}function H(e){if("object"!=typeof e){var t=e;(e=N).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 X(e){var t={},n=e.filter&&"function"==typeof e.filter;return t.query=e.query_params,function(r){r.doc||(
181
+ /* jshint ignore:end */void 0!==t&&(this.reason=t)}return n.prototype=I.prototype,new n(t)}function X(e){if("object"!=typeof e){var t=e;(e=F).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||(
182
182
  // CSG sends events on the changes feed that don't have documents,
183
183
  // this hack makes a whole lot of existing code robust.
184
- r.doc={});var o=n&&function(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return Y(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)
184
+ 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(V,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)
185
185
  /* istanbul ignore else */
186
- r.doc._attachments.hasOwnProperty(i)&&(r.doc._attachments[i].stub=!0)}else delete r.doc;return!0}}function Z(e){for(var t=[],n=0,r=e.length;n<r;n++)t=t.concat(e[n]);return t}
186
+ 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}
187
187
  // shim for Function.prototype.name,
188
188
  // Determine id an ID is valid
189
189
  // - invalid IDs begin with an underescore that does not begin '_design' or
190
190
  // '_local'
191
191
  // - any other string value is a valid id
192
192
  // Returns the specific error object for each case
193
- function ee(e){var t;if(e?"string"!=typeof e?t=Y(M):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=Y(U)):t=Y(R),t)throw t}
193
+ function te(e){var t;if(e?"string"!=typeof e?t=H(R):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=H(N)):t=H(U),t)throw t}
194
194
  // Checks if a PouchDB object is "remote" or not. This is
195
- function te(e){return"boolean"==typeof e._remote?e._remote:
195
+ function ne(e){return"boolean"==typeof e._remote?e._remote:
196
196
  /* istanbul ignore next */
197
- "function"==typeof e.type&&(C("warn","db.type() is deprecated and will be removed in a future version of PouchDB"),"http"===e.type()
198
- /* istanbul ignore next */)}function ne(e){if(!e)return null;var t=e.split("/");return 2===t.length?t:1===t.length?[e,e]:null}function re(e){var t=ne(e);return t?t.join("/"):null}
197
+ "function"==typeof e.type&&(P("warn","db.type() is deprecated and will be removed in a future version of PouchDB"),"http"===e.type()
198
+ /* 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}
199
199
  // originally parseUri 1.2.2, now patched by us
200
200
  // (c) Steven Levithan <stevenlevithan.com>
201
201
  // MIT License
202
- new $(413,"invalid_url","Provided URL is invalid");var oe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],ie="queryKey",se=/(?:^|&)([^&=]*)=?([^&]*)/g,ae=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;function ue(e){for(var t=ae.exec(e),n={},r=14;r--;){var o=oe[r],i=t[r]||"",s=-1!==["user","password"].indexOf(o);n[o]=s?decodeURIComponent(i):i}return n[ie]={},n[oe[12]].replace(se,(function(e,t,r){t&&(n[ie][t]=r)})),n}
202
+ new I(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",ae=/(?:^|&)([^&=]*)=?([^&]*)/g,ue=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;function ce(e){for(var t=ue.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(ae,(function(e,t,r){t&&(n[se][t]=r)})),n}
203
203
  // Based on https://github.com/alexdavid/scope-eval v0.0.3
204
204
  // (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js)
205
205
  // This is basically just a wrapper around new Function()
206
- function ce(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)}
206
+ 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)}
207
207
  // this is essentially the "update sugar" function from daleharvey/pouchdb#1388
208
208
  // the diffFun tells us what delta to apply to the doc. it either returns
209
209
  // the doc, or false if it doesn't need to do an update after all
210
- function fe(e,t,n){return new Promise((function(r,o){e.get(t,(function(i,s){if(i){
210
+ function le(e,t,n){return new Promise((function(r,o){e.get(t,(function(i,s){if(i){
211
211
  /* istanbul ignore next */
212
212
  if(404!==i.status)return o(i);s={}}
213
213
  // the user might change the _rev, so save it for posterity
@@ -219,34 +219,34 @@ return r({updated:!1,rev:a});
219
219
  // so reset them here
220
220
  u._id=t,u._rev=a,r(function(e,t,n){return e.put(t).then((function(e){return{updated:!0,rev:e.rev}}),(function(r){
221
221
  /* istanbul ignore next */
222
- if(409!==r.status)throw r;return fe(e,t._id,n)}))}(e,u,n))}))}))}var le=function(e){return atob(e)},de=function(e){return btoa(e)};
222
+ if(409!==r.status)throw r;return le(e,t._id,n)}))}(e,u,n))}))}))}var de=function(e){return atob(e)},he=function(e){return btoa(e)};
223
223
  // Abstracts constructing a Blob object, so it also works in older
224
224
  // browsers that don't support the native Blob constructor (e.g.
225
225
  // old QtWebKit versions, Android < 4.4).
226
- function he(e,t){
226
+ function pe(e,t){
227
227
  /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */
228
228
  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)}}
229
229
  // From http://stackoverflow.com/questions/14967647/ (continues on next line)
230
230
  // encode-decode-image-with-base64-breaks-image (2013-04-21)
231
- function pe(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 ve(e,t){return he([pe(e)],{type:t})}function ye(e,t){return ve(le(e),t)}
231
+ 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)}
232
232
  //Can't find original post, but this is close
233
233
  //http://stackoverflow.com/questions/6965107/ (continues on next line)
234
234
  //converting-between-strings-and-arraybuffers
235
235
  // shim for browsers that don't support it
236
- function ge(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 _e(e,t){ge(e,(function(e){t(e)}))}function me(e,t){_e(e,(function(e){t(de(e))}))}
236
+ 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))}))}
237
237
  // simplified API. universal browser support is assumed
238
238
  // this is not used in the browser
239
- var be=self.setImmediate||self.setTimeout;function we(e,t,n,r,o){(n>0||r<t.size)&&(
239
+ var we=self.setImmediate||self.setTimeout;function ke(e,t,n,r,o){(n>0||r<t.size)&&(
240
240
  // only slice blob if we really need to
241
- 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 ke(e,t,n,r,o){(n>0||r<t.length)&&(
241
+ 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)&&(
242
242
  // only create a substring if we really need to
243
- t=t.substring(n,r)),e.appendBinary(t),o()}function je(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,a=n?new u:new u.ArrayBuffer,c=n?ke:we;function f(){be(d)}function l(){var e=function(e){return de(e)}(a.end(!0));t(e),a.destroy()}function d(){var t=s*o;s++,c(a,e,t,t+o,s<i?f:l)}d()}function Oe(e){return u.hash(e)}function Ae(e,t){var n=b(e);return t?(delete n._rev_tree,Oe(JSON.stringify(n))):a.v4().replace(/-/g,"").toLowerCase()}var qe=a.v4;// mimic old import, only v4 is ever used elsewhere
243
+ 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,a=n?new u:new u.ArrayBuffer,c=n?je:ke;function f(){we(d)}function l(){var e=function(e){return he(e)}(a.end(!0));t(e),a.destroy()}function d(){var t=s*o;s++,c(a,e,t,t+o,s<i?f:l)}d()}function Ae(e){return u.hash(e)}function qe(e,t){var n=w(e);return t?(delete n._rev_tree,Ae(JSON.stringify(n))):a.v4().replace(/-/g,"").toLowerCase()}var Se=a.v4;// mimic old import, only v4 is ever used elsewhere
244
244
  // We fetch all leafs of the revision tree, and sort them based on tree length
245
245
  // and whether they were deleted, undeleted documents with the longest revision
246
246
  // tree (most edits) win
247
247
  // The final sort algorithm is slightly documented in a sidebar here:
248
248
  // http://guide.couchdb.org/draft/conflicts.html
249
- function Se(e){for(var t,n,r,o,i=e.rev_tree.slice();o=i.pop();){var s=o.ids,a=s[2],u=o.pos;if(a.length)// non-leaf
249
+ function xe(e){for(var t,n,r,o,i=e.rev_tree.slice();o=i.pop();){var s=o.ids,a=s[2],u=o.pos;if(a.length)// non-leaf
250
250
  for(var c=0,f=a.length;c<f;c++)i.push({pos:u+1,ids:a[c]});else{var l=!!s[1].deleted,d=s[0];
251
251
  // sort by deleted, then pos, then id
252
252
  t&&!(r!==l?r:n!==u?n<u:t<d)||(t=d,n=u,r=l)}}return n+"-"+t}
@@ -254,94 +254,94 @@ t&&!(r!==l?r:n!==u?n<u:t<d)||(t=d,n=u,r=l)}}return n+"-"+t}
254
254
  // traverse revisions
255
255
  // The return value from the callback will be passed as context to all
256
256
  // children of that node
257
- function xe(e,t){for(var n,r=e.slice();n=r.pop();)for(var o=n.pos,i=n.ids,s=i[2],a=t(0===s.length,o,i[0],n.ctx,i[1]),u=0,c=s.length;u<c;u++)r.push({pos:o+1,ids:s[u],ctx:a})}function Ee(e,t){return e.pos-t.pos}function Ce(e){var t=[];xe(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}
257
+ function Ee(e,t){for(var n,r=e.slice();n=r.pop();)for(var o=n.pos,i=n.ids,s=i[2],a=t(0===s.length,o,i[0],n.ctx,i[1]),u=0,c=s.length;u<c;u++)r.push({pos:o+1,ids:s[u],ctx:a})}function Ce(e,t){return e.pos-t.pos}function Pe(e){var t=[];Ee(e,(function(e,n,r,o,i){e&&t.push({rev:n+"-"+r,pos:n,opts:i})})),t.sort(Ce).reverse();for(var n=0,r=t.length;n<r;n++)delete t[n].pos;return t}
258
258
  // returns revs of all conflicts that is leaves such that
259
259
  // 1. are not deleted and
260
260
  // 2. are different than winning revision
261
- function Pe(e){for(var t=Se(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}
261
+ function Le(e){for(var t=xe(e),n=Pe(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}
262
262
  // compact a tree by marking its non-leafs as missing,
263
263
  // and return a list of revs to delete
264
264
  // build up a list of all the paths to the leafs in this revision tree
265
- function Le(e){for(var t,n=[],r=e.slice();t=r.pop();){var o=t.pos,i=t.ids,s=i[0],a=i[1],u=i[2],c=0===u.length,f=t.history?t.history.slice():[];f.push({id:s,opts:a}),c&&n.push({pos:o+1-f.length,ids:f});for(var l=0,d=u.length;l<d;l++)r.push({pos:o+1,ids:u[l],history:f})}return n.reverse()}
265
+ function De(e){for(var t,n=[],r=e.slice();t=r.pop();){var o=t.pos,i=t.ids,s=i[0],a=i[1],u=i[2],c=0===u.length,f=t.history?t.history.slice():[];f.push({id:s,opts:a}),c&&n.push({pos:o+1-f.length,ids:f});for(var l=0,d=u.length;l<d;l++)r.push({pos:o+1,ids:u[l],history:f})}return n.reverse()}
266
266
  // for a better overview of what this is doing, read:
267
- function De(e,t){return e.pos-t.pos}
267
+ function $e(e,t){return e.pos-t.pos}
268
268
  // classic binary search
269
269
  // assuming the arr is sorted, insert the item in the proper place
270
- function $e(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)}
270
+ function Ie(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)}
271
271
  // Turn a path as a flat array into a tree with a single branch.
272
272
  // If any should be stemmed from the beginning of the array, that's passed
273
273
  // in as the second argument
274
- function Ie(e,t){for(var n,r,o=t,i=e.length;o<i;o++){var s=e[o],a=[s.id,s.opts,[]];r?(r[2].push(a),r=a):n=r=a}return n}
274
+ function Te(e,t){for(var n,r,o=t,i=e.length;o<i;o++){var s=e[o],a=[s.id,s.opts,[]];r?(r[2].push(a),r=a):n=r=a}return n}
275
275
  // compare the IDs of two trees
276
- function Te(e,t){return e[0]<t[0]?-1:1}
276
+ function Be(e,t){return e[0]<t[0]?-1:1}
277
277
  // Merge two trees together
278
278
  // The roots of tree1 and tree2 must be the same revision
279
- function Be(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 a=0;a<s[2].length;a++)if(i[2][0]){for(var u=!1,c=0;c<i[2].length;c++)i[2][c][0]===s[2][a][0]&&(n.push({tree1:i[2][c],tree2:s[2][a]}),u=!0);u||(r="new_branch",$e(i[2],s[2][a],Te))}else r="new_leaf",i[2][0]=s[2][a]}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 a=0,u=e.length;a<u;a++){var c=e[a];if(c.pos===t.pos&&c.ids[0]===t.ids[0])
279
+ function Me(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 a=0;a<s[2].length;a++)if(i[2][0]){for(var u=!1,c=0;c<i[2].length;c++)i[2][c][0]===s[2][a][0]&&(n.push({tree1:i[2][c],tree2:s[2][a]}),u=!0);u||(r="new_branch",Ie(i[2],s[2][a],Be))}else r="new_leaf",i[2][0]=s[2][a]}return{conflicts:r,tree:e}}function Re(e,t,n){var r,o=[],i=!1,s=!1;if(!e.length)return{tree:[t],conflicts:"new_leaf"};for(var a=0,u=e.length;a<u;a++){var c=e[a];if(c.pos===t.pos&&c.ids[0]===t.ids[0])
280
280
  // Paths start at the same position and have the same root, so they need
281
281
  // merged
282
- r=Be(c.ids,t.ids),o.push({pos:c.pos,ids:r.tree}),i=i||r.conflicts,s=!0;else if(!0!==n){
282
+ r=Me(c.ids,t.ids),o.push({pos:c.pos,ids:r.tree}),i=i||r.conflicts,s=!0;else if(!0!==n){
283
283
  // The paths start at a different position, take the earliest path and
284
284
  // traverse up until it as at the same point from root as the path we
285
285
  // want to merge. If the keys match we return the longer path with the
286
286
  // other merged After stemming we dont want to expand the trees
287
- 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=Be(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)}
287
+ 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=Me(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)}
288
288
  // We didnt find
289
- return s||o.push(t),o.sort(De),{tree:o,conflicts:i||"internal_node"}}
289
+ return s||o.push(t),o.sort($e),{tree:o,conflicts:i||"internal_node"}}
290
290
  // To ensure we dont grow the revision tree infinitely, we stem old revisions
291
- function Re(e,t,n){var r=Me(e,t),o=function(e,t){for(
291
+ function Ue(e,t,n){var r=Re(e,t),o=function(e,t){for(
292
292
  // First we break out the tree into a complete list of root to leaf paths
293
- var n,r,o=Le(e),i=0,s=o.length;i<s;i++){
293
+ var n,r,o=De(e),i=0,s=o.length;i<s;i++){
294
294
  // Then for each path, we cut off the start of the path based on the
295
295
  // `depth` to stem to, and generate a new set of flat trees
296
296
  var a,u=o[i],c=u.ids;if(c.length>t){
297
297
  // only do the stemming work if we actually need to stem
298
- n||(n={});var f=c.length-t;a={pos:u.pos+f,ids:Ie(c,f)};for(var l=0;l<f;l++){var d=u.pos+l+"-"+c[l].id;n[d]=!0}}else// no need to actually stem
299
- a={pos:u.pos,ids:Ie(c,0)};
298
+ n||(n={});var f=c.length-t;a={pos:u.pos+f,ids:Te(c,f)};for(var l=0;l<f;l++){var d=u.pos+l+"-"+c[l].id;n[d]=!0}}else// no need to actually stem
299
+ a={pos:u.pos,ids:Te(c,0)};
300
300
  // Then we remerge all those flat trees together, ensuring that we dont
301
301
  // connect trees that would go beyond the depth limit
302
- r=r?Me(r,a,!0).tree:[a]}
302
+ r=r?Re(r,a,!0).tree:[a]}
303
303
  // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed
304
- return n&&xe(r,(function(e,t,r){
304
+ return n&&Ee(r,(function(e,t,r){
305
305
  // some revisions may have been removed in a branch but not in another
306
306
  delete n[t+"-"+r]})),{tree:r,revs:n?Object.keys(n):[]}}(r.tree,n);return{tree:o.tree,stemmedRevs:o.revs,conflicts:r.conflicts}}
307
307
  // return true if a rev exists in the rev tree, false otherwise
308
- function Ue(e){return e.ids}
308
+ function Ne(e){return e.ids}
309
309
  // check if a specific revision of a doc has been deleted
310
310
  // - metadata: the metadata object from the doc store
311
311
  // - rev: (optional) the revision to check. defaults to winning revision
312
- function Ne(e,t){t||(t=Se(e));for(var n,r=t.substring(t.indexOf("-")+1),o=e.rev_tree.map(Ue);n=o.pop();){if(n[0]===r)return!!n[1].deleted;o=o.concat(n[2])}}function Fe(e){return/^_local/.test(e)}
312
+ function Fe(e,t){t||(t=xe(e));for(var n,r=t.substring(t.indexOf("-")+1),o=e.rev_tree.map(Ne);n=o.pop();){if(n[0]===r)return!!n[1].deleted;o=o.concat(n[2])}}function Ke(e){return/^_local/.test(e)}
313
313
  // returns the current leaf node for a given revision
314
- function Ke(e,t,n){d.call(this);var r=this;this.db=e;var o=(t=t?b(t):{}).complete=w((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){
314
+ 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){
315
315
  /* istanbul ignore if */
316
316
  r.isCancelled||function(e,t,n,r){
317
317
  // isolate try/catches to avoid V8 deoptimizations
318
- 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 Je(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 Ne(t,e._rev)&&(o.deleted=!0),n.conflicts&&(o.doc._conflicts=Pe(t),o.doc._conflicts.length||delete o.doc._conflicts),o}
318
+ try{e.emit("change",t,n,r)}catch(e){P("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 ze(e,t,n){var r=[{rev:e._rev}];"all_docs"===n.style&&(r=Pe(t.rev_tree).map((function(e){return{rev:e.rev}})));var o={id:t.id,changes:r,doc:e};return Fe(t,e._rev)&&(o.deleted=!0),n.conflicts&&(o.doc._conflicts=Le(t),o.doc._conflicts.length||delete o.doc._conflicts),o}
319
319
  /*
320
320
  * A generic pouch adapter
321
- */function ze(e,t){return e<t?-1:e>t?1:0}
321
+ */function Ve(e,t){return e<t?-1:e>t?1:0}
322
322
  // Wrapper for functions that call the bulkdocs api with a single doc,
323
323
  // if the first result is an error, return an error
324
- function Ve(e,t){return function(n,r){n||r[0]&&r[0].error?((n=n||r[0]).docId=t,e(n)):e(null,r.length?r[0]:r)}}
324
+ function Ge(e,t){return function(n,r){n||r[0]&&r[0].error?((n=n||r[0]).docId=t,e(n)):e(null,r.length?r[0]:r)}}
325
325
  // clean docs given to us by the user
326
326
  // compare two docs, first by _id then by _rev
327
- function Ge(e,t){var n=ze(e._id,t._id);return 0!==n?n:ze(e._revisions?e._revisions.start:0,t._revisions?t._revisions.start:0)}
327
+ function Qe(e,t){var n=Ve(e._id,t._id);return 0!==n?n:Ve(e._revisions?e._revisions.start:0,t._revisions?t._revisions.start:0)}
328
328
  // for every node in a revision tree computes its distance from the closest
329
329
  // leaf
330
330
  // all compaction is done in a queue, to avoid attaching
331
331
  // too many listeners at once
332
- function Qe(e){var t=e._compactionQueue[0],n=t.opts,r=t.callback;e.get("_local/compaction").catch((function(){return!1})).then((function(t){t&&t.last_seq&&(n.last_seq=t.last_seq),e._compact(n,(function(t,n){
332
+ function We(e){var t=e._compactionQueue[0],n=t.opts,r=t.callback;e.get("_local/compaction").catch((function(){return!1})).then((function(t){t&&t.last_seq&&(n.last_seq=t.last_seq),e._compact(n,(function(t,n){
333
333
  /* istanbul ignore if */
334
- t?r(t):r(null,n),s((function(){e._compactionQueue.shift(),e._compactionQueue.length&&Qe(e)}))}))}))}function We(){
334
+ t?r(t):r(null,n),s((function(){e._compactionQueue.shift(),e._compactionQueue.length&&We(e)}))}))}))}function Ye(){
335
335
  // re-bind prototyped methods
336
- for(var e in d.call(this),We.prototype)"function"==typeof this[e]&&(this[e]=this[e].bind(this))}function Ye(){this.isReady=!1,this.failed=!1,this.queue=[]}function He(e,t){
336
+ for(var e in d.call(this),Ye.prototype)"function"==typeof this[e]&&(this[e]=this[e].bind(this))}function He(){this.isReady=!1,this.failed=!1,this.queue=[]}function Xe(e,t){
337
337
  // In Node our test suite only tests this for PouchAlt unfortunately
338
338
  /* istanbul ignore if */
339
- if(!(this instanceof He))return new He(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=b(t),n.auto_compaction=t.auto_compaction,n.prefix=He.prefix,"string"!=typeof e)throw new Error("Missing/invalid DB name");var r=function(e,t){var n=e.match(/([a-z-]*):\/\/(.*)/);if(n)
339
+ 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)
340
340
  // the http adapter expects the fully qualified name
341
- return{name:/https?/.test(n[1])?n[1]+"://"+n[2]:n[2],adapter:n[1]};var r=He.adapters,o=He.preferredAdapters,i=He.prefix,s=t.adapter;if(!s)// automatically determine adapter
342
- for(var a=0;a<o.length&&"idb"===(s=o[a])&&"websql"in r&&x()&&localStorage["_pouch__websqldb_"+i+e];++a)
341
+ 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
342
+ for(var a=0;a<o.length&&"idb"===(s=o[a])&&"websql"in r&&E()&&localStorage["_pouch__websqldb_"+i+e];++a)
343
343
  // log it, because this can be confusing during development
344
- C("log",'PouchDB is downgrading "'+e+'" to WebSQL to avoid data loss, because it was already opened with WebSQL.');var u=r[s];
344
+ P("log",'PouchDB is downgrading "'+e+'" to WebSQL to avoid data loss, because it was already opened with WebSQL.');var u=r[s];
345
345
  // if adapter is invalid, then an error will be thrown later
346
346
  return{name:u&&"use_prefix"in u&&!u.use_prefix?e:i+e,adapter:s}}
347
347
  // OK, so here's the deal. Consider this code:
@@ -354,35 +354,35 @@ return{name:u&&"use_prefix"in u&&!u.use_prefix?e:i+e,adapter:s}}
354
354
  // responsible for emitting the initial event, which then gets emitted
355
355
  // by the constructor, which then broadcasts it to any other dbs
356
356
  // that may have been created with the same name.
357
- ((t.prefix||"")+e,t);if(t.name=r.name,t.adapter=t.adapter||r.adapter,n.name=e,n._adapter=t.adapter,He.emit("debug",["adapter","Picked adapter: ",t.adapter]),!He.adapters[t.adapter]||!He.adapters[t.adapter].valid())throw new Error("Invalid Adapter: "+t.adapter);We.call(n),n.taskqueue=new Ye,n.adapter=t.adapter,He.adapters[t.adapter].call(n,t,(function(e){if(e)return n.taskqueue.fail(e);!function(e){function t(t){e.removeListener("closed",n),t||e.constructor.emit("destroyed",e.name)}function n(){e.removeListener("destroyed",t),e.constructor.emit("unref",e)}e.once("destroyed",t),e.once("closed",n),e.constructor.emit("ref",e)}(n),n.emit("created",n),He.emit("created",n.name),n.taskqueue.ready(n)}))}
357
+ ((t.prefix||"")+e,t);if(t.name=r.name,t.adapter=t.adapter||r.adapter,n.name=e,n._adapter=t.adapter,Xe.emit("debug",["adapter","Picked adapter: ",t.adapter]),!Xe.adapters[t.adapter]||!Xe.adapters[t.adapter].valid())throw new Error("Invalid Adapter: "+t.adapter);Ye.call(n),n.taskqueue=new He,n.adapter=t.adapter,Xe.adapters[t.adapter].call(n,t,(function(e){if(e)return n.taskqueue.fail(e);!function(e){function t(t){e.removeListener("closed",n),t||e.constructor.emit("destroyed",e.name)}function n(){e.removeListener("destroyed",t),e.constructor.emit("unref",e)}e.once("destroyed",t),e.once("closed",n),e.constructor.emit("ref",e)}(n),n.emit("created",n),Xe.emit("created",n.name),n.taskqueue.ready(n)}))}
358
358
  // AbortController was introduced quite a while after fetch and
359
359
  // isnt required for PouchDB to function so polyfill if needed
360
- l(Ke,d),Ke.prototype.cancel=function(){this.isCancelled=!0,this.db.taskqueue.isReady&&this.emit("cancel")},Ke.prototype.validateChanges=function(e){var t=e.complete,n=this;
361
- /* istanbul ignore else */He._changesFilterPlugin?He._changesFilterPlugin.validate(e,(function(r){if(r)return t(r);n.doChanges(e)})):n.doChanges(e)},Ke.prototype.doChanges=function(e){var t=this,n=e.complete;if("live"in(e=b(e))&&!("continuous"in e)&&(e.continuous=e.live),e.processChange=Je,"latest"===e.since&&(e.since="now"),e.since||(e.since=0),"now"!==e.since
362
- /* istanbul ignore else */){if(He._changesFilterPlugin){if(He._changesFilterPlugin.normalize(e),He._changesFilterPlugin.shouldFilter(this,e))return He._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),
360
+ l(Je,d),Je.prototype.cancel=function(){this.isCancelled=!0,this.db.taskqueue.isReady&&this.emit("cancel")},Je.prototype.validateChanges=function(e){var t=e.complete,n=this;
361
+ /* istanbul ignore else */Xe._changesFilterPlugin?Xe._changesFilterPlugin.validate(e,(function(r){if(r)return t(r);n.doChanges(e)})):n.doChanges(e)},Je.prototype.doChanges=function(e){var t=this,n=e.complete;if("live"in(e=w(e))&&!("continuous"in e)&&(e.continuous=e.live),e.processChange=ze,"latest"===e.since&&(e.since="now"),e.since||(e.since=0),"now"!==e.since
362
+ /* 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&&P("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),
363
363
  // 0 and 1 should return 1 document
364
364
  e.limit=0===e.limit?1:e.limit,e.complete=n;var r=this.db._changes(e);
365
365
  /* 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){
366
366
  /* istanbul ignore if */
367
- t.isCancelled?n(null,{status:"cancelled"}):(e.since=r.update_seq,t.doChanges(e))}),n)},l(We,d),We.prototype.post=j("post",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(Y(V));this.bulkDocs({docs:[e]},t,Ve(n,e._id))})),We.prototype.put=j("put",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(Y(V));if(ee(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,a=this;function u(n){"function"==typeof a._put&&!1!==t.new_edits?a._put(e,t,n):a.bulkDocs({docs:[e]},t,Ve(n,e._id))}t.force&&e._rev?(o=(r=e._rev.split("-"))[1],i=parseInt(r[0],10)+1,s=Ae(),e._revisions={start:i,ids:[s,o]},e._rev=i+"-"+s,t.new_edits=!1,u((function(t){var r=t?null:{ok:!0,id:e._id,rev:e._rev};n(t,r)}))):u(n)})),We.prototype.putAttachment=j("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),
367
+ 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),Ke(e._id)&&"function"==typeof this._putLocal)return e._deleted?this._removeLocal(e,n):this._putLocal(e,n);var r,o,i,s,a=this;function u(n){"function"==typeof a._put&&!1!==t.new_edits?a._put(e,t,n):a.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=qe(),e._revisions={start:i,ids:[s,o]},e._rev=i+"-"+s,t.new_edits=!1,u((function(t){var r=t?null:{ok:!0,id:e._id,rev:e._rev};n(t,r)}))):u(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),
368
368
  // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267
369
369
  /* istanbul ignore if */
370
- 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 Y(B);return s(e)}),(function(t){
370
+ void 0===o&&(o=r,r=n,n=null),o||P("warn","Attachment",t,"on document",e,"is missing content_type"),i.get(e).then((function(e){if(e._rev!==n)throw H(M);return s(e)}),(function(t){
371
371
  // create new doc
372
372
  /* istanbul ignore else */
373
- if(t.reason===T.message)return s({_id:e});throw t}))})),We.prototype.removeAttachment=j("removeAttachment",(function(e,t,n,r){var o=this;o.get(e,(function(e,i){
373
+ if(t.reason===B.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){
374
374
  /* istanbul ignore if */
375
375
  if(e)r(e);else if(i._rev===n){
376
376
  /* istanbul ignore if */
377
- if(!i._attachments)return r();delete i._attachments[t],0===Object.keys(i._attachments).length&&delete i._attachments,o.put(i,r)}else r(Y(B))}))})),We.prototype.remove=j("remove",(function(e,t,n,r){var o;"string"==typeof t?(
377
+ 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(M))}))})),Ye.prototype.remove=O("remove",(function(e,t,n,r){var o;"string"==typeof t?(
378
378
  // id, rev, opts, callback style
379
379
  o={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
380
380
  // doc, opts, callback style
381
- 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,Ve(r,i._id))})),We.prototype.revsDiff=j("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 a(e,t){s.has(e)||s.set(e,{missing:[]}),s.get(e).missing.push(t)}r.map((function(t){this._getRevisionTree(t,(function(i,u){if(i&&404===i.status&&"missing"===i.message)s.set(t,{missing:e[t]});else{if(i)
381
+ 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(Ke(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 a(e,t){s.has(e)||s.set(e,{missing:[]}),s.get(e).missing.push(t)}r.map((function(t){this._getRevisionTree(t,(function(i,u){if(i&&404===i.status&&"missing"===i.message)s.set(t,{missing:e[t]});else{if(i)
382
382
  /* istanbul ignore next */
383
383
  return n(i);!function(t,n){
384
384
  // Is this fast enough? Maybe we should switch to a set simulated by a map
385
- var r=e[t].slice(0);xe(n,(function(e,n,o,i,s){var u=n+"-"+o,c=r.indexOf(u);-1!==c&&(r.splice(c,1),
385
+ var r=e[t].slice(0);Ee(n,(function(e,n,o,i,s){var u=n+"-"+o,c=r.indexOf(u);-1!==c&&(r.splice(c,1),
386
386
  /* istanbul ignore if */
387
387
  "available"!==s.status&&a(t,u))})),
388
388
  // Traversing the tree is synchronous, so now `missingForId` contains
@@ -397,24 +397,24 @@ var c={};return s.forEach((function(e,t){c[t]=e})),n(null,c)}}))}),this)})),
397
397
  // for local databases (except the cost of multiple transactions, which is
398
398
  // small). The http adapter overrides this in order
399
399
  // to do a more efficient single HTTP request.
400
- We.prototype.bulkGet=j("bulkGet",(function(e,t){S(this,e,t)})),
400
+ Ye.prototype.bulkGet=O("bulkGet",(function(e,t){x(this,e,t)})),
401
401
  // compact one document and fire callback
402
402
  // by compacting we mean removing all revisions which
403
403
  // are further from the leaf in revision tree than max_height
404
- We.prototype.compactDocument=j("compactDocument",(function(e,t,n){var r=this;this._getRevisionTree(e,(function(o,i){
404
+ Ye.prototype.compactDocument=O("compactDocument",(function(e,t,n){var r=this;this._getRevisionTree(e,(function(o,i){
405
405
  /* istanbul ignore if */
406
- if(o)return n(o);var s=function(e){var t={},n=[];return xe(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),a=[],u=[];Object.keys(s).forEach((function(e){s[e]>t&&a.push(e)})),xe(i,(function(e,t,n,r,o){var i=t+"-"+n;"available"===o.status&&-1!==a.indexOf(i)&&u.push(i)})),r._doCompaction(e,u,n)}))})),
406
+ if(o)return n(o);var s=function(e){var t={},n=[];return Ee(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),a=[],u=[];Object.keys(s).forEach((function(e){s[e]>t&&a.push(e)})),Ee(i,(function(e,t,n,r,o){var i=t+"-"+n;"available"===o.status&&-1!==a.indexOf(i)&&u.push(i)})),r._doCompaction(e,u,n)}))})),
407
407
  // compact the whole database using single document
408
408
  // compaction
409
- We.prototype.compact=j("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&&Qe(n)})),We.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 fe(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)},
409
+ 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)},
410
410
  /* Begin api wrappers. Specific functionality to storage belongs in the
411
411
  _[method] */
412
- We.prototype.get=j("get",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"string"!=typeof e)return n(Y(M));if(Fe(e)&&"function"==typeof this._getLocal)return this._getLocal(e,n);var r=[],o=this;function i(){var i=[],s=r.length;
412
+ Ye.prototype.get=O("get",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"string"!=typeof e)return n(H(R));if(Ke(e)&&"function"==typeof this._getLocal)return this._getLocal(e,n);var r=[],o=this;function i(){var i=[],s=r.length;
413
413
  /* istanbul ignore if */if(!s)return n(null,i);
414
414
  // order with open_revs is unspecified
415
415
  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(
416
416
  // using latest=true can produce duplicates
417
- var o,a=0,u=i.length;a<u;a++)if(i[a].ok&&i[a].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,a=i.metadata,u=i.ctx;if(t.conflicts){var c=Pe(a);c.length&&(s._conflicts=c)}if(Ne(a,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=Le(a.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)}
417
+ var o,a=0,u=i.length;a<u;a++)if(i[a].ok&&i[a].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,a=i.metadata,u=i.ctx;if(t.conflicts){var c=Le(a);c.length&&(s._conflicts=c)}if(Fe(a,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=De(a.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)}
418
418
  /* 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],{
419
419
  // Previously the revision handling was done in adapter.js
420
420
  // getAttachment, however since idb-next doesnt we need to
@@ -423,27 +423,27 @@ rev:s._rev,binary:t.binary,ctx:u},(function(t,r){var o=s._attachments[e];o.data=
423
423
  /* istanbul ignore else */
424
424
  s._attachments.hasOwnProperty(j)&&(s._attachments[j].stub=!0);n(null,s)}}));if("all"===t.open_revs)this._getRevisionTree(e,(function(e,t){
425
425
  /* istanbul ignore if */
426
- if(e)return n(e);r=Ce(t).map((function(e){return e.rev})),i()}));else{if(!Array.isArray(t.open_revs))return n(Y(N,"function_clause"));r=t.open_revs;for(var s=0;s<r.length;s++){var a=r[s];
426
+ if(e)return n(e);r=Pe(t).map((function(e){return e.rev})),i()}));else{if(!Array.isArray(t.open_revs))return n(H(F,"function_clause"));r=t.open_revs;for(var s=0;s<r.length;s++){var a=r[s];
427
427
  // looks like it's the only thing couchdb checks
428
- if("string"!=typeof a||!/^\d+-/.test(a))return n(Y(Q))}i()}})),
428
+ if("string"!=typeof a||!/^\d+-/.test(a))return n(H(W))}i()}})),
429
429
  // TODO: I dont like this, it forces an extra read for every
430
430
  // attachment read and enforces a confusing api between
431
431
  // adapter.js and the adapter implementation
432
- We.prototype.getAttachment=j("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(Y(T))}))})),We.prototype.allDocs=j("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(Y(K,"Query parameter `"+n+"` is not compatible with multi-get"));if(!te(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)})),We.prototype.changes=function(e,t){return"function"==typeof e&&(t=e,e={}),
432
+ 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(B))}))})),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={}),
433
433
  // By default set return_docs to false if the caller has opts.live = true,
434
434
  // this will prevent us from collecting the set of changes indefinitely
435
435
  // resulting in growing memory
436
- (e=e||{}).return_docs="return_docs"in e?e.return_docs:!e.live,new Ke(this,e,t)},We.prototype.close=j("close",(function(e){return this._closed=!0,this.emit("closed"),this._close(e)})),We.prototype.info=j("info",(function(e){var t=this;this._info((function(n,r){if(n)return e(n);
436
+ (e=e||{}).return_docs="return_docs"in e?e.return_docs:!e.live,new Je(this,e,t)},Ye.prototype.close=O("close",(function(e){return this._closed=!0,this.emit("closed"),this._close(e)})),Ye.prototype.info=O("info",(function(e){var t=this;this._info((function(n,r){if(n)return e(n);
437
437
  // assume we know better than the adapter, unless it informs us
438
- r.db_name=r.db_name||t.name,r.auto_compaction=!(!t.auto_compaction||te(t)),r.adapter=t.adapter,e(null,r)}))})),We.prototype.id=j("id",(function(e){return this._id(e)})),
438
+ 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)})),
439
439
  /* istanbul ignore next */
440
- We.prototype.type=function(){return"function"==typeof this._type?this._type():this.adapter},We.prototype.bulkDocs=j("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(Y(I));for(var r=0;r<e.docs.length;++r)if("object"!=typeof e.docs[r]||Array.isArray(e.docs[r]))return n(Y(V));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(Y(z,o));"new_edits"in t||(t.new_edits=!("new_edits"in e)||e.new_edits);var i=this;t.new_edits||te(i)||
440
+ 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(T));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||P("warn","Attachment",t,"on document",e._id,"is missing content_type")}))})),o)return n(H(V,o));"new_edits"in t||(t.new_edits=!("new_edits"in e)||e.new_edits);var i=this;t.new_edits||ne(i)||
441
441
  // ensure revisions of the same doc are sorted, so that
442
442
  // the local adapter processes them correctly (#2935)
443
- e.docs.sort(Ge),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
443
+ 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
444
444
  else if(n._attachments)for(
445
445
  // filter out extraneous keys from _attachments
446
- var r=Object.keys(n._attachments),o=0;o<r.length;o++){var i=r[o];n._attachments[i]=O(n._attachments[i],["data","digest","content_type","length","revpos","stub"])}}}(e.docs);
446
+ var r=Object.keys(n._attachments),o=0;o<r.length;o++){var i=r[o];n._attachments[i]=A(n._attachments[i],["data","digest","content_type","length","revpos","stub"])}}}(e.docs);
447
447
  // in the case of conflicts, we want to return the _ids to the user
448
448
  // however, the underlying adapter may destroy the docs array, so
449
449
  // create a copy here
@@ -451,44 +451,44 @@ var s=e.docs.map((function(e){return e._id}));return this._bulkDocs(e,t,(functio
451
451
  // add ids for error/conflict responses (not required for CouchDB)
452
452
  if(t.new_edits||(
453
453
  // this is what couch does when new_edits is false
454
- r=r.filter((function(e){return e.error}))),!te(i))for(var o=0,a=r.length;o<a;o++)r[o].id=r[o].id||s[o];n(null,r)}))})),We.prototype.registerDependentDatabase=j("registerDependentDatabase",(function(e,t){var n=new this.constructor(e,this.__opts);fe(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)})),We.prototype.destroy=j("destroy",(function(e,t){"function"==typeof e&&(t=e,e={});var n=this,r=!("use_prefix"in n)||n.use_prefix;function o(){
454
+ r=r.filter((function(e){return e.error}))),!ne(i))for(var o=0,a=r.length;o<a;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(){
455
455
  // call destroy method of the particular adaptor
456
- n._destroy(e,(function(e,r){if(e)return t(e);n._destroyed=!0,n.emit("destroyed"),t(null,r||{ok:!0})}))}if(te(n))
456
+ 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))
457
457
  // no need to check for dependent DBs if it's a remote DB
458
458
  return o();n.get("_local/_pouch_dependentDbs",(function(e,i){if(e)
459
459
  /* istanbul ignore if */
460
460
  return 404!==e.status?t(e):o();var s=i.dependentDbs,a=n.constructor,u=Object.keys(s).map((function(e){
461
461
  // use_prefix is only false in the browser
462
462
  /* istanbul ignore next */
463
- var t=r?e.replace(new RegExp("^"+a.prefix),""):e;return new a(t,n.__opts).destroy()}));Promise.all(u).then(o,t)}))})),Ye.prototype.execute=function(){var e;if(this.failed)for(;e=this.queue.shift();)e(this.failed);else for(;e=this.queue.shift();)e()},Ye.prototype.fail=function(e){this.failed=e,this.execute()},Ye.prototype.ready=function(e){this.isReady=!0,this.db=e,this.execute()},Ye.prototype.addTask=function(e){this.queue.push(e),this.failed&&this.execute()},l(He,We);var Xe="undefined"!=typeof AbortController?AbortController:function(){return{abort:function(){}}},Ze=fetch,et=Headers;He.adapters={},He.preferredAdapters=[],He.prefix="_pouch_";var tt=new d;
463
+ var t=r?e.replace(new RegExp("^"+a.prefix),""):e;return new a(t,n.__opts).destroy()}));Promise.all(u).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;
464
464
  // this would just be "return doc[field]", but fields
465
465
  // can be "deep" due to dot notation
466
- function nt(e,t){for(var n=e,r=0,o=t.length;r<o&&(n=n[t[r]]);r++);return n}
466
+ function rt(e,t){for(var n=e,r=0,o=t.length;r<o&&(n=n[t[r]]);r++);return n}
467
467
  // Converts a string in dot notation to an array of its components, with backslash escaping
468
- function rt(e){for(
468
+ function ot(e){for(
469
469
  // fields may be deep (e.g. "foo.bar.baz"), so parse
470
470
  var t=[],n="",r=0,o=e.length;r<o;r++){var i=e[r];"."===i?r>0&&"\\"===e[r-1]?// escaped delimiter
471
471
  n=n.substring(0,n.length-1)+".":(// not escaped, so delimiter
472
472
  t.push(n),n=""):// normal character
473
- n+=i}return t.push(n),t}!function(e){Object.keys(d.prototype).forEach((function(t){"function"==typeof d.prototype[t]&&(e[t]=tt[t].bind(tt))}));
473
+ 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))}));
474
474
  // these are created in constructor.js, and allow us to notify each DB with
475
475
  // the same name that it was destroyed, via the constructor object
476
476
  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?
477
477
  /* istanbul ignore next */
478
- 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)}))}}))}(He),He.adapter=function(e,t,n){
478
+ 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){
479
479
  /* istanbul ignore else */
480
- t.valid()&&(He.adapters[e]=t,n&&He.preferredAdapters.push(e))},He.plugin=function(e){if("function"==typeof e)// function style for plugins
481
- e(He);else{if("object"!=typeof e||0===Object.keys(e).length)throw new Error('Invalid plugin: got "'+e+'", expected an object or a function');Object.keys(e).forEach((function(t){// object style for plugins
482
- He.prototype[t]=e[t]}))}return this.__defaults&&(He.__defaults=D({},this.__defaults)),He},He.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=D({},t.__defaults,n),He.call(this,e,n)}return l(t,He),t.preferredAdapters=He.preferredAdapters.slice(),Object.keys(He).forEach((function(e){e in t||(t[e]=He[e])})),
480
+ t.valid()&&(Xe.adapters[e]=t,n&&Xe.preferredAdapters.push(e))},Xe.plugin=function(e){if("function"==typeof e)// function style for plugins
481
+ e(Xe);else{if("object"!=typeof e||0===Object.keys(e).length)throw new Error('Invalid plugin: got "'+e+'", expected an object or a function');Object.keys(e).forEach((function(t){// object style for plugins
482
+ Xe.prototype[t]=e[t]}))}return this.__defaults&&(Xe.__defaults=$({},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.__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])})),
483
483
  // make default options transitive
484
484
  // https://github.com/pouchdb/pouchdb/issues/5922
485
- t.__defaults=D({},this.__defaults,e),t},He.fetch=function(e,t){return Ze(e,t)};var ot=["$or","$nor","$not"];function it(e){return ot.indexOf(e)>-1}function st(e){return Object.keys(e)[0]}
485
+ t.__defaults=$({},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 at(e){return Object.keys(e)[0]}
486
486
  // flatten an array of selectors joined by an $and operator
487
- function at(e){
487
+ function ut(e){
488
488
  // sort to ensure that e.g. if the user specified
489
489
  // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into
490
490
  // just {$gt: 'b'}
491
- var t={};return e.forEach((function(e){Object.keys(e).forEach((function(n){var r=e[n];if("object"!=typeof r&&(r={$eq:r}),it(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?
491
+ 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 ut([e])})):ut([r]);else{var o=t[n]=t[n]||{};Object.keys(r).forEach((function(e){var t=r[e];return"$gt"===e||"$gte"===e?
492
492
  // collapse logically equivalent gt/gte values
493
493
  function(e,t,n){void 0===n.$eq&&(// do nothing
494
494
  void 0!==n.$gte?"$gte"===e?t>n.$gte&&(// more specificity
@@ -518,32 +518,32 @@ t.$ne=[e]}
518
518
  // TODO: check for user errors here
519
519
  delete t.$gt,delete t.$gte,delete t.$lt,delete t.$lte,delete t.$ne,t.$eq=e}
520
520
  //#7458: execute function mergeAndedSelectors on nested $and
521
- (t,o):void(o[e]=t)}))}}))})),t}function ut(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&&ut(r)}return e}
521
+ (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]=ut(e[n].$and));var r=e[t];"object"==typeof r&&ct(r)}return e}
522
522
  //#7458: determine id $and is present in selector (at any level)
523
- function ct(e,t){for(var n in e){"$and"===n&&(t=!0);var r=e[n];"object"==typeof r&&(t=ct(r,t))}return t}
523
+ 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}
524
524
  // normalize the selector
525
- function ft(e){var t=b(e),n=!1;
525
+ function lt(e){var t=w(e),n=!1;
526
526
  //#7458: if $and is present in selector (at any level) merge nested $and
527
- ct(t,!1)&&("$and"in(t=ut(t))&&(t=at(t.$and)),n=!0),["$or","$nor"].forEach((function(e){e in t&&
527
+ ft(t,!1)&&("$and"in(t=ct(t))&&(t=ut(t.$and)),n=!0),["$or","$nor"].forEach((function(e){e in t&&
528
528
  // message each individual selector
529
529
  // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}}
530
530
  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&&(
531
531
  //This feels a little like forcing, but it will work for now,
532
532
  //I would like to come back to this and make the merging of selectors a little more generic
533
- 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&&(
533
+ t.$not=ut([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&&(
534
534
  // I put these in an array, since there may be more than one
535
535
  // but in the "mergeAnded" operation, I already take care of that
536
536
  s.$ne=[s.$ne]),t[i]=s}return t}// verified by -Number.MIN_VALUE
537
537
  // set to '_' for easier debugging
538
- function lt(e,t){if(e===t)return 0;e=dt(e),t=dt(t);var n=yt(e),r=yt(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){
538
+ 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){
539
539
  // See: https://github.com/daleharvey/pouchdb/issues/40
540
540
  // This is incompatible with the CouchDB implementation, but its the
541
541
  // best we can do for now
542
- 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=lt(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++){
542
+ 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++){
543
543
  // First sort the keys
544
- var s=lt(n[i],r[i]);if(0!==s)return s;
544
+ var s=dt(n[i],r[i]);if(0!==s)return s;
545
545
  // if the keys are equal sort the values
546
- if(0!==(s=lt(e[n[i]],t[r[i]])))return s}return n.length===r.length?0:n.length>r.length?1:-1}
546
+ if(0!==(s=dt(e[n[i]],t[r[i]])))return s}return n.length===r.length?0:n.length>r.length?1:-1}
547
547
  // The collation is defined by erlangs ordered terms
548
548
  // the atoms null, true, false come first, then numbers, strings,
549
549
  // arrays, then objects
@@ -551,13 +551,13 @@ if(0!==(s=lt(e[n[i]],t[r[i]])))return s}return n.length===r.length?0:n.length>r.
551
551
  (e,t)}
552
552
  // couch considers null/NaN/Infinity/-Infinity === undefined,
553
553
  // for the purposes of mapreduce indexes. also, dates get stringified.
554
- function dt(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]=dt(t[r]);
554
+ 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]);
555
555
  /* istanbul ignore next */}else{if(e instanceof Date)return e.toJSON();if(null!==e)for(var o in// generic object
556
- e={},t)if(t.hasOwnProperty(o)){var i=t[o];void 0!==i&&(e[o]=dt(i))}}}return e}
556
+ e={},t)if(t.hasOwnProperty(o)){var i=t[o];void 0!==i&&(e[o]=ht(i))}}}return e}
557
557
  // convert the given key to a string that would be appropriate
558
558
  // for lexical sorting, e.g. within a database, where the
559
559
  // sorting is the same given by the collate() function.
560
- function ht(e){return yt(e=dt(e))+""+function(e){if(null!==e)switch(typeof e){case"boolean":return e?1:0;case"number":
560
+ function pt(e){return gt(e=ht(e))+""+function(e){if(null!==e)switch(typeof e){case"boolean":return e?1:0;case"number":
561
561
  // conversion:
562
562
  // x yyy zz...zz
563
563
  // x = 0 for negative, 1 for 0, 2 for positive
@@ -566,15 +566,15 @@ function ht(e){return yt(e=dt(e))+""+function(e){if(null!==e)switch(typeof e){ca
566
566
  return function(e){if(0===e)return"1";
567
567
  // convert number to exponential format for easier and
568
568
  // more succinct string sorting
569
- var t,n=e.toExponential().split(/e\+?/),r=parseInt(n[1],10),o=e<0,i=o?"0":"2";i+=""+(function(e,t,n){
569
+ var t,n,r=e.toExponential().split(/e\+?/),o=parseInt(r[1],10),i=e<0,s=i?"0":"2",a=(n=function(e,t,n){
570
570
  /* istanbul ignore next */
571
- for(var r="",o=3-e.length;r.length<o;)r+="0";return r}(t=((o?-r:r)- -324).toString())+t);
571
+ for(var r="",o=3-e.length;r.length<o;)r+="0";return r}(t=((i?-o:o)- -324).toString()),n+t);s+=""+a;
572
572
  // then sort by the factor
573
- var s=Math.abs(parseFloat(n[0]));// [1..10)
574
- /* istanbul ignore next */o&&(// for negative reverse ordering
575
- s=10-s);var a=s.toFixed(20);
573
+ var u=Math.abs(parseFloat(r[0]));// [1..10)
574
+ /* istanbul ignore next */i&&(// for negative reverse ordering
575
+ u=10-u);var c=u.toFixed(20);
576
576
  // strip zeros from the end
577
- return i+""+a.replace(/\.?0+$/,"")}
577
+ return s+""+c.replace(/\.?0+$/,"")}
578
578
  // create a comparator based on the sort object
579
579
  (e);case"string":
580
580
  // We've to be sure that key does not contain \u0000
@@ -584,7 +584,7 @@ return i+""+a.replace(/\.?0+$/,"")}
584
584
  // 2 -> 2, 2
585
585
  /* eslint-disable no-control-regex */
586
586
  return e.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"");
587
- /* 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+=ht(n[r]);else for(;++r<o;){var s=n[r];i+=ht(s)+ht(e[s])}return i}return""}(e)+"\0"}function pt(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),a=parseInt(s,10)+-324;for(
587
+ /* 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),a=parseInt(s,10)+-324;for(
588
588
  /* istanbul ignore next */
589
589
  o&&(a=-a),t+=3;;){var u=e[t];if("\0"===u)break;i+=u,t++}n=1===(i=i.split(".")).length?parseInt(i,10):parseFloat(i[0]+"."+i[1])
590
590
  /* istanbul ignore next */,o&&(n-=10
@@ -595,89 +595,89 @@ o&&(a=-a),t+=3;;){var u=e[t];if("\0"===u)break;i+=u,t++}n=1===(i=i.split(".")).l
595
595
  n=parseFloat(n+"e"+a))}return{num:n,length:t-r}}
596
596
  // move up the stack while parsing
597
597
  // this function moved outside of parseIndexableString for performance
598
- function vt(e,t){var n=e.pop();if(t.length){var r=t[t.length-1];n===r.element&&(
598
+ function yt(e,t){var n=e.pop();if(t.length){var r=t[t.length-1];n===r.element&&(
599
599
  // popping a meta-element, e.g. an object whose value is another object
600
600
  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
601
- }}function yt(e){var t=["boolean","number","string","object"].indexOf(typeof e);
601
+ }}function gt(e){var t=["boolean","number","string","object"].indexOf(typeof e);
602
602
  //false if -1 otherwise true, but fast!!!!1
603
603
  return~t?null===e?1:Array.isArray(e)?5:t<3?t+2:t+3:
604
604
  /* istanbul ignore next */
605
- Array.isArray(e)?5:void 0}function gt(e,t,n){return n.every((function(n){var r=t[n],o=rt(n),i=nt(e,o);return it(n)?function(e,t,n){return"$or"===e?t.some((function(e){return gt(n,e,Object.keys(e))})):"$not"===e?!gt(n,t,Object.keys(t)):!t.find((function(e){return gt(n,e,Object.keys(e))}))}(n,r,e):_t(r,e,o,i)}))}function _t(e,t,n,r){return!e||(
605
+ 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||(
606
606
  // is matcher an object, if so continue recursion
607
- "object"==typeof e?Object.keys(e).every((function(o){var i=e[o];return function(e,t,n,r,o){if(!kt[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 kt[e](t,n,r,o)}(o,t,i,n,r)})):e===r)}function mt(e){return null!=e}function bt(e){return void 0!==e}function wt(e,t){return t.some((function(t){return e instanceof Array?e.indexOf(t)>-1:e===t}))}var kt={$elemMatch:function(e,t,n,r){return!!Array.isArray(r)&&0!==r.length&&("object"==typeof r[0]?r.some((function(e){return gt(e,t,Object.keys(t))})):r.some((function(r){return _t(t,e,n,r)})))},$allMatch:function(e,t,n,r){return!!Array.isArray(r)&&
607
+ "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)&&
608
608
  /* istanbul ignore next */
609
- 0!==r.length&&("object"==typeof r[0]?r.every((function(e){return gt(e,t,Object.keys(t))})):r.every((function(r){return _t(t,e,n,r)})))},$eq:function(e,t,n,r){return bt(r)&&0===lt(r,t)},$gte:function(e,t,n,r){return bt(r)&&lt(r,t)>=0},$gt:function(e,t,n,r){return bt(r)&&lt(r,t)>0},$lte:function(e,t,n,r){return bt(r)&&lt(r,t)<=0},$lt:function(e,t,n,r){return bt(r)&&lt(r,t)<0},$exists:function(e,t,n,r){
609
+ 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){
610
610
  //a field that is null is still considered to exist
611
- return t?bt(r):!bt(r)},$mod:function(e,t,n,r){return mt(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!==lt(r,e)}))},$in:function(e,t,n,r){return mt(r)&&wt(r,t)},$nin:function(e,t,n,r){return mt(r)&&!wt(r,t)},$size:function(e,t,n,r){return mt(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 mt(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)}};
611
+ 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)}};
612
612
  // return true if the given doc matches the supplied selector
613
- function jt(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 Ot(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=re(e.view):e.filter=re(e.filter))}function At(e,t){return t.filter&&"string"==typeof t.filter&&!t.doc_ids&&!te(e.db)}function qt(e,t){var n=t.complete;if("_view"===t.filter){if(!t.view||"string"!=typeof t.view){var r=Y(z,"`view` filter parameter not found or invalid.");return n(r)}
613
+ 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 At(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 qt(e,t){return t.filter&&"string"==typeof t.filter&&!t.doc_ids&&!ne(e.db)}function St(e,t){var n=t.complete;if("_view"===t.filter){if(!t.view||"string"!=typeof t.view){var r=H(V,"`view` filter parameter not found or invalid.");return n(r)}
614
614
  // fetch a view from a design doc, make it behave like a filter
615
- var o=ne(t.view);e.db.get("_design/"+o[0],(function(r,i){
615
+ var o=re(t.view);e.db.get("_design/"+o[0],(function(r,i){
616
616
  /* istanbul ignore if */
617
617
  if(e.isCancelled)return n(null,{status:"cancelled"});
618
- /* istanbul ignore next */if(r)return n(H(r));var s=i&&i.views&&i.views[o[1]]&&i.views[o[1]].map;if(!s)return n(Y(T,i.views?"missing json key: "+o[1]:"missing json key: views"));t.filter=ce(["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){
618
+ /* 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(B,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){
619
619
  /* istanbul ignore if */
620
620
  if("object"!=typeof t)
621
621
  // match the CouchDB error message
622
- throw new Error("Selector error: expected a JSON object");var n=function(e,t,n){if(e=e.filter((function(e){return gt(e.doc,t.selector,n)})),t.sort){
622
+ 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){
623
623
  // in-memory sort
624
- var r=function(e){function t(t){return e.map((function(e){var n=rt(st(e));return nt(t,n)}))}return function(e,n){var r,o,i=lt(t(e.doc),t(n.doc));return 0!==i?i:(r=e.doc._id)<(o=n.doc._id)?-1:r>o?1:0;
624
+ var r=function(e){function t(t){return e.map((function(e){var n=ot(at(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;
625
625
  // this is what mango seems to do
626
- }}(t.sort);e=e.sort(r),"string"!=typeof t.sort[0]&&"desc"===(o=t.sort[0])[st(o)]&&(e=e.reverse())}var o;if("limit"in t||"skip"in t){
626
+ }}(t.sort);e=e.sort(r),"string"!=typeof t.sort[0]&&"desc"===(o=t.sort[0])[at(o)]&&(e=e.reverse())}var o;if("limit"in t||"skip"in t){
627
627
  // have to do the limit in-memory
628
- 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=ft(t)},Object.keys(t));return n&&1===n.length}(e,t.selector)},e.doChanges(t);else{
628
+ 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{
629
629
  // fetch a filter from a design doc
630
- var i=ne(t.filter);e.db.get("_design/"+i[0],(function(r,o){
630
+ var i=re(t.filter);e.db.get("_design/"+i[0],(function(r,o){
631
631
  /* istanbul ignore if */
632
632
  if(e.isCancelled)return n(null,{status:"cancelled"});
633
- /* istanbul ignore next */if(r)return n(H(r));var s=o&&o.filters&&o.filters[i[1]];if(!s)return n(Y(T,o&&o.filters?"missing json key: "+i[1]:"missing json key: filters"));t.filter=ce('"use strict";\nreturn '+s+";",{}),e.doChanges(t)}))}}function St(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})}
633
+ /* istanbul ignore next */if(r)return n(X(r));var s=o&&o.filters&&o.filters[i[1]];if(!s)return n(H(B,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}),{})}
634
634
  // List of top level reserved words for doc
635
635
  // TODO: remove from pouchdb-core (breaking)
636
- He.plugin((function(e){e._changesFilterPlugin={validate:jt,normalize:Ot,shouldFilter:At,filter:qt}})),He.version="7.2.2";var xt=St(["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree",
636
+ Xe.plugin((function(e){e._changesFilterPlugin={validate:Ot,normalize:At,shouldFilter:qt,filter:St}})),Xe.version="7.2.2";var Et=xt(["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree",
637
637
  //replication documents
638
638
  "_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats",
639
639
  // Specific to Couchbase Sync Gateway
640
- "_removed"]),Et=St(["_attachments",
640
+ "_removed"]),Ct=xt(["_attachments",
641
641
  //replication documents
642
642
  "_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]);
643
643
  // List of reserved words that should end up the document
644
- function Ct(e){if(!/^\d+-/.test(e))return Y(Q);var t=e.indexOf("-"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:parseInt(n,10),id:r}}
644
+ function Pt(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}}
645
645
  // Preprocess documents, parse their revisions, assign an id and a
646
646
  // revision for new writes that are missing them, etc
647
- function Pt(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=qe()),o=Ae(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,[]]}]}ee(e._id),e._rev=r+"-"+o;var a={metadata:{},data:{}};for(var u in e)
647
+ function Lt(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=Se()),o=qe(e,n.deterministic_revs),e._rev){if((i=Pt(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=Pt(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 a={metadata:{},data:{}};for(var u in e)
648
648
  /* istanbul ignore else */
649
- if(Object.prototype.hasOwnProperty.call(e,u)){var c="_"===u[0];if(c&&!xt[u]){var f=Y(J,u);throw f.message=J.message+": "+u,f}c&&!Et[u]?a.metadata[u.slice(1)]=e[u]:a.data[u]=e[u]}return a}function Lt(e,t,n){if(e.stub)return n();"string"==typeof e.data?// input is a base64 string
650
- function(e,t,n){var r=function(e){try{return le(e)}catch(e){return{error:Y(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?ve(r,e.content_type):"base64"===t?de(r):r,je(r,(function(t){e.digest="md5-"+t,n()}))}(e,t,n):// input is a blob
651
- function(e,t,n){je(e.data,(function(r){e.digest="md5-"+r,
649
+ if(Object.prototype.hasOwnProperty.call(e,u)){var c="_"===u[0];if(c&&!Et[u]){var f=H(z,u);throw f.message=z.message+": "+u,f}c&&!Ct[u]?a.metadata[u.slice(1)]=e[u]:a.data[u]=e[u]}return a}function Dt(e,t,n){if(e.stub)return n();"string"==typeof e.data?// input is a base64 string
650
+ function(e,t,n){var r=function(e){try{return de(e)}catch(e){return{error:H(K,"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
651
+ function(e,t,n){Oe(e.data,(function(r){e.digest="md5-"+r,
652
652
  // size is for blobs (browser), length is for buffers (node)
653
- e.length=e.data.size||e.data.length||0,"binary"===t?_e(e.data,(function(t){e.data=t,n()})):"base64"===t?me(e.data,(function(t){e.data=t,n()})):n()}))}(e,t,n)}function Dt(e,t,n,r,o,s,a,u,c){
653
+ 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 $t(e,t,n,r,o,s,a,u,c){
654
654
  // Default to 1000 locally
655
- e=e||1e3;var f=u.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
655
+ e=e||1e3;var f=u.new_edits,l=new i,d=0,h=t.length;function p(){++d===h&&c&&c()}t.forEach((function(e,t){if(e._id&&Ke(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
656
656
  l.get(i).push([e,t])):l.set(i,[[e,t]])}})),
657
657
  // in the case of new_edits, the user can provide multiple docs
658
658
  // with the same id. these need to be processed sequentially
659
659
  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,a){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 a=n.ids[2],u=0,c=a.length;u<c;u++)r.push({pos:n.pos+1,ids:a[u]})}return!1}(t.rev_tree,n.metadata.rev)&&!a)return r[o]=n,i();
660
660
  // sometimes this is pre-calculated. historically not always
661
- var u=t.winningRev||Se(t),c="deleted"in t?t.deleted:Ne(t,u),f="deleted"in n.metadata?n.metadata.deleted:Ne(n.metadata),l=/^1-/.test(n.metadata.rev);if(c&&!f&&a&&l){var d=n.data;d._rev=u,d._id=n.metadata.id,n=Pt(d,a)}var h=Re(t.rev_tree,n.metadata.rev_tree[0],e);if(a&&(c&&f&&"new_leaf"!==h.conflicts||!c&&"new_leaf"!==h.conflicts||c&&!f&&"new_branch"===h.conflicts)){var p=Y(B);return r[o]=p,i()}var v=n.metadata.rev;n.metadata.rev_tree=h.tree,n.stemmedRevs=h.stemmedRevs||[],
661
+ var u=t.winningRev||xe(t),c="deleted"in t?t.deleted:Fe(t,u),f="deleted"in n.metadata?n.metadata.deleted:Fe(n.metadata),l=/^1-/.test(n.metadata.rev);if(c&&!f&&a&&l){var d=n.data;d._rev=u,d._id=n.metadata.id,n=Lt(d,a)}var h=Ue(t.rev_tree,n.metadata.rev_tree[0],e);if(a&&(c&&f&&"new_leaf"!==h.conflicts||!c&&"new_leaf"!==h.conflicts||c&&!f&&"new_branch"===h.conflicts)){var p=H(M);return r[o]=p,i()}var v=n.metadata.rev;n.metadata.rev_tree=h.tree,n.stemmedRevs=h.stemmedRevs||[],
662
662
  /* istanbul ignore else */
663
663
  t.rev_map&&(n.metadata.rev_map=t.rev_map);
664
664
  // recalculate
665
- var y=Se(n.metadata),g=Ne(n.metadata,y),_=c===g?0:c<g?-1:1;s(n,y,g,v===y?g:Ne(n.metadata,v),!0,_,o,i)}(e,r.get(n),l,s,d,i,a,f);else{
665
+ var y=xe(n.metadata),g=Fe(n.metadata,y),_=c===g?0:c<g?-1:1;s(n,y,g,v===y?g:Fe(n.metadata,v),!0,_,o,i)}(e,r.get(n),l,s,d,i,a,f);else{
666
666
  // Ensure stemming applies to new writes as well
667
- var h=Re([],l.metadata.rev_tree[0],e);l.metadata.rev_tree=h.tree,l.stemmedRevs=h.stemmedRevs||[],function(e,t,n){
667
+ var h=Ue([],l.metadata.rev_tree[0],e);l.metadata.rev_tree=h.tree,l.stemmedRevs=h.stemmedRevs||[],function(e,t,n){
668
668
  // Cant insert new deleted documents
669
- var r=Se(e.metadata),o=Ne(e.metadata,r);if("was_delete"in u&&o)return s[t]=Y(T,"deleted"),n();
669
+ var r=xe(e.metadata),o=Fe(e.metadata,r);if("was_delete"in u&&o)return s[t]=H(B,"deleted"),n();
670
670
  // 4712 - detect whether a new document was inserted with a _rev
671
- if(f&&function(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}(e)){var i=Y(B);return s[t]=i,n()}a(e,r,o,o,!1,o?0:1,t,n)}(l,d,i)}}c()}))}
671
+ var i=f&&function(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}(e);if(i){var c=H(M);return s[t]=c,n()}a(e,r,o,o,!1,o?0:1,t,n)}(l,d,i)}}c()}))}
672
672
  // IndexedDB requires a versioned database structure, so we use the
673
673
  // version here to manage migrations.
674
- var $t="document-store",It="by-sequence",Tt="attach-store",Bt="attach-seq-store",Mt="meta-store",Rt="local-store",Ut="detect-blob-support";
674
+ var It="document-store",Tt="by-sequence",Bt="attach-store",Mt="attach-seq-store",Rt="meta-store",Ut="local-store",Nt="detect-blob-support";
675
675
  // The object stores created for each database
676
676
  // DOC_STORE stores the document meta data, its revision history and state
677
677
  // Keyed by document id
678
- function Nt(e){try{return JSON.stringify(e)}catch(t){
678
+ function Ft(e){try{return JSON.stringify(e)}catch(t){
679
679
  /* istanbul ignore next */
680
- return c.stringify(e)}}function Ft(e){return function(t){var n="unknown_error";t.target&&t.target.error&&(n=t.target.error.name||t.target.error.message),e(Y(G,n,t.type))}}
680
+ return c.stringify(e)}}function Kt(e){return function(t){var n="unknown_error";t.target&&t.target.error&&(n=t.target.error.name||t.target.error.message),e(H(Q,n,t.type))}}
681
681
  // Unfortunately, the metadata has to be stringified
682
682
  // when it is put into the database, because otherwise
683
683
  // IndexedDB can throw errors for deeply-nested objects.
@@ -685,8 +685,8 @@ return c.stringify(e)}}function Ft(e){return function(t){var n="unknown_error";t
685
685
  // we use this custom vuvuzela library that avoids recursion.
686
686
  // If we could do it all over again, we'd probably use a
687
687
  // format for the revision trees other than JSON.
688
- function Kt(e,t,n){return{data:Nt(e),winningRev:t,deletedOrLocal:n?"1":"0",seq:e.seq,// highest seq for this doc
689
- id:e.id}}function Jt(e){if(!e)return null;var t=function(e){
688
+ function Jt(e,t,n){return{data:Ft(e),winningRev:t,deletedOrLocal:n?"1":"0",seq:e.seq,// highest seq for this doc
689
+ id:e.id}}function zt(e){if(!e)return null;var t=function(e){
690
690
  // This try/catch guards against stack overflow errors.
691
691
  // JSON.parse() is faster than vuvuzela.parse() but vuvuzela
692
692
  // cannot overflow.
@@ -695,33 +695,33 @@ try{return JSON.parse(e)}catch(t){
695
695
  return c.parse(e)}}(e.data);return t.winningRev=e.winningRev,t.deleted="1"===e.deletedOrLocal,t.seq=e.seq,t}
696
696
  // read the doc back out from the database. we don't store the
697
697
  // _id or _rev because we already have _doc_id_rev.
698
- function zt(e){if(!e)return e;var t=e._doc_id_rev.lastIndexOf(":");return e._id=e._doc_id_rev.substring(0,t-1),e._rev=e._doc_id_rev.substring(t+1),delete e._doc_id_rev,e}
698
+ function Vt(e){if(!e)return e;var t=e._doc_id_rev.lastIndexOf(":");return e._id=e._doc_id_rev.substring(0,t-1),e._rev=e._doc_id_rev.substring(t+1),delete e._doc_id_rev,e}
699
699
  // Read a blob from the database, encoding as necessary
700
700
  // and translating from base64 if the IDB doesn't support
701
701
  // native Blobs
702
- function Vt(e,t,n,r){n?// we have blob support
703
- r(e?"string"!=typeof e?e:ye(e,t):he([""],{type:t})):// as base64 string
702
+ function Gt(e,t,n,r){n?// we have blob support
703
+ r(e?"string"!=typeof e?e:ge(e,t):pe([""],{type:t})):// as base64 string
704
704
  e?"string"!=typeof e?// we have blob support
705
- ge(e,(function(e){r(de(e))})):// no blob support
706
- r(e):r("")}function Gt(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(Tt).get(o).onsuccess=function(e){r.body=e.target.result.body,s()}}(e,r):(e._attachments[r].stub=!0,s())}))}
705
+ _e(e,(function(e){r(he(e))})):// no blob support
706
+ 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(Bt).get(o).onsuccess=function(e){r.body=e.target.result.body,s()}}(e,r):(e._attachments[r].stub=!0,s())}))}
707
707
  // IDB-specific postprocessing necessary because
708
708
  // we don't know whether we stored a true Blob or
709
709
  // a base64-encoded string, and if it's a Blob it
710
710
  // needs to be read outside of the transaction context
711
- function Qt(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){Vt(o,i,t,(function(t){e.doc._attachments[n]=D(O(r,["digest","content_type"]),{data:t}),s()}))}))}})))}})))}function Wt(e,t,n){var r=[],o=n.objectStore(It),i=n.objectStore(Tt),s=n.objectStore(Bt),a=e.length;function u(){--a||r.length&&r.forEach((function(e){s.index("digestSeq").count(IDBKeyRange.bound(e+"::",e+"::￿",!1,!1)).onsuccess=function(t){t.target.result||
711
+ 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]=$(A(r,["digest","content_type"]),{data:t}),s()}))}))}})))}})))}function Yt(e,t,n){var r=[],o=n.objectStore(Tt),i=n.objectStore(Bt),s=n.objectStore(Mt),a=e.length;function u(){--a||r.length&&r.forEach((function(e){s.index("digestSeq").count(IDBKeyRange.bound(e+"::",e+"::￿",!1,!1)).onsuccess=function(t){t.target.result||
712
712
  // orphaned
713
713
  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 u();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
714
- u()}}}))}function Yt(e,t,n){try{return{txn:e.transaction(t,n)}}catch(e){return{error:e}}}var Ht=new E;function Xt(e,t,n,r,o,s){for(var a,u,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]=Pt(_,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 A(){m=!0,q()}function q(){p&&m&&(
714
+ u()}}}))}function Ht(e,t,n){try{return{txn:e.transaction(t,n)}}catch(e){return{error:e}}}var Xt=new C;function Zt(e,t,n,r,o,s){for(var a,u,c,f,l,d,h,p,v=t.docs,y=0,g=v.length;y<g;y++){var _=v[y];_._id&&Ke(_._id)||(_=v[y]=Lt(_,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 A(){m=!0,q()}function q(){p&&m&&(
715
715
  // caching the docCount saves a lot of time in allDocs() and
716
716
  // info(), which is why we go to all the trouble of doing this
717
- p.docCount+=b,d.put(p))}function S(){j||(Ht.notify(r._meta.name),s(null,w))}function x(e,t,n,r,o,i,s,a){e.metadata.winningRev=t,e.metadata.deleted=n;var u=e.data;if(u._id=e.metadata.id,u._rev=e.metadata.rev,r&&(u._deleted=!0),u._attachments&&Object.keys(u._attachments).length)return function(e,t,n,r,o,i){var s=e.data,a=0,u=Object.keys(s._attachments);function c(){a===u.length&&E(e,t,n,r,o,i)}function l(){a++,c()}u.forEach((function(n){var r=e.data._attachments[n];if(r.stub)a++,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
717
+ p.docCount+=b,d.put(p))}function S(){j||(Xt.notify(r._meta.name),s(null,w))}function x(e,t,n,r,o,i,s,a){e.metadata.winningRev=t,e.metadata.deleted=n;var u=e.data;if(u._id=e.metadata.id,u._rev=e.metadata.rev,r&&(u._deleted=!0),u._attachments&&Object.keys(u._attachments).length)return function(e,t,n,r,o,i){var s=e.data,a=0,u=Object.keys(s._attachments);function c(){a===u.length&&E(e,t,n,r,o,i)}function l(){a++,c()}u.forEach((function(n){var r=e.data._attachments[n];if(r.stub)a++,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
718
718
  var o={digest:e,body:t};f.put(o).onsuccess=n}}(r.digest,o,l)}}))}
719
719
  // map seqs to attachment digests, which
720
720
  // we will need later during compaction
721
- (e,t,n,o,s,a);b+=i,q(),E(e,t,n,o,s,a)}function E(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 xe(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&&Wt(s,e.metadata.id,a),d.seq=i.target.result;
721
+ (e,t,n,o,s,a);b+=i,q(),E(e,t,n,o,s,a)}function E(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 Ee(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,a),d.seq=i.target.result;
722
722
  // Current _rev is calculated from _rev_tree on read
723
723
  // delete metadata.rev;
724
- var c=Kt(d,t,n);u.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){
724
+ var c=Jt(d,t,n);u.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){
725
725
  // this callback is for a constaint error, which we ignore
726
726
  // because this docid/rev has already been associated with
727
727
  // the digest (e.g. when new_edits == false)
@@ -731,12 +731,12 @@ i()}}for(var a=0;a<o.length;a++)s(o[a]);// do in parallel
731
731
  }(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){
732
732
  // ConstraintError, need to update, not put (see #1638 for details)
733
733
  e.preventDefault(),// avoid transaction abort
734
- 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 a in e.data._attachments)e.data._attachments.hasOwnProperty(a)&&Lt(e.data._attachments[a],t,s)}))}(v,O,(function(t){if(t)return s(t);!function(){var t=Yt(o,[$t,It,Tt,Rt,Bt,Mt],"readwrite");if(t.error)return s(t.error);(a=t.txn).onabort=Ft(s),a.ontimeout=Ft(s),a.oncomplete=S,u=a.objectStore($t),c=a.objectStore(It),f=a.objectStore(Tt),l=a.objectStore(Bt),(d=a.objectStore(Mt)).get(Mt).onsuccess=function(e){p=e.target.result,q()},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=Y(W,"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():u.get(s.metadata.id).onsuccess=f}function c(){++t===v.length&&Dt(e.revs_limit,v,r,k,a,w,x,n,A)}function f(e){var t=Jt(e.target.result);t&&k.set(t.id,t),c()}}()}))}()}))}
734
+ 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 a in e.data._attachments)e.data._attachments.hasOwnProperty(a)&&Dt(e.data._attachments[a],t,s)}))}(v,O,(function(t){if(t)return s(t);!function(){var t=Ht(o,[It,Tt,Bt,Ut,Mt,Rt],"readwrite");if(t.error)return s(t.error);(a=t.txn).onabort=Kt(s),a.ontimeout=Kt(s),a.oncomplete=S,u=a.objectStore(It),c=a.objectStore(Tt),f=a.objectStore(Bt),l=a.objectStore(Mt),(d=a.objectStore(Rt)).get(Rt).onsuccess=function(e){p=e.target.result,q()},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&&Ke(s._id)?c():u.get(s.metadata.id).onsuccess=f}function c(){++t===v.length&&$t(e.revs_limit,v,r,k,a,w,x,n,A)}function f(e){var t=zt(e.target.result);t&&k.set(t.id,t),c()}}()}))}()}))}
735
735
  // Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations
736
736
  // while falling back to a normal IDBCursor operation on browsers that don't support getAll() or
737
737
  // getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because
738
738
  // we're not processing each document one-at-a-time.
739
- function Zt(e,t,n,r,o){
739
+ function en(e,t,n,r,o){
740
740
  // Bail out of getAll()/getAllKeys() in the following cases:
741
741
  // 1) either method is unsupported - we need both
742
742
  // 2) batchSize is 1 (might as well use IDBCursor)
@@ -750,20 +750,20 @@ return o();
750
750
  var n,a=i[i.length-1];if(t&&t.upper)try{n=IDBKeyRange.bound(a,t.upper,!0,t.upperOpen)}catch(e){if("DataError"===e.name&&0===e.code)return o();// we're done, startkey and endkey are equal
751
751
  }else n=IDBKeyRange.lowerBound(a,!0);t=n,i=null,s=null,e.getAll(t,r).onsuccess=u,e.getAllKeys(t,r).onsuccess=c}},e.getAll(t,r).onsuccess=u,e.getAllKeys(t,r).onsuccess=c):n?e.openCursor(t,"prev").onsuccess=f:e.openCursor(t).onsuccess=f}
752
752
  // simple shim for objectStore.getAll(), falling back to IDBCursor
753
- function en(e,t,n){var r,o,i="startkey"in e&&e.startkey,s="endkey"in e&&e.endkey,a="key"in e&&e.key,u="keys"in e&&e.keys,c=e.skip||0,f="number"==typeof e.limit?e.limit:-1,l=!1!==e.inclusive_end;if(!u&&(o=(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,a,e.descending))&&r.error)&&("DataError"!==o.name||0!==o.code))
753
+ function tn(e,t,n){var r,o,i="startkey"in e&&e.startkey,s="endkey"in e&&e.endkey,a="key"in e&&e.key,u="keys"in e&&e.keys,c=e.skip||0,f="number"==typeof e.limit?e.limit:-1,l=!1!==e.inclusive_end;if(!u&&(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,a,e.descending),(o=r&&r.error)&&("DataError"!==o.name||0!==o.code)))
754
754
  // DataError with error code 0 indicates start is less than end, so
755
755
  // can just do an empty query. Else need to throw
756
- return n(Y(G,o.name,o.message));var d=[$t,It,Mt];e.attachments&&d.push(Tt);var h=Yt(t,d,"readonly");if(h.error)return n(h.error);var p=h.txn;p.oncomplete=function(){e.attachments?Qt(w,e.binary).then(A):A()}
756
+ return n(H(Q,o.name,o.message));var d=[It,Tt,Rt];e.attachments&&d.push(Bt);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(A):A()}
757
757
  // don't bother doing any requests if start > end or limit === 0
758
- ,p.onabort=Ft(n);var v,y,g=p.objectStore($t),_=p.objectStore(It),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?u&&(w.push(r),
758
+ ,p.onabort=Kt(n);var v,y,g=p.objectStore(It),_=p.objectStore(Tt),m=p.objectStore(Rt),b=_.index("_doc_id_rev"),w=[];function k(t,n){var r={id:n.id,key:n.id,value:{rev:t}};n.deleted?u&&(w.push(r),
759
759
  // deleted docs are okay with "keys" requests
760
760
  r.value.deleted=!0,r.doc=null):c--<=0&&(w.push(r),e.include_docs&&
761
761
  // if the user specifies include_docs=true, then we don't
762
762
  // want to block the main cursor while we're fetching the doc
763
- 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=Pe(t);o.length&&(n.doc._conflicts=o)}Gt(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&&u)
763
+ function(t,n,r){var o=t.id+"::"+r;b.get(o).onsuccess=function(r){if(n.doc=Vt(r.target.result)||{},e.conflicts){var o=Le(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&&u)
764
764
  // key was not found with "keys" requests
765
- w.push(r);else{var o=Jt(r);k(o.winningRev,o)}}}function O(e,t,n){n&&(j(t),w.length<f&&n.continue())}function A(){var t={total_rows:v,offset:e.skip,rows:w};
766
- /* 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},
765
+ w.push(r);else{var o=zt(r);k(o.winningRev,o)}}}function O(e,t,n){n&&(j(t),w.length<f&&n.continue())}function A(){var t={total_rows:v,offset:e.skip,rows:w};
766
+ /* istanbul ignore if */e.update_seq&&void 0!==y&&(t.update_seq=y),n(null,t)}return m.get(Rt).onsuccess=function(e){v=e.target.result.docCount},
767
767
  /* istanbul ignore if */
768
768
  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:u?function(e,t,n){
769
769
  // It's not guaranted to be returned in right order
@@ -774,7 +774,7 @@ var r=[];e.openCursor(t).onsuccess=function(e){var t=e.target.result;t?(r.push(t
774
774
  e.getAll(t).onsuccess=n}(g,r,(function(t){var n=t.target.result;e.descending&&(n=n.reverse()),j(n)})):
775
775
  // else do a cursor
776
776
  // choose a batch size based on the skip, since we'll need to skip that many
777
- void Zt(g,r,e.descending,f+c,O)}
777
+ void en(g,r,e.descending,f+c,O)}
778
778
  // Blobs are not supported in all versions of IndexedDB, notably
779
779
  // Chrome <37 and Android <5. In those versions, storing a blob will throw.
780
780
  // Various other blob bugs exist in Chrome v37-42 (inclusive).
@@ -784,38 +784,38 @@ void Zt(g,r,e.descending,f+c,O)}
784
784
  // 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916
785
785
  // FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836
786
786
  // This task queue ensures that IDB open calls are done in their own tick
787
- var tn=!1,nn=[];function rn(){!tn&&nn.length&&(tn=!0,nn.shift()())}function on(e,t,n,r){if((e=b(e)).continuous){var s=n+":"+qe();return Ht.addListener(n,s,t,e),Ht.notify(n),{cancel:function(){Ht.removeListener(n,s)}}}var a=e.doc_ids&&new o(e.doc_ids);e.since=e.since||0;var u=e.since,c="limit"in e?e.limit:-1;0===c&&(c=1);var f,l,d,h,p=[],v=0,y=X(e),g=new i;function _(e,t,n,r){if(n.seq!==t)
787
+ 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+":"+Se();return Xt.addListener(n,s,t,e),Xt.notify(n),{cancel:function(){Xt.removeListener(n,s)}}}var a=e.doc_ids&&new o(e.doc_ids);e.since=e.since||0;var u=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)
788
788
  // some other seq is later
789
789
  return r();if(n.winningRev===e._rev)
790
790
  // this is the winning doc
791
791
  return r(n,e);
792
792
  // fetch winning doc in separate request
793
- 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:u})}var w=[$t,It];e.attachments&&w.push(Tt);var k=Yt(r,w,"readonly");if(k.error)return e.complete(k.error);(f=k.txn).onabort=Ft(e.complete),f.oncomplete=function(){!e.continuous&&e.attachments?
793
+ var o=e._id+"::"+n.winningRev;h.get(o).onsuccess=function(e){r(n,Vt(e.target.result))}}function m(){e.complete(null,{results:p,last_seq:u})}var b=[It,Tt];e.attachments&&b.push(Bt);var k=Ht(r,b,"readonly");if(k.error)return e.complete(k.error);(f=k.txn).onabort=Kt(e.complete),f.oncomplete=function(){!e.continuous&&e.attachments?
794
794
  // cannot guarantee that postProcessing was already done,
795
795
  // so do it again
796
- Qt(p).then(m):m()},l=f.objectStore(It),d=f.objectStore($t),h=l.index("_doc_id_rev"),Zt(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,u){!function(e,t,n){if(a&&!a.has(e._id))return n();var r=g.get(e._id);if(r)// cached
796
+ Wt(p).then(m):m()},l=f.objectStore(Tt),d=f.objectStore(It),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,u){!function(e,t,n){if(a&&!a.has(e._id))return n();var r=g.get(e._id);if(r)// cached
797
797
  return _(e,t,r,n);
798
798
  // metadata not cached, have to go fetch it
799
- d.get(e._id).onsuccess=function(o){r=Jt(o.target.result),g.set(e._id,r),_(e,t,r,n)}}(zt(n),t[u],(function(n,a){i[u]=n,o[u]=a,++s===t.length&&function(){for(var t=[],n=0,s=o.length;n<s&&v!==c;n++){var a=o[n];if(a){var u=i[n];t.push(l(u,a))}}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()}
799
+ d.get(e._id).onsuccess=function(o){r=zt(o.target.result),g.set(e._id,r),_(e,t,r,n)}}(Vt(n),t[u],(function(n,a){i[u]=n,o[u]=a,++s===t.length&&function(){for(var t=[],n=0,s=o.length;n<s&&v!==c;n++){var a=o[n];if(a){var u=i[n];t.push(l(u,a))}}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()}
800
800
  // Fetch all metadatas/winningdocs from this batch in parallel, then process
801
801
  // them all only once all data has been collected. This is done in parallel
802
802
  // because it's faster than doing it one-at-a-time.
803
803
  ()}))}))}function l(t,n){var r=e.processChange(n,t,e);u=r.seq=t.seq;var o=y(r);return"object"==typeof o?Promise.reject(o):o?(v++,e.return_docs&&p.push(r),
804
804
  // process the attachment immediately
805
805
  // for the benefit of live listeners
806
- e.attachments&&e.include_docs?new Promise((function(t){Gt(n,e,f,(function(){Qt([r],e.binary).then((function(){t(r)}))}))})):Promise.resolve(r)):Promise.resolve()}}))}var sn,an=new i,un=new i;function cn(e,t){var n=this;!function(e,t,n){nn.push((function(){e((function(e,r){!function(e,t,n,r){try{e(t,n)}catch(t){
806
+ 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 an,un=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){
807
807
  // Shouldn't happen, but in some odd cases
808
808
  // IndexedDB implementations might throw a sync
809
809
  // error, in which case this will at least log it.
810
- r.emit("error",t)}}(t,e,r,n),tn=!1,s((function(){rn()}))}))})),rn()}((function(t){!function(e,t,n){var r=t.name,o=null;
810
+ 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;
811
811
  // called when creating a fresh new database
812
812
  // migration to version 2
813
813
  // unfortunately "deletedOrLocal" is a misnomer now that we no longer
814
814
  // store local docs in the main doc-store, but whaddyagonnado
815
- function i(e,t){var n=e.objectStore($t);n.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=r.value,i=Ne(o);o.deletedOrLocal=i?"1":"0",n.put(o),r.continue()}else t()}}
815
+ function i(e,t){var n=e.objectStore(It);n.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=r.value,i=Fe(o);o.deletedOrLocal=i?"1":"0",n.put(o),r.continue()}else t()}}
816
816
  // migration to version 3 (part 1)
817
817
  // migration to version 3 (part 2)
818
- function a(e,t){var n=e.objectStore(Rt),r=e.objectStore($t),o=e.objectStore(It);r.openCursor().onsuccess=function(e){var i=e.target.result;if(i){var s=i.value,a=s.id,u=Fe(a),c=Se(s);if(u){var f=a+"::"+c,l=a+"::",d=a+"::~",h=o.index("_doc_id_rev"),p=IDBKeyRange.bound(l,d,!1,!1),v=h.openCursor(p);
818
+ function a(e,t){var n=e.objectStore(Ut),r=e.objectStore(It),o=e.objectStore(Tt);r.openCursor().onsuccess=function(e){var i=e.target.result;if(i){var s=i.value,a=s.id,u=Ke(a),c=xe(s);if(u){var f=a+"::"+c,l=a+"::",d=a+"::~",h=o.index("_doc_id_rev"),p=IDBKeyRange.bound(l,d,!1,!1),v=h.openCursor(p);
819
819
  // remove all seq entries
820
820
  // associated with this docId
821
821
  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
@@ -823,7 +823,7 @@ v.onsuccess=function(e){if(v=e.target.result){var t=v.value;t._doc_id_rev===f&&n
823
823
  r.delete(i.primaryKey),i.continue()}}else i.continue()}else t&&t()}}
824
824
  // migration to version 4 (part 1)
825
825
  // migration to version 4 (part 2)
826
- function u(e,t){var n=e.objectStore(It),r=e.objectStore(Tt),o=e.objectStore(Bt);r.count().onsuccess=function(e){if(!e.target.result)return t();// done
826
+ function u(e,t){var n=e.objectStore(Tt),r=e.objectStore(Bt),o=e.objectStore(Mt);r.count().onsuccess=function(e){if(!e.target.result)return t();// done
827
827
  n.openCursor().onsuccess=function(e){var n=e.target.result;if(!n)return t();// done
828
828
  for(var r=n.value,i=n.primaryKey,s=Object.keys(r._attachments||{}),a={},u=0;u<s.length;u++)a[r._attachments[s[u]].digest]=!0;var c=Object.keys(a);for(u=0;u<c.length;u++){var f=c[u];o.put({seq:i,digestSeq:f+"::"+i})}n.continue()}}}
829
829
  // migration to version 5
@@ -835,85 +835,85 @@ for(var r=n.value,i=n.primaryKey,s=Object.keys(r._attachments||{}),a={},u=0;u<s.
835
835
  function c(e){
836
836
  // ensure that every metadata has a winningRev and seq,
837
837
  // which was previously created on-the-fly but better to migrate
838
- var t=e.objectStore(It),n=e.objectStore($t);n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=function(e){return e.data?Jt(e):(
838
+ var t=e.objectStore(Tt),n=e.objectStore(It);n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=function(e){return e.data?zt(e):(
839
839
  // old format, when we didn't store it stringified
840
- e.deleted="1"===e.deletedOrLocal,e)}(r.value);if(o.winningRev=o.winningRev||Se(o),o.seq)return i();!function(){
840
+ e.deleted="1"===e.deletedOrLocal,e)}(r.value);if(o.winningRev=o.winningRev||xe(o),o.seq)return i();!function(){
841
841
  // metadata.seq was added post-3.2.0, so if it's missing,
842
842
  // we need to fetch it manually
843
- 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=Kt(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=k((function(t){t(null,e._meta.instanceId)})),e._bulkDocs=function(n,r,i){Xt(t,n,r,e,o,i)},
843
+ 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)},
844
844
  // First we look up the metadata in the ids database, then we fetch the
845
845
  // current revision(s) from the by sequence store
846
- e._get=function(e,t,n){var r,i,s,a=t.ctx;if(!a){var u=Yt(o,[$t,It,Tt],"readonly");if(u.error)return n(u.error);a=u.txn}function c(){n(s,{doc:r,metadata:i,ctx:a})}a.objectStore($t).get(e).onsuccess=function(e){
846
+ e._get=function(e,t,n){var r,i,s,a=t.ctx;if(!a){var u=Ht(o,[It,Tt,Bt],"readonly");if(u.error)return n(u.error);a=u.txn}function c(){n(s,{doc:r,metadata:i,ctx:a})}a.objectStore(It).get(e).onsuccess=function(e){
847
847
  // we can determine the result here if:
848
848
  // 1. there is no such document
849
849
  // 2. the document is deleted and we don't ask about specific rev
850
850
  // When we ask with opts.rev we expect the answer to be either
851
851
  // doc (possibly with _deleted=true) or missing error
852
- if(!(i=Jt(e.target.result)))return s=Y(T,"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],a=i[1],u=i[2],c=0===u.length,f=n.history?n.history.slice():[];if(f.push({id:s,pos:o,opts:a}),c)for(var l=0,d=f.length;l<d;l++){var h=f[l];if(h.pos+"-"+h.id===e)
852
+ if(!(i=zt(e.target.result)))return s=H(B,"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],a=i[1],u=i[2],c=0===u.length,f=n.history?n.history.slice():[];if(f.push({id:s,pos:o,opts:a}),c)for(var l=0,d=f.length;l<d;l++){var h=f[l];if(h.pos+"-"+h.id===e)
853
853
  // return the rev of this leaf
854
854
  return o+"-"+s}for(var p=0,v=u.length;p<v;p++)r.push({pos:o+1,ids:u[p],history:f})}
855
- /* 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,Ne(i))return s=Y(T,"deleted"),c();var o=a.objectStore(It),u=i.id+"::"+n;o.index("_doc_id_rev").get(u).onsuccess=function(e){if((r=e.target.result)&&(r=zt(r)),!r)return s=Y(T,"missing"),c();c()}}},e._getAttachment=function(e,t,n,r,i){var s;if(r.ctx)s=r.ctx;else{var a=Yt(o,[$t,It,Tt],"readonly");if(a.error)return i(a.error);s=a.txn}var u=n.digest,c=n.content_type;s.objectStore(Tt).get(u).onsuccess=function(e){Vt(e.target.result.body,c,r.binary,(function(e){i(null,e)}))}},e._info=function(t){var n,r,i=Yt(o,[Mt,It],"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(It).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,
855
+ /* 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,Fe(i))return s=H(B,"deleted"),c();var o=a.objectStore(Tt),u=i.id+"::"+n;o.index("_doc_id_rev").get(u).onsuccess=function(e){if((r=e.target.result)&&(r=Vt(r)),!r)return s=H(B,"missing"),c();c()}}},e._getAttachment=function(e,t,n,r,i){var s;if(r.ctx)s=r.ctx;else{var a=Ht(o,[It,Tt,Bt],"readonly");if(a.error)return i(a.error);s=a.txn}var u=n.digest,c=n.content_type;s.objectStore(Bt).get(u).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,[Rt,Tt],"readonly");if(i.error)return t(i.error);var s=i.txn;s.objectStore(Rt).get(Rt).onsuccess=function(e){r=e.target.result.docCount},s.objectStore(Tt).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,
856
856
  // for debugging
857
- idb_attachment_format:e._meta.blobSupport?"binary":"base64"})}},e._allDocs=function(e,t){en(e,o,t)},e._changes=function(t){return on(t,e,r,o)},e._close=function(e){
857
+ 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){
858
858
  // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close
859
859
  // "Returns immediately and closes the connection in a separate thread..."
860
- o.close(),an.delete(r),e()},e._getRevisionTree=function(e,t){var n=Yt(o,[$t],"readonly");if(n.error)return t(n.error);n.txn.objectStore($t).get(e).onsuccess=function(e){var n=Jt(e.target.result);n?t(null,n.rev_tree):t(Y(T))}},
860
+ o.close(),un.delete(r),e()},e._getRevisionTree=function(e,t){var n=Ht(o,[It],"readonly");if(n.error)return t(n.error);n.txn.objectStore(It).get(e).onsuccess=function(e){var n=zt(e.target.result);n?t(null,n.rev_tree):t(H(B))}},
861
861
  // This function removes revisions of document docId
862
862
  // which are listed in revs and sets this document
863
863
  // revision to to rev_tree
864
- e._doCompaction=function(e,t,n){var r=Yt(o,[$t,It,Tt,Bt],"readwrite");if(r.error)return n(r.error);var i=r.txn;i.objectStore($t).get(e).onsuccess=function(n){var r=Jt(n.target.result);xe(r.rev_tree,(function(e,n,r,o,i){var s=n+"-"+r;-1!==t.indexOf(s)&&(i.status="missing")})),Wt(t,e,i);var o=r.winningRev,s=r.deleted;i.objectStore($t).put(Kt(r,o,s))},i.onabort=Ft(n),i.oncomplete=function(){n()}},e._getLocal=function(e,t){var n=Yt(o,[Rt],"readonly");if(n.error)return t(n.error);var r=n.txn.objectStore(Rt).get(e);r.onerror=Ft(t),r.onsuccess=function(e){var n=e.target.result;n?(delete n._doc_id_rev,// for backwards compat
865
- t(null,n)):t(Y(T))}},e._putLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),delete e._revisions;// ignore this, trust the rev
866
- var r=e._rev,i=e._id;e._rev=r?"0-"+(parseInt(r.split("-")[1],10)+1):"0-1";var s,a=t.ctx;if(!a){var u=Yt(o,[Rt],"readwrite");if(u.error)return n(u.error);(a=u.txn).onerror=Ft(n),a.oncomplete=function(){s&&n(null,s)}}var c,f=a.objectStore(Rt);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
867
- n(null,s)}:n(Y(B))}:(// new doc
864
+ e._doCompaction=function(e,t,n){var r=Ht(o,[It,Tt,Bt,Mt],"readwrite");if(r.error)return n(r.error);var i=r.txn;i.objectStore(It).get(e).onsuccess=function(n){var r=zt(n.target.result);Ee(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(It).put(Jt(r,o,s))},i.onabort=Kt(n),i.oncomplete=function(){n()}},e._getLocal=function(e,t){var n=Ht(o,[Ut],"readonly");if(n.error)return t(n.error);var r=n.txn.objectStore(Ut).get(e);r.onerror=Kt(t),r.onsuccess=function(e){var n=e.target.result;n?(delete n._doc_id_rev,// for backwards compat
865
+ t(null,n)):t(H(B))}},e._putLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),delete e._revisions;// ignore this, trust the rev
866
+ var r=e._rev,i=e._id;e._rev=r?"0-"+(parseInt(r.split("-")[1],10)+1):"0-1";var s,a=t.ctx;if(!a){var u=Ht(o,[Ut],"readwrite");if(u.error)return n(u.error);(a=u.txn).onerror=Kt(n),a.oncomplete=function(){s&&n(null,s)}}var c,f=a.objectStore(Ut);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
867
+ n(null,s)}:n(H(M))}:(// new doc
868
868
  (c=f.add(e)).onerror=function(e){
869
869
  // constraint error, already exists
870
- n(Y(B)),e.preventDefault(),// avoid transaction abort
870
+ n(H(M)),e.preventDefault(),// avoid transaction abort
871
871
  e.stopPropagation()},c.onsuccess=function(){s={ok:!0,id:e._id,rev:e._rev},t.ctx&&// return immediately
872
- n(null,s)})},e._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={});var r,i=t.ctx;if(!i){var s=Yt(o,[Rt],"readwrite");if(s.error)return n(s.error);(i=s.txn).oncomplete=function(){r&&n(null,r)}}var a=e._id,u=i.objectStore(Rt),c=u.get(a);c.onerror=Ft(n),c.onsuccess=function(o){var i=o.target.result;i&&i._rev===e._rev?(u.delete(a),r={ok:!0,id:a,rev:"0-0"},t.ctx&&// return immediately
873
- n(null,r)):n(Y(T))}},e._destroy=function(e,t){Ht.removeAllListeners(r);
872
+ 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,[Ut],"readwrite");if(s.error)return n(s.error);(i=s.txn).oncomplete=function(){r&&n(null,r)}}var a=e._id,u=i.objectStore(Ut),c=u.get(a);c.onerror=Kt(n),c.onsuccess=function(o){var i=o.target.result;i&&i._rev===e._rev?(u.delete(a),r={ok:!0,id:a,rev:"0-0"},t.ctx&&// return immediately
873
+ n(null,r)):n(H(B))}},e._destroy=function(e,t){Xt.removeAllListeners(r);
874
874
  //Close open request for "dbName" database to fix ie delay.
875
- var n=un.get(r);n&&n.result&&(n.result.close(),an.delete(r));var o=indexedDB.deleteDatabase(r);o.onsuccess=function(){
875
+ var n=cn.get(r);n&&n.result&&(n.result.close(),un.delete(r));var o=indexedDB.deleteDatabase(r);o.onsuccess=function(){
876
876
  //Remove open request from the list.
877
- un.delete(r),x()&&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);un.set(r,l),l.onupgradeneeded=function(e){var t=e.target.result;if(e.oldVersion<1)return function(e){var t=e.createObjectStore($t,{keyPath:"id"});e.createObjectStore(It,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),e.createObjectStore(Tt,{keyPath:"digest"}),e.createObjectStore(Mt,{keyPath:"id",autoIncrement:!1}),e.createObjectStore(Ut),
877
+ cn.delete(r),E()&&r in localStorage&&delete localStorage[r],t(null,{ok:!0})},o.onerror=Kt(t)};var f=un.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(It,{keyPath:"id"});e.createObjectStore(Tt,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),e.createObjectStore(Bt,{keyPath:"digest"}),e.createObjectStore(Rt,{keyPath:"id",autoIncrement:!1}),e.createObjectStore(Nt),
878
878
  // added in v2
879
879
  t.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),
880
880
  // added in v3
881
- e.createObjectStore(Rt,{keyPath:"_id"});
881
+ e.createObjectStore(Ut,{keyPath:"_id"});
882
882
  // added in v4
883
- var n=e.createObjectStore(Bt,{autoIncrement:!0});n.createIndex("seq","seq"),n.createIndex("digestSeq","digestSeq",{unique:!0})}(t);// new db, initial schema
883
+ var n=e.createObjectStore(Mt,{autoIncrement:!0});n.createIndex("seq","seq"),n.createIndex("digestSeq","digestSeq",{unique:!0})}(t);// new db, initial schema
884
884
  // do migrations
885
885
  var n=e.currentTarget.transaction;
886
886
  // these migrations have to be done in this function, before
887
887
  // control is returned to the event loop, because IndexedDB
888
- e.oldVersion<3&&function(e){e.createObjectStore(Rt,{keyPath:"_id"}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0})}(t),e.oldVersion<4&&function(e){var t=e.createObjectStore(Bt,{autoIncrement:!0});t.createIndex("seq","seq"),t.createIndex("digestSeq","digestSeq",{unique:!0})}(t);var r=[i,// v1 -> v2
888
+ e.oldVersion<3&&function(e){e.createObjectStore(Ut,{keyPath:"_id"}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0})}(t),e.oldVersion<4&&function(e){var t=e.createObjectStore(Mt,{autoIncrement:!0});t.createIndex("seq","seq"),t.createIndex("digestSeq","digestSeq",{unique:!0})}(t);var r=[i,// v1 -> v2
889
889
  a,// v2 -> v3
890
890
  u,// v3 -> v4
891
- 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)};
891
+ 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(),un.delete(r)},o.onabort=function(e){P("error","Database has a global failure",e.target.error),o.close(),un.delete(r)};
892
892
  // Do a few setup operations (in parallel as much as possible):
893
893
  // 1. Fetch meta doc
894
894
  // 2. Check blob support
895
895
  // 3. Calculate docCount
896
896
  // 4. Generate an instanceId if necessary
897
897
  // 5. Store docCount and instanceId on meta doc
898
- var i,s,a,u,c=o.transaction([Mt,Ut,$t],"readwrite"),f=!1;function l(){void 0!==a&&f&&(e._meta={name:r,instanceId:u,blobSupport:a},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?u=i[e]:i[e]=u=qe(),i.docCount=s,c.objectStore(Mt).put(i)}}
898
+ var i,s,a,u,c=o.transaction([Rt,Nt,It],"readwrite"),f=!1;function l(){void 0!==a&&f&&(e._meta={name:r,instanceId:u,blobSupport:a},un.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?u=i[e]:i[e]=u=Se(),i.docCount=s,c.objectStore(Rt).put(i)}}
899
899
  // fetch or generate the instanceId
900
- c.objectStore(Mt).get(Mt).onsuccess=function(e){i=e.target.result||{id:Mt},d()},
900
+ c.objectStore(Rt).get(Rt).onsuccess=function(e){i=e.target.result||{id:Rt},d()},
901
901
  // countDocs
902
- function(e,t){e.objectStore($t).index("deletedOrLocal").count(IDBKeyRange.only("0")).onsuccess=function(e){!function(e){s=e,d()}(e.target.result)}}(c),
902
+ function(e,t){e.objectStore(It).index("deletedOrLocal").count(IDBKeyRange.only("0")).onsuccess=function(e){!function(e){s=e,d()}(e.target.result)}}(c),
903
903
  // check blob support
904
- sn||(
904
+ an||(
905
905
  // make sure blob support is only checked once
906
- sn=function(e){return new Promise((function(t){var n=he([""]),r=e.objectStore(Ut).put(n,"key");r.onsuccess=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);
906
+ an=function(e){return new Promise((function(t){var n=pe([""]),r=e.objectStore(Nt).put(n,"key");r.onsuccess=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);
907
907
  // MS Edge pretends to be Chrome 42:
908
908
  // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx
909
909
  t(n||!e||parseInt(e[1],10)>=43)},r.onerror=e.onabort=function(e){
910
910
  // If the transaction aborts now its due to not being able to
911
911
  // write to the database, likely due to the disk being full
912
912
  e.preventDefault(),e.stopPropagation(),t(!1)}})).catch((function(){return!1;// error, so assume unsupported
913
- }))}(c)),sn.then((function(e){a=e,l()})),
913
+ }))}(c)),an.then((function(e){a=e,l()})),
914
914
  // only when the metadata put transaction has completed,
915
915
  // consider the setup done
916
- c.oncomplete=function(){f=!0,l()},c.onabort=Ft(n)},l.onerror=function(e){var t=e.target.error&&e.target.error.message;t?-1!==t.indexOf("stored database is a higher version")&&(t=new Error('This DB was created with the newer "indexeddb" adapter, but you are trying to open it with the older "idb" adapter')):t="Failed to open indexedDB, are you in private browsing mode?",C("error",t),n(Y(G,t))}}(n,e,t)}),t,n.constructor)}cn.valid=function(){
916
+ c.oncomplete=function(){f=!0,l()},c.onabort=Kt(n)},l.onerror=function(e){var t=e.target.error&&e.target.error.message;t?-1!==t.indexOf("stored database is a higher version")&&(t=new Error('This DB was created with the newer "indexeddb" adapter, but you are trying to open it with the older "idb" adapter')):t="Failed to open indexedDB, are you in private browsing mode?",P("error",t),n(H(Q,t))}}(n,e,t)}),t,n.constructor)}fn.valid=function(){
917
917
  // Following #7085 buggy idb versions (typically Safari < 10.1) are
918
918
  // considered valid.
919
919
  // On Firefox SecurityError is thrown while referencing indexedDB if cookies
@@ -921,40 +921,40 @@ c.oncomplete=function(){f=!0,l()},c.onabort=Ft(n)},l.onerror=function(e){var t=e
921
921
  try{
922
922
  // some outdated implementations of IDB that appear on Samsung
923
923
  // and HTC Android devices <4.4 are missing IDBKeyRange
924
- return"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}};var fn=5e3,ln={};function dn(e){var t=e.doc||e.ok,n=t&&t._attachments;n&&Object.keys(n).forEach((function(e){var t=n[e];t.data=ye(t.data,t.content_type)}))}function hn(e){return/^_design/.test(e)?"_design/"+encodeURIComponent(e.slice(8)):/^_local/.test(e)?"_local/"+encodeURIComponent(e.slice(7)):encodeURIComponent(e)}function pn(e){return e._attachments&&Object.keys(e._attachments)?Promise.all(Object.keys(e._attachments).map((function(t){var n=e._attachments[t];if(n.data&&"string"!=typeof n.data)return new Promise((function(e){me(n.data,e)})).then((function(e){n.data=e}))}))):Promise.resolve()}
924
+ return"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}};var ln=5e3,dn={};function hn(e){var t=e.doc||e.ok,n=t&&t._attachments;n&&Object.keys(n).forEach((function(e){var t=n[e];t.data=ge(t.data,t.content_type)}))}function pn(e){return/^_design/.test(e)?"_design/"+encodeURIComponent(e.slice(8)):/^_local/.test(e)?"_local/"+encodeURIComponent(e.slice(7)):encodeURIComponent(e)}function vn(e){return e._attachments&&Object.keys(e._attachments)?Promise.all(Object.keys(e._attachments).map((function(t){var n=e._attachments[t];if(n.data&&"string"!=typeof n.data)return new Promise((function(e){be(n.data,e)})).then((function(e){n.data=e}))}))):Promise.resolve()}
925
925
  // Get all the information you possibly can about the URI given by name and
926
926
  // return it as a suitable object.
927
927
  // Generate a URL with the host data given by opts and the given path
928
- function vn(e,t){return yn(e,e.db+"/"+t)}
928
+ function yn(e,t){return gn(e,e.db+"/"+t)}
929
929
  // Generate a URL with the host data given by opts and the given path
930
- function yn(e,t){
930
+ function gn(e,t){
931
931
  // If the host already has a path, then we need to have a path delimiter
932
932
  // Otherwise, the path delimiter is the empty string
933
933
  var n=e.path?"/":"";
934
934
  // If the host already has a path, then we need to have a path delimiter
935
935
  // Otherwise, the path delimiter is the empty string
936
- return e.protocol+"://"+e.host+(e.port?":"+e.port:"")+"/"+e.path+n+t}function gn(e){return"?"+Object.keys(e).map((function(t){return t+"="+encodeURIComponent(e[t])})).join("&")}
936
+ return e.protocol+"://"+e.host+(e.port?":"+e.port:"")+"/"+e.path+n+t}function _n(e){return"?"+Object.keys(e).map((function(t){return t+"="+encodeURIComponent(e[t])})).join("&")}
937
937
  // Implements the PouchDB API for dealing with CouchDB instances over HTTP
938
- function _n(e,t){
938
+ function mn(e,t){
939
939
  // The functions that will be publicly available for HttpPouch
940
940
  var r=this,o=function(e,t){
941
941
  // encode db name if opts.prefix is a url (#5574)
942
- if(function(e){if(!e.prefix)return!1;var t=ue(e.prefix).protocol;return"http"===t||"https"===t}(t)){var n=t.name.substr(t.prefix.length);
942
+ 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);
943
943
  // Ensure prefix has a trailing slash
944
- e=t.prefix.replace(/\/?$/,"/")+encodeURIComponent(n)}var r=ue(e);(r.user||r.password)&&(r.auth={username:r.user,password:r.password});
944
+ e=t.prefix.replace(/\/?$/,"/")+encodeURIComponent(n)}var r=ce(e);(r.user||r.password)&&(r.auth={username:r.user,password:r.password});
945
945
  // Split the path part of the URI into parts using '/' as the delimiter
946
946
  // after removing any leading '/' and any trailing '/'
947
947
  var o=r.path.replace(/(^\/|\/$)/g,"").split("/");return r.db=o.pop(),
948
948
  // Prevent double encoding of URI component
949
- -1===r.db.indexOf("%")&&(r.db=encodeURIComponent(r.db)),r.path=o.join("/"),r}(e.name,e),i=vn(o,"");e=b(e);var a,u=function(t,n){if((n=n||{}).headers=n.headers||new et,n.credentials="include",e.auth||o.auth){var r=e.auth||o.auth,i=r.username+":"+r.password,s=de(unescape(encodeURIComponent(i)));n.headers.set("Authorization","Basic "+s)}var a=e.headers||{};return Object.keys(a).forEach((function(e){n.headers.append(e,a[e])})),
949
+ -1===r.db.indexOf("%")&&(r.db=encodeURIComponent(r.db)),r.path=o.join("/"),r}(e.name,e),i=yn(o,"");e=w(e);var a,u=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 a=e.headers||{};return Object.keys(a).forEach((function(e){n.headers.append(e,a[e])})),
950
950
  /* istanbul ignore if */
951
- 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||Ze)(t,n)};function c(e,t){return j(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 et,t.headers.get("Content-Type")||t.headers.set("Content-Type","application/json"),t.headers.get("Accept")||t.headers.set("Accept","application/json"),u(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=H(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?H(e):e}))),!n)return r;n(null,r.data)}))}function d(){return e.skip_setup?Promise.resolve():
951
+ 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"),u(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():
952
952
  // If there is a setup in process or previous successful setup
953
953
  // done then we will use that
954
954
  // If previous setups have been rejected we will try again
955
955
  a||((a=l(i).catch((function(e){return e&&e.status&&404===e.status?(
956
956
  // Doesnt exist, create it
957
- L(404,"PouchDB is just detecting if the remote exists."),l(i,{method:"PUT"})):Promise.reject(e)})).catch((function(e){
957
+ D(404,"PouchDB is just detecting if the remote exists."),l(i,{method:"PUT"})):Promise.reject(e)})).catch((function(e){
958
958
  // If we try to create a database that already exists, skipped in
959
959
  // istanbul since its catching a race condition.
960
960
  /* istanbul ignore if */
@@ -962,33 +962,33 @@ return!(!e||!e.status||412!==e.status)||Promise.reject(e)}))).catch((function(){
962
962
  // Get the attachment
963
963
  s((function(){t(null,r)})),r._remote=!0,
964
964
  /* istanbul ignore next */
965
- r.type=function(){return"http"},r.id=c("id",(function(e){u(yn(o,"")).then((function(e){return e.json()})).catch((function(){return{}})).then((function(t){
965
+ r.type=function(){return"http"},r.id=c("id",(function(e){u(gn(o,"")).then((function(e){return e.json()})).catch((function(){return{}})).then((function(t){
966
966
  // Bad response or missing `uuid` should not prevent ID generation.
967
- var n=t&&t.uuid?t.uuid+o.db:vn(o,"");e(null,n)}))})),
967
+ var n=t&&t.uuid?t.uuid+o.db:yn(o,"");e(null,n)}))})),
968
968
  // Sends a POST request to the host calling the couchdb _compact function
969
969
  // version: The version of CouchDB it is running
970
- r.compact=c("compact",(function(e,t){"function"==typeof e&&(t=e,e={}),e=b(e),l(vn(o,"_compact"),{method:"POST"}).then((function(){
970
+ r.compact=c("compact",(function(e,t){"function"==typeof e&&(t=e,e={}),e=w(e),l(yn(o,"_compact"),{method:"POST"}).then((function(){
971
971
  // Ping the http if it's finished compaction
972
972
  !function n(){r.info((function(r,o){
973
973
  // CouchDB may send a "compact_running:true" if it's
974
974
  // already compacting. PouchDB Server doesn't.
975
975
  /* istanbul ignore else */
976
- o&&!o.compact_running?t(null,{ok:!0}):setTimeout(n,e.interval||200)}))}()}))})),r.bulkGet=j("bulkGet",(function(e,t){var n=this;function r(t){var n={};e.revs&&(n.revs=!0),e.attachments&&(
977
- /* istanbul ignore next */n.attachments=!0),e.latest&&(n.latest=!0),l(vn(o,"_bulk_get"+gn(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(dn)})),t(null,n.data)})).catch(t)}
976
+ 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&&(
977
+ /* 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)}
978
978
  /* istanbul ignore next */function i(){
979
979
  // avoid "url too long error" by splitting up into multiple requests
980
980
  var r=Math.ceil(e.docs.length/50),o=0,i=new Array(r);function s(e){return function(n,s){
981
981
  // err is impossible because shim returns a list of errs in that case
982
- i[e]=s.results,++o===r&&t(null,{results:Z(i)})}}for(var a=0;a<r;a++){var u=O(e,["revs","attachments","binary","latest"]);u.docs=e.docs.slice(50*a,Math.min(e.docs.length,50*(a+1))),S(n,u,s(a))}}
982
+ i[e]=s.results,++o===r&&t(null,{results:ee(i)})}}for(var a=0;a<r;a++){var u=A(e,["revs","attachments","binary","latest"]);u.docs=e.docs.slice(50*a,Math.min(e.docs.length,50*(a+1))),x(n,u,s(a))}}
983
983
  // mark the whole database as either supporting or not supporting _bulk_get
984
- var s=yn(o,""),a=ln[s];
984
+ var s=gn(o,""),a=dn[s];
985
985
  /* istanbul ignore next */"boolean"!=typeof a?
986
986
  // check if this database supports _bulk_get
987
- r((function(e,n){e?(ln[s]=!1,L(e.status,"PouchDB is just detecting if the remote supports the _bulk_get API."),i()):(ln[s]=!0,t(null,n))})):a?r(t):i()})),
987
+ r((function(e,n){e?(dn[s]=!1,D(e.status,"PouchDB is just detecting if the remote supports the _bulk_get API."),i()):(dn[s]=!0,t(null,n))})):a?r(t):i()})),
988
988
  // Calls GET on the host, which gets back a JSON string containing
989
989
  // couchdb: A welcome string
990
990
  // version: The version of CouchDB it is running
991
- r._info=function(e){d().then((function(){return u(vn(o,""))})).then((function(e){return e.json()})).then((function(t){t.host=vn(o,""),e(null,t)})).catch(e)},r.fetch=function(e,t){return d().then((function(){var n="/"===e.substring(0,1)?yn(o,e.substring(1)):vn(o,e);return u(n,t)}))},
991
+ r._info=function(e){d().then((function(){return u(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 u(n,t)}))},
992
992
  // Get the document with the given id from the database given by host.
993
993
  // The id could be solely the _id in the database, or it may be a
994
994
  // _design/ID or _local/ID path
@@ -1009,45 +1009,45 @@ r?n(r):t():l()}function c(){o--,u()}
1009
1009
  // Sync Gateway would normally send it back as multipart/mixed,
1010
1010
  // which we cannot parse. Also, this is more efficient than
1011
1011
  // receiving attachments as base64-encoded strings.
1012
- return function(r){var i=n[r],s=hn(e._id)+"/"+h(r)+"?rev="+e._rev;return u(vn(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){me(e,t)}))})).then((function(e){delete i.stub,delete i.length,i.data=e}))}(r)}})))}(t=b(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
1013
- /* istanbul ignore if */),t.update_seq&&(r.update_seq=t.update_seq),e=hn(e),l(vn(o,e+gn(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)}))})),
1012
+ return function(r){var i=n[r],s=pn(e._id)+"/"+h(r)+"?rev="+e._rev;return u(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
1013
+ /* 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)}))})),
1014
1014
  // Delete the document given by doc from the database given by host.
1015
1015
  r.remove=c("remove",(function(e,t,n,r){var i;"string"==typeof t?(
1016
1016
  // id, rev, opts, callback style
1017
1017
  i={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
1018
1018
  // doc, opts, callback style
1019
- i=e,"function"==typeof t?(r=t,n={}):(r=n,n=t));var s=i._rev||n.rev;l(vn(o,hn(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,a=r.rev?"?rev="+r.rev:"",c=vn(o,hn(e))+"/"+h(t)+a;u(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){
1019
+ 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,a=r.rev?"?rev="+r.rev:"",c=yn(o,pn(e))+"/"+h(t)+a;u(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){
1020
1020
  // TODO: also remove
1021
1021
  void 0===n||n.browser||(e.type=s),i(null,e)})).catch((function(e){i(e)}))})),
1022
1022
  // Remove the attachment given by the id and rev
1023
- r.removeAttachment=c("removeAttachment",(function(e,t,n,r){l(vn(o,hn(e)+"/"+h(t))+"?rev="+n,{method:"DELETE"},r).catch(r)})),
1023
+ r.removeAttachment=c("removeAttachment",(function(e,t,n,r){l(yn(o,pn(e)+"/"+h(t))+"?rev="+n,{method:"DELETE"},r).catch(r)})),
1024
1024
  // Add the attachment given by blob and its contentType property
1025
1025
  // to the document with the given id, the revision given by rev, and
1026
1026
  // add it to the database given by host.
1027
- r.putAttachment=c("putAttachment",(function(e,t,n,r,i,s){"function"==typeof i&&(s=i,i=r,r=n,n=null);var a=hn(e)+"/"+h(t),u=vn(o,a);if(n&&(u+="?rev="+n),"string"==typeof r){
1027
+ r.putAttachment=c("putAttachment",(function(e,t,n,r,i,s){"function"==typeof i&&(s=i,i=r,r=n,n=null);var a=pn(e)+"/"+h(t),u=yn(o,a);if(n&&(u+="?rev="+n),"string"==typeof r){
1028
1028
  // input is assumed to be a base64 string
1029
- var c;try{c=le(r)}catch(e){return s(Y(F,"Attachment is not a valid base64 string"))}r=c?ve(c,i):""}
1029
+ var c;try{c=de(r)}catch(e){return s(H(K,"Attachment is not a valid base64 string"))}r=c?ye(c,i):""}
1030
1030
  // Add the attachment
1031
- l(u,{headers:new et({"Content-Type":i}),method:"PUT",body:r},s).catch(s)})),
1031
+ l(u,{headers:new tt({"Content-Type":i}),method:"PUT",body:r},s).catch(s)})),
1032
1032
  // Update/create multiple documents given by req in the database
1033
1033
  // given by host.
1034
1034
  r._bulkDocs=function(e,t,n){
1035
1035
  // If new_edits=false then it prevents the database from creating
1036
1036
  // new revision numbers for the documents. Instead it just uses
1037
1037
  // the old ones. This is used in database replication.
1038
- e.new_edits=t.new_edits,d().then((function(){return Promise.all(e.docs.map(pn))})).then((function(){
1038
+ e.new_edits=t.new_edits,d().then((function(){return Promise.all(e.docs.map(vn))})).then((function(){
1039
1039
  // Update/create the documents
1040
- return l(vn(o,"_bulk_docs"),{method:"POST",body:JSON.stringify(e)},n)})).catch(n)},
1040
+ return l(yn(o,"_bulk_docs"),{method:"POST",body:JSON.stringify(e)},n)})).catch(n)},
1041
1041
  // Update/create document
1042
- r._put=function(e,t,n){d().then((function(){return pn(e)})).then((function(){return l(vn(o,hn(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)}))},
1042
+ 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)}))},
1043
1043
  // Get a listing of the documents in the database given
1044
1044
  // by host and ordered by increasing id.
1045
1045
  r.allDocs=c("allDocs",(function(e,t){"function"==typeof e&&(t=e,e={});
1046
1046
  // List of parameters to add to the GET request
1047
- var n,r={},i="GET";(e=b(e)).conflicts&&(r.conflicts=!0
1047
+ var n,r={},i="GET";(e=w(e)).conflicts&&(r.conflicts=!0
1048
1048
  /* istanbul ignore if */),e.update_seq&&(r.update_seq=!0),e.descending&&(r.descending=!0),e.include_docs&&(r.include_docs=!0),
1049
1049
  // added in CouchDB 1.6.0
1050
- 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=gn(r);void 0!==e.keys&&(i="POST",n={keys:e.keys}),l(vn(o,"_all_docs"+s),{method:i,body:JSON.stringify(n)}).then((function(n){e.include_docs&&e.attachments&&e.binary&&n.data.rows.forEach(dn),t(null,n.data)})).catch(t)})),
1050
+ 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)})),
1051
1051
  // Get a list of changes made to documents in the database given by host.
1052
1052
  // TODO According to the README, there should be two other methods here,
1053
1053
  // api.changes.addListener and api.changes.removeListener.
@@ -1056,10 +1056,10 @@ r._changes=function(e){
1056
1056
  // if there is a large set of changes to be returned we can start
1057
1057
  // processing them quicker instead of waiting on the entire
1058
1058
  // set of changes to return and attempting to process them at once
1059
- var t="batch_size"in e?e.batch_size:25;(e=b(e)).continuous&&!("heartbeat"in e)&&(e.heartbeat=1e4);var n="timeout"in e?e.timeout:3e4;
1059
+ 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;
1060
1060
  // ensure CHANGES_TIMEOUT_BUFFER applies
1061
- "timeout"in e&&e.timeout&&n-e.timeout<fn&&(n=e.timeout+fn
1062
- /* istanbul ignore if */),"heartbeat"in e&&e.heartbeat&&n-e.heartbeat<fn&&(n=e.heartbeat+fn);var r={};"timeout"in e&&e.timeout&&(r.timeout=e.timeout);var i=void 0!==e.limit&&e.limit,a=i;
1061
+ "timeout"in e&&e.timeout&&n-e.timeout<ln&&(n=e.timeout+ln
1062
+ /* 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,a=i;
1063
1063
  // If opts.query_params exists, pass it through to the changes request.
1064
1064
  // These parameters may be used by the filter on the source database.
1065
1065
  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
@@ -1070,12 +1070,12 @@ e.query_params.hasOwnProperty(u)&&(r[u]=e.query_params[u]);var c,f="GET";e.doc_i
1070
1070
  // requires both a "filter" and a "doc_ids" param.
1071
1071
  r.filter="_doc_ids",f="POST",c={doc_ids:e.doc_ids}):e.selector&&(
1072
1072
  // set this automagically for the user, similar to above
1073
- r.filter="_selector",f="POST",c={selector:e.selector});var h,p=new Xe,v=function(n,s){if(!e.aborted){r.since=n,
1073
+ r.filter="_selector",f="POST",c={selector:e.selector});var h,p=new Ze,v=function(n,s){if(!e.aborted){r.since=n,
1074
1074
  // "since" can be any kind of json object in Cloudant/CouchDB 2.x
1075
1075
  /* istanbul ignore next */
1076
1076
  "object"==typeof r.since&&(r.since=JSON.stringify(r.since)),e.descending?i&&(r.limit=a):r.limit=!i||a>t?t:a;
1077
1077
  // Set the options for the ajax call
1078
- var u=vn(o,"_changes"+gn(r)),v={signal:p.signal,method:f,body:JSON.stringify(c)};h=n,
1078
+ var u=yn(o,"_changes"+_n(r)),v={signal:p.signal,method:f,body:JSON.stringify(c)};h=n,
1079
1079
  /* istanbul ignore if */
1080
1080
  e.aborted||
1081
1081
  // Get the changes
@@ -1083,7 +1083,7 @@ d().then((function(){return l(u,v,s)})).catch(s)}},y={results:[]},g=function(n,r
1083
1083
  // If the result of the ajax call (res) contains changes (res.results)
1084
1084
  if(r&&r.results){o=r.results.length,y.last_seq=r.last_seq;var u=null,c=null;
1085
1085
  // Attach 'pending' property if server supports it (CouchDB 2.0+)
1086
- /* istanbul ignore if */"number"==typeof r.pending&&(u=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){a--;var n=X(e)(t);return n&&(e.include_docs&&e.attachments&&e.binary&&dn(t),e.return_docs&&y.results.push(t),e.onChange(t,u,c)),n}))}else if(n)
1086
+ /* istanbul ignore if */"number"==typeof r.pending&&(u=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){a--;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,u,c)),n}))}else if(n)
1087
1087
  // In case of an error, stop listening for changes and call
1088
1088
  // opts.complete
1089
1089
  return e.aborted=!0,void e.complete(n);
@@ -1103,22 +1103,22 @@ r.revsDiff=c("revsDiff",(function(e,t,n){
1103
1103
  // If no options were given, set the callback to be the second parameter
1104
1104
  "function"==typeof t&&(n=t,t={}),
1105
1105
  // Get the missing document/revision IDs
1106
- l(vn(o,"_revs_diff"),{method:"POST",body:JSON.stringify(e)},n).catch(n)})),r._close=function(e){e()},r._destroy=function(e,t){l(vn(o,""),{method:"DELETE"}).then((function(e){t(null,e)})).catch((function(e){
1106
+ 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){
1107
1107
  /* istanbul ignore if */
1108
1108
  404===e.status?t(null,{ok:!0}):t(e)}))}}
1109
1109
  // HttpPouch is a valid adapter.
1110
- function mn(e){this.status=400,this.name="query_parse_error",this.message=e,this.error=!0;try{Error.captureStackTrace(this,mn)}catch(e){}}function bn(e){this.status=404,this.name="not_found",this.message=e,this.error=!0;try{Error.captureStackTrace(this,bn)}catch(e){}}function wn(e){this.status=500,this.name="invalid_value",this.message=e,this.error=!0;try{Error.captureStackTrace(this,wn)}catch(e){}}function kn(e,t){return t&&e.then((function(e){s((function(){t(null,e)}))}),(function(e){s((function(){t(e)}))})),e}function jn(e,t){return function(){var n=arguments,r=this;return e.add((function(){return t.apply(r,n)}))}}
1110
+ 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)}))}}
1111
1111
  // uniq an array of strings, order not guaranteed
1112
1112
  // similar to underscore/lodash _.uniq
1113
- function On(e){var t=new o(e),n=new Array(t.size),r=-1;return t.forEach((function(e){n[++r]=e})),n}function An(e){var t=new Array(e.size),n=-1;return e.forEach((function(e,r){t[++n]=r})),t}function qn(e){return new wn("builtin "+e+" function requires map values to be numbers or number arrays")}function Sn(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
1114
- throw qn("_sum");
1113
+ function An(e){var t=new o(e),n=new Array(t.size),r=-1;return t.forEach((function(e){n[++r]=e})),n}function qn(e){var t=new Array(e.size),n=-1;return e.forEach((function(e,r){t[++n]=r})),t}function Sn(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
1114
+ throw Sn("_sum");
1115
1115
  // lists of numbers are also allowed, sum them separately
1116
- t="number"==typeof t?[t]:t;for(var i=0,s=o.length;i<s;i++){var a=o[i];if("number"!=typeof a)throw qn("_sum");void 0===t[i]?t.push(a):t[i]+=a}}else"number"==typeof t?t+=o:// add number to array
1117
- t[0]+=o}return t}_n.valid=function(){return!0},l(mn,Error),l(bn,Error),l(wn,Error);var xn=C.bind(null,"log"),En=Array.isArray,Cn=JSON.parse;function Pn(e,t){return ce("return ("+e.replace(/;\s*$/,"")+");",{emit:t,sum:Sn,log:xn,isArray:En,toJSON:Cn})}
1116
+ t="number"==typeof t?[t]:t;for(var i=0,s=o.length;i<s;i++){var a=o[i];if("number"!=typeof a)throw Sn("_sum");void 0===t[i]?t.push(a):t[i]+=a}}else"number"==typeof t?t+=o:// add number to array
1117
+ t[0]+=o}return t}mn.valid=function(){return!0},l(bn,Error),l(wn,Error),l(kn,Error);var En=P.bind(null,"log"),Cn=Array.isArray,Pn=JSON.parse;function Ln(e,t){return fe("return ("+e.replace(/;\s*$/,"")+");",{emit:t,sum:xn,log:En,isArray:Cn,toJSON:Pn})}
1118
1118
  /*
1119
1119
  * Simple task queue to sequentialize actions. Assumes
1120
1120
  * callbacks will eventually fire (once).
1121
- */function Ln(){this.promise=new Promise((function(e){e()}))}function Dn(e){if(!e)return"undefined";// backwards compat for empty reduce
1121
+ */function Dn(){this.promise=new Promise((function(e){e()}))}function $n(e){if(!e)return"undefined";// backwards compat for empty reduce
1122
1122
  // for backwards compat with mapreduce, functions/strings are stringified
1123
1123
  // as-is. everything else is JSON-stringified.
1124
1124
  switch(typeof e){case"function":case"string":
@@ -1126,22 +1126,22 @@ switch(typeof e){case"function":case"string":
1126
1126
  return e.toString();default:
1127
1127
  // e.g. a JSON object in the case of mango queries
1128
1128
  return JSON.stringify(e)}}
1129
- /* create a string signature for a view so we can cache it and uniq it */function $n(e,t,n,r,o,i){var s,a=function(e,t){
1129
+ /* create a string signature for a view so we can cache it and uniq it */function In(e,t,n,r,o,i){var s,a=function(e,t){
1130
1130
  // the "undefined" part is for backwards compatibility
1131
- return Dn(e)+Dn(t)+"undefined"}(n,r);if(!o&&
1131
+ return $n(e)+$n(t)+"undefined"}(n,r);if(!o&&
1132
1132
  // cache this to ensure we don't try to update the same view twice
1133
- (s=e._cachedViews=e._cachedViews||{})[a])return s[a];var u=e.info().then((function(u){var c=u.db_name+"-mrview-"+(o?"temp":Oe(a));
1133
+ (s=e._cachedViews=e._cachedViews||{})[a])return s[a];var u=e.info().then((function(u){var c=u.db_name+"-mrview-"+(o?"temp":Ae(a));
1134
1134
  // save the view name in the source db so it can be cleaned up if necessary
1135
1135
  // (e.g. when the _design doc is deleted, remove all associated view data)
1136
- return fe(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]||{};
1136
+ 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]||{};
1137
1137
  /* 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){
1138
1138
  /* istanbul ignore if */
1139
- if(404!==e.status)throw e})).then((function(e){return i.seq=e?e.seq:0,s&&i.db.once("destroyed",(function(){delete s[a]})),i}))}))}))}));return s&&(s[a]=u),u}Ln.prototype.add=function(e){return this.promise=this.promise.catch((function(){
1139
+ if(404!==e.status)throw e})).then((function(e){return i.seq=e?e.seq:0,s&&i.db.once("destroyed",(function(){delete s[a]})),i}))}))}))}));return s&&(s[a]=u),u}Dn.prototype.add=function(e){return this.promise=this.promise.catch((function(){
1140
1140
  // just recover
1141
- })).then((function(){return e()})),this.promise},Ln.prototype.finish=function(){return this.promise};var In={},Tn=new Ln;function Bn(e){
1141
+ })).then((function(){return e()})),this.promise},Dn.prototype.finish=function(){return this.promise};var Tn={},Bn=new Dn;function Mn(e){
1142
1142
  // can be either 'ddocname/viewname' or just 'viewname'
1143
1143
  // (where the ddoc name is the same)
1144
- return-1===e.indexOf("/")?[e,e]:e.split("/")}function Mn(e,t){try{e.emit("error",t)}catch(e){C("error","The user's map/reduce function threw an uncaught error.\nYou can debug this error by doing:\nmyDatabase.on('error', function (err) { debugger; });\nPlease double-check your map/reduce function."),C("error",t)
1144
+ return-1===e.indexOf("/")?[e,e]:e.split("/")}function Rn(e,t){try{e.emit("error",t)}catch(e){P("error","The user's map/reduce function threw an uncaught error.\nYou can debug this error by doing:\nmyDatabase.on('error', function (err) { debugger; });\nPlease double-check your map/reduce function."),P("error",t)
1145
1145
  /**
1146
1146
  * Returns an "abstract" mapreduce object of the form:
1147
1147
  *
@@ -1167,25 +1167,25 @@ return-1===e.indexOf("/")?[e,e]:e.split("/")}function Mn(e,t){try{e.emit("error"
1167
1167
  * Throws an error if the ddoc or viewName is not valid.
1168
1168
  * This could be a way to communicate to the user that the configuration for the
1169
1169
  * indexer is invalid.
1170
- */}}var Rn=function(e,t){return Sn(t)},Un=function(e,t){return t.length},Nn=function(e,t){return{sum:Sn(t),min:Math.min.apply(null,t),max:Math.max.apply(null,t),count:t.length,sumsqr:
1170
+ */}}var Un=function(e,t){return xn(t)},Nn=function(e,t){return t.length},Fn=function(e,t){return{sum:xn(t),min:Math.min.apply(null,t),max:Math.max.apply(null,t),count:t.length,sumsqr:
1171
1171
  // no need to implement rereduce=true, because Pouch
1172
1172
  // will never call it
1173
- 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 a(e,t,n){
1173
+ function(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=e[n];t+=o*o}return t}(t)}},Kn=function(e,t,n,r){function a(e,t,n){
1174
1174
  // emit an event if there was an error thrown by a map function.
1175
1175
  // putting try/catches in a single function also avoids deoptimizations.
1176
- try{t(n)}catch(t){Mn(e,t)}}function u(e,t,n,r,o){
1176
+ try{t(n)}catch(t){Rn(e,t)}}function u(e,t,n,r,o){
1177
1177
  // same as above, but returning the result or an error. there are two separate
1178
1178
  // functions to avoid extra memory allocations since the tryCode() case is used
1179
1179
  // for custom map functions (common) vs this function, which is only used for
1180
1180
  // custom reduce functions (rare)
1181
- try{return{output:t(n,r,o)}}catch(t){return Mn(e,t),{error:t}}}function c(e,t){var n=lt(e.key,t.key);return 0!==n?n:lt(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;
1181
+ try{return{output:t(n,r,o)}}catch(t){return Rn(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;
1182
1182
  // Users can explicitly specify a joined doc _id, or it
1183
1183
  // defaults to the doc _id that emitted the key/value.
1184
- 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=ye(n.data,n.content_type)}))}))}(t),t}}function p(e,t,n,r){
1184
+ 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){
1185
1185
  // add an http param from opts to params, optionally json-encoded
1186
1186
  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);
1187
1187
  // prevents e.g. '1foo' or '1.1' being coerced to 1
1188
- 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]&&lt(e[n],e[r])>0)throw new mn("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 mn("{include_docs:true} is invalid for reduce");if(e.keys&&e.keys.length>1&&!e.group&&!e.group_level)throw new mn("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 mn('Invalid value for integer: "'+e+'"');if(e<0)return new mn('Invalid value for positive integer: "'+e+'"')}}(e[t]);if(n)throw n}))}function g(e){return function(t){
1188
+ 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){
1189
1189
  /* istanbul ignore else */
1190
1190
  if(404===t.status)return e;throw t}}
1191
1191
  // returns a promise for a list of docs to update, based on the input docId.
@@ -1194,21 +1194,21 @@ if(404===t.status)return e;throw t}}
1194
1194
  function _(e,t,n){var r="_local/doc_"+e,i={_id:r,keys:[]},s=n.get(e),a=s[0];return(function(e){
1195
1195
  // only return true if the current change is 1-
1196
1196
  // and there are no other leafs
1197
- 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 u=t.rows[i].doc;if(u&&(n.push(u),r.add(u._id),u._deleted=!a.has(u._id),!u._deleted)){var c=a.get(u._id);"value"in c&&(u.value=c.value)}}var f=An(a);return f.forEach((function(e){if(!r.has(e)){
1197
+ 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 u=t.rows[i].doc;if(u&&(n.push(u),r.add(u._id),u._deleted=!a.has(u._id),!u._deleted)){var c=a.get(u._id);"value"in c&&(u.value=c.value)}}var f=qn(a);return f.forEach((function(e){if(!r.has(e)){
1198
1198
  // new doc
1199
- var t={_id:e},o=a.get(e);"value"in o&&(t.value=o.value),n.push(t)}})),e.keys=On(f.concat(e.keys)),n.push(e),n}(e,t)}))}))}
1199
+ var t={_id:e},o=a.get(e);"value"in o&&(t.value=o.value),n.push(t)}})),e.keys=An(f.concat(e.keys)),n.push(e),n}(e,t)}))}))}
1200
1200
  // updates all emitted key/value docs and metaDocs in the mrview database
1201
1201
  // for the given batch of documents from the source database
1202
- function m(e){var t="string"==typeof e?e:e.name,n=In[t];return n||(n=In[t]=new Ln),n}function b(e){return jn(m(e),(function(){return function(e){
1202
+ function m(e){var t="string"==typeof e?e:e.name,n=Tn[t];return n||(n=Tn[t]=new Dn),n}function b(e){return On(m(e),(function(){return function(e){
1203
1203
  // bind the emit function once
1204
1204
  var t,n;var r=function(e,t){
1205
1205
  // for temp_views one can use emit(doc, emit), see #38
1206
- if("function"==typeof e&&2===e.length){var n=e;return function(e){return n(e,t)}}return Pn(e.toString(),t)}(e.mapFun,(function(e,r){var o={id:n._id,key:dt(e)};
1206
+ if("function"==typeof e&&2===e.length){var n=e;return function(e){return n(e,t)}}return Ln(e.toString(),t)}(e.mapFun,(function(e,r){var o={id:n._id,key:ht(e)};
1207
1207
  // Don't explicitly store the value unless it's defined and non-null.
1208
1208
  // This saves on storage space, because often people don't use it.
1209
- null!=r&&(o.value=dt(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=An(t);return Promise.all(o.map((function(n){return _(n,e,t)}))).then((function(t){var o=Z(t);
1209
+ 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=qn(t);return Promise.all(o.map((function(n){return _(n,e,t)}))).then((function(t){var o=ee(t);
1210
1210
  // write all docs in a single operation, update the seq once
1211
- return r.seq=n,o.push(r),e.db.bulkDocs({docs:o})}))}))}(e,t,n)}}var u=new Ln;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(u.add(s(n,o)),!(t.length<50))return f()}}function d(s){for(var u=new i,f=0,l=s.length;f<l;f++){var d=s[f];if("_"!==d.doc._id[0]){t=[],(n=d.doc)._deleted||a(e.sourceDB,r,n),t.sort(c);var p=h(t);u.set(d.doc._id,[p,d.changes])}o=d.seq}return u}function h(e){for(var t,n=new i,r=0,o=e.length;r<o;r++){var s=e[r],a=[s.key,s.id];r>0&&0===lt(s.key,t)&&a.push(r),n.set(ht(a),s),t=s.key}return n}return f().then((function(){return u.finish()})).then((function(){e.seq=o}))}(e)}))()}function w(e,t){return jn(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){
1211
+ return r.seq=n,o.push(r),e.db.bulkDocs({docs:o})}))}))}(e,t,n)}}var u=new Dn;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(u.add(s(n,o)),!(t.length<50))return f()}}function d(s){for(var u=new i,f=0,l=s.length;f<l;f++){var d=s[f];if("_"!==d.doc._id[0]){t=[],(n=d.doc)._deleted||a(e.sourceDB,r,n),t.sort(c);var p=h(t);u.set(d.doc._id,[p,d.changes])}o=d.seq}return u}function h(e){for(var t,n=new i,r=0,o=e.length;r<o;r++){var s=e[r],a=[s.key,s.id];r>0&&0===dt(s.key,t)&&a.push(r),n.set(pt(a),s),t=s.key}return n}return f().then((function(){return u.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){
1212
1212
  // implicit migration - in older versions of PouchDB,
1213
1213
  // we explicitly stored the doc as {id: ..., key: ..., value: ...}
1214
1214
  // this is tested in a migration test
@@ -1218,7 +1218,7 @@ if("value"in e.doc&&"object"==typeof e.doc.value&&null!==e.doc.value){var t=Obje
1218
1218
  // emitted a value which was an object with these 3 exact keys
1219
1219
  if(!(t<n||t>n))return e.doc.value}var r=function(e){
1220
1220
  /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
1221
- 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=pt(e,r);t.push(i.num),r+=i.length;break;case"4":
1221
+ 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":
1222
1222
  /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
1223
1223
  for(var s="";;){var a=e[r];if("\0"===a)break;s+=a,r++}
1224
1224
  // perform the reverse of the order-preserving replacement
@@ -1226,21 +1226,21 @@ for(var s="";;){var a=e[r];if("\0"===a)break;s+=a,r++}
1226
1226
  /* eslint-disable no-control-regex */s=s.replace(/\u0001\u0001/g,"\0").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,""),
1227
1227
  /* eslint-enable no-control-regex */
1228
1228
  t.push(s);break;case"5":var u={element:[],index:t.length};t.push(u.element),n.push(u);break;case"6":var c={element:{},index:t.length};t.push(c.element),n.push(c);break;
1229
- /* istanbul ignore next */default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+o)}else{if(1===t.length)return t.pop();vt(t,n)}}}(e.doc._id);return{key:r[0],id:r[1],value:"value"in e.doc?e.doc.value:null}}))}))}function a(s){var a;if(a=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();return function(e){if(/^_sum/.test(e))return Rn;if(/^_count/.test(e))return Un;if(/^_stats/.test(e))return Nn;if(/^_/.test(e))throw new Error(e+" is not a supported reduce function.")}(t)||Pn(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(
1229
+ /* 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 a(s){var a;if(a=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 Un;if(/^_count/.test(e))return Nn;if(/^_stats/.test(e))return Fn;if(/^_/.test(e))throw new Error(e+" is not a supported reduce function.")}(t);return n||Ln(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(
1230
1230
  // only set group_level for array keys
1231
- r&&Array.isArray(n)&&(n=n.slice(0,s)),t&&0===lt(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 a=0,c=i.length;a<c;a++){var f=i[a],d=u(e.sourceDB,o,f.keys,f.values,!1);if(d.error&&d.error instanceof wn)
1231
+ 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 a=0,c=i.length;a<c;a++){var f=i[a],d=u(e.sourceDB,o,f.keys,f.values,!1);if(d.error&&d.error instanceof kn)
1232
1232
  // CouchDB returns an error if a built-in errors out
1233
1233
  throw d.error;t.push({
1234
1234
  // CouchDB just sets the value to null if a non-built-in errors out
1235
1235
  value:d.error?null:d.output,key:f.groupKey})}
1236
1236
  // no total_rows/offset when reducing
1237
1237
  return{rows:l(t,n.limit,n.skip)}}(e,s,t):{total_rows:n,offset:o,rows:s}
1238
- /* istanbul ignore if */,t.update_seq&&(a.update_seq=e.seq),t.include_docs){var c=On(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)})),a}))}return a}if(void 0===t.keys||t.keys.length||(
1238
+ /* istanbul ignore if */,t.update_seq&&(a.update_seq=e.seq),t.include_docs){var c=An(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)})),a}))}return a}if(void 0===t.keys||t.keys.length||(
1239
1239
  // equivalent query
1240
- t.limit=0,delete t.keys),void 0!==t.keys){var c=t.keys.map((function(e){var n={startkey:ht([e]),endkey:ht([e,{}])};
1241
- /* istanbul ignore if */return t.update_seq&&(n.update_seq=!0),s(n)}));return Promise.all(c).then(Z).then(a)}// normal query, no 'keys'
1240
+ 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,{}])};
1241
+ /* istanbul ignore if */return t.update_seq&&(n.update_seq=!0),s(n)}));return Promise.all(c).then(ee).then(a)}// normal query, no 'keys'
1242
1242
  var f,h,p={descending:t.descending};
1243
- /* 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?ht([f,{}]):ht([f])),void 0!==h){var v=!1!==t.inclusive_end;t.descending&&(v=!v),p.endkey=ht(v?[h,{}]:[h])}if(void 0!==t.key){var y=ht([t.key]),g=ht([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(a)}(e,t)}))()}function k(t,n,r){
1243
+ /* 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(a)}(e,t)}))()}function k(t,n,r){
1244
1244
  /* istanbul ignore next */
1245
1245
  if("function"==typeof t._query)
1246
1246
  // custom adapters can define their own api._query
@@ -1249,7 +1249,7 @@ if("function"==typeof t._query)
1249
1249
  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)}))}))}
1250
1250
  // custom adapters can define their own api._viewCleanup
1251
1251
  // and override the default behavior
1252
- /* istanbul ignore next */(t,n,r);if(te(t))return function(e,t,n){
1252
+ /* istanbul ignore next */(t,n,r);if(ne(t))return function(e,t,n){
1253
1253
  // List of parameters to add to the PUT request
1254
1254
  var r,o,i,s=[],a="GET";
1255
1255
  // If keys are supplied, issue a POST to circumvent GET query string limits
@@ -1270,15 +1270,15 @@ u.length+s.length+1<=2e3?
1270
1270
  s+=("?"===s[0]?"&":"?")+u:(a="POST","string"==typeof t?r={keys:n.keys}:// fun is {map : mapfun}, so append to this
1271
1271
  t.keys=n.keys)}
1272
1272
  // We are referencing a query defined in the design doc
1273
- if("string"==typeof t){var c=Bn(t);return e.fetch("_design/"+c[0]+"/_view/"+c[1]+s,{headers:new et({"Content-Type":"application/json"}),method:a,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,H(e);
1273
+ if("string"==typeof t){var c=Mn(t);return e.fetch("_design/"+c[0]+"/_view/"+c[1]+s,{headers:new tt({"Content-Type":"application/json"}),method:a,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);
1274
1274
  // fail the entire request if the result contains an error
1275
1275
  return e.rows.forEach((function(e){
1276
1276
  /* istanbul ignore if */
1277
1277
  if(e.value&&e.value.error&&"builtin_reduce_error"===e.value.error)throw new Error(e.reason)})),e})).then(h(n))}
1278
1278
  // We are using a temporary view, terrible for performance, good for testing
1279
- 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 et({"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,H(e);return e})).then(h(n))}(t,n,r);if("string"!=typeof n)
1279
+ 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)
1280
1280
  // temp_view
1281
- return y(r,n),Tn.add((function(){return $n(
1281
+ return y(r,n),Bn.add((function(){return In(
1282
1282
  /* sourceDB */t,
1283
1283
  /* viewName */"temp_view/temp_view",
1284
1284
  /* mapFun */n.map,
@@ -1286,30 +1286,30 @@ return y(r,n),Tn.add((function(){return $n(
1286
1286
  /* temporary */!0,
1287
1287
  /* localDocName */e).then((function(e){return t=b(e).then((function(){return w(e,r)})),n=function(){return e.db.destroy()},t.then((function(e){return n().then((function(){return e}))}),(function(e){return n().then((function(){throw e}))}));
1288
1288
  // Promise finally util similar to Q.finally
1289
- var t,n}))})),Tn.finish();
1289
+ var t,n}))})),Bn.finish();
1290
1290
  // persistent view
1291
- var o=n,i=Bn(o),a=i[0],u=i[1];return t.get("_design/"+a).then((function(n){var i=n.views&&n.views[u];if(!i)
1291
+ var o=n,i=Mn(o),a=i[0],u=i[1];return t.get("_design/"+a).then((function(n){var i=n.views&&n.views[u];if(!i)
1292
1292
  // basic validator; it's assumed that every subclass would want this
1293
- throw new bn("ddoc "+n._id+" has no view named "+u);return function(e,t){var n=e.views&&e.views[t];if("string"!=typeof n.map)throw new bn("ddoc "+e._id+" has no string view named "+t+", instead found object of type: "+typeof n.map)}(n,u),y(r,i),$n(
1293
+ throw new wn("ddoc "+n._id+" has no view named "+u);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,u),y(r,i),In(
1294
1294
  /* sourceDB */t,
1295
1295
  /* viewName */o,
1296
1296
  /* mapFun */i.map,
1297
1297
  /* reduceFun */i.reduce,
1298
1298
  /* temporary */!1,
1299
- /* 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 kn(o,n),o},viewCleanup:(j=function(){var t=this;
1300
- /* 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):te(t)?function(e){return e.fetch("_view_cleanup",{headers:new et({"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=Bn(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:An(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/'
1299
+ /* 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;
1300
+ /* 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=Mn(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:qn(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/'
1301
1301
  n.get(t.key).forEach((function(n){var i=r+"/"+n;
1302
1302
  /* istanbul ignore if */e.views[i]||(
1303
1303
  // new format, without slashes, to support PouchDB 2.2.0
1304
1304
  // migration test in pouchdb's browser.migration.js verifies this
1305
1305
  i=n);var s=Object.keys(e.views[i]),a=t.doc&&t.doc.views&&t.doc.views[n];
1306
1306
  // design doc deleted, or view function nonexistent
1307
- s.forEach((function(e){o[e]=o[e]||a}))}))}));var i=Object.keys(o).filter((function(e){return!o[e]})).map((function(e){return jn(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&&kn(n,t),n})))}}("mrviews"),Kn={query:function(e,t,n){return Fn.query.call(this,e,t,n)},viewCleanup:function(e){return Fn.viewCleanup.call(this,e)}};function Jn(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})})))}
1307
+ s.forEach((function(e){o[e]=o[e]||a}))}))}));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 Kn.query.call(this,e,t,n)},viewCleanup:function(e){return Kn.viewCleanup.call(this,e)}};function zn(e){return/^1-/.test(e)}function Vn(e,t){var n=Object.keys(t._attachments);return Promise.all(n.map((function(n){return e.getAttachment(t._id,n,{rev:t._rev})})))}
1308
1308
  // Fetch all the documents from the src as described in the "diffs",
1309
1309
  // which is a mapping of docs IDs to revisions. If the state ever
1310
1310
  // changes to "cancelled", then the returned promise will be rejected.
1311
1311
  // Else it will be resolved with a list of fetched documents.
1312
- var Vn="pouchdb";function Gn(e,t,n,r,o){return e.get(t).catch((function(n){if(404===n.status)return"http"!==e.adapter&&"https"!==e.adapter||L(404,"PouchDB is just checking if a remote checkpoint exists."),{session_id:r,_id:t,history:[],replicator:Vn,version:1};throw n})).then((function(i){if(!o.cancelled&&i.last_seq!==n)
1312
+ 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||D(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)
1313
1313
  // Filter out current entry for this replication
1314
1314
  return i.history=(i.history||[]).filter((function(e){return e.session_id!==r})),
1315
1315
  // Add the latest checkpoint to history
@@ -1317,47 +1317,47 @@ i.history.unshift({last_seq:n,session_id:r}),
1317
1317
  // Just take the last pieces in history, to
1318
1318
  // avoid really big checkpoint docs.
1319
1319
  // see comment on history size above
1320
- i.history=i.history.slice(0,5),i.version=1,i.replicator=Vn,i.session_id=r,i.last_seq=n,e.put(i).catch((function(i){if(409===i.status)
1320
+ 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)
1321
1321
  // retry; someone is trying to write a checkpoint simultaneously
1322
- return Gn(e,t,n,r,o);throw i}));
1322
+ return Qn(e,t,n,r,o);throw i}));
1323
1323
  // if the checkpoint has not changed, do not update
1324
- }))}function Qn(e,t,n,r,o){this.src=e,this.target=t,this.id=n,this.returnValue=r,this.opts=o||{}}Qn.prototype.writeCheckpoint=function(e,t){var n=this;return this.updateTarget(e,t).then((function(){return n.updateSource(e,t)}))},Qn.prototype.updateTarget=function(e,t){return this.opts.writeTargetCheckpoint?Gn(this.target,this.id,e,t,this.returnValue):Promise.resolve(!0)},Qn.prototype.updateSource=function(e,t){if(this.opts.writeSourceCheckpoint){var n=this;return Gn(this.src,this.id,e,t,this.returnValue).catch((function(e){if(Xn(e))return n.opts.writeSourceCheckpoint=!1,!0;throw e}))}return Promise.resolve(!0)};var Wn={undefined:function(e,t){
1324
+ }))}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){
1325
1325
  // This is the previous comparison function
1326
- return 0===lt(e.last_seq,t.last_seq)?t.last_seq:0
1326
+ return 0===dt(e.last_seq,t.last_seq)?t.last_seq:0
1327
1327
  /* istanbul ignore next */},1:function(e,t){
1328
1328
  // This is the comparison function ported from CouchDB
1329
1329
  // This checkpoint comparison is ported from CouchDBs source
1330
1330
  // they come from here:
1331
1331
  // https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906
1332
- return function(e,t){return e.session_id===t.session_id?{last_seq:e.last_seq,history:e.history}:Yn(e.history,t.history)}(t,e).last_seq}};function Yn(e,t){
1332
+ 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){
1333
1333
  // the erlang loop via function arguments is not so easy to repeat in JS
1334
1334
  // therefore, doing this as recursion
1335
1335
  var n=e[0],r=e.slice(1),o=t[0],i=t.slice(1);return n&&0!==t.length?
1336
1336
  /* istanbul ignore if */
1337
- Hn(n.session_id,t)?{last_seq:n.last_seq,history:e}:Hn(o.session_id,r)?{last_seq:o.last_seq,history:i}:Yn(r,i):{last_seq:0,history:[]}}function Hn(e,t){var n=t[0],r=t.slice(1);return!(!e||0===t.length)&&(e===n.session_id||Hn(e,r))}function Xn(e){return"number"==typeof e.status&&4===Math.floor(e.status/100)}function Zn(e,t,n,r,o){var i,a,u,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,w=n.selector,k=[],j=qe();// list of batches to be processed
1337
+ 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,a,u,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=Se();// list of batches to be processed
1338
1338
  o=o||{ok:!0,start_time:(new Date).toISOString(),docs_read:0,docs_written:0,doc_write_failures:0,errors:[]};var O={};function A(){return u?Promise.resolve():
1339
1339
  // Generate a unique id particular to this replication.
1340
1340
  // Not guaranteed to align perfectly with CouchDB's rep ids.
1341
- function(e,t,n){var r=n.doc_ids?n.doc_ids.sort(lt):"",o=n.filter?n.filter.toString():"",i="",s="",a="";
1341
+ function(e,t,n){var r=n.doc_ids?n.doc_ids.sort(dt):"",o=n.filter?n.filter.toString():"",i="",s="",a="";
1342
1342
  // possibility for checkpoints to be lost here as behaviour of
1343
1343
  // JSON.stringify is not stable (see #6226)
1344
- /* istanbul ignore if */return n.selector&&(a=JSON.stringify(n.selector)),n.filter&&n.query_params&&(i=JSON.stringify(function(e){return Object.keys(e).sort(lt).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+a;return new Promise((function(e){je(t,e)}))})).then((function(e){return"_local/"+e.replace(/\//g,".").replace(/\+/g,"_")}))}(e,t,n).then((function(o){a=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},u=new Qn(e,t,a,r,i)}))}function q(){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){
1344
+ /* istanbul ignore if */return n.selector&&(a=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+a;return new Promise((function(e){Oe(t,e)}))})).then((function(e){return"_local/"+e.replace(/\//g,".").replace(/\+/g,"_")}))}(e,t,n).then((function(o){a=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},u=new Wn(e,t,a,r,i)}))}function q(){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){
1345
1345
  /* istanbul ignore if */
1346
1346
  if(r.cancelled)throw D(),new Error("cancelled");
1347
1347
  // `res` doesn't include full documents (which live in `docs`), so we create a map of
1348
1348
  // (id -> error), and check for errors while iterating over `docs`
1349
1349
  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);
1350
1350
  // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
1351
- var i=(t.name||"").toLowerCase();if("unauthorized"!==i&&"forbidden"!==i)throw t;r.emit("denied",b(t))}else k.push(e)}))}),(function(t){throw o.doc_write_failures+=e.length,t}))}}function S(){if(i.error)throw new Error("There was a problem getting docs.");o.last_seq=p=i.seq;var e=b(o);return k.length&&(e.docs=k,
1351
+ 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 S(){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,
1352
1352
  // Attach 'pending' property if server supports it (CouchDB 2.0+)
1353
1353
  /* istanbul ignore if */
1354
1354
  "number"==typeof i.pending&&(e.pending=i.pending,delete i.pending),r.emit("change",e)),l=!0,u.writeCheckpoint(i.seq,j).then((function(){
1355
1355
  /* istanbul ignore if */
1356
- if(l=!1,r.cancelled)throw D(),new Error("cancelled");i=void 0,B()})).catch((function(e){throw R(e),e}))}function x(){return function(e,t,n,r){n=b(n);// we do not need to modify this
1356
+ if(l=!1,r.cancelled)throw D(),new Error("cancelled");i=void 0,B()})).catch((function(e){throw R(e),e}))}function x(){return function(e,t,n,r){n=w(n);// we do not need to modify this
1357
1357
  var o=[],i=!0;function s(t){
1358
1358
  // Optimization: fetch gen-1 docs and attachments in
1359
1359
  // a single request using _all_docs
1360
- 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||!Jn(e.value.rev)||(t=e.doc)._attachments&&Object.keys(t._attachments).length>0||function(e){return e._conflicts&&e._conflicts.length>0}(e.doc)||(
1360
+ 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||!zn(e.value.rev)||(t=e.doc)._attachments&&Object.keys(t._attachments).length>0||function(e){return e._conflicts&&e._conflicts.length>0}(e.doc)||(
1361
1361
  // strip _conflicts array to appease CSG (#5793)
1362
1362
  /* istanbul ignore if */
1363
1363
  e.doc._conflicts&&delete e.doc._conflicts,
@@ -1365,31 +1365,31 @@ e.doc._conflicts&&delete e.doc._conflicts,
1365
1365
  o.push(e.doc),delete n[e.id])}))}))}return Promise.resolve().then((function(){
1366
1366
  // filter out the generation 1 docs and get them
1367
1367
  // leaving the non-generation one docs to be got otherwise
1368
- var e=Object.keys(n).filter((function(e){var t=n[e].missing;return 1===t.length&&Jn(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){
1368
+ var e=Object.keys(n).filter((function(e){var t=n[e].missing;return 1===t.length&&zn(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){
1369
1369
  /* istanbul ignore if */
1370
1370
  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&&(
1371
1371
  // when AUTO_COMPACTION is set, docs can be returned which look
1372
1372
  // like this: {"missing":"1-7c3ac256b693c462af8442f992b83696"}
1373
- i=!1),r&&r._attachments?function(e,t,n){var r=te(t)&&!te(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){
1373
+ 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){
1374
1374
  /* istanbul ignore if */
1375
- 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(Z(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 E(){var e;r.cancelled||i||(0!==c.length?(i=c.shift(),(e={},i.changes.forEach((function(t){
1375
+ if(404!==e.status)throw e;return Vn(t,n)})):Vn(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 E(){var e;r.cancelled||i||(0!==c.length?(i=c.shift(),(e={},i.changes.forEach((function(t){
1376
1376
  // Couchbase Sync Gateway emits these, but we can ignore them
1377
1377
  /* istanbul ignore if */
1378
1378
  "_user/"!==t.id&&(e[t.id]=t.changes.map((function(e){return e.rev})))})),t.revsDiff(e).then((function(e){
1379
1379
  /* istanbul ignore if */
1380
1380
  if(r.cancelled)throw D(),new Error("cancelled");
1381
1381
  // currentBatch.diffs elements are deleted as the documents are written
1382
- i.diffs=e}))).then(x).then(q).then(S).then(E).catch((function(e){L("batch processing terminated with error",e)}))):C(!0))}function C(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")),E()):0!==c.length||i||((v&&O.live||d)&&(r.state="pending",r.emit("paused")),d&&D())}function L(e,t){h||(t.message||(t.message=e),o.ok=!1,o.status="aborting",c=[],f={seq:0,changes:[],docs:[]},D(t))}function D(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){
1382
+ i.diffs=e}))).then(x).then(q).then(S).then(E).catch((function(e){P("batch processing terminated with error",e)}))):C(!0))}function C(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")),E()):0!==c.length||i||((v&&O.live||d)&&(r.state="pending",r.emit("paused")),d&&D())}function P(e,t){h||(t.message||(t.message=e),o.ok=!1,o.status="aborting",c=[],f={seq:0,changes:[],docs:[]},D(t))}function D(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){
1383
1383
  // need to extend the error because Firefox considers ".result" read-only
1384
- (i=Y(i)).result=o;
1384
+ (i=H(i)).result=o;
1385
1385
  // Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
1386
1386
  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();
1387
- /* istanbul ignore if */if("function"!=typeof e.back_off_function&&(e.back_off_function=P),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(){Zn(e,t,n,r)}))}else r.emit("complete",o),r.removeAllListeners();
1387
+ /* istanbul ignore if */if("function"!=typeof e.back_off_function&&(e.back_off_function=L),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();
1388
1388
  /* istanbul ignore if */}function $(e,t,o){
1389
1389
  /* istanbul ignore if */
1390
1390
  if(r.cancelled)return D();
1391
1391
  // Attach 'pending' property if server supports it (CouchDB 2.0+)
1392
- /* istanbul ignore if */"number"==typeof t&&(f.pending=t),X(n)(e)&&(f.seq=e.seq||o,f.changes.push(e),s((function(){C(0===c.length&&O.live)})))}function I(e){
1392
+ /* istanbul ignore if */"number"==typeof t&&(f.pending=t),Z(n)(e)&&(f.seq=e.seq||o,f.changes.push(e),s((function(){C(0===c.length&&O.live)})))}function I(e){
1393
1393
  /* istanbul ignore if */
1394
1394
  if(_=!1,r.cancelled)return D();
1395
1395
  // if no results were returned then we're done,
@@ -1398,30 +1398,30 @@ if(e.results.length>0)O.since=e.results[e.results.length-1].seq,B(),C(!0);else{v
1398
1398
  // update the checkpoint so we start from the right seq next time
1399
1399
  i||0!==e.results.length?t():(l=!0,u.writeCheckpoint(e.last_seq,j).then((function(){l=!1,o.last_seq=p=e.last_seq,t()})).catch(R))}}function T(e){
1400
1400
  /* istanbul ignore if */
1401
- if(_=!1,r.cancelled)return D();L("changes rejected",e)}function B(){if(!_&&!d&&c.length<g){_=!0,r._changes&&(// remove old changes() and listeners
1401
+ if(_=!1,r.cancelled)return D();P("changes rejected",e)}function B(){if(!_&&!d&&c.length<g){_=!0,r._changes&&(// remove old changes() and listeners
1402
1402
  r.removeListener("cancel",r._abortChanges),r._changes.cancel()),r.once("cancel",o);var t=e.changes(O).on("change",$);t.then(i,i),t.then(I).catch(T),n.retry&&(
1403
1403
  // save for later so we can cancel if necessary
1404
1404
  r._changes=t,r._abortChanges=o)}function o(){t.cancel()}function i(){r.removeListener("cancel",o)}}function M(){A().then((function(){
1405
1405
  /* istanbul ignore if */
1406
- if(!r.cancelled)return u.getCheckpoint().then((function(e){O={since:p=e,limit:y,batch_size:y,style:"all_docs",doc_ids:m,selector:w,return_docs:!0},n.filter&&("string"!=typeof n.filter?
1406
+ if(!r.cancelled)return u.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?
1407
1407
  // required for the client-side filter in onChange
1408
1408
  O.include_docs=!0:// ddoc filter
1409
- O.filter=n.filter),"heartbeat"in n&&(O.heartbeat=n.heartbeat),"timeout"in n&&(O.timeout=n.timeout),n.query_params&&(O.query_params=n.query_params),n.view&&(O.view=n.view),B()}));D()})).catch((function(e){L("getCheckpoint rejected with ",e)}))}
1410
- /* istanbul ignore next */function R(e){l=!1,L("writeCheckpoint completed with error",e)}
1409
+ O.filter=n.filter),"heartbeat"in n&&(O.heartbeat=n.heartbeat),"timeout"in n&&(O.timeout=n.timeout),n.query_params&&(O.query_params=n.query_params),n.view&&(O.view=n.view),B()}));D()})).catch((function(e){P("getCheckpoint rejected with ",e)}))}
1410
+ /* istanbul ignore next */function R(e){l=!1,P("writeCheckpoint completed with error",e)}
1411
1411
  /* istanbul ignore if */r.ready(e,t),r.cancelled?// cancelled immediately
1412
1412
  D():(r._addedListeners||(r.once("cancel",D),"function"==typeof n.complete&&(r.once("error",n.complete),r.once("complete",(function(e){n.complete(null,e)}))),r._addedListeners=!0),void 0===n.since?M():A().then((function(){return l=!0,u.writeCheckpoint(n.since,j)})).then((function(){l=!1,
1413
1413
  /* istanbul ignore if */
1414
1414
  r.cancelled?D():(p=n.since,M())})).catch(R))}
1415
1415
  // We create a basic promise so the caller can cancel the replication possibly
1416
1416
  // before we have actually started listening to changes etc
1417
- function er(){d.call(this),this.cancelled=!1,this.state="pending";var e=this,t=new Promise((function(t,n){e.once("complete",t),e.once("error",n)}));e.then=function(e,n){return t.then(e,n)},e.catch=function(e){return t.catch(e)},
1417
+ function tr(){d.call(this),this.cancelled=!1,this.state="pending";var e=this,t=new Promise((function(t,n){e.once("complete",t),e.once("error",n)}));e.then=function(e,n){return t.then(e,n)},e.catch=function(e){return t.catch(e)},
1418
1418
  // As we allow error handling via "error" event as well,
1419
1419
  // put a stub in here so that rejecting never throws UnhandledError.
1420
- e.catch((function(){}))}function tr(e,t){var n=t.PouchConstructor;return"string"==typeof e?new n(e,t):e}function nr(e,t,n,r){if("function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),n.doc_ids&&!Array.isArray(n.doc_ids))throw Y(z,"`doc_ids` filter parameter is not a list.");n.complete=r,(n=b(n)).continuous=n.continuous||n.live,n.retry="retry"in n&&n.retry,
1420
+ 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(V,"`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,
1421
1421
  /*jshint validthis:true */
1422
- n.PouchConstructor=n.PouchConstructor||this;var o=new er(n);return Zn(tr(e,n),tr(t,n),n,o),o}function rr(e,t,n,r){return"function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),
1422
+ 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={}),
1423
1423
  /*jshint validthis:true */
1424
- (n=b(n)).PouchConstructor=n.PouchConstructor||this,new or(e=tr(e,n),t=tr(t,n),n,r)}function or(e,t,n,r){var o=this;this.canceled=!1;var i=n.push?D({},n,n.push):n,s=n.pull?D({},n,n.pull):n;function a(e){o.emit("change",{direction:"pull",change:e})}function u(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,
1424
+ (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?$({},n,n.push):n,s=n.pull?$({},n,n.pull):n;function a(e){o.emit("change",{direction:"pull",change:e})}function u(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,
1425
1425
  /* istanbul ignore if */
1426
1426
  o.pullPaused&&o.emit("paused")}function d(){o.pullPaused=!0,
1427
1427
  /* istanbul ignore if */
@@ -1429,7 +1429,7 @@ o.pushPaused&&o.emit("paused")}function h(){o.pushPaused=!1,
1429
1429
  /* istanbul ignore if */
1430
1430
  o.pullPaused&&o.emit("active",{direction:"push"})}function p(){o.pullPaused=!1,
1431
1431
  /* istanbul ignore if */
1432
- o.pushPaused&&o.emit("active",{direction:"pull"})}this.push=nr(e,t,i),this.pull=nr(t,e,s),this.pushPaused=!0,this.pullPaused=!0;var v={};function y(e){// type is 'push' or 'pull'
1432
+ 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'
1433
1433
  return function(t,n){("change"===t&&(n===a||n===u)||"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&&
1434
1434
  // both push and pull have asked to be removed
1435
1435
  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",a),g(o.push,"change",u)):"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",a),o.push.removeListener("change",u)):"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?
@@ -1441,15 +1441,15 @@ r(e):
1441
1441
  // due to 'error' being a special event in EventEmitters
1442
1442
  o.emit("error",e),o.removeAllListeners(),r)
1443
1443
  // no sense throwing if we're already emitting an 'error' event
1444
- throw e}));this.then=function(e,t){return _.then(e,t)},this.catch=function(e){return _.catch(e)}}Qn.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){
1444
+ 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){
1445
1445
  /* istanbul ignore if */
1446
1446
  if(404!==e.status)throw e;return 0})):e.target.get(e.id).then((function(t){return e.opts&&e.opts.writeTargetCheckpoint&&!e.opts.writeSourceCheckpoint?t.last_seq||0:e.src.get(e.id).then((function(e){
1447
1447
  // Since we can't migrate an old version doc to a new one
1448
1448
  // (no session id), we just go with the lowest seq in this case
1449
1449
  /* istanbul ignore if */
1450
- return t.version!==e.version?0:(n=t.version?t.version.toString():"undefined")in Wn?Wn[n](t,e):0
1451
- /* 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 Xn(n)?(e.opts.writeSourceCheckpoint=!1,t.last_seq):0
1452
- /* istanbul ignore next */}));throw n}))})).catch((function(e){if(404!==e.status)throw e;return 0}))},l(er,d),er.prototype.cancel=function(){this.cancelled=!0,this.state="cancelled",this.emit("cancel")},er.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())},He.plugin((function(e){e.adapter("idb",cn,!0)})).plugin((function(e){e.adapter("http",_n,!1),e.adapter("https",_n,!1)})).plugin(Kn).plugin((function(e){e.replicate=nr,e.sync=rr,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=He}).call(this)}).call(this,e("_process"))},{_process:22,argsarray:1,events:3,immediate:4,inherits:11,"spark-md5":23,uuid:13,vuvuzela:24}],11:[function(e,t,n){"function"==typeof Object.create?
1450
+ return t.version!==e.version?0:(n=t.version?t.version.toString():"undefined")in Yn?Yn[n](t,e):0
1451
+ /* 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
1452
+ /* 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)}).call(this,e("_process"))},{_process:22,argsarray:1,events:3,immediate:4,inherits:11,"spark-md5":23,uuid:13,vuvuzela:24}],11:[function(e,t,n){"function"==typeof Object.create?
1453
1453
  // implementation from standard node.js 'util' module
1454
1454
  t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:
1455
1455
  // old school shim for old browsers
@@ -1516,7 +1516,7 @@ e[t>>5]|=128<<t%32,e[r(t)-1]=t;let n=1732584193,i=-271733879,f=-1732584194,l=271
1516
1516
  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";
1517
1517
  // Adapted from Chris Veness' SHA1 code at
1518
1518
  // http://www.movable-type.co.uk/scripts/sha1.html
1519
- function r(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^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
1519
+ 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
1520
1520
  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),a=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];a[t]=n}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[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]=a[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],u=n[1],c=n[2],f=n[3],l=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),a=o(s,5)+r(n,u,c,f)+l+t[n]+i[e]>>>0;l=f,f=c,c=o(u,30)>>>0,u=s,s=a}n[0]=n[0]+s>>>0,n[1]=n[1]+u>>>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}}
1521
1521
  // **`v1()` - Generate time-based UUID**
1522
1522
  // Inspired by https://github.com/LiosK/UUID.js