@oracle/oraclejet 11.1.0 → 11.1.4
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.
- package/README.md +1 -1
- package/THIRDPARTYLICENSE.txt +7 -7
- package/dist/css/alta/oj-alta-min.css +1 -1
- package/dist/css/alta/oj-alta-notag-min.css +1 -1
- package/dist/css/alta/oj-alta-notag.css +81 -30
- package/dist/css/alta/oj-alta.css +81 -30
- package/dist/css/alta-android/oj-alta-min.css +1 -1
- package/dist/css/alta-android/oj-alta.css +81 -30
- package/dist/css/alta-ios/oj-alta-min.css +1 -1
- package/dist/css/alta-ios/oj-alta.css +81 -30
- package/dist/css/alta-windows/oj-alta-min.css +1 -1
- package/dist/css/alta-windows/oj-alta.css +81 -30
- package/dist/css/redwood/oj-redwood-min.css +1 -1
- package/dist/css/redwood/oj-redwood-notag-min.css +1 -1
- package/dist/css/redwood/oj-redwood-notag-novars-min.css +1 -1
- package/dist/css/redwood/oj-redwood-notag-novars.css +9 -2
- package/dist/css/redwood/oj-redwood-notag.css +9 -2
- package/dist/css/redwood/oj-redwood-novars-min.css +1 -1
- package/dist/css/redwood/oj-redwood-novars.css +9 -2
- package/dist/css/redwood/oj-redwood.css +9 -2
- package/dist/css/stable/oj-stable-min.css +1 -1
- package/dist/css/stable/oj-stable.css +112 -1
- package/dist/custom-tsc/utils/MetadataUtils.js +7 -5
- package/dist/js/libs/oj/debug/ojbufferingdataprovider.js +12 -8
- package/dist/js/libs/oj/debug/ojcachediteratorresultsdataprovider.js +83 -41
- package/dist/js/libs/oj/debug/ojcore-base.js +2 -2
- package/dist/js/libs/oj/debug/ojdatacollection-common.js +53 -2
- package/dist/js/libs/oj/debug/ojdataproviderscroller.js +6 -4
- package/dist/js/libs/oj/debug/ojdrawerlayout.js +1 -0
- package/dist/js/libs/oj/debug/ojdrawerpopup.js +1 -6
- package/dist/js/libs/oj/debug/ojlistdataproviderview.js +28 -9
- package/dist/js/libs/oj/debug/ojlistview.js +19 -0
- package/dist/js/libs/oj/debug/ojselectbase.js +14 -5
- package/dist/js/libs/oj/debug/ojselectcombobox.js +51 -0
- package/dist/js/libs/oj/debug/ojtable.js +5 -5
- package/dist/js/libs/oj/debug/ojtemplateengine.js +19 -2
- package/dist/js/libs/oj/debug/ojtoolbar.js +14 -3
- package/dist/js/libs/oj/debug/ojtreeview.js +12 -0
- package/dist/js/libs/oj/debug/ojvcomponent-template.js +11 -6
- package/dist/js/libs/oj/debug_esm/ojbufferingdataprovider.js +12 -8
- package/dist/js/libs/oj/debug_esm/ojcachediteratorresultsdataprovider.js +83 -41
- package/dist/js/libs/oj/debug_esm/ojcore-base.js +2 -2
- package/dist/js/libs/oj/debug_esm/ojdatacollection-common.js +53 -3
- package/dist/js/libs/oj/debug_esm/ojdataproviderscroller.js +7 -5
- package/dist/js/libs/oj/debug_esm/ojdrawerlayout.js +1 -0
- package/dist/js/libs/oj/debug_esm/ojdrawerpopup.js +1 -6
- package/dist/js/libs/oj/debug_esm/ojlistdataproviderview.js +28 -9
- package/dist/js/libs/oj/debug_esm/ojlistview.js +20 -1
- package/dist/js/libs/oj/debug_esm/ojselectbase.js +14 -5
- package/dist/js/libs/oj/debug_esm/ojselectcombobox.js +51 -0
- package/dist/js/libs/oj/debug_esm/ojtable.js +6 -6
- package/dist/js/libs/oj/debug_esm/ojtemplateengine.js +18 -1
- package/dist/js/libs/oj/debug_esm/ojtoolbar.js +14 -3
- package/dist/js/libs/oj/debug_esm/ojtreeview.js +12 -0
- package/dist/js/libs/oj/debug_esm/ojvcomponent-template.js +10 -6
- package/dist/js/libs/oj/main-template.js +3 -3
- package/dist/js/libs/oj/min/ojbufferingdataprovider.js +1 -1
- package/dist/js/libs/oj/min/ojbufferingdataprovider.js.map +1 -1
- package/dist/js/libs/oj/min/ojcachediteratorresultsdataprovider.js +2 -2
- package/dist/js/libs/oj/min/ojcachediteratorresultsdataprovider.js.map +1 -1
- package/dist/js/libs/oj/min/ojcore-base.js +1 -1
- package/dist/js/libs/oj/min/ojdatacollection-common.js +1 -1
- package/dist/js/libs/oj/min/ojdatacollection-common.js.map +1 -1
- package/dist/js/libs/oj/min/ojdataproviderscroller.js +1 -1
- package/dist/js/libs/oj/min/ojdataproviderscroller.js.map +1 -1
- package/dist/js/libs/oj/min/ojdrawerlayout.js +1 -1
- package/dist/js/libs/oj/min/ojdrawerlayout.js.map +1 -1
- package/dist/js/libs/oj/min/ojdrawerpopup.js +1 -1
- package/dist/js/libs/oj/min/ojdrawerpopup.js.map +1 -1
- package/dist/js/libs/oj/min/ojlistdataproviderview.js +1 -1
- package/dist/js/libs/oj/min/ojlistdataproviderview.js.map +1 -1
- package/dist/js/libs/oj/min/ojlistview.js +1 -1
- package/dist/js/libs/oj/min/ojlistview.js.map +1 -1
- package/dist/js/libs/oj/min/ojselectbase.js +1 -1
- package/dist/js/libs/oj/min/ojselectbase.js.map +1 -1
- package/dist/js/libs/oj/min/ojselectcombobox.js +1 -1
- package/dist/js/libs/oj/min/ojselectcombobox.js.map +1 -1
- package/dist/js/libs/oj/min/ojtable.js +1 -1
- package/dist/js/libs/oj/min/ojtable.js.map +1 -1
- package/dist/js/libs/oj/min/ojtemplateengine.js +1 -1
- package/dist/js/libs/oj/min/ojtemplateengine.js.map +1 -1
- package/dist/js/libs/oj/min/ojtoolbar.js +1 -1
- package/dist/js/libs/oj/min/ojtoolbar.js.map +1 -1
- package/dist/js/libs/oj/min/ojtreeview.js +1 -1
- package/dist/js/libs/oj/min/ojtreeview.js.map +1 -1
- package/dist/js/libs/oj/min/ojvcomponent-template.js +1 -1
- package/dist/js/libs/oj/min/ojvcomponent-template.js.map +1 -1
- package/dist/js/libs/persist/debug/impl/PersistenceXMLHttpRequest.js +20 -0
- package/dist/js/libs/persist/debug/{offline-persistence-toolkit-arraystore-1.5.4.js → offline-persistence-toolkit-arraystore-1.5.7.js} +0 -0
- package/dist/js/libs/persist/debug/{offline-persistence-toolkit-core-1.5.4.js → offline-persistence-toolkit-core-1.5.7.js} +1515 -1393
- package/dist/js/libs/persist/debug/{offline-persistence-toolkit-filesystemstore-1.5.4.js → offline-persistence-toolkit-filesystemstore-1.5.7.js} +1369 -1369
- package/dist/js/libs/persist/debug/{offline-persistence-toolkit-localstore-1.5.4.js → offline-persistence-toolkit-localstore-1.5.7.js} +0 -0
- package/dist/js/libs/persist/debug/{offline-persistence-toolkit-pouchdbstore-1.5.4.js → offline-persistence-toolkit-pouchdbstore-1.5.7.js} +1369 -1369
- package/dist/js/libs/persist/debug/{offline-persistence-toolkit-responseproxy-1.5.4.js → offline-persistence-toolkit-responseproxy-1.5.7.js} +1369 -1369
- package/dist/js/libs/persist/debug/persistenceManager.js +114 -21
- package/dist/js/libs/persist/debug/persistenceUtils.js +16 -7
- package/dist/js/libs/persist/debug/pouchdb-browser-7.2.2.js +1369 -1369
- package/dist/js/libs/persist/min/impl/PersistenceSyncManager.js +1 -1
- package/dist/js/libs/persist/min/impl/PersistenceXMLHttpRequest.js +1 -1
- package/dist/js/libs/persist/min/impl/sql-where-parser.min.js +1 -1
- package/dist/js/libs/persist/min/{offline-persistence-toolkit-arraystore-1.5.4.js → offline-persistence-toolkit-arraystore-1.5.7.js} +0 -0
- package/dist/js/libs/persist/min/{offline-persistence-toolkit-core-1.5.4.js → offline-persistence-toolkit-core-1.5.7.js} +443 -443
- package/dist/js/libs/persist/min/{offline-persistence-toolkit-filesystemstore-1.5.4.js → offline-persistence-toolkit-filesystemstore-1.5.7.js} +441 -441
- package/dist/js/libs/persist/min/{offline-persistence-toolkit-localstore-1.5.4.js → offline-persistence-toolkit-localstore-1.5.7.js} +0 -0
- package/dist/js/libs/persist/min/{offline-persistence-toolkit-pouchdbstore-1.5.4.js → offline-persistence-toolkit-pouchdbstore-1.5.7.js} +441 -441
- package/dist/js/libs/persist/min/{offline-persistence-toolkit-responseproxy-1.5.4.js → offline-persistence-toolkit-responseproxy-1.5.7.js} +441 -441
- package/dist/js/libs/persist/min/persistenceManager.js +1 -1
- package/dist/js/libs/persist/min/persistenceUtils.js +1 -1
- package/dist/js/libs/persist/min/pouchdb-browser-7.2.2.js +441 -441
- package/dist/js/libs/persist/min/pouchdb.find.js +1 -1
- package/dist/js/libs/persist/min/queryHandlers.js +1 -1
- package/dist/metadata/components/allComponents.json +233 -233
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/accordion/themes/base/_oj-accordion.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/accordion/themes/redwood/_oj-accordion.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/accordion/themes/redwood/oj-accordion.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/accordion/themes/stable/_oj-accordion.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/accordion/themes/stable/oj-accordion.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/action-card/themes/base/_oj-action-card.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/action-card/themes/redwood/_oj-action-card.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/action-card/themes/redwood/oj-action-card.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/action-card/themes/stable/_oj-action-card.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/action-card/themes/stable/oj-action-card.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/base/_oj.common.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/base/oj.common.settings.cssvariables.css +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/redwood/_oj-all-components-common.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/redwood/_oj-all-components-notag.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/redwood/_oj-all-components.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/redwood/_oj.redwood.settings.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/redwood/oj.redwood.cssvars.settings.css +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/stable/_oj-all-components-common.scss +2 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/stable/_oj-all-components-notag.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/stable/_oj-all-components.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/stable/_oj.stable.settings.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/all-components/themes/stable/oj.stable.cssvars.settings.css +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/animation/themes/base/_oj-animation.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/animation/themes/redwood/_oj-animation.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/animation/themes/redwood/_oj-animation.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/animation/themes/redwood/oj-animation.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/animation/themes/stable/_oj-animation.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/animation/themes/stable/_oj-animation.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/animation/themes/stable/oj-animation.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout/themes/base/_oj-app-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout/themes/redwood/_oj-app-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout/themes/redwood/_oj-app-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout/themes/stable/_oj-app-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout/themes/stable/_oj-app-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-hybrid/themes/base/_oj-app-layout-hybrid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-hybrid/themes/redwood/_oj-app-layout-hybrid.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-hybrid/themes/redwood/oj-app-layout-hybrid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-hybrid/themes/stable/_oj-app-layout-hybrid.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-hybrid/themes/stable/oj-app-layout-hybrid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-web/themes/base/_oj-app-layout-web.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-web/themes/redwood/_oj-app-layout-web.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-web/themes/redwood/oj-app-layout-web.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-web/themes/stable/_oj-app-layout-web.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/app-layout-web/themes/stable/oj-app-layout-web.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/avatar/themes/base/_oj-avatar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/avatar/themes/redwood/_oj-avatar-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/avatar/themes/redwood/_oj-avatar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/avatar/themes/redwood/oj-avatar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/avatar/themes/stable/_oj-avatar-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/avatar/themes/stable/_oj-avatar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/avatar/themes/stable/oj-avatar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/badge/themes/base/_oj-badge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/badge/themes/redwood/_oj-badge-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/badge/themes/redwood/_oj-badge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/badge/themes/redwood/oj-badge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/badge/themes/stable/_oj-badge-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/badge/themes/stable/_oj-badge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/badge/themes/stable/oj-badge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/base/_oj-button.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/redwood/_oj-button-ignore.scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/redwood/_oj-button-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/redwood/_oj-button.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/redwood/oj-button.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/stable/_oj-button-ignore.scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/stable/_oj-button.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/button/themes/stable/oj-button.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset/themes/base/_oj-buttonset.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset/themes/redwood/_oj-buttonset-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset/themes/redwood/_oj-buttonset.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset/themes/redwood/_oj-buttonset.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset/themes/stable/_oj-buttonset-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset/themes/stable/_oj-buttonset.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset/themes/stable/_oj-buttonset.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset-many/themes/redwood/oj-buttonset-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset-many/themes/stable/oj-buttonset-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset-one/themes/redwood/oj-buttonset-one.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/buttonset-one/themes/stable/oj-buttonset-one.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/chart/themes/base/_oj-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/chart/themes/redwood/_oj-chart.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/chart/themes/redwood/oj-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/chart/themes/stable/_oj-chart.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/chart/themes/stable/oj-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/checkboxset/themes/redwood/_oj-checkboxset.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/checkboxset/themes/redwood/oj-checkboxset.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/checkboxset/themes/stable/_oj-checkboxset.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/checkboxset/themes/stable/oj-checkboxset.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/collapsible/themes/base/_oj-collapsible.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/collapsible/themes/redwood/_oj-collapsible.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/collapsible/themes/redwood/oj-collapsible.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/collapsible/themes/stable/_oj-collapsible.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/collapsible/themes/stable/oj-collapsible.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/collection/themes/redwood/_oj-collection.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/collection/themes/stable/_oj-collection.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-palette/themes/base/_oj-color-palette.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-palette/themes/redwood/_oj-color-palette.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-palette/themes/redwood/oj-color-palette.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-palette/themes/stable/_oj-color-palette.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-palette/themes/stable/oj-color-palette.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-spectrum/themes/base/_oj-color-spectrum.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-spectrum/themes/redwood/_oj-color-spectrum.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-spectrum/themes/redwood/oj-color-spectrum.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-spectrum/themes/stable/_oj-color-spectrum.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/color-spectrum/themes/stable/oj-color-spectrum.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox/themes/base/_oj-combobox.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox/themes/redwood/_oj-combobox.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox/themes/redwood/_oj-combobox.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox/themes/stable/_oj-combobox.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox/themes/stable/_oj-combobox.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox-many/themes/redwood/oj-combobox-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox-many/themes/stable/oj-combobox-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox-one/themes/redwood/oj-combobox-one.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/combobox-one/themes/stable/oj-combobox-one.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/conveyor-belt/themes/base/_oj-conveyor-belt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/conveyor-belt/themes/redwood/_oj-conveyor-belt.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/conveyor-belt/themes/redwood/oj-conveyor-belt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/conveyor-belt/themes/stable/_oj-conveyor-belt.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/conveyor-belt/themes/stable/oj-conveyor-belt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/core/themes/redwood/_oj-core-ignore.scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/core/themes/redwood/_oj-core-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/core/themes/redwood/_oj-core.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/core/themes/stable/_oj-core.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/data-grid/themes/base/_oj-data-grid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/data-grid/themes/redwood/_oj-data-grid.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/data-grid/themes/redwood/oj-data-grid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/data-grid/themes/stable/_oj-data-grid.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/data-grid/themes/stable/oj-data-grid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-picker/themes/redwood/oj-date-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-picker/themes/stable/oj-date-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-time-picker/themes/base/_oj-date-time-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-time-picker/themes/redwood/oj-date-time-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-time-picker/themes/stable/_oj-date-time-picker.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-time-picker/themes/stable/_oj-date-time-picker.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/date-time-picker/themes/stable/oj-date-time-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/diagram/themes/base/_oj-diagram.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/diagram/themes/redwood/_oj-diagram.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/diagram/themes/redwood/oj-diagram.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/diagram/themes/stable/_oj-diagram.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/diagram/themes/stable/oj-diagram.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/base/_oj-dialog.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/redwood/_oj-dialog-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/redwood/_oj-dialog.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/redwood/_oj-dialog.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/redwood/oj-dialog.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/stable/_oj-dialog-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/stable/_oj-dialog.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/stable/_oj-dialog.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dialog/themes/stable/oj-dialog.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-layout/themes/base/_oj-drawer-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-layout/themes/redwood/_oj-drawer-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-layout/themes/redwood/oj-drawer-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-layout/themes/stable/_oj-drawer-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-layout/themes/stable/oj-drawer-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-popup/themes/base/_oj-drawer-popup.scss +10 -1
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-popup/themes/redwood/_oj-drawer-popup.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-popup/themes/redwood/oj-drawer-popup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-popup/themes/stable/_oj-drawer-popup.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/drawer-popup/themes/stable/oj-drawer-popup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dvt/themes/base/_oj-dvt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dvt/themes/redwood/_oj-dvt.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dvt/themes/redwood/_oj-dvt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dvt/themes/stable/_oj-dvt.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/dvt/themes/stable/_oj-dvt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/file-picker/themes/base/_oj-file-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/file-picker/themes/redwood/_oj-file-picker.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/file-picker/themes/redwood/oj-file-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/file-picker/themes/stable/_oj-file-picker.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/file-picker/themes/stable/oj-file-picker.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/film-strip/themes/base/_oj-film-strip.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/film-strip/themes/redwood/_oj-film-strip.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/film-strip/themes/redwood/oj-film-strip.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/film-strip/themes/stable/_oj-film-strip.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/film-strip/themes/stable/oj-film-strip.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/flex/themes/base/_oj-flex.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/flex/themes/redwood/oj-flex.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/flex/themes/stable/oj-flex.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/base/_oj-form-control.mixins.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/base/_oj-form-control.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/base/_oj-messaging.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/redwood/_oj-form-control.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/redwood/_oj-form-control.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/redwood/_oj-messaging.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/redwood/_oj-messaging.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/stable/_oj-form-control.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/stable/_oj-form-control.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/stable/_oj-messaging.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-control/themes/stable/_oj-messaging.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-layout/themes/base/_oj-form-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-layout/themes/redwood/_oj-form-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-layout/themes/redwood/_oj-form-layout.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-layout/themes/redwood/oj-form-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-layout/themes/stable/_oj-form-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-layout/themes/stable/_oj-form-layout.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/form-layout/themes/stable/oj-form-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gantt/themes/base/_oj-gantt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gantt/themes/redwood/_oj-gantt.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gantt/themes/redwood/oj-gantt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gantt/themes/stable/_oj-gantt.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gantt/themes/stable/oj-gantt.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gauge/themes/base/_oj-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gauge/themes/redwood/_oj-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gauge/themes/redwood/oj-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gauge/themes/stable/_oj-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/gauge/themes/stable/oj-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/grid/themes/base/_oj-grid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/grid/themes/redwood/oj-grid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/grid/themes/stable/oj-grid.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/base/_oj-helpers.scss +1 -1
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/base/_oj-responsive-helpers.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/redwood/_oj-theme.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/redwood/oj-helpers.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/redwood/oj-responsive.helpers.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/stable/_oj-theme.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/stable/oj-helpers.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/helpers/themes/stable/oj-responsive.helpers.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/highlight-text/themes/base/_oj-highlight-text.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/highlight-text/themes/redwood/oj-highlight-text.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/highlight-text/themes/stable/oj-highlight-text.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icon-circle/themes/base/_oj-icon-circle.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icon-circle/themes/redwood/_oj-icon-circle-ignore.scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icon-circle/themes/redwood/_oj-icon-circle.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icon-circle/themes/redwood/oj-icon-circle.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/base/_oj-icons.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/redwood/_oj-icon-font.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/redwood/_oj-icons-ignore.scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/redwood/_oj-icons.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/redwood/oj-icons.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/stable/_oj-icon-font.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/stable/_oj-icons.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/icons/themes/stable/oj-icons.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/indexer/themes/base/_oj-indexer.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/indexer/themes/redwood/_oj-indexer.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/indexer/themes/redwood/oj-indexer.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/indexer/themes/stable/_oj-indexer.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/indexer/themes/stable/oj-indexer.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-date/themes/redwood/oj-input-date.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-date/themes/stable/oj-input-date.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-date-time/themes/redwood/oj-input-date-time.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-date-time/themes/stable/oj-input-date-time.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-number/themes/base/_oj-input-number.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-number/themes/redwood/_oj-input-number.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-number/themes/redwood/oj-input-number.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-number/themes/stable/_oj-input-number.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-number/themes/stable/oj-input-number.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-password/themes/redwood/oj-input-password.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-password/themes/stable/oj-input-password.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-search/themes/base/_oj-input-search.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-search/themes/redwood/_oj-input-search-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-search/themes/redwood/_oj-input-search.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-search/themes/redwood/_oj-input-search.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-search/themes/stable/_oj-input-search-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-search/themes/stable/_oj-input-search.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-search/themes/stable/_oj-input-search.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-text/themes/base/_oj-input-text.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-text/themes/redwood/_oj-input-text.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-text/themes/redwood/oj-input-text.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-text/themes/stable/_oj-input-text.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-text/themes/stable/oj-input-text.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-time/themes/redwood/oj-input-time.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/input-time/themes/stable/oj-input-time.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label/themes/base/_oj-label.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label/themes/redwood/_oj-label-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label/themes/redwood/_oj-label.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label/themes/redwood/oj-label.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label/themes/stable/_oj-label.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label/themes/stable/oj-label.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label-value/themes/base/_oj-label-value.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label-value/themes/redwood/_oj-label-value.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/label-value/themes/stable/_oj-label-value.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/led-gauge/themes/base/_oj-led-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/led-gauge/themes/redwood/_oj-led-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/led-gauge/themes/redwood/oj-led-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/led-gauge/themes/stable/_oj-led-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/led-gauge/themes/stable/oj-led-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/legend/themes/base/_oj-legend.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/legend/themes/redwood/_oj-legend.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/legend/themes/redwood/oj-legend.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/legend/themes/stable/_oj-legend.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/legend/themes/stable/oj-legend.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-box/themes/base/_oj-list-box.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-box/themes/redwood/_oj-list-box.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-box/themes/redwood/_oj-list-box.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-box/themes/stable/_oj-list-box.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-box/themes/stable/_oj-list-box.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-item-layout/themes/base/_oj-list-item-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-item-layout/themes/redwood/_oj-list-item-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-item-layout/themes/redwood/oj-list-item-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-item-layout/themes/stable/_oj-list-item-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-item-layout/themes/stable/oj-list-item-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-view/themes/base/_oj-list-view.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-view/themes/redwood/_oj-list-view.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-view/themes/redwood/oj-list-view.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-view/themes/stable/_oj-list-view.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/list-view/themes/stable/oj-list-view.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/masonry-layout/themes/base/_oj-masonry-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/masonry-layout/themes/redwood/oj-masonry-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/masonry-layout/themes/stable/_oj-masonry-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/masonry-layout/themes/stable/_oj-masonry-layout.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/masonry-layout/themes/stable/oj-masonry-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu/themes/base/_oj-menu.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu/themes/redwood/_oj-menu.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu/themes/redwood/oj-menu.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu/themes/stable/_oj-menu.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu/themes/stable/oj-menu.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-button/themes/base/_oj-menu-button.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-button/themes/redwood/_oj-menu-button.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-button/themes/redwood/_oj-menu-button.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-button/themes/redwood/oj-menu-button.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-button/themes/stable/_oj-menu-button.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-button/themes/stable/_oj-menu-button.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-button/themes/stable/oj-menu-button.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-select-many/themes/base/_oj-menu-select-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-select-many/themes/redwood/_oj-menu-select-many.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-select-many/themes/redwood/oj-menu-select-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-select-many/themes/stable/_oj-menu-select-many.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/menu-select-many/themes/stable/oj-menu-select-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/base/_oj-message.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/redwood/_oj-message-ignore.scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/redwood/_oj-message.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/redwood/_oj-message.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/redwood/oj-message.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/stable/_oj-message.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/stable/_oj-message.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/message/themes/stable/oj-message.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/messages/themes/base/_oj-messages.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/messages/themes/redwood/_oj-messages.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/messages/themes/redwood/_oj-messages.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/messages/themes/redwood/oj-messages.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/messages/themes/stable/_oj-messages.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/messages/themes/stable/_oj-messages.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/messages/themes/stable/oj-messages.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/module/themes/base/_oj-module.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/module/themes/redwood/oj-module.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/module/themes/stable/oj-module.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/n-box/themes/base/_oj-n-box.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/n-box/themes/redwood/_oj-n-box.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/n-box/themes/redwood/oj-n-box.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/n-box/themes/stable/_oj-n-box.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/n-box/themes/stable/oj-n-box.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/navigation-list/themes/base/_oj-navigation-list.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/navigation-list/themes/redwood/_oj-navigation-list-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/navigation-list/themes/redwood/_oj-navigation-list.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/navigation-list/themes/redwood/oj-navigation-list.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/navigation-list/themes/stable/_oj-navigation-list-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/navigation-list/themes/stable/_oj-navigation-list.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/navigation-list/themes/stable/oj-navigation-list.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/off-canvas/themes/base/_oj-off-canvas.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/off-canvas/themes/redwood/_oj-off-canvas.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/off-canvas/themes/redwood/oj-off-canvas.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/off-canvas/themes/stable/_oj-off-canvas.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/off-canvas/themes/stable/oj-off-canvas.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/optgroup/themes/base/_oj-optgroup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/optgroup/themes/redwood/oj-optgroup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/optgroup/themes/stable/oj-optgroup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/option/themes/base/_oj-option.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/option/themes/redwood/oj-option.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/option/themes/stable/oj-option.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/paging-control/themes/base/_oj-paging-control.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/paging-control/themes/redwood/_oj-paging-control.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/paging-control/themes/redwood/oj-paging-control.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/paging-control/themes/stable/_oj-paging-control.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/paging-control/themes/stable/oj-paging-control.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/palette/themes/redwood/_oj-palette-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/palette/themes/redwood/_oj-palette.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/palette/themes/stable/_oj-palette.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/panel/themes/base/_oj-panel.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/panel/themes/redwood/_oj-panel-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/panel/themes/redwood/_oj-panel.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/panel/themes/redwood/oj-panel.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/panel/themes/stable/_oj-panel.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/panel/themes/stable/oj-panel.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/picto-chart/themes/base/_oj-picto-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/picto-chart/themes/redwood/_oj-picto-chart.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/picto-chart/themes/redwood/oj-picto-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/picto-chart/themes/stable/_oj-picto-chart.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/picto-chart/themes/stable/oj-picto-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/base/_oj-layer.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/base/_oj-popup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/redwood/_oj-layer.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/redwood/_oj-popup.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/redwood/oj-popup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/stable/_oj-layer.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/stable/_oj-popup.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/popup/themes/stable/oj-popup.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/base/_oj-progress-bar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/redwood/_oj-progress-bar-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/redwood/_oj-progress-bar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/redwood/_oj-progress-bar.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/redwood/oj-progress-bar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/stable/_oj-progress-bar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/stable/_oj-progress-bar.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-bar/themes/stable/oj-progress-bar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/base/_oj-progress-circle.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/redwood/_oj-progress-circle-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/redwood/_oj-progress-circle.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/redwood/_oj-progress-circle.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/redwood/oj-progress-circle.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/stable/_oj-progress-circle.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/stable/_oj-progress-circle.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/progress-circle/themes/stable/oj-progress-circle.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radio-checkbox/themes/base/_oj-radiocheckbox.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radioset/themes/redwood/_oj-radioset.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radioset/themes/redwood/oj-radioset.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radioset/themes/stable/_oj-radioset.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/radioset/themes/stable/oj-radioset.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rangeslider/themes/redwood/_oj-rangeslider.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rangeslider/themes/redwood/oj-rangeslider.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rangeslider/themes/stable/_oj-rangeslider.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rangeslider/themes/stable/oj-rangeslider.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rating-gauge/themes/base/_oj-rating-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rating-gauge/themes/redwood/_oj-rating-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rating-gauge/themes/redwood/oj-rating-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rating-gauge/themes/stable/_oj-rating-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/rating-gauge/themes/stable/oj-rating-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/refresher/themes/base/_oj-refresher.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/refresher/themes/redwood/_oj-refresher.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/refresher/themes/redwood/_oj-refresher.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/refresher/themes/redwood/oj-refresher.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/refresher/themes/stable/_oj-refresher.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/refresher/themes/stable/_oj-refresher.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/refresher/themes/stable/oj-refresher.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/resizable/themes/base/_oj-resizable.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/resizable/themes/redwood/_oj-resizable.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/resizable/themes/stable/_oj-resizable.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/row-expander/themes/base/_oj-row-expander.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/row-expander/themes/redwood/_oj-row-expander.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/row-expander/themes/redwood/oj-row-expander.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/row-expander/themes/stable/_oj-row-expander.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/row-expander/themes/stable/oj-row-expander.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/scrollbar/themes/base/_oj-scrollbar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/scrollbar/themes/redwood/_oj-scrollbar-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/scrollbar/themes/redwood/_oj-scrollbar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/scrollbar/themes/redwood/_oj-scrollbar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/scrollbar/themes/stable/_oj-scrollbar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/scrollbar/themes/stable/_oj-scrollbar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select/themes/base/_oj-select.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select/themes/redwood/_oj-select.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select/themes/redwood/_oj-select.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select/themes/stable/_oj-select.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select/themes/stable/_oj-select.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-many/themes/redwood/oj-select-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-many/themes/stable/oj-select-many.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-one/themes/redwood/oj-select-one.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-original/themes/base/_oj-select-original.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-original/themes/redwood/_oj-select-original.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-original/themes/redwood/_oj-select-original.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-original/themes/stable/_oj-select-original.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-original/themes/stable/_oj-select-original.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-single/themes/base/_oj-select-single.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-single/themes/redwood/oj-select-single.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/select-single/themes/stable/oj-select-single.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/selector/themes/base/_oj-selector.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/selector/themes/redwood/_oj-selector.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/selector/themes/redwood/oj-selector.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/selector/themes/stable/_oj-selector.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/selector/themes/stable/oj-selector.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/slider/themes/base/_oj-slider.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/slider/themes/redwood/_oj-slider.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/slider/themes/redwood/oj-slider.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/slider/themes/stable/_oj-slider.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/slider/themes/stable/oj-slider.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/spark-chart/themes/base/_oj-spark-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/spark-chart/themes/redwood/oj-spark-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/spark-chart/themes/stable/oj-spark-chart.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/status-meter-gauge/themes/base/_oj-status-meter-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/status-meter-gauge/themes/redwood/_oj-status-meter-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/status-meter-gauge/themes/redwood/oj-status-meter-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/status-meter-gauge/themes/stable/_oj-status-meter-gauge.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/status-meter-gauge/themes/stable/oj-status-meter-gauge.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/stream-list/themes/base/_oj-stream-list.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/stream-list/themes/redwood/_oj-stream-list.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/stream-list/themes/redwood/_oj-stream-list.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/stream-list/themes/redwood/oj-stream-list.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/stream-list/themes/stable/_oj-stream-list.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/stream-list/themes/stable/_oj-stream-list.servervars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/stream-list/themes/stable/oj-stream-list.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/sunburst/themes/base/_oj-sunburst.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/sunburst/themes/redwood/_oj-sunburst.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/sunburst/themes/redwood/oj-sunburst.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/sunburst/themes/stable/_oj-sunburst.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/sunburst/themes/stable/oj-sunburst.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/swipe-actions/themes/base/_oj-swipe-actions.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/swipe-actions/themes/redwood/_oj-swipe-actions.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/swipe-actions/themes/redwood/oj-swipe-actions.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/swipe-actions/themes/stable/_oj-swipe-actions.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/swipe-actions/themes/stable/oj-swipe-actions.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switch/themes/base/_oj-switch.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switch/themes/redwood/_oj-switch.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switch/themes/redwood/oj-switch.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switch/themes/stable/_oj-switch.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switch/themes/stable/oj-switch.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switcher/themes/base/_oj-switcher.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switcher/themes/redwood/oj-switcher.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/switcher/themes/stable/oj-switcher.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tab-bar/themes/base/_oj-tab-bar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tab-bar/themes/redwood/_oj-tab-bar-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tab-bar/themes/redwood/_oj-tab-bar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tab-bar/themes/redwood/oj-tab-bar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tab-bar/themes/stable/_oj-tab-bar-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tab-bar/themes/stable/_oj-tab-bar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tab-bar/themes/stable/oj-tab-bar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/table/themes/base/_oj-table.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/table/themes/redwood/_oj-table.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/table/themes/redwood/oj-table.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/table/themes/stable/_oj-table.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/table/themes/stable/oj-table.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tag-cloud/themes/base/_oj-tag-cloud.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tag-cloud/themes/redwood/_oj-tag-cloud.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tag-cloud/themes/redwood/oj-tag-cloud.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tag-cloud/themes/stable/_oj-tag-cloud.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tag-cloud/themes/stable/oj-tag-cloud.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/base/_oj-notags.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/base/_oj-tags.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/redwood/_oj-tags-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/redwood/_oj-tags.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/redwood/oj-notags.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/redwood/oj-tags.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/stable/_oj-tags.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/stable/oj-notags.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tags/themes/stable/oj-tags.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-area/themes/base/_oj-text-area.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-area/themes/redwood/_oj-text-area.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-area/themes/redwood/oj-text-area.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-area/themes/stable/_oj-text-area.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-area/themes/stable/oj-text-area.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-field/themes/base/_oj-text-field.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-field/themes/redwood/_oj-text-field-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-field/themes/redwood/_oj-text-field.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/text-field/themes/stable/_oj-text-field.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/thematic-map/themes/base/_oj-thematic-map.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/thematic-map/themes/redwood/_oj-thematic-map.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/thematic-map/themes/redwood/oj-thematic-map.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/thematic-map/themes/stable/_oj-thematic-map.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/thematic-map/themes/stable/oj-thematic-map.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/time-axis/themes/base/_oj-time-axis.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/time-axis/themes/redwood/_oj-time-axis.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/time-axis/themes/redwood/oj-time-axis.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/time-axis/themes/stable/_oj-time-axis.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/time-axis/themes/stable/oj-time-axis.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/timeline/themes/base/_oj-timeline.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/timeline/themes/redwood/_oj-timeline.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/timeline/themes/redwood/oj-timeline.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/timeline/themes/stable/_oj-timeline.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/timeline/themes/stable/oj-timeline.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/toolbar/themes/base/_oj-toolbar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/toolbar/themes/redwood/_oj-toolbar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/toolbar/themes/redwood/oj-toolbar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/toolbar/themes/stable/_oj-toolbar.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/toolbar/themes/stable/oj-toolbar.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tooltip/themes/base/_oj-tooltip.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tooltip/themes/redwood/_oj-tooltip.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tooltip/themes/redwood/oj-tooltip.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tooltip/themes/stable/_oj-tooltip.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tooltip/themes/stable/oj-tooltip.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/train/themes/base/_oj-train.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/train/themes/redwood/_oj-train.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/train/themes/redwood/oj-train.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/train/themes/stable/_oj-train.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/train/themes/stable/oj-train.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tree-view/themes/base/_oj-tree-view.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tree-view/themes/redwood/_oj-tree-view.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tree-view/themes/redwood/oj-tree-view.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tree-view/themes/stable/_oj-tree-view.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/tree-view/themes/stable/oj-tree-view.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/treemap/themes/base/_oj-treemap.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/treemap/themes/redwood/_oj-treemap.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/treemap/themes/redwood/oj-treemap.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/treemap/themes/stable/_oj-treemap.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/treemap/themes/stable/oj-treemap.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/typography/themes/base/_oj-typography.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/typography/themes/redwood/_oj-typography-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/typography/themes/redwood/_oj-typography.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/typography/themes/redwood/oj-typography.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/typography/themes/stable/_oj-typography-scoped.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/typography/themes/stable/_oj-typography.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/typography/themes/stable/oj-typography.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/utilities/_oj.utilities.bidi.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/utilities/_oj.utilities.icons.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/utilities/_oj.utilities.json.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/utilities/_oj.utilities.masonrylayout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/utilities/_oj.utilities.modules.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/validation-group/themes/base/_oj-validation-group.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/validation-group/themes/redwood/oj-validation-group.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/validation-group/themes/stable/oj-validation-group.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/waterfall-layout/themes/base/_oj-waterfall-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/waterfall-layout/themes/redwood/_oj-waterfall-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/waterfall-layout/themes/redwood/oj-waterfall-layout.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/waterfall-layout/themes/stable/_oj-waterfall-layout.cssvars.scss +0 -0
- package/dist/pcss/oj/{v11.1.0 → v11.1.4}/oj/waterfall-layout/themes/stable/oj-waterfall-layout.scss +0 -0
- package/dist/scss/common/helpers/_oj.common.helpers.scss +1 -1
- package/dist/scss/common/widgets/_oj.common.formcontrol.mixins.scss +0 -71
- package/dist/scss/common/widgets/_oj.common.formcontrol.select2.scss +11 -16
- package/dist/scss/common/widgets/_oj.common.formlayout.mixins.scss +12 -5
- package/dist/scss/common/widgets/_oj.common.treeview.scss +2 -0
- package/dist/webpack-tools/4.x/webpack.config.js +3 -3
- package/dist/webpack-tools/webpack.config.js +3 -3
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
define("persist/impl/logger",[],(function(){"use strict";function e(){Object.defineProperty(this,"LEVEL_NONE",{value:0,enumerable:!0}),Object.defineProperty(this,"LEVEL_ERROR",{value:1,enumerable:!0}),Object.defineProperty(this,"LEVEL_WARN",{value:2,enumerable:!0}),Object.defineProperty(this,"LEVEL_INFO",{value:3,enumerable:!0}),Object.defineProperty(this,"LEVEL_LOG",{value:4,enumerable:!0}),Object.defineProperty(this,"_METHOD_ERROR",{value:"error"}),Object.defineProperty(this,"_METHOD_WARN",{value:"warn"}),Object.defineProperty(this,"_METHOD_INFO",{value:"info"}),Object.defineProperty(this,"_METHOD_LOG",{value:"log"}),Object.defineProperty(this,"_defaultOptions",{value:{level:this.LEVEL_ERROR,writer:null}}),Object.defineProperty(this,"_options",{value:this._defaultOptions,writable:!0})}function t(e,n,r,o){var i=e;if(!(i.option("level")<n)){var s=function(e){var t=e,n=null;return t.option("writer")?n=t.option("writer"):"undefined"!=typeof window&&void 0!==window.console?n=window.console:"undefined"!=typeof console&&(n=console),n}(i);if(null!=s){if(1==o.length&&o[0]instanceof Function){var a=o[0]();o=[a]}s[r]&&s[r].apply?s[r].apply(s,o):s[r]&&(s[r]=Function.prototype.bind.call(s[r],s),t(i,n,r,o))}}}return e.prototype.error=function(e){t(this,this.LEVEL_ERROR,this._METHOD_ERROR,arguments)},e.prototype.info=function(e){t(this,this.LEVEL_INFO,this._METHOD_INFO,arguments)},e.prototype.warn=function(e){t(this,this.LEVEL_WARN,this._METHOD_WARN,arguments)},e.prototype.log=function(e){t(this,this.LEVEL_LOG,this._METHOD_LOG,arguments)},e.prototype.option=function(e,t){var n,r={};if(0==arguments.length){for(n in this._options)this._options.hasOwnProperty(n)&&(r[n]=this._options[n]);return r}if("string"==typeof e&&void 0===t)return void 0===this._options[e]?null:this._options[e];if("string"==typeof e)this._options[e]=t;else{var o=e;for(n in o)o.hasOwnProperty(n)&&this.option(n,o[n])}},new e})),define("persist/persistenceUtils",["./impl/logger"],(function(e){"use strict";function t(e){return e.headers.has("x-oracle-jscpt-cache-expiration-date")}function n(e){var t=e.get("Content-Type");return!(!t||!t.match(/.*text\/.*/)&&!t.match(/.*application\/.*json.*/))}function r(t,n){e.log("Offline Persistence Toolkit persistenceUtils: requestToJSON()"),n&&n._noClone||(t=t.clone());var r={};return o(t,r,["body","headers","signal"]),r.headers=i(t.headers),s(t,r)}function o(e,t,n){for(var r in e)"function"!=typeof e[r]&&0!==r.indexOf("_")&&-1===n.indexOf(r)&&(t[r]=e[r])}function i(t){var n={};if(t.entries){var r,o,i,s=t.entries();do{(r=s.next()).value&&(o=r.value[0],i=r.value[1],n[o]=i)}while(!r.done)}else t.forEach&&t.forEach((function(e,t){n[t]=e}));return function(t){var n=t.date;n||(e.log("Offline Persistence Toolkit persistenceUtils: Setting HTTP date header since it's null or not exposed"),n=(new Date).toUTCString(),t.date=n)}(n),n}function s(t,r){return r.body={},t instanceof Request&&((o=t.headers.get("Content-Type"))&&-1!==o.indexOf("multipart/"))?function(t,n){if(e.log("Offline Persistence Toolkit persistenceUtils: Copying multipart payload"),"function"==typeof t.formData)return t.formData().then((function(e){var t,r,o,i,s={},a=e.entries();do{(r=(t=a.next()).value)&&(o=r[0],i=r[1],s[o]=i)}while(!t.done);return n.body.formData=s,n}));var r=t.headers.get("Content-Type");return t.text().then((function(e){for(var t=l(e,r),o={},i=0;i<t.length;i++)o[t[i].headers.name]=t[i].data;return n.body.formData=o,n}))}(t,r):t instanceof Request||n(t.headers)?t.text().then((function(e){return r.body.text=e,r})):t instanceof Request||"function"!=typeof t.arrayBuffer?Promise.reject(new Error({message:"payload body type is not supported"})):t.arrayBuffer().then((function(e){return e.byteLength>0&&(r.body.arrayBuffer=e),r}));var o}function a(t,n){e.log("Offline Persistence Toolkit persistenceUtils: responseToJSON()"),n&&n._noClone||(t=t.clone());var r={};return o(t,r,["body","headers"]),r.headers=i(t.headers),n&&n.excludeBody?Promise.resolve(r):s(t,r)}function u(t){if(e.log("Offline Persistence Toolkit persistenceUtils: requestFromJSON()"),!t)return Promise.resolve();var n={};o(t,n,["headers","body","signal"]);var r=function(e,t){var n=!1,r=e.body;if(r.text&&r.text.length>0)t.body=r.text;else if(r.arrayBuffer)t.body=r.arrayBuffer;else if(r.formData){n=!0;var o=new FormData,i=r.formData;Object.keys(i).forEach((function(e){o.append(e,i[e])})),t.body=o}return n}(t,n);return n.headers=c(t,r),Promise.resolve(new Request(t.url,n))}function c(e,t){var n=new Headers;return Object.keys(e.headers).forEach((function(r){("content-type"!==r||!t&&"content-type"===r)&&n.append(r,e.headers[r])})),n}function f(t){e.log("Offline Persistence Toolkit persistenceUtils: responseFromJSON()");var n={};return o(t,n,["headers","body"]),n.headers=c(t,!1),Promise.resolve(function(e,t){var n,r=e.body;return r&&r.text?n=new Response(r.text,t):r&&r.arrayBuffer?(t.responseType="blob",n=new Response(r.arrayBuffer,t)):r&&r.blob?(t.responseType="blob",n=new Response(r.blob,t)):n=new Response(null,t),n}(t,n))}function l(t,n){e.log("Offline Persistence Toolkit persistenceUtils: parseMultipartFormData()");var r=n.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new Error("not a valid multipart form data value.");var o,i=function(e){for(var t={},n={},r=e.split("\r\n"),o=0;o<r.length;o++){var i=r[o];if(0!==i.length){var s=i.split(";");if(1===s.length&&0===s[0].indexOf("Content-Type"))t.contentType=s[0].split(":")[1].trim();else for(var a=0;a<s.length;a++)if(-1!==s[a].indexOf("=")){var u=s[a].split("=");n[u[0].trim()]=u[1].substring(1,u[1].length-1)}}}return t.headers=n,t},s=function(e,t){var n=e.split("\r\n");return t&&t.indexOf("image")>=0?a(n[0],t):n[0]},a=function(e,t){var n=null;try{n=atob(e)}catch(e){return null}for(var r=new ArrayBuffer(n.length),o=new Uint8Array(r),i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new Blob([r],{type:t})},u=r[1]||r[2];if("string"==typeof t)o=t;else{var c=new Uint8Array(t);o=String.fromCharCode.apply(null,c)}for(var f=o.split(new RegExp(u)),l=[],d=1;d<f.length-1;d++){var h={},p=f[d].split("\r\n\r\n"),v=p[0],y=p[1],g=i(v);h.headers=g.headers,h.data=s(y,g.contentType),l.push(h)}return l}function d(e){if(e){var t={};return Object.keys(e).forEach((function(n){if(n.startsWith("value.")){var r=e[n];r instanceof Object?(t.op=Object.keys(r)[0],t.value=r[t.op]):(t.op="$eq",t.value=r),t.attribute=n.substr(6,n.length)}else{var o=n;"$and"!=o&&"$or"!=o||(t.op=o,t.value=[],e[o].forEach((function(e,n){t.value[n]=d(e)})))}})),t}return null}function h(e){if(e){var t={},n=e.op;return"$and"==n||"$or"==n?(t[n]=[],e.value.forEach((function(e,r){t[n][r]=h(e)}))):(t["value."+e.attribute]={},t["value."+e.attribute][e.op]=e.value),t}return null}return{requestToJSON:r,requestFromJSON:u,responseToJSON:a,responseFromJSON:f,setResponsePayload:function(t,n){return e.log("Offline Persistence Toolkit persistenceUtils: setResponsePayload()"),a(t).then((function(e){var t=e.body;return t.arrayBuffer=null,t.blob=null,t.text=null,n instanceof ArrayBuffer?t.arrayBuffer=n:n instanceof Blob?t.blob=n:t.text=JSON.stringify(n),f(e)}))},parseMultipartFormData:l,isCachedResponse:t,isGeneratedEtagResponse:function(e){return e.headers.has("x-oracle-jscpt-etag-generated")},_isTextPayload:n,buildEndpointKey:function(t){e.log("Offline Persistence Toolkit persistenceUtils: buildEndpointKey() for Request with url: "+t.url);var n={url:t.url,id:Math.random().toString(36).replace(/[^a-z]+/g,"")};return JSON.stringify(n)},_cloneRequest:function(e){return r(e,{_noClone:!0}).then((function(e){return u(e).then((function(e){return e}))}))},_cloneResponse:function(e,t){return t=t||{},a(e,{_noClone:!0}).then((function(e){return f(e).then((function(e){return null!=t.url&&t.url.length>0&&null==e.headers.get("x-oracle-jscpt-response-url")&&e.headers.set("x-oracle-jscpt-response-url",t.url),e}))}))},_derivePayloadType:function(e,r){var o=r.headers.get("Content-Type"),i=e.responseType;return n(r.headers)?"text":t(r)||"blob"===i?"blob":o&&-1!==o.indexOf("image/")||"arraybuffer"===i?"arraybuffer":o&&-1!==o.indexOf("multipart/form-data")?"multipart":"text"},_mapData:function(e,t,n){var r=e||[],o=t||[];if(n){r=[],o=[];var i,s=null!=e?e.length:t.length;for(i=0;i<s;i++){var a=null!=e?{key:e[i]}:{key:null},u=null!=t?{metadata:a,data:t[i]}:{metadata:a,data:null},c=n.mapFields(u);r[i]=c.metadata.key,o[i]=c.data}}return{keys:r,data:o}},_unmapData:function(e,t,n){var r=e||[],o=t||[];if(n){r=[],o=[];var i,s=null!=e?e.length:t.length;for(i=0;i<s;i++){var a=null!=e?{key:e[i]}:{key:null},u=null!=t?{metadata:a,data:t[i]}:{metadata:a,data:null},c=n.unmapFields(u);r[i]=c.metadata.key,o[i]=c.data}}return{keys:r,data:o}},_mapFindQuery:function(e,t,n){if(e&&t){var r=d(e.selector);r&&(e.selector=h(t.mapFilterCriterion(r)))}return n&&n.length&&(e.sort=n),e},isReplayRequest:function(e){return e.headers.has("x-oracle-jscpt-sync-replay")},markReplayRequest:function(e,t){t?e.headers.set("x-oracle-jscpt-sync-replay",""):e.headers.delete("x-oracle-jscpt-sync-replay")}}})),define("persist/impl/PersistenceXMLHttpRequest",["../persistenceUtils","./logger"],(function(e,t){"use strict";function n(e){var t=this;Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_browserXMLHttpRequest",{value:e}),Object.defineProperty(this,"_method",{value:null,writable:!0}),Object.defineProperty(this,"onabort",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onerror",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onload",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadend",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadstart",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onprogress",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onreadystatechange",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"ontimeout",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"_password",{value:null,writable:!0}),Object.defineProperty(this,"_readyState",{value:0,writable:!0}),Object.defineProperty(this,"readyState",{enumerable:!0,get:function(){return t._readyState}}),Object.defineProperty(this,"_requestHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_response",{value:"",writable:!0}),Object.defineProperty(this,"response",{enumerable:!0,get:function(){return t._response}}),Object.defineProperty(this,"_responseHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_responseText",{value:"",writable:!0}),Object.defineProperty(this,"responseText",{enumerable:!0,get:function(){return t._responseText}}),Object.defineProperty(this,"responseType",{value:"",enumerable:!0,writable:!0}),Object.defineProperty(this,"_responseURL",{value:"",writable:!0}),Object.defineProperty(this,"responseURL",{enumerable:!0,get:function(){return t._responseURL}}),Object.defineProperty(this,"_responseXML",{value:null,writable:!0}),Object.defineProperty(this,"responseXML",{enumerable:!0,get:function(){return t._responseXML}}),Object.defineProperty(this,"_status",{value:0,writable:!0}),Object.defineProperty(this,"status",{enumerable:!0,get:function(){return t._status}}),Object.defineProperty(this,"_statusText",{value:"",writable:!0}),Object.defineProperty(this,"statusText",{enumerable:!0,get:function(){return t._statusText}}),Object.defineProperty(this,"timeout",{value:0,enumerable:!0,writable:!0}),Object.defineProperty(this,"_isTimedOut",{value:!1,enumerable:!0,writable:!0}),Object.defineProperty(this,"upload",{value:new s,enumerable:!0}),Object.defineProperty(this,"_url",{value:null,writable:!0}),Object.defineProperty(this,"_username",{value:null,writable:!0}),Object.defineProperty(this,"withCredentials",{value:!1,enumerable:!0,writable:!0}),Object.defineProperty(this,"_abortController",{value:null,writable:!0}),Object.defineProperty(this,"_isUpload",{value:!1,writable:!0})}function r(e,t){e._readyState=t,e.dispatchEvent(new u("readystatechange")),1==e._isTimedOut&&e._readyState==n.DONE?(e.dispatchEvent(new u("timeout",!1,!1,e)),e.dispatchEvent(new u("loadend",!1,!1,e)),e._isTimedOut=!1):e._readyState==n.DONE&&(e.dispatchEvent(new u("load",!1,!1,e)),e.dispatchEvent(new u("loadend",!1,!1,e)))}function o(o,i,s){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Processing Response"),function(e,t){if(e._responseHeaders={},t.entries){var o,i,s,a=t.entries();do{(o=a.next()).value&&(i=o.value[0],s=o.value[1],e._forceMimeType&&"content-type"==i.toLowerCase()?e._responseHeaders[i]=e._forceMimeType:e._responseHeaders[i]=s)}while(!o.done)}else t.forEach&&t.forEach((function(t,n){e._forceMimeType&&"content-type"==n.toLowerCase()?e._responseHeaders[n]=e._forceMimeType:e._responseHeaders[n]=t}));r(e,n.HEADERS_RECEIVED)}(o,s.headers);var a=s.headers.get("Content-Type");o._status=s.status,o._statusText=s.statusText,o._responseURL=i.url;var u=e._derivePayloadType(o,s);if("blob"===u)t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.blob()"),s.blob().then((function(e){o._responseType="blob",o._response=e,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}),(function(e){t.error(e)}));else if("arraybuffer"===u)t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.arrayBuffer()"),s.arrayBuffer().then((function(e){o._responseType="arrayBuffer",o._response=e,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}),(function(e){t.error("error reading response as arrayBuffer!")}));else if("multipart"===u){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.formData()"),o._responseType="formData";var c=function(t){var i="";e.parseMultipartFormData(t,a).forEach((function(e){i+=e.data})),o._response=i,o._responseText=i,r(o,n.DONE),"function"==typeof o.onload&&o.onload()};if(s.formData)try{s.formData().then((function(e){var t,i,s="",a=e.values();do{(t=(i=a.next()).value)&&(s+=t)}while(!i.done);o._response=s,o._responseText=s,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}))}catch(e){s.text().then((function(e){c(e)}))}else s.text().then((function(e){c(e)}))}else s.text().then((function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.text()"),o._responseType="",o._response=e,o._responseText=e,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}),(function(e){t.error(e)}))}function i(e){if(e._readyState!==n.OPENED)throw new Error("INVALID_STATE_ERR")}function s(){this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this._eventListeners=[]}function a(e,t,n,r){Object.defineProperty(this,"type",{value:e,enumerable:!0}),Object.defineProperty(this,"bubbles",{value:t,enumerable:!0}),Object.defineProperty(this,"cancelable",{value:n,enumerable:!0}),Object.defineProperty(this,"target",{value:r,enumerable:!0}),Object.defineProperty(this,"lengthComputable",{value:!1,enumerable:!0}),Object.defineProperty(this,"loaded",{value:0,enumerable:!0}),Object.defineProperty(this,"total",{value:0,enumerable:!0})}function u(e,t,n,r){Object.defineProperty(this,"type",{value:e,enumerable:!0}),Object.defineProperty(this,"bubbles",{value:t,enumerable:!0}),Object.defineProperty(this,"cancelable",{value:n,enumerable:!0}),Object.defineProperty(this,"target",{value:r,enumerable:!0})}return Object.defineProperty(n,"UNSENT",{value:0,enumerable:!0}),Object.defineProperty(n,"OPENED",{value:1,enumerable:!0}),Object.defineProperty(n,"HEADERS_RECEIVED",{value:2,enumerable:!0}),Object.defineProperty(n,"LOADING",{value:3,enumerable:!0}),Object.defineProperty(n,"DONE",{value:4,enumerable:!0}),n.prototype.open=function(e,o,i,s,a){if(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open() for method: "+e+", url: "+o),"boolean"==typeof i&&!i)throw new Error("InvalidAccessError: Failed to execute 'open' on 'XMLHttpRequest': Synchronous requests are disabled on the XHR Adapter");if(this._method=e,this._url=o,this._isTimedOut=!1,function(e){var t=e.toLowerCase();if(0===t.indexOf("http:")||0===t.indexOf("https:"))return!1;if(0===t.indexOf("file:")||0===t.indexOf("cdvfile:"))return!0;if(URL&&URL.prototype&&null!=(t=new URL(e,window.location.href).origin)&&"null"!=t&&t.length>0)return 0===t.toLowerCase().indexOf("file:");var n=document.createElement("a");return n.href=e,!(!(t=n.protocol)||0!==t.toLowerCase().indexOf("file:"))}(o)){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open called for a File url");var u=this;this._passthroughXHR=new u._browserXMLHttpRequest,this._passthroughXHR.onreadystatechange=function(){u._passthroughXHR.readyState==n.DONE&&(u._status=u._passthroughXHR.status,u._statusText=u._passthroughXHR.statusText,u._response=u._passthroughXHR.response,u._responseHeaders=u._passthroughXHR.responseHeaders,u._responseType=u._passthroughXHR.responseType,null!=u._responseType&&""!=u._responseType&&"text"!=u._responseType||(u._responseText=u._passthroughXHR.responseText),u._responseURL=u._passthroughXHR.responseURL,null!=u._responseType&&""!=u._responseType&&"document"!=u._responseType||(u._responseXML=u._passthroughXHR.responseXML)),r(u,u._passthroughXHR.readyState)},this._passthroughXHR.open(e,o,i,s,a)}else this._passthroughXHR=null;"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._username=s,this._password=a,this._responseText=null,this._responseXML=null,this._requestHeaders={},r(this,n.OPENED)},n.prototype.setRequestHeader=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: setRequestHeader() with header: "+e+" ,value: "+n),i(this);var r=this._requestHeaders[e];this._requestHeaders[e]=r?r+=","+n:n},n.prototype.send=function(e){var s=this;if(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: send()"),this._passthroughXHR)null!=this.responseType&&(this._passthroughXHR.responseType=this.responseType),this._passthroughXHR.send(e);else{i(this),r(this,n.OPENED);var a=function(e,t){var n=function(e){var t=new Headers;return Object.keys(e._requestHeaders).forEach((function(n){t.append(n,e._requestHeaders[n])})),t}(e),r=e.withCredentials?"include":"same-origin",o={method:e._method,headers:n,mode:"cors",cache:"default",credentials:r};return"GET"!==e._method&&"HEAD"!==e._method&&"DELETE"!==e._method&&(o.body=t),o}(this,e),c=new Request(this._url,a);this._isUpload=!!a.body;var f={};(s=this)._abortController&&(f.signal=s._abortController.signal);try{s.timeout&&"number"==typeof s.timeout?function(e,n,r){return new Promise((function(o,i){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling fetchWithTimeout");var s=new Error("Fetch Timeout");s.name="TimeoutError";var a=setTimeout((function(){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Request Timedout: "+e.url),i(s),r._abortController&&r._abortController.abort()}),r.timeout);fetch(e,n).then((function(e){o(e)}),(function(e){i(e)})).finally((function(){clearTimeout(a)}))}))}(c,f,s).then((function(e){o(s,c,e)})).catch((function(e){e&&e.name&&"TimeoutError"===e.name?(s._isTimedOut=!0,r(s,n.DONE)):s.dispatchEvent(new u("error",!1,!1,s))})):fetch(c,f).then((function(e){o(s,c,e)}),(function(e){e&&e.name&&"AbortError"===e.name?(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Request Timedout: "+c.url),s.dispatchEvent(new u("abort",!1,!1,s))):s.dispatchEvent(new u("error",!1,!1,s))}))}catch(e){throw e}this.dispatchEvent(new u("loadstart",!1,!1,this))}},n.prototype.abort=function(){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: abort()"),this._abortController?this._abortController.abort():this.dispatchEvent(new u("abort",!1,!1,self)),this._readyState=n.UNSENT,this._status=0,this._statusText=""},n.prototype.getResponseHeader=function(e){if(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getResponseHeader() for header: "+e),this._readyState<n.HEADERS_RECEIVED)return null;for(var r in e=e.toLowerCase(),this._responseHeaders)if(r.toLowerCase()==e.toLowerCase())return this._responseHeaders[r];return null},n.prototype.getAllResponseHeaders=function(){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getAllResponseHeaders()");var e=this;if(this._readyState<n.HEADERS_RECEIVED)return"";var r="";return this._responseHeaders&&Object.keys(this._responseHeaders).forEach((function(t){r+=t+": "+e._responseHeaders[t]+"\r\n"})),r},n.prototype.overrideMimeType=function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: overrideMimeType() for mimeType: "+e),"string"==typeof e&&(this._forceMimeType=e.toLowerCase())},n.prototype.addEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: addEventListener() for event type: "+e),this._eventListeners[e]=this._eventListeners[e]||[],this._eventListeners[e].push(n)},n.prototype.removeEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: removeEventListener() for event type: "+e);var r,o=this._eventListeners[e]||[],i=o.length;for(r=0;r<i;r++)if(o[r]==n)return o.splice(r,1)},n.prototype.dispatchEvent=function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: dispatchEvent() for event type: "+e.type);var n=this,r=e.type;switch((this._eventListeners[r]||[]).forEach((function(t){"function"==typeof t?t.call(n,e):t.handleEvent(e)})),r){case"abort":this._isUpload&&this.upload._dispatchEvent(new a("abort",!1,!1,n.upload)),this.onabort&&this.onabort(e),n.dispatchEvent(new u("loadend",!1,!1,n));break;case"error":this._isUpload&&this.upload._dispatchEvent(new a("error",!1,!1,n.upload)),this.onerror&&this.onerror(e);break;case"load":this._isUpload&&this.upload._dispatchEvent(new a("load",!1,!1,n.upload)),this.onload&&this.onload(e);break;case"loadend":this._isUpload&&this.upload._dispatchEvent(new a("loadend",!1,!1,n.upload)),this.onloadend&&this.onloadend(e);break;case"loadstart":this._isUpload&&this.upload._dispatchEvent(new a("loadstart",!1,!1,n.upload)),this.onloadstart&&this.onloadstart(e);break;case"progress":this.onprogress&&this.onprogress(e);break;case"readystatechange":this.onreadystatechange&&this.onreadystatechange(e);break;case"timeout":this._isUpload&&this.upload._dispatchEvent(new a("timeout",!1,!1,n.upload)),this.ontimeout&&this.ontimeout(e)}return!!e.defaultPrevented},s.prototype.addEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequestUpload: addEventListener() for event type: "+e),this._eventListeners[e]=this._eventListeners[e]||[],this._eventListeners[e].push(n)},s.prototype.removeEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequestUpload: removeEventListener() for event type: "+e);var r,o=this._eventListeners[e]||[],i=o.length;for(r=0;r<i;r++)if(o[r]==n)return o.splice(r,1)},s.prototype._dispatchEvent=function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequestUpload: dispatchEvent() for event type: "+e.type);var n=this,r=e.type;switch((this._eventListeners[r]||[]).forEach((function(t){"function"==typeof t?t.call(n,e):t.handleEvent(e)})),r){case"abort":this.onabort&&this.onabort(e);break;case"error":this.onerror&&this.onerror(e);break;case"load":this.onload&&this.onload(e);break;case"loadend":this.onloadend&&this.onloadend(e);break;case"loadstart":this.onloadstart&&this.onloadstart(e),this._dispatchEvent(new a("progress",!1,!1,n));break;case"progress":this.onprogress&&this.onprogress(e);break;case"timeout":this.ontimeout&&this.ontimeout(e)}return!!e.defaultPrevented},a.prototype.stopPropagation=function(){},a.prototype.preventDefault=function(){this.defaultPrevented=!0},u.prototype.stopPropagation=function(){},u.prototype.preventDefault=function(){this.defaultPrevented=!0},n})),define("persist/impl/PersistenceStoreMetadata",[],(function(){"use strict";var e=function(e,t,n){this.name=e,this.persistenceStoreFactory=t,this.versions=n};return(e.prototype={}).persistenceStoreFactory,e.prototype.versions,e})),define("persist/PersistenceStore",[],(function(){"use strict";var e=function(e){this._name=e};return(e.prototype={}).getName=function(){return this._name},e.prototype.getVersion=function(){return this._version},e.prototype.Init=function(e){return e&&e.version?this._version=e.version:this._version="0",Promise.resolve()},e.prototype.upsert=function(e,t,n,r){throw TypeError("failed in abstract function")},e.prototype.upsertAll=function(e){throw TypeError("failed in abstract function")},e.prototype.find=function(e){throw TypeError("failed in abstract function")},e.prototype.findByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.removeByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.delete=function(e){throw TypeError("failed in abstract function")},e.prototype.keys=function(){throw TypeError("failed in abstract function")},e.prototype.updateKey=function(e,t){throw TypeError("failed in abstract function")},e})),define("persist/impl/storageUtils",["./logger"],(function(e){"use strict";function t(e){var r,s=[];for(var a in e)if(e.hasOwnProperty(a)){var u=e[a];if(0===a.indexOf("$")){if(o(a)){if(!(u instanceof Array))throw new Error("not a valid expression: "+e);r={operator:a,array:[]};for(var c=0;c<u.length;c++){var f=t(u[c]);r.array.push(f)}}else if(i(a))throw new Error("not a valid expression: "+e)}else if("object"!=typeof u)s.push({left:a,right:u,operator:"$eq"});else{var l={left:a};n(l,u),s.push(l)}}return s.length>1?r={operator:"$and",array:s}:1===s.length&&(r=s[0]),r}function n(e,t){var n=!1;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(n||!i(r))throw new Error("parsing error "+t);e.operator=r,e.right=o,n=!0}}function r(e,t){var n=e.operator;if(o(n)){if(!e.left&&e.array instanceof Array){for(var s,c=e.array,f=0;f<c.length;f++){var l=r(c[f],t);if("$or"===n&&!0===l)return!0;if("$and"===n&&!1===l)return!1;s=l}return s}throw new Error("invalid expression tree!"+e)}if(!i(n))throw new Error("not a valid expression!"+e);var d,h=u(e.left,t),p=e.right;if("$lt"===n)return(h=(d=a(h,p))[0])<d[1];if("$gt"===n)return(h=(d=a(h,p))[0])>d[1];if("$lte"===n)return(h=(d=a(h,p))[0])<=d[1];if("$gte"===n)return(h=(d=a(h,p))[0])>=d[1];if("$eq"===n)return h===p;if("$ne"===n)return h!==p;if("$regex"===n)return null!==h.match(p);if("$exists"===n)return p?null!=h:null==h;if("$in"!==n){if("$nin"===n)return p.indexOf(h)<0;throw new Error("not a valid expression! "+e)}for(var v=0;v<p.length;v++)if(p[v]===h)return!0;return!1}function o(e){return"$and"===e||"$or"===e}function i(e){return"$lt"===e||"$gt"===e||"$lte"===e||"$gte"===e||"$eq"===e||"$ne"===e||"$regex"===e||"$exists"===e||"$in"===e||"$nin"===e}function s(e){return null!=e&&(e instanceof String||"string"==typeof e)}function a(e,t){return s(e)&&null==t?t="":s(t)&&null==e&&(e=""),[e,t]}function u(e,t){for(var n=e.split("."),r=t,o=0;o<n.length;o++)r=r[n[o]];return r}return{satisfy:function(n,o){return e.log("Offline Persistence Toolkit storageUtils: Processing selector: "+JSON.stringify(n)),!n||r(t(n),o)},getValue:u,assembleObject:function(e,t){var n;if(t){n={};for(var r=0;r<t.length;r++)for(var o=n,i=e,s=t[r].split("."),a=0;a<s.length;a++)i=i[s[a]],!o[s[a]]&&a<s.length-1&&(o[s[a]]={}),a===s.length-1?o[s[a]]=i:o=o[s[a]]}else n=e;return n},sortRows:function(e,t){return e&&Array.isArray(e)&&!(e.length<1)&&t&&Array.isArray(t)&&t.length?e.sort(function(e){return function(t,n){for(var r=0;r<e.length;r++){var o,i=e[r],s=!0;if("string"==typeof i)o=i;else{if("object"!=typeof i)throw new Error("invalid sort criteria.");var a=Object.keys(i);if(!a||1!==a.length)throw new Error("invalid sort criteria");s="asc"===i[o=a[0]].toLowerCase()}var c=u(o,t),f=u(o,n);if(c!=f)return s?c<f?-1:1:c<f?1:-1}return 0}}(t)):e}}})),function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pouchdb",[],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PouchDB=e()}((function(){return function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,(function(e){return o(t[s][1][e]||e)}),f,f.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments.length;if(t){for(var n=[],r=-1;++r<t;)n[r]=arguments[r];return e.call(this,n)}return e.call(this,[])}}},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){
|
|
6
|
+
define("persist/impl/logger",[],(function(){"use strict";function e(){Object.defineProperty(this,"LEVEL_NONE",{value:0,enumerable:!0}),Object.defineProperty(this,"LEVEL_ERROR",{value:1,enumerable:!0}),Object.defineProperty(this,"LEVEL_WARN",{value:2,enumerable:!0}),Object.defineProperty(this,"LEVEL_INFO",{value:3,enumerable:!0}),Object.defineProperty(this,"LEVEL_LOG",{value:4,enumerable:!0}),Object.defineProperty(this,"_METHOD_ERROR",{value:"error"}),Object.defineProperty(this,"_METHOD_WARN",{value:"warn"}),Object.defineProperty(this,"_METHOD_INFO",{value:"info"}),Object.defineProperty(this,"_METHOD_LOG",{value:"log"}),Object.defineProperty(this,"_defaultOptions",{value:{level:this.LEVEL_ERROR,writer:null}}),Object.defineProperty(this,"_options",{value:this._defaultOptions,writable:!0})}function t(e,n,r,o){var i=e;if(!(i.option("level")<n)){var s=function(e){var t=e,n=null;return t.option("writer")?n=t.option("writer"):"undefined"!=typeof window&&void 0!==window.console?n=window.console:"undefined"!=typeof console&&(n=console),n}(i);if(null!=s){if(1==o.length&&o[0]instanceof Function){var a=o[0]();o=[a]}s[r]&&s[r].apply?s[r].apply(s,o):s[r]&&(s[r]=Function.prototype.bind.call(s[r],s),t(i,n,r,o))}}}return e.prototype.error=function(e){t(this,this.LEVEL_ERROR,this._METHOD_ERROR,arguments)},e.prototype.info=function(e){t(this,this.LEVEL_INFO,this._METHOD_INFO,arguments)},e.prototype.warn=function(e){t(this,this.LEVEL_WARN,this._METHOD_WARN,arguments)},e.prototype.log=function(e){t(this,this.LEVEL_LOG,this._METHOD_LOG,arguments)},e.prototype.option=function(e,t){var n,r={};if(0==arguments.length){for(n in this._options)this._options.hasOwnProperty(n)&&(r[n]=this._options[n]);return r}if("string"==typeof e&&void 0===t)return void 0===this._options[e]?null:this._options[e];if("string"==typeof e)this._options[e]=t;else{var o=e;for(n in o)o.hasOwnProperty(n)&&this.option(n,o[n])}},new e})),define("persist/persistenceUtils",["./impl/logger"],(function(e){"use strict";function t(e){return e.headers.has("x-oracle-jscpt-cache-expiration-date")}function n(e,t){var n=e.get("Content-Type");if(t){if(n&&(n.match(/.*text\/.*/)||n.match(/.*application\/.*json.*/)))return!0}else if(n&&n.match(/.*text\/.*/))return!0;return!1}function r(t,n){e.log("Offline Persistence Toolkit persistenceUtils: requestToJSON()"),n&&n._noClone||(t=t.clone());var r={};return o(t,r,["body","headers","signal"]),r.headers=i(t.headers),s(t,r)}function o(e,t,n){for(var r in e)"function"!=typeof e[r]&&0!==r.indexOf("_")&&-1===n.indexOf(r)&&(t[r]=e[r])}function i(t){var n={};if(t.entries){var r,o,i,s=t.entries();do{(r=s.next()).value&&(o=r.value[0],i=r.value[1],n[o]=i)}while(!r.done)}else t.forEach&&t.forEach((function(e,t){n[t]=e}));return function(t){var n=t.date;n||(e.log("Offline Persistence Toolkit persistenceUtils: Setting HTTP date header since it's null or not exposed"),n=(new Date).toUTCString(),t.date=n)}(n),n}function s(t,r){return r.body={},t instanceof Request&&((o=t.headers.get("Content-Type"))&&-1!==o.indexOf("multipart/"))?function(t,n){if(e.log("Offline Persistence Toolkit persistenceUtils: Copying multipart payload"),"function"==typeof t.formData)return t.formData().then((function(e){var t,r,o,i,s={},a=e.entries();do{(r=(t=a.next()).value)&&(o=r[0],i=r[1],s[o]=i)}while(!t.done);return n.body.formData=s,n}));var r=t.headers.get("Content-Type");return t.text().then((function(e){for(var t=l(e,r),o={},i=0;i<t.length;i++)o[t[i].headers.name]=t[i].data;return n.body.formData=o,n}))}(t,r):t instanceof Request||n(t.headers,!0)?t.text().then((function(e){return r.body.text=e,r})):t instanceof Request||"function"!=typeof t.arrayBuffer?Promise.reject(new Error({message:"payload body type is not supported"})):t.arrayBuffer().then((function(e){return e.byteLength>0&&(r.body.arrayBuffer=e),r}));var o}function a(t,n){e.log("Offline Persistence Toolkit persistenceUtils: responseToJSON()"),n&&n._noClone||(t=t.clone());var r={};return o(t,r,["body","headers"]),r.headers=i(t.headers),n&&n.excludeBody?Promise.resolve(r):s(t,r)}function u(t){if(e.log("Offline Persistence Toolkit persistenceUtils: requestFromJSON()"),!t)return Promise.resolve();var n={};o(t,n,["headers","body","signal"]);var r=function(e,t){var n=!1,r=e.body;if(r.text&&r.text.length>0)t.body=r.text;else if(r.arrayBuffer)t.body=r.arrayBuffer;else if(r.formData){n=!0;var o=new FormData,i=r.formData;Object.keys(i).forEach((function(e){o.append(e,i[e])})),t.body=o}return n}(t,n);return n.headers=c(t,r),Promise.resolve(new Request(t.url,n))}function c(e,t){var n=new Headers;return Object.keys(e.headers).forEach((function(r){("content-type"!==r||!t&&"content-type"===r)&&n.append(r,e.headers[r])})),n}function f(t){e.log("Offline Persistence Toolkit persistenceUtils: responseFromJSON()");var n={};return o(t,n,["headers","body"]),n.headers=c(t,!1),Promise.resolve(function(e,t){var n,r=e.body;return r&&r.text?n=new Response(r.text,t):r&&r.arrayBuffer?(t.responseType="blob",n=new Response(r.arrayBuffer,t)):r&&r.blob?(t.responseType="blob",n=new Response(r.blob,t)):n=new Response(null,t),n}(t,n))}function l(t,n){e.log("Offline Persistence Toolkit persistenceUtils: parseMultipartFormData()");var r=n.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new Error("not a valid multipart form data value.");var o,i=function(e){for(var t={},n={},r=e.split("\r\n"),o=0;o<r.length;o++){var i=r[o];if(0!==i.length){var s=i.split(";");if(1===s.length&&0===s[0].indexOf("Content-Type"))t.contentType=s[0].split(":")[1].trim();else for(var a=0;a<s.length;a++)if(-1!==s[a].indexOf("=")){var u=s[a].split("=");n[u[0].trim()]=u[1].substring(1,u[1].length-1)}}}return t.headers=n,t},s=function(e,t){var n=e.split("\r\n");return t&&t.indexOf("image")>=0?a(n[0],t):n[0]},a=function(e,t){var n=null;try{n=atob(e)}catch(e){return null}for(var r=new ArrayBuffer(n.length),o=new Uint8Array(r),i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new Blob([r],{type:t})},u=r[1]||r[2];if("string"==typeof t)o=t;else{var c=new Uint8Array(t);o=String.fromCharCode.apply(null,c)}for(var f=o.split(new RegExp(u)),l=[],d=1;d<f.length-1;d++){var h={},p=f[d].split("\r\n\r\n"),v=p[0],y=p[1],g=i(v);h.headers=g.headers,h.data=s(y,g.contentType),l.push(h)}return l}function d(e){if(e){var t={};return Object.keys(e).forEach((function(n){if(n.startsWith("value.")){var r=e[n];r instanceof Object?(t.op=Object.keys(r)[0],t.value=r[t.op]):(t.op="$eq",t.value=r),t.attribute=n.substr(6,n.length)}else{var o=n;"$and"!=o&&"$or"!=o||(t.op=o,t.value=[],e[o].forEach((function(e,n){t.value[n]=d(e)})))}})),t}return null}function h(e){if(e){var t={},n=e.op;return"$and"==n||"$or"==n?(t[n]=[],e.value.forEach((function(e,r){t[n][r]=h(e)}))):(t["value."+e.attribute]={},t["value."+e.attribute][e.op]=e.value),t}return null}return{requestToJSON:r,requestFromJSON:u,responseToJSON:a,responseFromJSON:f,setResponsePayload:function(t,n){return e.log("Offline Persistence Toolkit persistenceUtils: setResponsePayload()"),a(t).then((function(e){var t=e.body;return t.arrayBuffer=null,t.blob=null,t.text=null,n instanceof ArrayBuffer?t.arrayBuffer=n:n instanceof Blob?t.blob=n:t.text=JSON.stringify(n),f(e)}))},parseMultipartFormData:l,isCachedResponse:t,isGeneratedEtagResponse:function(e){return e.headers.has("x-oracle-jscpt-etag-generated")},_isTextPayload:n,buildEndpointKey:function(t){e.log("Offline Persistence Toolkit persistenceUtils: buildEndpointKey() for Request with url: "+t.url);var n={url:t.url,id:Math.random().toString(36).replace(/[^a-z]+/g,"")};return JSON.stringify(n)},_cloneRequest:function(e){return r(e,{_noClone:!0}).then((function(e){return u(e).then((function(e){return e}))}))},_cloneResponse:function(e,t){return t=t||{},a(e,{_noClone:!0}).then((function(e){return f(e).then((function(e){return null!=t.url&&t.url.length>0&&null==e.headers.get("x-oracle-jscpt-response-url")&&e.headers.set("x-oracle-jscpt-response-url",t.url),e}))}))},_derivePayloadType:function(e,r){var o=r.headers.get("Content-Type"),i=e.responseType,s=o&&-1!==o.indexOf("image/svg+xml");return n(r.headers)||s?"text":t(r)||"blob"===i?"blob":o&&-1!==o.indexOf("image/")||"arraybuffer"===i?"arraybuffer":o&&-1!==o.indexOf("multipart/form-data")?"multipart":"text"},_mapData:function(e,t,n){var r=e||[],o=t||[];if(n){r=[],o=[];var i,s=null!=e?e.length:t.length;for(i=0;i<s;i++){var a=null!=e?{key:e[i]}:{key:null},u=null!=t?{metadata:a,data:t[i]}:{metadata:a,data:null},c=n.mapFields(u);r[i]=c.metadata.key,o[i]=c.data}}return{keys:r,data:o}},_unmapData:function(e,t,n){var r=e||[],o=t||[];if(n){r=[],o=[];var i,s=null!=e?e.length:t.length;for(i=0;i<s;i++){var a=null!=e?{key:e[i]}:{key:null},u=null!=t?{metadata:a,data:t[i]}:{metadata:a,data:null},c=n.unmapFields(u);r[i]=c.metadata.key,o[i]=c.data}}return{keys:r,data:o}},_mapFindQuery:function(e,t,n){if(e&&t){var r=d(e.selector);r&&(e.selector=h(t.mapFilterCriterion(r)))}return n&&n.length&&(e.sort=n),e},isReplayRequest:function(e){return e.headers.has("x-oracle-jscpt-sync-replay")},markReplayRequest:function(e,t){t?e.headers.set("x-oracle-jscpt-sync-replay",""):e.headers.delete("x-oracle-jscpt-sync-replay")}}})),define("persist/impl/PersistenceXMLHttpRequest",["../persistenceUtils","./logger"],(function(e,t){"use strict";function n(e){var t=this;Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_browserXMLHttpRequest",{value:e}),Object.defineProperty(this,"_method",{value:null,writable:!0}),Object.defineProperty(this,"onabort",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onerror",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onload",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadend",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadstart",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onprogress",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onreadystatechange",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"ontimeout",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"_password",{value:null,writable:!0}),Object.defineProperty(this,"_readyState",{value:0,writable:!0}),Object.defineProperty(this,"readyState",{enumerable:!0,get:function(){return t._readyState}}),Object.defineProperty(this,"_requestHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_response",{value:"",writable:!0}),Object.defineProperty(this,"response",{enumerable:!0,get:function(){return t._response}}),Object.defineProperty(this,"_responseHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_responseText",{value:"",writable:!0}),Object.defineProperty(this,"responseText",{enumerable:!0,get:function(){return t._responseText}}),Object.defineProperty(this,"responseType",{value:"",enumerable:!0,writable:!0}),Object.defineProperty(this,"_responseURL",{value:"",writable:!0}),Object.defineProperty(this,"responseURL",{enumerable:!0,get:function(){return t._responseURL}}),Object.defineProperty(this,"_responseXML",{value:null,writable:!0}),Object.defineProperty(this,"responseXML",{enumerable:!0,get:function(){return t._responseXML}}),Object.defineProperty(this,"_status",{value:0,writable:!0}),Object.defineProperty(this,"status",{enumerable:!0,get:function(){return t._status}}),Object.defineProperty(this,"_statusText",{value:"",writable:!0}),Object.defineProperty(this,"statusText",{enumerable:!0,get:function(){return t._statusText}}),Object.defineProperty(this,"timeout",{value:0,enumerable:!0,writable:!0}),Object.defineProperty(this,"_isTimedOut",{value:!1,enumerable:!0,writable:!0}),Object.defineProperty(this,"upload",{value:new s,enumerable:!0}),Object.defineProperty(this,"_url",{value:null,writable:!0}),Object.defineProperty(this,"_username",{value:null,writable:!0}),Object.defineProperty(this,"withCredentials",{value:!1,enumerable:!0,writable:!0}),Object.defineProperty(this,"_abortController",{value:null,writable:!0}),Object.defineProperty(this,"_isUpload",{value:!1,writable:!0}),Object.defineProperty(this,"UNSENT",{value:0,enumerable:!0}),Object.defineProperty(this,"OPENED",{value:1,enumerable:!0}),Object.defineProperty(this,"HEADERS_RECEIVED",{value:2,enumerable:!0}),Object.defineProperty(this,"LOADING",{value:3,enumerable:!0}),Object.defineProperty(this,"DONE",{value:4,enumerable:!0})}function r(e,t){e._readyState=t,e.dispatchEvent(new u("readystatechange")),1==e._isTimedOut&&e._readyState==n.DONE?(e.dispatchEvent(new u("timeout",!1,!1,e)),e.dispatchEvent(new u("loadend",!1,!1,e)),e._isTimedOut=!1):e._readyState==n.DONE&&(e.dispatchEvent(new u("load",!1,!1,e)),e.dispatchEvent(new u("loadend",!1,!1,e)))}function o(o,i,s){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Processing Response"),function(e,t){if(e._responseHeaders={},t.entries){var o,i,s,a=t.entries();do{(o=a.next()).value&&(i=o.value[0],s=o.value[1],e._forceMimeType&&"content-type"==i.toLowerCase()?e._responseHeaders[i]=e._forceMimeType:e._responseHeaders[i]=s)}while(!o.done)}else t.forEach&&t.forEach((function(t,n){e._forceMimeType&&"content-type"==n.toLowerCase()?e._responseHeaders[n]=e._forceMimeType:e._responseHeaders[n]=t}));r(e,n.HEADERS_RECEIVED)}(o,s.headers);var a=s.headers.get("Content-Type");o._status=s.status,o._statusText=s.statusText,o._responseURL=i.url;var u=e._derivePayloadType(o,s);if("blob"===u)t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.blob()"),s.blob().then((function(e){o._responseType="blob",o._response=e,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}),(function(e){t.error(e)}));else if("arraybuffer"===u)t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.arrayBuffer()"),s.arrayBuffer().then((function(e){o._responseType="arrayBuffer",o._response=e,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}),(function(e){t.error("error reading response as arrayBuffer!")}));else if("multipart"===u){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.formData()"),o._responseType="formData";var c=function(t){var i="";e.parseMultipartFormData(t,a).forEach((function(e){i+=e.data})),o._response=i,o._responseText=i,r(o,n.DONE),"function"==typeof o.onload&&o.onload()};if(s.formData)try{s.formData().then((function(e){var t,i,s="",a=e.values();do{(t=(i=a.next()).value)&&(s+=t)}while(!i.done);o._response=s,o._responseText=s,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}))}catch(e){s.text().then((function(e){c(e)}))}else s.text().then((function(e){c(e)}))}else s.text().then((function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.text()"),o._responseType="",o._response=e,o._responseText=e,r(o,n.DONE),"function"==typeof o.onload&&o.onload()}),(function(e){t.error(e)}))}function i(e){if(e._readyState!==n.OPENED)throw new Error("INVALID_STATE_ERR")}function s(){this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this._eventListeners=[]}function a(e,t,n,r){Object.defineProperty(this,"type",{value:e,enumerable:!0}),Object.defineProperty(this,"bubbles",{value:t,enumerable:!0}),Object.defineProperty(this,"cancelable",{value:n,enumerable:!0}),Object.defineProperty(this,"target",{value:r,enumerable:!0}),Object.defineProperty(this,"lengthComputable",{value:!1,enumerable:!0}),Object.defineProperty(this,"loaded",{value:0,enumerable:!0}),Object.defineProperty(this,"total",{value:0,enumerable:!0})}function u(e,t,n,r){Object.defineProperty(this,"type",{value:e,enumerable:!0}),Object.defineProperty(this,"bubbles",{value:t,enumerable:!0}),Object.defineProperty(this,"cancelable",{value:n,enumerable:!0}),Object.defineProperty(this,"target",{value:r,enumerable:!0})}return Object.defineProperty(n,"UNSENT",{value:0,enumerable:!0}),Object.defineProperty(n,"OPENED",{value:1,enumerable:!0}),Object.defineProperty(n,"HEADERS_RECEIVED",{value:2,enumerable:!0}),Object.defineProperty(n,"LOADING",{value:3,enumerable:!0}),Object.defineProperty(n,"DONE",{value:4,enumerable:!0}),n.prototype.open=function(e,o,i,s,a){if(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open() for method: "+e+", url: "+o),"boolean"==typeof i&&!i)throw new Error("InvalidAccessError: Failed to execute 'open' on 'XMLHttpRequest': Synchronous requests are disabled on the XHR Adapter");this._method=e,this._url=o,this._isTimedOut=!1;var u=function(e){var t=e.toLowerCase();if(0===t.indexOf("http:")||0===t.indexOf("https:"))return!1;if(0===t.indexOf("file:")||0===t.indexOf("cdvfile:"))return!0;if(URL&&URL.prototype&&null!=(t=new URL(e,window.location.href).origin)&&"null"!=t&&t.length>0)return 0===t.toLowerCase().indexOf("file:");var n=document.createElement("a");return n.href=e,!(!(t=n.protocol)||0!==t.toLowerCase().indexOf("file:"))}(o);if(u){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open called for a File url");var c=this;this._passthroughXHR=new c._browserXMLHttpRequest,this._passthroughXHR.onreadystatechange=function(){c._passthroughXHR.readyState==n.DONE&&(c._status=c._passthroughXHR.status,c._statusText=c._passthroughXHR.statusText,c._response=c._passthroughXHR.response,c._responseHeaders=c._passthroughXHR.responseHeaders,c._responseType=c._passthroughXHR.responseType,null!=c._responseType&&""!=c._responseType&&"text"!=c._responseType||(c._responseText=c._passthroughXHR.responseText),c._responseURL=c._passthroughXHR.responseURL,null!=c._responseType&&""!=c._responseType&&"document"!=c._responseType||(c._responseXML=c._passthroughXHR.responseXML)),r(c,c._passthroughXHR.readyState)},this._passthroughXHR.open(e,o,i,s,a)}else this._passthroughXHR=null;"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._username=s,this._password=a,this._responseText=null,this._responseXML=null,this._requestHeaders={},r(this,n.OPENED)},n.prototype.setRequestHeader=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: setRequestHeader() with header: "+e+" ,value: "+n),i(this);var r=this._requestHeaders[e];this._requestHeaders[e]=r?r+=","+n:n},n.prototype.send=function(e){var s=this;if(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: send()"),this._passthroughXHR)null!=this.responseType&&(this._passthroughXHR.responseType=this.responseType),this._passthroughXHR.send(e);else{i(this),r(this,n.OPENED);var a=function(e,t){var n=function(e){var t=new Headers;return Object.keys(e._requestHeaders).forEach((function(n){t.append(n,e._requestHeaders[n])})),t}(e),r=e.withCredentials?"include":"same-origin",o={method:e._method,headers:n,mode:"cors",cache:"default",credentials:r};return"GET"!==e._method&&"HEAD"!==e._method&&"DELETE"!==e._method&&(o.body=t),o}(this,e),c=new Request(this._url,a);this._isUpload=!!a.body;var f={};(s=this)._abortController&&(f.signal=s._abortController.signal);try{s.timeout&&"number"==typeof s.timeout?function(e,n,r){return new Promise((function(o,i){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling fetchWithTimeout");var s=new Error("Fetch Timeout");s.name="TimeoutError";var a=setTimeout((function(){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Request Timedout: "+e.url),i(s),r._abortController&&r._abortController.abort()}),r.timeout);fetch(e,n).then((function(e){o(e)}),(function(e){i(e)})).finally((function(){clearTimeout(a)}))}))}(c,f,s).then((function(e){o(s,c,e)})).catch((function(e){e&&e.name&&"TimeoutError"===e.name?(s._isTimedOut=!0,r(s,n.DONE)):s.dispatchEvent(new u("error",!1,!1,s))})):fetch(c,f).then((function(e){o(s,c,e)}),(function(e){e&&e.name&&"AbortError"===e.name?(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Request Timedout: "+c.url),s.dispatchEvent(new u("abort",!1,!1,s))):s.dispatchEvent(new u("error",!1,!1,s))}))}catch(e){throw e}this.dispatchEvent(new u("loadstart",!1,!1,this))}},n.prototype.abort=function(){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: abort()"),this._abortController?this._abortController.abort():this.dispatchEvent(new u("abort",!1,!1,self)),this._readyState=n.UNSENT,this._status=0,this._statusText=""},n.prototype.getResponseHeader=function(e){if(t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getResponseHeader() for header: "+e),this._readyState<n.HEADERS_RECEIVED)return null;for(var r in e=e.toLowerCase(),this._responseHeaders)if(r.toLowerCase()==e.toLowerCase())return this._responseHeaders[r];return null},n.prototype.getAllResponseHeaders=function(){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getAllResponseHeaders()");var e=this;if(this._readyState<n.HEADERS_RECEIVED)return"";var r="";return this._responseHeaders&&Object.keys(this._responseHeaders).forEach((function(t){r+=t+": "+e._responseHeaders[t]+"\r\n"})),r},n.prototype.overrideMimeType=function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: overrideMimeType() for mimeType: "+e),"string"==typeof e&&(this._forceMimeType=e.toLowerCase())},n.prototype.addEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: addEventListener() for event type: "+e),this._eventListeners[e]=this._eventListeners[e]||[],this._eventListeners[e].push(n)},n.prototype.removeEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: removeEventListener() for event type: "+e);var r,o=this._eventListeners[e]||[],i=o.length;for(r=0;r<i;r++)if(o[r]==n)return o.splice(r,1)},n.prototype.dispatchEvent=function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: dispatchEvent() for event type: "+e.type);var n=this,r=e.type;switch((this._eventListeners[r]||[]).forEach((function(t){"function"==typeof t?t.call(n,e):t.handleEvent(e)})),r){case"abort":this._isUpload&&this.upload._dispatchEvent(new a("abort",!1,!1,n.upload)),this.onabort&&this.onabort(e),n.dispatchEvent(new u("loadend",!1,!1,n));break;case"error":this._isUpload&&this.upload._dispatchEvent(new a("error",!1,!1,n.upload)),this.onerror&&this.onerror(e);break;case"load":this._isUpload&&this.upload._dispatchEvent(new a("load",!1,!1,n.upload)),this.onload&&this.onload(e);break;case"loadend":this._isUpload&&this.upload._dispatchEvent(new a("loadend",!1,!1,n.upload)),this.onloadend&&this.onloadend(e);break;case"loadstart":this._isUpload&&this.upload._dispatchEvent(new a("loadstart",!1,!1,n.upload)),this.onloadstart&&this.onloadstart(e);break;case"progress":this.onprogress&&this.onprogress(e);break;case"readystatechange":this.onreadystatechange&&this.onreadystatechange(e);break;case"timeout":this._isUpload&&this.upload._dispatchEvent(new a("timeout",!1,!1,n.upload)),this.ontimeout&&this.ontimeout(e)}return!!e.defaultPrevented},s.prototype.addEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequestUpload: addEventListener() for event type: "+e),this._eventListeners[e]=this._eventListeners[e]||[],this._eventListeners[e].push(n)},s.prototype.removeEventListener=function(e,n){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequestUpload: removeEventListener() for event type: "+e);var r,o=this._eventListeners[e]||[],i=o.length;for(r=0;r<i;r++)if(o[r]==n)return o.splice(r,1)},s.prototype._dispatchEvent=function(e){t.log("Offline Persistence Toolkit PersistenceXMLHttpRequestUpload: dispatchEvent() for event type: "+e.type);var n=this,r=e.type;switch((this._eventListeners[r]||[]).forEach((function(t){"function"==typeof t?t.call(n,e):t.handleEvent(e)})),r){case"abort":this.onabort&&this.onabort(e);break;case"error":this.onerror&&this.onerror(e);break;case"load":this.onload&&this.onload(e);break;case"loadend":this.onloadend&&this.onloadend(e);break;case"loadstart":this.onloadstart&&this.onloadstart(e),this._dispatchEvent(new a("progress",!1,!1,n));break;case"progress":this.onprogress&&this.onprogress(e);break;case"timeout":this.ontimeout&&this.ontimeout(e)}return!!e.defaultPrevented},a.prototype.stopPropagation=function(){},a.prototype.preventDefault=function(){this.defaultPrevented=!0},u.prototype.stopPropagation=function(){},u.prototype.preventDefault=function(){this.defaultPrevented=!0},n})),define("persist/impl/PersistenceStoreMetadata",[],(function(){"use strict";var e=function(e,t,n){this.name=e,this.persistenceStoreFactory=t,this.versions=n};return(e.prototype={}).persistenceStoreFactory,e.prototype.versions,e})),define("persist/PersistenceStore",[],(function(){"use strict";var e=function(e){this._name=e};return(e.prototype={}).getName=function(){return this._name},e.prototype.getVersion=function(){return this._version},e.prototype.Init=function(e){return e&&e.version?this._version=e.version:this._version="0",Promise.resolve()},e.prototype.upsert=function(e,t,n,r){throw TypeError("failed in abstract function")},e.prototype.upsertAll=function(e){throw TypeError("failed in abstract function")},e.prototype.find=function(e){throw TypeError("failed in abstract function")},e.prototype.findByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.removeByKey=function(e){throw TypeError("failed in abstract function")},e.prototype.delete=function(e){throw TypeError("failed in abstract function")},e.prototype.keys=function(){throw TypeError("failed in abstract function")},e.prototype.updateKey=function(e,t){throw TypeError("failed in abstract function")},e})),define("persist/impl/storageUtils",["./logger"],(function(e){"use strict";function t(e){var r,s=[];for(var a in e)if(e.hasOwnProperty(a)){var u=e[a];if(0===a.indexOf("$")){if(o(a)){if(!(u instanceof Array))throw new Error("not a valid expression: "+e);r={operator:a,array:[]};for(var c=0;c<u.length;c++){var f=t(u[c]);r.array.push(f)}}else if(i(a))throw new Error("not a valid expression: "+e)}else if("object"!=typeof u)s.push({left:a,right:u,operator:"$eq"});else{var l={left:a};n(l,u),s.push(l)}}return s.length>1?r={operator:"$and",array:s}:1===s.length&&(r=s[0]),r}function n(e,t){var n=!1;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(n||!i(r))throw new Error("parsing error "+t);e.operator=r,e.right=o,n=!0}}function r(e,t){var n=e.operator;if(o(n)){if(!e.left&&e.array instanceof Array){for(var s,c=e.array,f=0;f<c.length;f++){var l=r(c[f],t);if("$or"===n&&!0===l)return!0;if("$and"===n&&!1===l)return!1;s=l}return s}throw new Error("invalid expression tree!"+e)}if(!i(n))throw new Error("not a valid expression!"+e);var d,h=u(e.left,t),p=e.right;if("$lt"===n)return(h=(d=a(h,p))[0])<d[1];if("$gt"===n)return(h=(d=a(h,p))[0])>d[1];if("$lte"===n)return(h=(d=a(h,p))[0])<=d[1];if("$gte"===n)return(h=(d=a(h,p))[0])>=d[1];if("$eq"===n)return h===p;if("$ne"===n)return h!==p;if("$regex"===n)return null!==h.match(p);if("$exists"===n)return p?null!=h:null==h;if("$in"!==n){if("$nin"===n)return p.indexOf(h)<0;throw new Error("not a valid expression! "+e)}for(var v=0;v<p.length;v++)if(p[v]===h)return!0;return!1}function o(e){return"$and"===e||"$or"===e}function i(e){return"$lt"===e||"$gt"===e||"$lte"===e||"$gte"===e||"$eq"===e||"$ne"===e||"$regex"===e||"$exists"===e||"$in"===e||"$nin"===e}function s(e){return null!=e&&(e instanceof String||"string"==typeof e)}function a(e,t){return s(e)&&null==t?t="":s(t)&&null==e&&(e=""),[e,t]}function u(e,t){for(var n=e.split("."),r=t,o=0;o<n.length;o++)r=r[n[o]];return r}return{satisfy:function(n,o){return e.log("Offline Persistence Toolkit storageUtils: Processing selector: "+JSON.stringify(n)),!n||r(t(n),o)},getValue:u,assembleObject:function(e,t){var n;if(t){n={};for(var r=0;r<t.length;r++)for(var o=n,i=e,s=t[r].split("."),a=0;a<s.length;a++)i=i[s[a]],!o[s[a]]&&a<s.length-1&&(o[s[a]]={}),a===s.length-1?o[s[a]]=i:o=o[s[a]]}else n=e;return n},sortRows:function(e,t){return e&&Array.isArray(e)&&!(e.length<1)&&t&&Array.isArray(t)&&t.length?e.sort(function(e){return function(t,n){for(var r=0;r<e.length;r++){var o,i=e[r],s=!0;if("string"==typeof i)o=i;else{if("object"!=typeof i)throw new Error("invalid sort criteria.");var a=Object.keys(i);if(!a||1!==a.length)throw new Error("invalid sort criteria");s="asc"===i[o=a[0]].toLowerCase()}var c=u(o,t),f=u(o,n);if(c!=f)return s?c<f?-1:1:c<f?1:-1}return 0}}(t)):e}}})),function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pouchdb",[],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PouchDB=e()}((function(){return function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,(function(e){return o(t[s][1][e]||e)}),f,f.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments.length;if(t){for(var n=[],r=-1;++r<t;)n[r]=arguments[r];return e.call(this,n)}return e.call(this,[])}}},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){
|
|
7
7
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
8
8
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
9
9
|
// copy of this software and associated documentation files (the
|
|
@@ -81,7 +81,11 @@ function p(e,t){this.fun=e,this.array=t}p.prototype.run=function(){var e=this.fu
|
|
|
81
81
|
var t=e.MutationObserver||e.WebKitMutationObserver;n.test=function(){return t},n.install=function(n){var r=0,o=new t(n),i=e.document.createTextNode("");return o.observe(i,{characterData:!0}),function(){i.data=r=++r%2}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(e,t,n){(function(e){(function(){"use strict";n.test=function(){return"function"==typeof e.queueMicrotask},n.install=function(t){return function(){e.queueMicrotask(t)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,n){(function(e){(function(){"use strict";n.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},n.install=function(t){return function(){
|
|
82
82
|
// Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
|
|
83
83
|
// into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
|
|
84
|
-
var n=e.document.createElement("script");return n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n),t}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t,n){"use strict";n.test=function(){return!0},n.install=function(e){return function(){setTimeout(e,0)}}},{}],10:[function(e,t,n){
|
|
84
|
+
var n=e.document.createElement("script");return n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n),t}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t,n){"use strict";n.test=function(){return!0},n.install=function(e){return function(){setTimeout(e,0)}}},{}],10:[function(e,t,n){"function"==typeof Object.create?
|
|
85
|
+
// implementation from standard node.js 'util' module
|
|
86
|
+
t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:
|
|
87
|
+
// old school shim for old browsers
|
|
88
|
+
t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t,n){(function(n){(function(){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o,i,s=r(e("immediate")),a=e("uuid"),u=r(e("spark-md5")),c=r(e("vuvuzela")),f=r(e("argsarray")),l=r(e("inherits")),d=r(e("events"));function h(e){return"$"+e}function p(e){return e.substring(1)}function v(){this._store={}}function y(e){
|
|
85
89
|
// init with an array
|
|
86
90
|
if(this._store=new v,e&&Array.isArray(e))for(var t=0,n=e.length;t<n;t++)this.add(e[t])}
|
|
87
91
|
// most of this is borrowed from lodash.isPlainObject:
|
|
@@ -96,7 +100,7 @@ function(){if("undefined"==typeof Symbol||"undefined"==typeof Map||"undefined"==
|
|
|
96
100
|
// based on https://github.com/montagejs/collections
|
|
97
101
|
()?(// prefer built-in Map/Set
|
|
98
102
|
o=Set,i=Map):(// fall back to our polyfill
|
|
99
|
-
o=y,i=v);var g,_=Function.prototype.toString,m
|
|
103
|
+
o=y,i=v);var g,_,m=Function.prototype.toString,b=m.call(Object);function w(e){var t,n,r;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],n=0,r=e.length;n<r;n++)t[n]=w(e[n]);return t}
|
|
100
104
|
// special case: to avoid inconsistencies between IndexedDB
|
|
101
105
|
// and other backends, we automatically stringify Dates
|
|
102
106
|
if(e instanceof Date)return e.toISOString();if(function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||"undefined"!=typeof Blob&&e instanceof Blob}(e))return function(e){if(e instanceof ArrayBuffer)return function(e){if("function"==typeof e.slice)return e.slice(0);
|
|
@@ -107,55 +111,55 @@ return"function"==typeof e.slice?e.slice(0,t,n):e.webkitSlice(0,t,n);
|
|
|
107
111
|
// PhantomJS slice() replacement
|
|
108
112
|
}(e);if(!function(e){var t=Object.getPrototypeOf(e);
|
|
109
113
|
/* istanbul ignore if */if(null===t)// not sure when this happens, but I guess it can
|
|
110
|
-
return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&
|
|
114
|
+
return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&m.call(n)==b}(e))return e;// don't clone objects like Workers
|
|
111
115
|
for(n in t={},e)
|
|
112
116
|
/* istanbul ignore else */
|
|
113
|
-
if(Object.prototype.hasOwnProperty.call(e,n)){var o=
|
|
117
|
+
if(Object.prototype.hasOwnProperty.call(e,n)){var o=w(e[n]);void 0!==o&&(t[n]=o)}return t}function O(e){var t=!1;return f((function(n){
|
|
114
118
|
/* istanbul ignore if */
|
|
115
119
|
if(t)
|
|
116
120
|
// this is a smoke test and should never actually happen
|
|
117
|
-
throw new Error("once called more than once");t=!0,e.apply(this,n)}))}function
|
|
121
|
+
throw new Error("once called more than once");t=!0,e.apply(this,n)}))}function k(e){
|
|
118
122
|
//create the function we will be returning
|
|
119
123
|
return f((function(t){
|
|
120
124
|
// Clone arguments
|
|
121
|
-
t=
|
|
125
|
+
t=w(t);var n=this,r="function"==typeof t[t.length-1]&&t.pop(),o=new Promise((function(r,o){var i;try{var s=O((function(e,t){e?o(e):r(t)}));
|
|
122
126
|
// create a callback for this invocation
|
|
123
127
|
// apply the function in the orig context
|
|
124
128
|
t.push(s),(i=e.apply(n,t))&&"function"==typeof i.then&&r(i)}catch(e){o(e)}}));
|
|
125
129
|
// if the last argument is a function, assume its a callback
|
|
126
130
|
// if there is a callback, call it back
|
|
127
|
-
return r&&o.then((function(e){r(null,e)}),r),o}))}function
|
|
131
|
+
return r&&o.then((function(e){r(null,e)}),r),o}))}function P(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){
|
|
128
132
|
/* istanbul ignore if */
|
|
129
133
|
if(e.constructor.listeners("debug").length){for(var r=["api",e.name,t],o=0;o<n.length-1;o++)r.push(n[o]);e.constructor.emit("debug",r);
|
|
130
134
|
// override the callback itself to log the response
|
|
131
135
|
var i=n[n.length-1];n[n.length-1]=function(n,r){var o=["api",e.name,t];o=o.concat(n?["error",n]:["success",r]),e.constructor.emit("debug",o),i(n,r)}}}(r,e,n),this.taskqueue.isReady?t.apply(this,n):new Promise((function(t,o){r.taskqueue.addTask((function(i){i?o(i):t(r[e].apply(r,n))}))}))})))}
|
|
132
136
|
// like underscore/lodash _.pick()
|
|
133
|
-
function
|
|
137
|
+
function S(e,t){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];i in e&&(n[i]=e[i])}return n}
|
|
134
138
|
// Most browsers throttle concurrent requests at 6, so it's silly
|
|
135
139
|
// to shim _bulk_get by trying to launch potentially hundreds of requests
|
|
136
140
|
// and then letting the majority time out. We can handle this ourselves.
|
|
137
|
-
function
|
|
141
|
+
function j(e){return e}function T(e){return[{ok:e}]}
|
|
138
142
|
// shim for P/CouchDB adapters that don't directly implement _bulk_get
|
|
139
|
-
function
|
|
143
|
+
function E(e,t,n){var r=t.docs,o=new i;
|
|
140
144
|
// consolidate into one request per doc if possible
|
|
141
|
-
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=
|
|
145
|
+
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=S(f[0],["atts_since","attachments"]);l.open_revs=f.map((function(e){
|
|
142
146
|
// rev is optional, open_revs disallowed
|
|
143
147
|
return e.rev})),
|
|
144
148
|
// remove falsey / undefined revisions
|
|
145
|
-
l.open_revs=l.open_revs.filter(
|
|
149
|
+
l.open_revs=l.open_revs.filter(j);var d=j;0===l.open_revs.length&&(delete l.open_revs,
|
|
146
150
|
// when fetching only the "winning" leaf,
|
|
147
151
|
// transform the result so it looks like an open_revs
|
|
148
152
|
// request
|
|
149
|
-
d=
|
|
153
|
+
d=T),
|
|
150
154
|
// globally-supplied options
|
|
151
155
|
["revs","attachments","binary","ajax","latest"].forEach((function(e){e in t&&(l[e]=t[e])})),e.get(r,l,(function(e,t){var o,i,s;
|
|
152
|
-
/* 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
|
|
156
|
+
/* 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 q(){return g}
|
|
153
157
|
// Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We
|
|
154
|
-
function
|
|
158
|
+
function R(){d.call(this),this._listeners={},
|
|
155
159
|
/* istanbul ignore next */
|
|
156
|
-
function(e){
|
|
160
|
+
function(e){q()&&addEventListener("storage",(function(t){e.emit(t.key)}))}(this)}function A(e){
|
|
157
161
|
/* istanbul ignore else */
|
|
158
|
-
if("undefined"!=typeof console&&"function"==typeof console[e]){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}function
|
|
162
|
+
if("undefined"!=typeof console&&"function"==typeof console[e]){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}function C(e){var t=0;return e||(t=2e3),function(e,t){var n=6e5;// Hard-coded default of 10 minutes
|
|
159
163
|
return e=parseInt(e,10)||0,(t=parseInt(t,10))!=t||t<=e?t=(e||1)<<1:t+=1,
|
|
160
164
|
// In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout
|
|
161
165
|
t>n&&(e=3e5,// divide by two
|
|
@@ -163,56 +167,56 @@ t=n),~~((t-e)*Math.random()+e);// ~~ coerces to an int, but fast.
|
|
|
163
167
|
}(e,t)}
|
|
164
168
|
// designed to give info to browser users, who are disturbed
|
|
165
169
|
// when they see http errors in the console
|
|
166
|
-
function
|
|
170
|
+
function x(e,t){A("info","The above "+e+" is totally normal. "+t)}l(R,d),R.prototype.addListener=function(e,t,n,r){
|
|
167
171
|
/* istanbul ignore if */
|
|
168
172
|
if(!this._listeners[t]){var o=this,i=!1;this._listeners[t]=a,this.on(e,a)}function a(){
|
|
169
173
|
/* istanbul ignore if */
|
|
170
|
-
if(o._listeners[t])if(i)i="waiting";else{i=!0;var e=
|
|
171
|
-
/* 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}))}}},
|
|
174
|
+
if(o._listeners[t])if(i)i="waiting";else{i=!0;var e=S(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);
|
|
175
|
+
/* istanbul ignore next */n.changes(e).on("change",(function(e){e.seq>r.since&&!r.cancelled&&(r.since=e.seq,r.onChange(e))})).on("complete",(function(){"waiting"===i&&s(a),i=!1})).on("error",(function(){i=!1}))}}},R.prototype.removeListener=function(e,t){
|
|
172
176
|
/* istanbul ignore if */
|
|
173
177
|
t in this._listeners&&(d.prototype.removeListener.call(this,e,this._listeners[t]),delete this._listeners[t])},
|
|
174
178
|
/* istanbul ignore next */
|
|
175
|
-
|
|
179
|
+
R.prototype.notifyLocalWindows=function(e){
|
|
176
180
|
//do a useless change on a storage thing
|
|
177
181
|
//in order to get other windows's listeners to activate
|
|
178
|
-
|
|
182
|
+
q()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},R.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
|
|
179
183
|
for(var o in r)
|
|
180
184
|
// Avoid bugs when hasOwnProperty is shadowed
|
|
181
|
-
Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};function
|
|
185
|
+
Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t};var L=_;function D(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}l(D,Error),D.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})},new D(401,"unauthorized","Name or password is incorrect.");var M=new D(400,"bad_request","Missing JSON list of 'docs'"),B=new D(404,"not_found","missing"),N=new D(409,"conflict","Document update conflict"),I=new D(400,"bad_request","_id field must contain a string"),U=new D(412,"missing_id","_id is required for puts"),$=new D(400,"bad_request","Only reserved document ids may start with underscore."),F=(new D(412,"precondition_failed","Database not open"),new D(500,"unknown_error","Database encountered an unknown error")),H=new D(500,"badarg","Some query argument is invalid"),K=(new D(400,"invalid_request","Request was invalid"),new D(400,"query_parse_error","Some query parameter is invalid")),J=new D(500,"doc_validation","Bad special document member"),X=new D(400,"bad_request","Something wrong with the request"),V=new D(400,"bad_request","Document must be a JSON object"),z=(new D(404,"not_found","Database not found"),new D(500,"indexed_db_went_bad","unknown")),G=(new D(500,"web_sql_went_bad","unknown"),new D(500,"levelDB_went_went_bad","unknown"),new D(403,"forbidden","Forbidden by design doc validate_doc_update function"),new D(400,"bad_request","Invalid rev format")),W=(new D(412,"file_exists","The database could not be created, the file already exists."),new D(412,"missing_stub","A pre-existing attachment stub wasn't found"));function Q(e,t){function n(t){for(
|
|
182
186
|
// inherit error properties from our parent error manually
|
|
183
187
|
// so as to allow proper JSON parsing.
|
|
184
188
|
/* jshint ignore:start */
|
|
185
189
|
var n=Object.getOwnPropertyNames(e),r=0,o=n.length;r<o;r++)"function"!=typeof e[n[r]]&&(this[n[r]]=e[n[r]]);
|
|
186
|
-
/* jshint ignore:end */void 0!==t&&(this.reason=t)}return n.prototype=
|
|
190
|
+
/* jshint ignore:end */void 0!==t&&(this.reason=t)}return n.prototype=D.prototype,new n(t)}function Y(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||(
|
|
187
191
|
// CSG sends events on the changes feed that don't have documents,
|
|
188
192
|
// this hack makes a whole lot of existing code robust.
|
|
189
|
-
r.doc={});var o=n&&function(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return
|
|
193
|
+
r.doc={});var o=n&&function(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return Q(X,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)
|
|
190
194
|
/* istanbul ignore else */
|
|
191
|
-
r.doc._attachments.hasOwnProperty(i)&&(r.doc._attachments[i].stub=!0)}else delete r.doc;return!0}}function
|
|
195
|
+
r.doc._attachments.hasOwnProperty(i)&&(r.doc._attachments[i].stub=!0)}else delete r.doc;return!0}}function ee(e){for(var t=[],n=0,r=e.length;n<r;n++)t=t.concat(e[n]);return t}
|
|
192
196
|
// shim for Function.prototype.name,
|
|
193
197
|
// Determine id an ID is valid
|
|
194
198
|
// - invalid IDs begin with an underescore that does not begin '_design' or
|
|
195
199
|
// '_local'
|
|
196
200
|
// - any other string value is a valid id
|
|
197
201
|
// Returns the specific error object for each case
|
|
198
|
-
function
|
|
202
|
+
function te(e){var t;if(e?"string"!=typeof e?t=Q(I):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=Q($)):t=Q(U),t)throw t}
|
|
199
203
|
// Checks if a PouchDB object is "remote" or not. This is
|
|
200
|
-
function
|
|
204
|
+
function ne(e){return"boolean"==typeof e._remote?e._remote:
|
|
201
205
|
/* istanbul ignore next */
|
|
202
|
-
"function"==typeof e.type&&(
|
|
203
|
-
/* istanbul ignore next */)}function
|
|
206
|
+
"function"==typeof e.type&&(A("warn","db.type() is deprecated and will be removed in a future version of PouchDB"),"http"===e.type()
|
|
207
|
+
/* istanbul ignore next */)}function re(e){if(!e)return null;var t=e.split("/");return 2===t.length?t:1===t.length?[e,e]:null}function oe(e){var t=re(e);return t?t.join("/"):null}
|
|
204
208
|
// originally parseUri 1.2.2, now patched by us
|
|
205
209
|
// (c) Steven Levithan <stevenlevithan.com>
|
|
206
210
|
// MIT License
|
|
207
|
-
new
|
|
211
|
+
new D(413,"invalid_url","Provided URL is invalid");var ie=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],se="queryKey",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}
|
|
208
212
|
// Based on https://github.com/alexdavid/scope-eval v0.0.3
|
|
209
213
|
// (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js)
|
|
210
214
|
// This is basically just a wrapper around new Function()
|
|
211
|
-
function
|
|
215
|
+
function fe(e,t){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&(n.push(o),r.push(t[o]));return n.push(e),Function.apply(null,n).apply(null,r)}
|
|
212
216
|
// this is essentially the "update sugar" function from daleharvey/pouchdb#1388
|
|
213
217
|
// the diffFun tells us what delta to apply to the doc. it either returns
|
|
214
218
|
// the doc, or false if it doesn't need to do an update after all
|
|
215
|
-
function
|
|
219
|
+
function le(e,t,n){return new Promise((function(r,o){e.get(t,(function(i,s){if(i){
|
|
216
220
|
/* istanbul ignore next */
|
|
217
221
|
if(404!==i.status)return o(i);s={}}
|
|
218
222
|
// the user might change the _rev, so save it for posterity
|
|
@@ -224,34 +228,34 @@ return r({updated:!1,rev:a});
|
|
|
224
228
|
// so reset them here
|
|
225
229
|
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){
|
|
226
230
|
/* istanbul ignore next */
|
|
227
|
-
if(409!==r.status)throw r;return
|
|
231
|
+
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)};
|
|
228
232
|
// Abstracts constructing a Blob object, so it also works in older
|
|
229
233
|
// browsers that don't support the native Blob constructor (e.g.
|
|
230
234
|
// old QtWebKit versions, Android < 4.4).
|
|
231
|
-
function
|
|
235
|
+
function pe(e,t){
|
|
232
236
|
/* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */
|
|
233
237
|
e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}
|
|
234
238
|
// From http://stackoverflow.com/questions/14967647/ (continues on next line)
|
|
235
239
|
// encode-decode-image-with-base64-breaks-image (2013-04-21)
|
|
236
|
-
function
|
|
240
|
+
function ve(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o);return n}function ye(e,t){return pe([ve(e)],{type:t})}function ge(e,t){return ye(de(e),t)}
|
|
237
241
|
//Can't find original post, but this is close
|
|
238
242
|
//http://stackoverflow.com/questions/6965107/ (continues on next line)
|
|
239
243
|
//converting-between-strings-and-arraybuffers
|
|
240
244
|
// shim for browsers that don't support it
|
|
241
|
-
function
|
|
245
|
+
function _e(e,t){var n=new FileReader,r="function"==typeof n.readAsBinaryString;n.onloadend=function(e){var n=e.target.result||"";if(r)return t(n);t(function(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=0;o<r;o++)t+=String.fromCharCode(n[o]);return t}(n))},r?n.readAsBinaryString(e):n.readAsArrayBuffer(e)}function me(e,t){_e(e,(function(e){t(e)}))}function be(e,t){me(e,(function(e){t(he(e))}))}
|
|
242
246
|
// simplified API. universal browser support is assumed
|
|
243
247
|
// this is not used in the browser
|
|
244
|
-
var
|
|
248
|
+
var we=self.setImmediate||self.setTimeout;function Oe(e,t,n,r,o){(n>0||r<t.size)&&(
|
|
245
249
|
// only slice blob if we really need to
|
|
246
|
-
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
|
|
250
|
+
t=function(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.slice(t,n)}(t,n,r)),function(e,t){var n=new FileReader;n.onloadend=function(e){var n=e.target.result||new ArrayBuffer(0);t(n)},n.readAsArrayBuffer(e)}(t,(function(t){e.append(t),o()}))}function ke(e,t,n,r,o){(n>0||r<t.length)&&(
|
|
247
251
|
// only create a substring if we really need to
|
|
248
|
-
t=t.substring(n,r)),e.appendBinary(t),o()}function
|
|
252
|
+
t=t.substring(n,r)),e.appendBinary(t),o()}function Pe(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:Oe;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 Se(e){return u.hash(e)}function je(e,t){var n=w(e);return t?(delete n._rev_tree,Se(JSON.stringify(n))):a.v4().replace(/-/g,"").toLowerCase()}var Te=a.v4;// mimic old import, only v4 is ever used elsewhere
|
|
249
253
|
// We fetch all leafs of the revision tree, and sort them based on tree length
|
|
250
254
|
// and whether they were deleted, undeleted documents with the longest revision
|
|
251
255
|
// tree (most edits) win
|
|
252
256
|
// The final sort algorithm is slightly documented in a sidebar here:
|
|
253
257
|
// http://guide.couchdb.org/draft/conflicts.html
|
|
254
|
-
function
|
|
258
|
+
function Ee(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
|
|
255
259
|
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];
|
|
256
260
|
// sort by deleted, then pos, then id
|
|
257
261
|
t&&!(r!==l?r:n!==u?n<u:t<d)||(t=d,n=u,r=l)}}return n+"-"+t}
|
|
@@ -259,94 +263,94 @@ t&&!(r!==l?r:n!==u?n<u:t<d)||(t=d,n=u,r=l)}}return n+"-"+t}
|
|
|
259
263
|
// traverse revisions
|
|
260
264
|
// The return value from the callback will be passed as context to all
|
|
261
265
|
// children of that node
|
|
262
|
-
function
|
|
266
|
+
function qe(e,t){for(var n,r=e.slice();n=r.pop();)for(var o=n.pos,i=n.ids,s=i[2],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 Re(e,t){return e.pos-t.pos}function Ae(e){var t=[];qe(e,(function(e,n,r,o,i){e&&t.push({rev:n+"-"+r,pos:n,opts:i})})),t.sort(Re).reverse();for(var n=0,r=t.length;n<r;n++)delete t[n].pos;return t}
|
|
263
267
|
// returns revs of all conflicts that is leaves such that
|
|
264
268
|
// 1. are not deleted and
|
|
265
269
|
// 2. are different than winning revision
|
|
266
|
-
function
|
|
270
|
+
function Ce(e){for(var t=Ee(e),n=Ae(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}
|
|
267
271
|
// compact a tree by marking its non-leafs as missing,
|
|
268
272
|
// and return a list of revs to delete
|
|
269
273
|
// build up a list of all the paths to the leafs in this revision tree
|
|
270
|
-
function
|
|
274
|
+
function xe(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()}
|
|
271
275
|
// for a better overview of what this is doing, read:
|
|
272
|
-
function
|
|
276
|
+
function Le(e,t){return e.pos-t.pos}
|
|
273
277
|
// classic binary search
|
|
274
278
|
// assuming the arr is sorted, insert the item in the proper place
|
|
275
|
-
function
|
|
279
|
+
function De(e,t,n){var r=function(e,t,n){for(var r,o=0,i=e.length;o<i;)n(e[r=o+i>>>1],t)<0?o=r+1:i=r;return o}(e,t,n);e.splice(r,0,t)}
|
|
276
280
|
// Turn a path as a flat array into a tree with a single branch.
|
|
277
281
|
// If any should be stemmed from the beginning of the array, that's passed
|
|
278
282
|
// in as the second argument
|
|
279
|
-
function
|
|
283
|
+
function Me(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}
|
|
280
284
|
// compare the IDs of two trees
|
|
281
|
-
function
|
|
285
|
+
function Be(e,t){return e[0]<t[0]?-1:1}
|
|
282
286
|
// Merge two trees together
|
|
283
287
|
// The roots of tree1 and tree2 must be the same revision
|
|
284
|
-
function
|
|
288
|
+
function Ne(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",De(i[2],s[2][a],Be))}else r="new_leaf",i[2][0]=s[2][a]}return{conflicts:r,tree:e}}function Ie(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])
|
|
285
289
|
// Paths start at the same position and have the same root, so they need
|
|
286
290
|
// merged
|
|
287
|
-
r=
|
|
291
|
+
r=Ne(c.ids,t.ids),o.push({pos:c.pos,ids:r.tree}),i=i||r.conflicts,s=!0;else if(!0!==n){
|
|
288
292
|
// The paths start at a different position, take the earliest path and
|
|
289
293
|
// traverse up until it as at the same point from root as the path we
|
|
290
294
|
// want to merge. If the keys match we return the longer path with the
|
|
291
295
|
// other merged After stemming we dont want to expand the trees
|
|
292
|
-
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=
|
|
296
|
+
var f=c.pos<t.pos?c:t,l=c.pos<t.pos?t:c,d=l.pos-f.pos,h=[],p=[];for(p.push({ids:f.ids,diff:d,parent:null,parentIdx:null});p.length>0;){var v=p.pop();if(0!==v.diff)for(var y=v.ids[2],g=0,_=y.length;g<_;g++)p.push({ids:y[g],diff:v.diff-1,parent:v.ids,parentIdx:g});else v.ids[0]===l.ids[0]&&h.push(v)}var m=h[0];m?(r=Ne(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)}
|
|
293
297
|
// We didnt find
|
|
294
|
-
return s||o.push(t),o.sort(
|
|
298
|
+
return s||o.push(t),o.sort(Le),{tree:o,conflicts:i||"internal_node"}}
|
|
295
299
|
// To ensure we dont grow the revision tree infinitely, we stem old revisions
|
|
296
|
-
function
|
|
300
|
+
function Ue(e,t,n){var r=Ie(e,t),o=function(e,t){for(
|
|
297
301
|
// First we break out the tree into a complete list of root to leaf paths
|
|
298
|
-
var n,r,o=
|
|
302
|
+
var n,r,o=xe(e),i=0,s=o.length;i<s;i++){
|
|
299
303
|
// Then for each path, we cut off the start of the path based on the
|
|
300
304
|
// `depth` to stem to, and generate a new set of flat trees
|
|
301
305
|
var a,u=o[i],c=u.ids;if(c.length>t){
|
|
302
306
|
// only do the stemming work if we actually need to stem
|
|
303
|
-
n||(n={});var f=c.length-t;a={pos:u.pos+f,ids:
|
|
304
|
-
a={pos:u.pos,ids:
|
|
307
|
+
n||(n={});var f=c.length-t;a={pos:u.pos+f,ids:Me(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
|
|
308
|
+
a={pos:u.pos,ids:Me(c,0)};
|
|
305
309
|
// Then we remerge all those flat trees together, ensuring that we dont
|
|
306
310
|
// connect trees that would go beyond the depth limit
|
|
307
|
-
r=r?
|
|
311
|
+
r=r?Ie(r,a,!0).tree:[a]}
|
|
308
312
|
// this is memory-heavy per Chrome profiler, avoid unless we actually stemmed
|
|
309
|
-
return n&&
|
|
313
|
+
return n&&qe(r,(function(e,t,r){
|
|
310
314
|
// some revisions may have been removed in a branch but not in another
|
|
311
315
|
delete n[t+"-"+r]})),{tree:r,revs:n?Object.keys(n):[]}}(r.tree,n);return{tree:o.tree,stemmedRevs:o.revs,conflicts:r.conflicts}}
|
|
312
316
|
// return true if a rev exists in the rev tree, false otherwise
|
|
313
|
-
function
|
|
317
|
+
function $e(e){return e.ids}
|
|
314
318
|
// check if a specific revision of a doc has been deleted
|
|
315
319
|
// - metadata: the metadata object from the doc store
|
|
316
320
|
// - rev: (optional) the revision to check. defaults to winning revision
|
|
317
|
-
function
|
|
321
|
+
function Fe(e,t){t||(t=Ee(e));for(var n,r=t.substring(t.indexOf("-")+1),o=e.rev_tree.map($e);n=o.pop();){if(n[0]===r)return!!n[1].deleted;o=o.concat(n[2])}}function He(e){return/^_local/.test(e)}
|
|
318
322
|
// returns the current leaf node for a given revision
|
|
319
|
-
function
|
|
323
|
+
function Ke(e,t,n){d.call(this);var r=this;this.db=e;var o=(t=t?w(t):{}).complete=O((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){
|
|
320
324
|
/* istanbul ignore if */
|
|
321
325
|
r.isCancelled||function(e,t,n,r){
|
|
322
326
|
// isolate try/catches to avoid V8 deoptimizations
|
|
323
|
-
try{e.emit("change",t,n,r)}catch(e){
|
|
327
|
+
try{e.emit("change",t,n,r)}catch(e){A("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=Ae(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=Ce(t),o.doc._conflicts.length||delete o.doc._conflicts),o}
|
|
324
328
|
/*
|
|
325
329
|
* A generic pouch adapter
|
|
326
|
-
*/function
|
|
330
|
+
*/function Xe(e,t){return e<t?-1:e>t?1:0}
|
|
327
331
|
// Wrapper for functions that call the bulkdocs api with a single doc,
|
|
328
332
|
// if the first result is an error, return an error
|
|
329
|
-
function
|
|
333
|
+
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)}}
|
|
330
334
|
// clean docs given to us by the user
|
|
331
335
|
// compare two docs, first by _id then by _rev
|
|
332
|
-
function
|
|
336
|
+
function ze(e,t){var n=Xe(e._id,t._id);return 0!==n?n:Xe(e._revisions?e._revisions.start:0,t._revisions?t._revisions.start:0)}
|
|
333
337
|
// for every node in a revision tree computes its distance from the closest
|
|
334
338
|
// leaf
|
|
335
339
|
// all compaction is done in a queue, to avoid attaching
|
|
336
340
|
// too many listeners at once
|
|
337
|
-
function
|
|
341
|
+
function Ge(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){
|
|
338
342
|
/* istanbul ignore if */
|
|
339
|
-
t?r(t):r(null,n),s((function(){e._compactionQueue.shift(),e._compactionQueue.length&&
|
|
343
|
+
t?r(t):r(null,n),s((function(){e._compactionQueue.shift(),e._compactionQueue.length&&Ge(e)}))}))}))}function We(){
|
|
340
344
|
// re-bind prototyped methods
|
|
341
|
-
for(var e in d.call(this),
|
|
345
|
+
for(var e in d.call(this),We.prototype)"function"==typeof this[e]&&(this[e]=this[e].bind(this))}function Qe(){this.isReady=!1,this.failed=!1,this.queue=[]}function Ye(e,t){
|
|
342
346
|
// In Node our test suite only tests this for PouchAlt unfortunately
|
|
343
347
|
/* istanbul ignore if */
|
|
344
|
-
if(!(this instanceof
|
|
348
|
+
if(!(this instanceof Ye))return new Ye(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=Ye.prefix,"string"!=typeof e)throw new Error("Missing/invalid DB name");var r=function(e,t){var n=e.match(/([a-z-]*):\/\/(.*)/);if(n)
|
|
345
349
|
// the http adapter expects the fully qualified name
|
|
346
|
-
return{name:/https?/.test(n[1])?n[1]+"://"+n[2]:n[2],adapter:n[1]};var r=
|
|
347
|
-
for(var a=0;a<o.length&&"idb"===(s=o[a])&&"websql"in r&&
|
|
350
|
+
return{name:/https?/.test(n[1])?n[1]+"://"+n[2]:n[2],adapter:n[1]};var r=Ye.adapters,o=Ye.preferredAdapters,i=Ye.prefix,s=t.adapter;if(!s)// automatically determine adapter
|
|
351
|
+
for(var a=0;a<o.length&&"idb"===(s=o[a])&&"websql"in r&&q()&&localStorage["_pouch__websqldb_"+i+e];++a)
|
|
348
352
|
// log it, because this can be confusing during development
|
|
349
|
-
|
|
353
|
+
A("log",'PouchDB is downgrading "'+e+'" to WebSQL to avoid data loss, because it was already opened with WebSQL.');var u=r[s];
|
|
350
354
|
// if adapter is invalid, then an error will be thrown later
|
|
351
355
|
return{name:u&&"use_prefix"in u&&!u.use_prefix?e:i+e,adapter:s}}
|
|
352
356
|
// OK, so here's the deal. Consider this code:
|
|
@@ -359,35 +363,35 @@ return{name:u&&"use_prefix"in u&&!u.use_prefix?e:i+e,adapter:s}}
|
|
|
359
363
|
// responsible for emitting the initial event, which then gets emitted
|
|
360
364
|
// by the constructor, which then broadcasts it to any other dbs
|
|
361
365
|
// that may have been created with the same name.
|
|
362
|
-
((t.prefix||"")+e,t);if(t.name=r.name,t.adapter=t.adapter||r.adapter,n.name=e,n._adapter=t.adapter,
|
|
366
|
+
((t.prefix||"")+e,t);if(t.name=r.name,t.adapter=t.adapter||r.adapter,n.name=e,n._adapter=t.adapter,Ye.emit("debug",["adapter","Picked adapter: ",t.adapter]),!Ye.adapters[t.adapter]||!Ye.adapters[t.adapter].valid())throw new Error("Invalid Adapter: "+t.adapter);We.call(n),n.taskqueue=new Qe,n.adapter=t.adapter,Ye.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),Ye.emit("created",n.name),n.taskqueue.ready(n)}))}
|
|
363
367
|
// AbortController was introduced quite a while after fetch and
|
|
364
368
|
// isnt required for PouchDB to function so polyfill if needed
|
|
365
|
-
l(
|
|
366
|
-
/* istanbul ignore else */
|
|
367
|
-
/* istanbul ignore else */){if(
|
|
369
|
+
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;
|
|
370
|
+
/* istanbul ignore else */Ye._changesFilterPlugin?Ye._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=w(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
|
|
371
|
+
/* istanbul ignore else */){if(Ye._changesFilterPlugin){if(Ye._changesFilterPlugin.normalize(e),Ye._changesFilterPlugin.shouldFilter(this,e))return Ye._changesFilterPlugin.filter(this,e)}else["doc_ids","filter","selector","view"].forEach((function(t){t in e&&A("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),
|
|
368
372
|
// 0 and 1 should return 1 document
|
|
369
373
|
e.limit=0===e.limit?1:e.limit,e.complete=n;var r=this.db._changes(e);
|
|
370
374
|
/* istanbul ignore else */if(r&&"function"==typeof r.cancel){var o=t.cancel;t.cancel=f((function(e){r.cancel(),o.apply(this,e)}))}}else this.db.info().then((function(r){
|
|
371
375
|
/* istanbul ignore if */
|
|
372
|
-
t.isCancelled?n(null,{status:"cancelled"}):(e.since=r.update_seq,t.doChanges(e))}),n)},l(
|
|
376
|
+
t.isCancelled?n(null,{status:"cancelled"}):(e.since=r.update_seq,t.doChanges(e))}),n)},l(We,d),We.prototype.post=P("post",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(Q(V));this.bulkDocs({docs:[e]},t,Ve(n,e._id))})),We.prototype.put=P("put",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"object"!=typeof e||Array.isArray(e))return n(Q(V));if(te(e._id),He(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=je(),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=P("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),
|
|
373
377
|
// Lets fix in https://github.com/pouchdb/pouchdb/issues/3267
|
|
374
378
|
/* istanbul ignore if */
|
|
375
|
-
void 0===o&&(o=r,r=n,n=null),o||
|
|
379
|
+
void 0===o&&(o=r,r=n,n=null),o||A("warn","Attachment",t,"on document",e,"is missing content_type"),i.get(e).then((function(e){if(e._rev!==n)throw Q(N);return s(e)}),(function(t){
|
|
376
380
|
// create new doc
|
|
377
381
|
/* istanbul ignore else */
|
|
378
|
-
if(t.reason===
|
|
382
|
+
if(t.reason===B.message)return s({_id:e});throw t}))})),We.prototype.removeAttachment=P("removeAttachment",(function(e,t,n,r){var o=this;o.get(e,(function(e,i){
|
|
379
383
|
/* istanbul ignore if */
|
|
380
384
|
if(e)r(e);else if(i._rev===n){
|
|
381
385
|
/* istanbul ignore if */
|
|
382
|
-
if(!i._attachments)return r();delete i._attachments[t],0===Object.keys(i._attachments).length&&delete i._attachments,o.put(i,r)}else r(
|
|
386
|
+
if(!i._attachments)return r();delete i._attachments[t],0===Object.keys(i._attachments).length&&delete i._attachments,o.put(i,r)}else r(Q(N))}))})),We.prototype.remove=P("remove",(function(e,t,n,r){var o;"string"==typeof t?(
|
|
383
387
|
// id, rev, opts, callback style
|
|
384
388
|
o={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
|
|
385
389
|
// doc, opts, callback style
|
|
386
|
-
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(
|
|
390
|
+
o=e,"function"==typeof t?(r=t,n={}):(r=n,n=t)),(n=n||{}).was_delete=!0;var i={_id:o._id,_rev:o._rev||n.rev,_deleted:!0};if(He(i._id)&&"function"==typeof this._removeLocal)return this._removeLocal(o,r);this.bulkDocs({docs:[i]},n,Ve(r,i._id))})),We.prototype.revsDiff=P("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)
|
|
387
391
|
/* istanbul ignore next */
|
|
388
392
|
return n(i);!function(t,n){
|
|
389
393
|
// Is this fast enough? Maybe we should switch to a set simulated by a map
|
|
390
|
-
var r=e[t].slice(0);
|
|
394
|
+
var r=e[t].slice(0);qe(n,(function(e,n,o,i,s){var u=n+"-"+o,c=r.indexOf(u);-1!==c&&(r.splice(c,1),
|
|
391
395
|
/* istanbul ignore if */
|
|
392
396
|
"available"!==s.status&&a(t,u))})),
|
|
393
397
|
// Traversing the tree is synchronous, so now `missingForId` contains
|
|
@@ -402,24 +406,24 @@ var c={};return s.forEach((function(e,t){c[t]=e})),n(null,c)}}))}),this)})),
|
|
|
402
406
|
// for local databases (except the cost of multiple transactions, which is
|
|
403
407
|
// small). The http adapter overrides this in order
|
|
404
408
|
// to do a more efficient single HTTP request.
|
|
405
|
-
|
|
409
|
+
We.prototype.bulkGet=P("bulkGet",(function(e,t){E(this,e,t)})),
|
|
406
410
|
// compact one document and fire callback
|
|
407
411
|
// by compacting we mean removing all revisions which
|
|
408
412
|
// are further from the leaf in revision tree than max_height
|
|
409
|
-
|
|
413
|
+
We.prototype.compactDocument=P("compactDocument",(function(e,t,n){var r=this;this._getRevisionTree(e,(function(o,i){
|
|
410
414
|
/* istanbul ignore if */
|
|
411
|
-
if(o)return n(o);var s=function(e){var t={},n=[];return
|
|
415
|
+
if(o)return n(o);var s=function(e){var t={},n=[];return qe(e,(function(e,r,o,i){var s=r+"-"+o;return e&&(t[s]=0),void 0!==i&&n.push({from:i,to:s}),s})),n.reverse(),n.forEach((function(e){void 0===t[e.from]?t[e.from]=1+t[e.to]:t[e.from]=Math.min(t[e.from],1+t[e.to])})),t}(i),a=[],u=[];Object.keys(s).forEach((function(e){s[e]>t&&a.push(e)})),qe(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)}))})),
|
|
412
416
|
// compact the whole database using single document
|
|
413
417
|
// compaction
|
|
414
|
-
|
|
418
|
+
We.prototype.compact=P("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&&Ge(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 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)},
|
|
415
419
|
/* Begin api wrappers. Specific functionality to storage belongs in the
|
|
416
420
|
_[method] */
|
|
417
|
-
|
|
421
|
+
We.prototype.get=P("get",(function(e,t,n){if("function"==typeof t&&(n=t,t={}),"string"!=typeof e)return n(Q(I));if(He(e)&&"function"==typeof this._getLocal)return this._getLocal(e,n);var r=[],o=this;function i(){var i=[],s=r.length;
|
|
418
422
|
/* istanbul ignore if */if(!s)return n(null,i);
|
|
419
423
|
// order with open_revs is unspecified
|
|
420
424
|
r.forEach((function(r){o.get(e,{rev:r,revs:t.revs,latest:t.latest,attachments:t.attachments,binary:t.binary},(function(e,t){if(e)i.push({missing:r});else{for(
|
|
421
425
|
// using latest=true can produce duplicates
|
|
422
|
-
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=
|
|
426
|
+
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=Ce(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=xe(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)}
|
|
423
427
|
/* istanbul ignore if */if(!p)return(r=new Error("invalid rev tree")).docId=e,n(r);var _=p.ids.map((function(e){return e.id})).indexOf(s._rev.split("-")[1])+1,m=p.ids.length-_;if(p.ids.splice(_,m),p.ids.reverse(),t.revs&&(s._revisions={start:p.pos+p.ids.length-1,ids:p.ids.map((function(e){return e.id}))}),t.revs_info){var b=p.pos+p.ids.length;s._revs_info=p.ids.map((function(e){return{rev:--b+"-"+e.id,status:e.opts.status}}))}}if(t.attachments&&s._attachments){var w=s._attachments,O=Object.keys(w).length;if(0===O)return n(null,s);Object.keys(w).forEach((function(e){this._getAttachment(s._id,e,w[e],{
|
|
424
428
|
// Previously the revision handling was done in adapter.js
|
|
425
429
|
// getAttachment, however since idb-next doesnt we need to
|
|
@@ -428,27 +432,27 @@ rev:s._rev,binary:t.binary,ctx:u},(function(t,r){var o=s._attachments[e];o.data=
|
|
|
428
432
|
/* istanbul ignore else */
|
|
429
433
|
s._attachments.hasOwnProperty(k)&&(s._attachments[k].stub=!0);n(null,s)}}));if("all"===t.open_revs)this._getRevisionTree(e,(function(e,t){
|
|
430
434
|
/* istanbul ignore if */
|
|
431
|
-
if(e)return n(e);r=
|
|
435
|
+
if(e)return n(e);r=Ae(t).map((function(e){return e.rev})),i()}));else{if(!Array.isArray(t.open_revs))return n(Q(F,"function_clause"));r=t.open_revs;for(var s=0;s<r.length;s++){var a=r[s];
|
|
432
436
|
// looks like it's the only thing couchdb checks
|
|
433
|
-
if("string"!=typeof a||!/^\d+-/.test(a))return n(
|
|
437
|
+
if("string"!=typeof a||!/^\d+-/.test(a))return n(Q(G))}i()}})),
|
|
434
438
|
// TODO: I dont like this, it forces an extra read for every
|
|
435
439
|
// attachment read and enforces a confusing api between
|
|
436
440
|
// adapter.js and the adapter implementation
|
|
437
|
-
|
|
441
|
+
We.prototype.getAttachment=P("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(Q(B))}))})),We.prototype.allDocs=P("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(Q(K,"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)})),We.prototype.changes=function(e,t){return"function"==typeof e&&(t=e,e={}),
|
|
438
442
|
// By default set return_docs to false if the caller has opts.live = true,
|
|
439
443
|
// this will prevent us from collecting the set of changes indefinitely
|
|
440
444
|
// resulting in growing memory
|
|
441
|
-
(e=e||{}).return_docs="return_docs"in e?e.return_docs:!e.live,new
|
|
445
|
+
(e=e||{}).return_docs="return_docs"in e?e.return_docs:!e.live,new Ke(this,e,t)},We.prototype.close=P("close",(function(e){return this._closed=!0,this.emit("closed"),this._close(e)})),We.prototype.info=P("info",(function(e){var t=this;this._info((function(n,r){if(n)return e(n);
|
|
442
446
|
// assume we know better than the adapter, unless it informs us
|
|
443
|
-
r.db_name=r.db_name||t.name,r.auto_compaction=!(!t.auto_compaction||
|
|
447
|
+
r.db_name=r.db_name||t.name,r.auto_compaction=!(!t.auto_compaction||ne(t)),r.adapter=t.adapter,e(null,r)}))})),We.prototype.id=P("id",(function(e){return this._id(e)})),
|
|
444
448
|
/* istanbul ignore next */
|
|
445
|
-
|
|
449
|
+
We.prototype.type=function(){return"function"==typeof this._type?this._type():this.adapter},We.prototype.bulkDocs=P("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(Q(M));for(var r=0;r<e.docs.length;++r)if("object"!=typeof e.docs[r]||Array.isArray(e.docs[r]))return n(Q(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||A("warn","Attachment",t,"on document",e._id,"is missing content_type")}))})),o)return n(Q(X,o));"new_edits"in t||(t.new_edits=!("new_edits"in e)||e.new_edits);var i=this;t.new_edits||ne(i)||
|
|
446
450
|
// ensure revisions of the same doc are sorted, so that
|
|
447
451
|
// the local adapter processes them correctly (#2935)
|
|
448
|
-
e.docs.sort(
|
|
452
|
+
e.docs.sort(ze),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
|
|
449
453
|
else if(n._attachments)for(
|
|
450
454
|
// filter out extraneous keys from _attachments
|
|
451
|
-
var r=Object.keys(n._attachments),o=0;o<r.length;o++){var i=r[o];n._attachments[i]=
|
|
455
|
+
var r=Object.keys(n._attachments),o=0;o<r.length;o++){var i=r[o];n._attachments[i]=S(n._attachments[i],["data","digest","content_type","length","revpos","stub"])}}}(e.docs);
|
|
452
456
|
// in the case of conflicts, we want to return the _ids to the user
|
|
453
457
|
// however, the underlying adapter may destroy the docs array, so
|
|
454
458
|
// create a copy here
|
|
@@ -456,44 +460,44 @@ var s=e.docs.map((function(e){return e._id}));return this._bulkDocs(e,t,(functio
|
|
|
456
460
|
// add ids for error/conflict responses (not required for CouchDB)
|
|
457
461
|
if(t.new_edits||(
|
|
458
462
|
// this is what couch does when new_edits is false
|
|
459
|
-
r=r.filter((function(e){return e.error}))),!
|
|
463
|
+
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)}))})),We.prototype.registerDependentDatabase=P("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)})),We.prototype.destroy=P("destroy",(function(e,t){"function"==typeof e&&(t=e,e={});var n=this,r=!("use_prefix"in n)||n.use_prefix;function o(){
|
|
460
464
|
// call destroy method of the particular adaptor
|
|
461
|
-
n._destroy(e,(function(e,r){if(e)return t(e);n._destroyed=!0,n.emit("destroyed"),t(null,r||{ok:!0})}))}if(
|
|
465
|
+
n._destroy(e,(function(e,r){if(e)return t(e);n._destroyed=!0,n.emit("destroyed"),t(null,r||{ok:!0})}))}if(ne(n))
|
|
462
466
|
// no need to check for dependent DBs if it's a remote DB
|
|
463
467
|
return o();n.get("_local/_pouch_dependentDbs",(function(e,i){if(e)
|
|
464
468
|
/* istanbul ignore if */
|
|
465
469
|
return 404!==e.status?t(e):o();var s=i.dependentDbs,a=n.constructor,u=Object.keys(s).map((function(e){
|
|
466
470
|
// use_prefix is only false in the browser
|
|
467
471
|
/* istanbul ignore next */
|
|
468
|
-
var t=r?e.replace(new RegExp("^"+a.prefix),""):e;return new a(t,n.__opts).destroy()}));Promise.all(u).then(o,t)}))})),
|
|
472
|
+
var t=r?e.replace(new RegExp("^"+a.prefix),""):e;return new a(t,n.__opts).destroy()}));Promise.all(u).then(o,t)}))})),Qe.prototype.execute=function(){var e;if(this.failed)for(;e=this.queue.shift();)e(this.failed);else for(;e=this.queue.shift();)e()},Qe.prototype.fail=function(e){this.failed=e,this.execute()},Qe.prototype.ready=function(e){this.isReady=!0,this.db=e,this.execute()},Qe.prototype.addTask=function(e){this.queue.push(e),this.failed&&this.execute()},l(Ye,We);var Ze="undefined"!=typeof AbortController?AbortController:function(){return{abort:function(){}}},et=fetch,tt=Headers;Ye.adapters={},Ye.preferredAdapters=[],Ye.prefix="_pouch_";var nt=new d;
|
|
469
473
|
// this would just be "return doc[field]", but fields
|
|
470
474
|
// can be "deep" due to dot notation
|
|
471
|
-
function
|
|
475
|
+
function rt(e,t){for(var n=e,r=0,o=t.length;r<o&&(n=n[t[r]]);r++);return n}
|
|
472
476
|
// Converts a string in dot notation to an array of its components, with backslash escaping
|
|
473
|
-
function
|
|
477
|
+
function ot(e){for(
|
|
474
478
|
// fields may be deep (e.g. "foo.bar.baz"), so parse
|
|
475
479
|
var t=[],n="",r=0,o=e.length;r<o;r++){var i=e[r];"."===i?r>0&&"\\"===e[r-1]?// escaped delimiter
|
|
476
480
|
n=n.substring(0,n.length-1)+".":(// not escaped, so delimiter
|
|
477
481
|
t.push(n),n=""):// normal character
|
|
478
|
-
n+=i}return t.push(n),t}!function(e){Object.keys(d.prototype).forEach((function(t){"function"==typeof d.prototype[t]&&(e[t]=
|
|
482
|
+
n+=i}return t.push(n),t}!function(e){Object.keys(d.prototype).forEach((function(t){"function"==typeof d.prototype[t]&&(e[t]=nt[t].bind(nt))}));
|
|
479
483
|
// these are created in constructor.js, and allow us to notify each DB with
|
|
480
484
|
// the same name that it was destroyed, via the constructor object
|
|
481
485
|
var t=e._destructionListeners=new i;e.on("ref",(function(e){t.has(e.name)||t.set(e.name,[]),t.get(e.name).push(e)})),e.on("unref",(function(e){if(t.has(e.name)){var n=t.get(e.name),r=n.indexOf(e);r<0||(n.splice(r,1),n.length>1?
|
|
482
486
|
/* istanbul ignore next */
|
|
483
|
-
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)}))}}))}(
|
|
487
|
+
t.set(e.name,n):t.delete(e.name))}})),e.on("destroyed",(function(e){if(t.has(e)){var n=t.get(e);t.delete(e),n.forEach((function(e){e.emit("destroyed",!0)}))}}))}(Ye),Ye.adapter=function(e,t,n){
|
|
484
488
|
/* istanbul ignore else */
|
|
485
|
-
t.valid()&&(
|
|
486
|
-
e(
|
|
487
|
-
|
|
489
|
+
t.valid()&&(Ye.adapters[e]=t,n&&Ye.preferredAdapters.push(e))},Ye.plugin=function(e){if("function"==typeof e)// function style for plugins
|
|
490
|
+
e(Ye);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
|
|
491
|
+
Ye.prototype[t]=e[t]}))}return this.__defaults&&(Ye.__defaults=L({},this.__defaults)),Ye},Ye.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=L({},t.__defaults,n),Ye.call(this,e,n)}return l(t,Ye),t.preferredAdapters=Ye.preferredAdapters.slice(),Object.keys(Ye).forEach((function(e){e in t||(t[e]=Ye[e])})),
|
|
488
492
|
// make default options transitive
|
|
489
493
|
// https://github.com/pouchdb/pouchdb/issues/5922
|
|
490
|
-
t.__defaults=
|
|
494
|
+
t.__defaults=L({},this.__defaults,e),t},Ye.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]}
|
|
491
495
|
// flatten an array of selectors joined by an $and operator
|
|
492
|
-
function
|
|
496
|
+
function ut(e){
|
|
493
497
|
// sort to ensure that e.g. if the user specified
|
|
494
498
|
// $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into
|
|
495
499
|
// just {$gt: 'b'}
|
|
496
|
-
var t={};return e.forEach((function(e){Object.keys(e).forEach((function(n){var r=e[n];if("object"!=typeof r&&(r={$eq:r}),
|
|
500
|
+
var t={};return e.forEach((function(e){Object.keys(e).forEach((function(n){var r=e[n];if("object"!=typeof r&&(r={$eq:r}),st(n))t[n]=r instanceof Array?r.map((function(e){return 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?
|
|
497
501
|
// collapse logically equivalent gt/gte values
|
|
498
502
|
function(e,t,n){void 0===n.$eq&&(// do nothing
|
|
499
503
|
void 0!==n.$gte?"$gte"===e?t>n.$gte&&(// more specificity
|
|
@@ -523,32 +527,32 @@ t.$ne=[e]}
|
|
|
523
527
|
// TODO: check for user errors here
|
|
524
528
|
delete t.$gt,delete t.$gte,delete t.$lt,delete t.$lte,delete t.$ne,t.$eq=e}
|
|
525
529
|
//#7458: execute function mergeAndedSelectors on nested $and
|
|
526
|
-
(t,o):void(o[e]=t)}))}}))})),t}function
|
|
530
|
+
(t,o):void(o[e]=t)}))}}))})),t}function ct(e){for(var t in e){if(Array.isArray(e))for(var n in e)e[n].$and&&(e[n]=ut(e[n].$and));var r=e[t];"object"==typeof r&&ct(r)}return e}
|
|
527
531
|
//#7458: determine id $and is present in selector (at any level)
|
|
528
|
-
function
|
|
532
|
+
function ft(e,t){for(var n in e){"$and"===n&&(t=!0);var r=e[n];"object"==typeof r&&(t=ft(r,t))}return t}
|
|
529
533
|
// normalize the selector
|
|
530
|
-
function
|
|
534
|
+
function lt(e){var t=w(e),n=!1;
|
|
531
535
|
//#7458: if $and is present in selector (at any level) merge nested $and
|
|
532
|
-
|
|
536
|
+
ft(t,!1)&&("$and"in(t=ct(t))&&(t=ut(t.$and)),n=!0),["$or","$nor"].forEach((function(e){e in t&&
|
|
533
537
|
// message each individual selector
|
|
534
538
|
// e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}}
|
|
535
539
|
t[e].forEach((function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var r=t[n],o=e[r];"object"==typeof o&&null!==o||(e[r]={$eq:o})}}))})),"$not"in t&&(
|
|
536
540
|
//This feels a little like forcing, but it will work for now,
|
|
537
541
|
//I would like to come back to this and make the merging of selectors a little more generic
|
|
538
|
-
t.$not=
|
|
542
|
+
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&&(
|
|
539
543
|
// I put these in an array, since there may be more than one
|
|
540
544
|
// but in the "mergeAnded" operation, I already take care of that
|
|
541
545
|
s.$ne=[s.$ne]),t[i]=s}return t}// verified by -Number.MIN_VALUE
|
|
542
546
|
// set to '_' for easier debugging
|
|
543
|
-
function
|
|
547
|
+
function dt(e,t){if(e===t)return 0;e=ht(e),t=ht(t);var n=gt(e),r=gt(t);if(n-r!=0)return n-r;switch(typeof e){case"number":return e-t;case"boolean":return e<t?-1:1;case"string":return function(e,t){
|
|
544
548
|
// See: https://github.com/daleharvey/pouchdb/issues/40
|
|
545
549
|
// This is incompatible with the CouchDB implementation, but its the
|
|
546
550
|
// best we can do for now
|
|
547
|
-
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=
|
|
551
|
+
return e===t?0:e>t?1:-1}(e,t)}return Array.isArray(e)?function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var o=dt(e[r],t[r]);if(0!==o)return o}return e.length===t.length?0:e.length>t.length?1:-1}(e,t):function(e,t){for(var n=Object.keys(e),r=Object.keys(t),o=Math.min(n.length,r.length),i=0;i<o;i++){
|
|
548
552
|
// First sort the keys
|
|
549
|
-
var s=
|
|
553
|
+
var s=dt(n[i],r[i]);if(0!==s)return s;
|
|
550
554
|
// if the keys are equal sort the values
|
|
551
|
-
if(0!==(s=
|
|
555
|
+
if(0!==(s=dt(e[n[i]],t[r[i]])))return s}return n.length===r.length?0:n.length>r.length?1:-1}
|
|
552
556
|
// The collation is defined by erlangs ordered terms
|
|
553
557
|
// the atoms null, true, false come first, then numbers, strings,
|
|
554
558
|
// arrays, then objects
|
|
@@ -556,13 +560,13 @@ if(0!==(s=lt(e[n[i]],t[r[i]])))return s}return n.length===r.length?0:n.length>r.
|
|
|
556
560
|
(e,t)}
|
|
557
561
|
// couch considers null/NaN/Infinity/-Infinity === undefined,
|
|
558
562
|
// for the purposes of mapreduce indexes. also, dates get stringified.
|
|
559
|
-
function
|
|
563
|
+
function ht(e){switch(typeof e){case"undefined":return null;case"number":return e===1/0||e===-1/0||isNaN(e)?null:e;case"object":var t=e;if(Array.isArray(e)){var n=e.length;e=new Array(n);for(var r=0;r<n;r++)e[r]=ht(t[r]);
|
|
560
564
|
/* istanbul ignore next */}else{if(e instanceof Date)return e.toJSON();if(null!==e)for(var o in// generic object
|
|
561
|
-
e={},t)if(t.hasOwnProperty(o)){var i=t[o];void 0!==i&&(e[o]=
|
|
565
|
+
e={},t)if(t.hasOwnProperty(o)){var i=t[o];void 0!==i&&(e[o]=ht(i))}}}return e}
|
|
562
566
|
// convert the given key to a string that would be appropriate
|
|
563
567
|
// for lexical sorting, e.g. within a database, where the
|
|
564
568
|
// sorting is the same given by the collate() function.
|
|
565
|
-
function
|
|
569
|
+
function pt(e){return gt(e=ht(e))+""+function(e){if(null!==e)switch(typeof e){case"boolean":return e?1:0;case"number":
|
|
566
570
|
// conversion:
|
|
567
571
|
// x yyy zz...zz
|
|
568
572
|
// x = 0 for negative, 1 for 0, 2 for positive
|
|
@@ -571,15 +575,15 @@ function ht(e){return yt(e=dt(e))+""+function(e){if(null!==e)switch(typeof e){ca
|
|
|
571
575
|
return function(e){if(0===e)return"1";
|
|
572
576
|
// convert number to exponential format for easier and
|
|
573
577
|
// more succinct string sorting
|
|
574
|
-
var t,n=e.toExponential().split(/e\+?/),
|
|
578
|
+
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){
|
|
575
579
|
/* istanbul ignore next */
|
|
576
|
-
for(var r="",o=3-e.length;r.length<o;)r+="0";return r}(t=((o
|
|
580
|
+
for(var r="",o=3-e.length;r.length<o;)r+="0";return r}(t=((i?-o:o)- -324).toString()),n+t);s+=""+a;
|
|
577
581
|
// then sort by the factor
|
|
578
|
-
var
|
|
579
|
-
/* istanbul ignore next */
|
|
580
|
-
|
|
582
|
+
var u=Math.abs(parseFloat(r[0]));// [1..10)
|
|
583
|
+
/* istanbul ignore next */i&&(// for negative reverse ordering
|
|
584
|
+
u=10-u);var c=u.toFixed(20);
|
|
581
585
|
// strip zeros from the end
|
|
582
|
-
return
|
|
586
|
+
return s+""+c.replace(/\.?0+$/,"")}
|
|
583
587
|
// create a comparator based on the sort object
|
|
584
588
|
(e);case"string":
|
|
585
589
|
// We've to be sure that key does not contain \u0000
|
|
@@ -589,7 +593,7 @@ return i+""+a.replace(/\.?0+$/,"")}
|
|
|
589
593
|
// 2 -> 2, 2
|
|
590
594
|
/* eslint-disable no-control-regex */
|
|
591
595
|
return e.replace(/\u0002/g,"").replace(/\u0001/g,"").replace(/\u0000/g,"");
|
|
592
|
-
/* 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+=
|
|
596
|
+
/* eslint-enable no-control-regex */case"object":var t=Array.isArray(e),n=t?e:Object.keys(e),r=-1,o=n.length,i="";if(t)for(;++r<o;)i+=pt(n[r]);else for(;++r<o;){var s=n[r];i+=pt(s)+pt(e[s])}return i}return""}(e)+"\0"}function vt(e,t){var n,r=t;if("1"===e[t])n=0,t++;else{var o="0"===e[t];t++;var i="",s=e.substring(t,t+3),a=parseInt(s,10)+-324;for(
|
|
593
597
|
/* istanbul ignore next */
|
|
594
598
|
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])
|
|
595
599
|
/* istanbul ignore next */,o&&(n-=10
|
|
@@ -600,89 +604,89 @@ o&&(a=-a),t+=3;;){var u=e[t];if("\0"===u)break;i+=u,t++}n=1===(i=i.split(".")).l
|
|
|
600
604
|
n=parseFloat(n+"e"+a))}return{num:n,length:t-r}}
|
|
601
605
|
// move up the stack while parsing
|
|
602
606
|
// this function moved outside of parseIndexableString for performance
|
|
603
|
-
function
|
|
607
|
+
function yt(e,t){var n=e.pop();if(t.length){var r=t[t.length-1];n===r.element&&(
|
|
604
608
|
// popping a meta-element, e.g. an object whose value is another object
|
|
605
609
|
t.pop(),r=t[t.length-1]);var o=r.element,i=r.index;Array.isArray(o)?o.push(n):i===e.length-2?o[e.pop()]=n:e.push(n);// obj with key only
|
|
606
|
-
}}function
|
|
610
|
+
}}function gt(e){var t=["boolean","number","string","object"].indexOf(typeof e);
|
|
607
611
|
//false if -1 otherwise true, but fast!!!!1
|
|
608
612
|
return~t?null===e?1:Array.isArray(e)?5:t<3?t+2:t+3:
|
|
609
613
|
/* istanbul ignore next */
|
|
610
|
-
Array.isArray(e)?5:void 0}function
|
|
614
|
+
Array.isArray(e)?5:void 0}function _t(e,t,n){return n.every((function(n){var r=t[n],o=ot(n),i=rt(e,o);return st(n)?function(e,t,n){return"$or"===e?t.some((function(e){return _t(n,e,Object.keys(e))})):"$not"===e?!_t(n,t,Object.keys(t)):!t.find((function(e){return _t(n,e,Object.keys(e))}))}(n,r,e):mt(r,e,o,i)}))}function mt(e,t,n,r){return!e||(
|
|
611
615
|
// is matcher an object, if so continue recursion
|
|
612
|
-
"object"==typeof e?Object.keys(e).every((function(o){var i=e[o];return function(e,t,n,r,o){if(!
|
|
616
|
+
"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 bt(e){return null!=e}function wt(e){return void 0!==e}function Ot(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 _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)&&
|
|
613
617
|
/* istanbul ignore next */
|
|
614
|
-
0!==r.length&&("object"==typeof r[0]?r.every((function(e){return
|
|
618
|
+
0!==r.length&&("object"==typeof r[0]?r.every((function(e){return _t(e,t,Object.keys(t))})):r.every((function(r){return mt(t,e,n,r)})))},$eq:function(e,t,n,r){return wt(r)&&0===dt(r,t)},$gte:function(e,t,n,r){return wt(r)&&dt(r,t)>=0},$gt:function(e,t,n,r){return wt(r)&&dt(r,t)>0},$lte:function(e,t,n,r){return wt(r)&&dt(r,t)<=0},$lt:function(e,t,n,r){return wt(r)&&dt(r,t)<0},$exists:function(e,t,n,r){
|
|
615
619
|
//a field that is null is still considered to exist
|
|
616
|
-
return t?
|
|
620
|
+
return t?wt(r):!wt(r)},$mod:function(e,t,n,r){return bt(r)&&function(e,t){var n=t[0],r=t[1];if(0===n)throw new Error("Bad divisor, cannot divide by zero");if(parseInt(n,10)!==n)throw new Error("Divisor is not an integer");if(parseInt(r,10)!==r)throw new Error("Modulus is not an integer");return parseInt(e,10)===e&&e%n===r}(r,t)},$ne:function(e,t,n,r){return t.every((function(e){return 0!==dt(r,e)}))},$in:function(e,t,n,r){return bt(r)&&Ot(r,t)},$nin:function(e,t,n,r){return bt(r)&&!Ot(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)}};
|
|
617
621
|
// return true if the given doc matches the supplied selector
|
|
618
|
-
function
|
|
622
|
+
function Pt(e,t){if(e.selector&&e.filter&&"_selector"!==e.filter){var n="string"==typeof e.filter?e.filter:"function";return t(new Error('selector invalid for filter "'+n+'"'))}t()}function St(e){e.view&&!e.filter&&(e.filter="_view"),e.selector&&!e.filter&&(e.filter="_selector"),e.filter&&"string"==typeof e.filter&&("_view"===e.filter?e.view=oe(e.view):e.filter=oe(e.filter))}function jt(e,t){return t.filter&&"string"==typeof t.filter&&!t.doc_ids&&!ne(e.db)}function Tt(e,t){var n=t.complete;if("_view"===t.filter){if(!t.view||"string"!=typeof t.view){var r=Q(X,"`view` filter parameter not found or invalid.");return n(r)}
|
|
619
623
|
// fetch a view from a design doc, make it behave like a filter
|
|
620
|
-
var o=
|
|
624
|
+
var o=re(t.view);e.db.get("_design/"+o[0],(function(r,i){
|
|
621
625
|
/* istanbul ignore if */
|
|
622
626
|
if(e.isCancelled)return n(null,{status:"cancelled"});
|
|
623
|
-
/* istanbul ignore next */if(r)return n(
|
|
627
|
+
/* istanbul ignore next */if(r)return n(Y(r));var s=i&&i.views&&i.views[o[1]]&&i.views[o[1]].map;if(!s)return n(Q(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){
|
|
624
628
|
/* istanbul ignore if */
|
|
625
629
|
if("object"!=typeof t)
|
|
626
630
|
// match the CouchDB error message
|
|
627
|
-
throw new Error("Selector error: expected a JSON object");var n=function(e,t,n){if(e=e.filter((function(e){return
|
|
631
|
+
throw new Error("Selector error: expected a JSON object");var n=function(e,t,n){if(e=e.filter((function(e){return _t(e.doc,t.selector,n)})),t.sort){
|
|
628
632
|
// in-memory sort
|
|
629
|
-
var r=function(e){function t(t){return e.map((function(e){var n=
|
|
633
|
+
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;
|
|
630
634
|
// this is what mango seems to do
|
|
631
|
-
}}(t.sort);e=e.sort(r),"string"!=typeof t.sort[0]&&"desc"===(o=t.sort[0])[
|
|
635
|
+
}}(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){
|
|
632
636
|
// have to do the limit in-memory
|
|
633
|
-
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=
|
|
637
|
+
var i=t.skip||0,s=("limit"in t?t.limit:e.length)+i;e=e.slice(i,s)}return e}([{doc:e}],{selector:t=lt(t)},Object.keys(t));return n&&1===n.length}(e,t.selector)},e.doChanges(t);else{
|
|
634
638
|
// fetch a filter from a design doc
|
|
635
|
-
var i=
|
|
639
|
+
var i=re(t.filter);e.db.get("_design/"+i[0],(function(r,o){
|
|
636
640
|
/* istanbul ignore if */
|
|
637
641
|
if(e.isCancelled)return n(null,{status:"cancelled"});
|
|
638
|
-
/* istanbul ignore next */if(r)return n(
|
|
642
|
+
/* istanbul ignore next */if(r)return n(Y(r));var s=o&&o.filters&&o.filters[i[1]];if(!s)return n(Q(B,o&&o.filters?"missing json key: "+i[1]:"missing json key: filters"));t.filter=fe('"use strict";\nreturn '+s+";",{}),e.doChanges(t)}))}}function Et(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})}
|
|
639
643
|
// List of top level reserved words for doc
|
|
640
644
|
// TODO: remove from pouchdb-core (breaking)
|
|
641
|
-
|
|
645
|
+
Ye.plugin((function(e){e._changesFilterPlugin={validate:Pt,normalize:St,shouldFilter:jt,filter:Tt}})),Ye.version="7.2.2";var qt=Et(["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree",
|
|
642
646
|
//replication documents
|
|
643
647
|
"_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats",
|
|
644
648
|
// Specific to Couchbase Sync Gateway
|
|
645
|
-
"_removed"]),
|
|
649
|
+
"_removed"]),Rt=Et(["_attachments",
|
|
646
650
|
//replication documents
|
|
647
651
|
"_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]);
|
|
648
652
|
// List of reserved words that should end up the document
|
|
649
|
-
function
|
|
653
|
+
function At(e){if(!/^\d+-/.test(e))return Q(G);var t=e.indexOf("-"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:parseInt(n,10),id:r}}
|
|
650
654
|
// Preprocess documents, parse their revisions, assign an id and a
|
|
651
655
|
// revision for new writes that are missing them, etc
|
|
652
|
-
function
|
|
656
|
+
function Ct(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=Te()),o=je(e,n.deterministic_revs),e._rev){if((i=At(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=At(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)
|
|
653
657
|
/* istanbul ignore else */
|
|
654
|
-
if(Object.prototype.hasOwnProperty.call(e,u)){var c="_"===u[0];if(c&&!
|
|
655
|
-
function(e,t,n){var r=function(e){try{return
|
|
656
|
-
function(e,t,n){
|
|
658
|
+
if(Object.prototype.hasOwnProperty.call(e,u)){var c="_"===u[0];if(c&&!qt[u]){var f=Q(J,u);throw f.message=J.message+": "+u,f}c&&!Rt[u]?a.metadata[u.slice(1)]=e[u]:a.data[u]=e[u]}return a}function xt(e,t,n){if(e.stub)return n();"string"==typeof e.data?// input is a base64 string
|
|
659
|
+
function(e,t,n){var r=function(e){try{return de(e)}catch(e){return{error:Q(H,"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,Pe(r,(function(t){e.digest="md5-"+t,n()}))}(e,t,n):// input is a blob
|
|
660
|
+
function(e,t,n){Pe(e.data,(function(r){e.digest="md5-"+r,
|
|
657
661
|
// size is for blobs (browser), length is for buffers (node)
|
|
658
|
-
e.length=e.data.size||e.data.length||0,"binary"===t?
|
|
662
|
+
e.length=e.data.size||e.data.length||0,"binary"===t?me(e.data,(function(t){e.data=t,n()})):"base64"===t?be(e.data,(function(t){e.data=t,n()})):n()}))}(e,t,n)}function Lt(e,t,n,r,o,s,a,u,c){
|
|
659
663
|
// Default to 1000 locally
|
|
660
|
-
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&&
|
|
664
|
+
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&&He(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
|
|
661
665
|
l.get(i).push([e,t])):l.set(i,[[e,t]])}})),
|
|
662
666
|
// in the case of new_edits, the user can provide multiple docs
|
|
663
667
|
// with the same id. these need to be processed sequentially
|
|
664
668
|
l.forEach((function(t,n){var o=0;function i(){++o<t.length?c():p()}function c(){var c=t[o],l=c[0],d=c[1];if(r.has(n))!function(e,t,n,r,o,i,s,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();
|
|
665
669
|
// sometimes this is pre-calculated. historically not always
|
|
666
|
-
var u=t.winningRev||
|
|
670
|
+
var u=t.winningRev||Ee(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=Ct(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=Q(N);return r[o]=p,i()}var v=n.metadata.rev;n.metadata.rev_tree=h.tree,n.stemmedRevs=h.stemmedRevs||[],
|
|
667
671
|
/* istanbul ignore else */
|
|
668
672
|
t.rev_map&&(n.metadata.rev_map=t.rev_map);
|
|
669
673
|
// recalculate
|
|
670
|
-
var y=
|
|
674
|
+
var y=Ee(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{
|
|
671
675
|
// Ensure stemming applies to new writes as well
|
|
672
|
-
var h=
|
|
676
|
+
var h=Ue([],l.metadata.rev_tree[0],e);l.metadata.rev_tree=h.tree,l.stemmedRevs=h.stemmedRevs||[],function(e,t,n){
|
|
673
677
|
// Cant insert new deleted documents
|
|
674
|
-
var r=
|
|
678
|
+
var r=Ee(e.metadata),o=Fe(e.metadata,r);if("was_delete"in u&&o)return s[t]=Q(B,"deleted"),n();
|
|
675
679
|
// 4712 - detect whether a new document was inserted with a _rev
|
|
676
|
-
|
|
680
|
+
var i=f&&function(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}(e);if(i){var c=Q(N);return s[t]=c,n()}a(e,r,o,o,!1,o?0:1,t,n)}(l,d,i)}}c()}))}
|
|
677
681
|
// IndexedDB requires a versioned database structure, so we use the
|
|
678
682
|
// version here to manage migrations.
|
|
679
|
-
var
|
|
683
|
+
var Dt="document-store",Mt="by-sequence",Bt="attach-store",Nt="attach-seq-store",It="meta-store",Ut="local-store",$t="detect-blob-support";
|
|
680
684
|
// The object stores created for each database
|
|
681
685
|
// DOC_STORE stores the document meta data, its revision history and state
|
|
682
686
|
// Keyed by document id
|
|
683
|
-
function
|
|
687
|
+
function Ft(e){try{return JSON.stringify(e)}catch(t){
|
|
684
688
|
/* istanbul ignore next */
|
|
685
|
-
return c.stringify(e)}}function
|
|
689
|
+
return c.stringify(e)}}function Ht(e){return function(t){var n="unknown_error";t.target&&t.target.error&&(n=t.target.error.name||t.target.error.message),e(Q(z,n,t.type))}}
|
|
686
690
|
// Unfortunately, the metadata has to be stringified
|
|
687
691
|
// when it is put into the database, because otherwise
|
|
688
692
|
// IndexedDB can throw errors for deeply-nested objects.
|
|
@@ -690,8 +694,8 @@ return c.stringify(e)}}function Ft(e){return function(t){var n="unknown_error";t
|
|
|
690
694
|
// we use this custom vuvuzela library that avoids recursion.
|
|
691
695
|
// If we could do it all over again, we'd probably use a
|
|
692
696
|
// format for the revision trees other than JSON.
|
|
693
|
-
function
|
|
694
|
-
id:e.id}}function
|
|
697
|
+
function Kt(e,t,n){return{data:Ft(e),winningRev:t,deletedOrLocal:n?"1":"0",seq:e.seq,// highest seq for this doc
|
|
698
|
+
id:e.id}}function Jt(e){if(!e)return null;var t=function(e){
|
|
695
699
|
// This try/catch guards against stack overflow errors.
|
|
696
700
|
// JSON.parse() is faster than vuvuzela.parse() but vuvuzela
|
|
697
701
|
// cannot overflow.
|
|
@@ -700,33 +704,33 @@ try{return JSON.parse(e)}catch(t){
|
|
|
700
704
|
return c.parse(e)}}(e.data);return t.winningRev=e.winningRev,t.deleted="1"===e.deletedOrLocal,t.seq=e.seq,t}
|
|
701
705
|
// read the doc back out from the database. we don't store the
|
|
702
706
|
// _id or _rev because we already have _doc_id_rev.
|
|
703
|
-
function
|
|
707
|
+
function Xt(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}
|
|
704
708
|
// Read a blob from the database, encoding as necessary
|
|
705
709
|
// and translating from base64 if the IDB doesn't support
|
|
706
710
|
// native Blobs
|
|
707
|
-
function
|
|
708
|
-
r(e?"string"!=typeof e?e:
|
|
711
|
+
function Vt(e,t,n,r){n?// we have blob support
|
|
712
|
+
r(e?"string"!=typeof e?e:ge(e,t):pe([""],{type:t})):// as base64 string
|
|
709
713
|
e?"string"!=typeof e?// we have blob support
|
|
710
|
-
|
|
711
|
-
r(e):r("")}function
|
|
714
|
+
_e(e,(function(e){r(he(e))})):// no blob support
|
|
715
|
+
r(e):r("")}function zt(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())}))}
|
|
712
716
|
// IDB-specific postprocessing necessary because
|
|
713
717
|
// we don't know whether we stored a true Blob or
|
|
714
718
|
// a base64-encoded string, and if it's a Blob it
|
|
715
719
|
// needs to be read outside of the transaction context
|
|
716
|
-
function
|
|
720
|
+
function Gt(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]=L(S(r,["digest","content_type"]),{data:t}),s()}))}))}})))}})))}function Wt(e,t,n){var r=[],o=n.objectStore(Mt),i=n.objectStore(Bt),s=n.objectStore(Nt),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||
|
|
717
721
|
// orphaned
|
|
718
722
|
i.delete(e)}}))}e.forEach((function(e){var n=o.index("_doc_id_rev"),i=t+"::"+e;n.getKey(i).onsuccess=function(e){var t=e.target.result;if("number"!=typeof t)return 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
|
|
719
|
-
u()}}}))}function
|
|
723
|
+
u()}}}))}function Qt(e,t,n){try{return{txn:e.transaction(t,n)}}catch(e){return{error:e}}}var Yt=new R;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&&He(_._id)||(_=v[y]=Ct(_,n.new_edits,e)).error&&!h&&(h=_)}if(h)return s(h);var m=!1,b=0,w=new Array(v.length),O=new i,k=!1,P=r._meta.blobSupport?"blob":"base64";function S(){m=!0,j()}function j(){p&&m&&(
|
|
720
724
|
// caching the docCount saves a lot of time in allDocs() and
|
|
721
725
|
// info(), which is why we go to all the trouble of doing this
|
|
722
|
-
p.docCount+=b,d.put(p))}function T(){k||(
|
|
726
|
+
p.docCount+=b,d.put(p))}function T(){k||(Yt.notify(r._meta.name),s(null,w))}function E(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&&q(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
|
|
723
727
|
var o={digest:e,body:t};f.put(o).onsuccess=n}}(r.digest,o,l)}}))}
|
|
724
728
|
// map seqs to attachment digests, which
|
|
725
729
|
// we will need later during compaction
|
|
726
|
-
(e,t,n,o,s,a);b+=i,j(),q(e,t,n,o,s,a)}function q(e,t,n,o,i,s){var f=e.data,d=e.metadata;function h(i){var s=e.stemmedRevs||[];o&&r.auto_compaction&&(s=s.concat(function(e){var t=[];return
|
|
730
|
+
(e,t,n,o,s,a);b+=i,j(),q(e,t,n,o,s,a)}function q(e,t,n,o,i,s){var f=e.data,d=e.metadata;function h(i){var s=e.stemmedRevs||[];o&&r.auto_compaction&&(s=s.concat(function(e){var t=[];return qe(e.rev_tree,(function(e,n,r,o,i){"available"!==i.status||e||(t.push(n+"-"+r),i.status="missing")})),t}(e.metadata))),s&&s.length&&Wt(s,e.metadata.id,a),d.seq=i.target.result;
|
|
727
731
|
// Current _rev is calculated from _rev_tree on read
|
|
728
732
|
// delete metadata.rev;
|
|
729
|
-
var c=
|
|
733
|
+
var c=Kt(d,t,n);u.put(c).onsuccess=p}function p(){w[i]={ok:!0,id:d.id,rev:d.rev},O.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){
|
|
730
734
|
// this callback is for a constaint error, which we ignore
|
|
731
735
|
// because this docid/rev has already been associated with
|
|
732
736
|
// the digest (e.g. when new_edits == false)
|
|
@@ -736,12 +740,12 @@ i()}}for(var a=0;a<o.length;a++)s(o[a]);// do in parallel
|
|
|
736
740
|
}(e,d.seq,s)}f._doc_id_rev=d.id+"::"+d.rev,delete f._id,delete f._rev;var v=c.put(f);v.onsuccess=h,v.onerror=function(e){
|
|
737
741
|
// ConstraintError, need to update, not put (see #1638 for details)
|
|
738
742
|
e.preventDefault(),// avoid transaction abort
|
|
739
|
-
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)&&
|
|
743
|
+
e.stopPropagation(),c.index("_doc_id_rev").getKey(f._doc_id_rev).onsuccess=function(e){c.put(f,e.target.result).onsuccess=h}}}!function(e,t,n){if(!e.length)return n();var r,o=0;function i(){o++,e.length===o&&(r?n(r):n())}e.forEach((function(e){var n=e.data&&e.data._attachments?Object.keys(e.data._attachments):[],o=0;if(!n.length)return i();function s(e){r=e,++o===n.length&&i()}for(var a in e.data._attachments)e.data._attachments.hasOwnProperty(a)&&xt(e.data._attachments[a],t,s)}))}(v,P,(function(t){if(t)return s(t);!function(){var t=Qt(o,[Dt,Mt,Bt,Ut,Nt,It],"readwrite");if(t.error)return s(t.error);(a=t.txn).onabort=Ht(s),a.ontimeout=Ht(s),a.oncomplete=T,u=a.objectStore(Dt),c=a.objectStore(Mt),f=a.objectStore(Bt),l=a.objectStore(Nt),(d=a.objectStore(It)).get(It).onsuccess=function(e){p=e.target.result,j()},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=Q(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 k=!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&&He(s._id)?c():u.get(s.metadata.id).onsuccess=f}function c(){++t===v.length&&Lt(e.revs_limit,v,r,O,a,w,E,n,S)}function f(e){var t=Jt(e.target.result);t&&O.set(t.id,t),c()}}()}))}()}))}
|
|
740
744
|
// Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations
|
|
741
745
|
// while falling back to a normal IDBCursor operation on browsers that don't support getAll() or
|
|
742
746
|
// getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because
|
|
743
747
|
// we're not processing each document one-at-a-time.
|
|
744
|
-
function
|
|
748
|
+
function en(e,t,n,r,o){
|
|
745
749
|
// Bail out of getAll()/getAllKeys() in the following cases:
|
|
746
750
|
// 1) either method is unsupported - we need both
|
|
747
751
|
// 2) batchSize is 1 (might as well use IDBCursor)
|
|
@@ -755,20 +759,20 @@ return o();
|
|
|
755
759
|
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
|
|
756
760
|
}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}
|
|
757
761
|
// simple shim for objectStore.getAll(), falling back to IDBCursor
|
|
758
|
-
function
|
|
762
|
+
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)))
|
|
759
763
|
// DataError with error code 0 indicates start is less than end, so
|
|
760
764
|
// can just do an empty query. Else need to throw
|
|
761
|
-
return n(
|
|
765
|
+
return n(Q(z,o.name,o.message));var d=[Dt,Mt,It];e.attachments&&d.push(Bt);var h=Qt(t,d,"readonly");if(h.error)return n(h.error);var p=h.txn;p.oncomplete=function(){e.attachments?Gt(w,e.binary).then(S):S()}
|
|
762
766
|
// don't bother doing any requests if start > end or limit === 0
|
|
763
|
-
,p.onabort=
|
|
767
|
+
,p.onabort=Ht(n);var v,y,g=p.objectStore(Dt),_=p.objectStore(Mt),m=p.objectStore(It),b=_.index("_doc_id_rev"),w=[];function O(t,n){var r={id:n.id,key:n.id,value:{rev:t}};n.deleted?u&&(w.push(r),
|
|
764
768
|
// deleted docs are okay with "keys" requests
|
|
765
769
|
r.value.deleted=!0,r.doc=null):c--<=0&&(w.push(r),e.include_docs&&
|
|
766
770
|
// if the user specifies include_docs=true, then we don't
|
|
767
771
|
// want to block the main cursor while we're fetching the doc
|
|
768
|
-
function(t,n,r){var o=t.id+"::"+r;b.get(o).onsuccess=function(r){if(n.doc=
|
|
772
|
+
function(t,n,r){var o=t.id+"::"+r;b.get(o).onsuccess=function(r){if(n.doc=Xt(r.target.result)||{},e.conflicts){var o=Ce(t);o.length&&(n.doc._conflicts=o)}zt(n.doc,e,p)}}(n,r,t))}function k(e){for(var t=0,n=e.length;t<n&&w.length!==f;t++){var r=e[t];if(r.error&&u)
|
|
769
773
|
// key was not found with "keys" requests
|
|
770
|
-
w.push(r);else{var o=
|
|
771
|
-
/* istanbul ignore if */e.update_seq&&void 0!==y&&(t.update_seq=y),n(null,t)}return m.get(
|
|
774
|
+
w.push(r);else{var o=Jt(r);O(o.winningRev,o)}}}function P(e,t,n){n&&(k(t),w.length<f&&n.continue())}function S(){var t={total_rows:v,offset:e.skip,rows:w};
|
|
775
|
+
/* istanbul ignore if */e.update_seq&&void 0!==y&&(t.update_seq=y),n(null,t)}return m.get(It).onsuccess=function(e){v=e.target.result.docCount},
|
|
772
776
|
/* istanbul ignore if */
|
|
773
777
|
e.update_seq&&function(e,t){e.openCursor(null,"prev").onsuccess=function(e){var t=e.target.result,n=void 0;return t&&t.key&&(n=t.key),function(e){e.target.result&&e.target.result.length>0&&(y=e.target.result[0])}({target:{result:[n]}})}}(_),o||0===f?void 0:u?function(e,t,n){
|
|
774
778
|
// It's not guaranted to be returned in right order
|
|
@@ -779,7 +783,7 @@ var r=[];e.openCursor(t).onsuccess=function(e){var t=e.target.result;t?(r.push(t
|
|
|
779
783
|
e.getAll(t).onsuccess=n}(g,r,(function(t){var n=t.target.result;e.descending&&(n=n.reverse()),k(n)})):
|
|
780
784
|
// else do a cursor
|
|
781
785
|
// choose a batch size based on the skip, since we'll need to skip that many
|
|
782
|
-
void
|
|
786
|
+
void en(g,r,e.descending,f+c,P)}
|
|
783
787
|
// Blobs are not supported in all versions of IndexedDB, notably
|
|
784
788
|
// Chrome <37 and Android <5. In those versions, storing a blob will throw.
|
|
785
789
|
// Various other blob bugs exist in Chrome v37-42 (inclusive).
|
|
@@ -789,38 +793,38 @@ void Zt(g,r,e.descending,f+c,P)}
|
|
|
789
793
|
// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916
|
|
790
794
|
// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836
|
|
791
795
|
// This task queue ensures that IDB open calls are done in their own tick
|
|
792
|
-
var
|
|
796
|
+
var nn=!1,rn=[];function on(){!nn&&rn.length&&(nn=!0,rn.shift()())}function sn(e,t,n,r){if((e=w(e)).continuous){var s=n+":"+Te();return Yt.addListener(n,s,t,e),Yt.notify(n),{cancel:function(){Yt.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)
|
|
793
797
|
// some other seq is later
|
|
794
798
|
return r();if(n.winningRev===e._rev)
|
|
795
799
|
// this is the winning doc
|
|
796
800
|
return r(n,e);
|
|
797
801
|
// fetch winning doc in separate request
|
|
798
|
-
var o=e._id+"::"+n.winningRev;h.get(o).onsuccess=function(e){r(n,
|
|
802
|
+
var o=e._id+"::"+n.winningRev;h.get(o).onsuccess=function(e){r(n,Xt(e.target.result))}}function m(){e.complete(null,{results:p,last_seq:u})}var b=[Dt,Mt];e.attachments&&b.push(Bt);var O=Qt(r,b,"readonly");if(O.error)return e.complete(O.error);(f=O.txn).onabort=Ht(e.complete),f.oncomplete=function(){!e.continuous&&e.attachments?
|
|
799
803
|
// cannot guarantee that postProcessing was already done,
|
|
800
804
|
// so do it again
|
|
801
|
-
|
|
805
|
+
Gt(p).then(m):m()},l=f.objectStore(Mt),d=f.objectStore(Dt),h=l.index("_doc_id_rev"),en(l,e.since&&!e.descending?IDBKeyRange.lowerBound(e.since,!0):null,e.descending,c,(function(t,n,r){if(r&&t.length){var o=new Array(t.length),i=new Array(t.length),s=0;n.forEach((function(n,u){!function(e,t,n){if(a&&!a.has(e._id))return n();var r=g.get(e._id);if(r)// cached
|
|
802
806
|
return _(e,t,r,n);
|
|
803
807
|
// metadata not cached, have to go fetch it
|
|
804
|
-
d.get(e._id).onsuccess=function(o){r=
|
|
808
|
+
d.get(e._id).onsuccess=function(o){r=Jt(o.target.result),g.set(e._id,r),_(e,t,r,n)}}(Xt(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()}
|
|
805
809
|
// Fetch all metadatas/winningdocs from this batch in parallel, then process
|
|
806
810
|
// them all only once all data has been collected. This is done in parallel
|
|
807
811
|
// because it's faster than doing it one-at-a-time.
|
|
808
812
|
()}))}))}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),
|
|
809
813
|
// process the attachment immediately
|
|
810
814
|
// for the benefit of live listeners
|
|
811
|
-
e.attachments&&e.include_docs?new Promise((function(t){
|
|
815
|
+
e.attachments&&e.include_docs?new Promise((function(t){zt(n,e,f,(function(){Gt([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){
|
|
812
816
|
// Shouldn't happen, but in some odd cases
|
|
813
817
|
// IndexedDB implementations might throw a sync
|
|
814
818
|
// error, in which case this will at least log it.
|
|
815
|
-
r.emit("error",t)}}(t,e,r,n),
|
|
819
|
+
r.emit("error",t)}}(t,e,r,n),nn=!1,s((function(){on()}))}))})),on()}((function(t){!function(e,t,n){var r=t.name,o=null;
|
|
816
820
|
// called when creating a fresh new database
|
|
817
821
|
// migration to version 2
|
|
818
822
|
// unfortunately "deletedOrLocal" is a misnomer now that we no longer
|
|
819
823
|
// store local docs in the main doc-store, but whaddyagonnado
|
|
820
|
-
function i(e,t){var n=e.objectStore(
|
|
824
|
+
function i(e,t){var n=e.objectStore(Dt);n.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=r.value,i=Fe(o);o.deletedOrLocal=i?"1":"0",n.put(o),r.continue()}else t()}}
|
|
821
825
|
// migration to version 3 (part 1)
|
|
822
826
|
// migration to version 3 (part 2)
|
|
823
|
-
function a(e,t){var n=e.objectStore(
|
|
827
|
+
function a(e,t){var n=e.objectStore(Ut),r=e.objectStore(Dt),o=e.objectStore(Mt);r.openCursor().onsuccess=function(e){var i=e.target.result;if(i){var s=i.value,a=s.id,u=He(a),c=Ee(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);
|
|
824
828
|
// remove all seq entries
|
|
825
829
|
// associated with this docId
|
|
826
830
|
v.onsuccess=function(e){if(v=e.target.result){var t=v.value;t._doc_id_rev===f&&n.put(t),o.delete(v.primaryKey),v.continue()}else
|
|
@@ -828,7 +832,7 @@ v.onsuccess=function(e){if(v=e.target.result){var t=v.value;t._doc_id_rev===f&&n
|
|
|
828
832
|
r.delete(i.primaryKey),i.continue()}}else i.continue()}else t&&t()}}
|
|
829
833
|
// migration to version 4 (part 1)
|
|
830
834
|
// migration to version 4 (part 2)
|
|
831
|
-
function u(e,t){var n=e.objectStore(
|
|
835
|
+
function u(e,t){var n=e.objectStore(Mt),r=e.objectStore(Bt),o=e.objectStore(Nt);r.count().onsuccess=function(e){if(!e.target.result)return t();// done
|
|
832
836
|
n.openCursor().onsuccess=function(e){var n=e.target.result;if(!n)return t();// done
|
|
833
837
|
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()}}}
|
|
834
838
|
// migration to version 5
|
|
@@ -840,85 +844,85 @@ for(var r=n.value,i=n.primaryKey,s=Object.keys(r._attachments||{}),a={},u=0;u<s.
|
|
|
840
844
|
function c(e){
|
|
841
845
|
// ensure that every metadata has a winningRev and seq,
|
|
842
846
|
// which was previously created on-the-fly but better to migrate
|
|
843
|
-
var t=e.objectStore(
|
|
847
|
+
var t=e.objectStore(Mt),n=e.objectStore(Dt);n.openCursor().onsuccess=function(e){var r=e.target.result;if(r){var o=function(e){return e.data?Jt(e):(
|
|
844
848
|
// old format, when we didn't store it stringified
|
|
845
|
-
e.deleted="1"===e.deletedOrLocal,e)}(r.value);if(o.winningRev=o.winningRev||
|
|
849
|
+
e.deleted="1"===e.deletedOrLocal,e)}(r.value);if(o.winningRev=o.winningRev||Ee(o),o.seq)return i();!function(){
|
|
846
850
|
// metadata.seq was added post-3.2.0, so if it's missing,
|
|
847
851
|
// we need to fetch it manually
|
|
848
|
-
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=
|
|
852
|
+
var e=o.id+"::",n=o.id+"::",r=t.index("_doc_id_rev").openCursor(IDBKeyRange.bound(e,n)),s=0;r.onsuccess=function(e){var t=e.target.result;if(!t)return o.seq=s,i();var n=t.primaryKey;n>s&&(s=n),t.continue()}}()}function i(){var e=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){Zt(t,n,r,e,o,i)},
|
|
849
853
|
// First we look up the metadata in the ids database, then we fetch the
|
|
850
854
|
// current revision(s) from the by sequence store
|
|
851
|
-
e._get=function(e,t,n){var r,i,s,a=t.ctx;if(!a){var u=
|
|
855
|
+
e._get=function(e,t,n){var r,i,s,a=t.ctx;if(!a){var u=Qt(o,[Dt,Mt,Bt],"readonly");if(u.error)return n(u.error);a=u.txn}function c(){n(s,{doc:r,metadata:i,ctx:a})}a.objectStore(Dt).get(e).onsuccess=function(e){
|
|
852
856
|
// we can determine the result here if:
|
|
853
857
|
// 1. there is no such document
|
|
854
858
|
// 2. the document is deleted and we don't ask about specific rev
|
|
855
859
|
// When we ask with opts.rev we expect the answer to be either
|
|
856
860
|
// doc (possibly with _deleted=true) or missing error
|
|
857
|
-
if(!(i=
|
|
861
|
+
if(!(i=Jt(e.target.result)))return s=Q(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)
|
|
858
862
|
// return the rev of this leaf
|
|
859
863
|
return o+"-"+s}for(var p=0,v=u.length;p<v;p++)r.push({pos:o+1,ids:u[p],history:f})}
|
|
860
|
-
/* 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
|
|
864
|
+
/* istanbul ignore next */throw new Error("Unable to resolve latest revision for id "+t.id+", rev "+e)}(t.rev,i):t.rev;else if(n=i.winningRev,Fe(i))return s=Q(B,"deleted"),c();var o=a.objectStore(Mt),u=i.id+"::"+n;o.index("_doc_id_rev").get(u).onsuccess=function(e){if((r=e.target.result)&&(r=Xt(r)),!r)return s=Q(B,"missing"),c();c()}}},e._getAttachment=function(e,t,n,r,i){var s;if(r.ctx)s=r.ctx;else{var a=Qt(o,[Dt,Mt,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){Vt(e.target.result.body,c,r.binary,(function(e){i(null,e)}))}},e._info=function(t){var n,r,i=Qt(o,[It,Mt],"readonly");if(i.error)return t(i.error);var s=i.txn;s.objectStore(It).get(It).onsuccess=function(e){r=e.target.result.docCount},s.objectStore(Mt).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,
|
|
861
865
|
// for debugging
|
|
862
|
-
idb_attachment_format:e._meta.blobSupport?"binary":"base64"})}},e._allDocs=function(e,t){
|
|
866
|
+
idb_attachment_format:e._meta.blobSupport?"binary":"base64"})}},e._allDocs=function(e,t){tn(e,o,t)},e._changes=function(t){return sn(t,e,r,o)},e._close=function(e){
|
|
863
867
|
// https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close
|
|
864
868
|
// "Returns immediately and closes the connection in a separate thread..."
|
|
865
|
-
o.close(),
|
|
869
|
+
o.close(),un.delete(r),e()},e._getRevisionTree=function(e,t){var n=Qt(o,[Dt],"readonly");if(n.error)return t(n.error);n.txn.objectStore(Dt).get(e).onsuccess=function(e){var n=Jt(e.target.result);n?t(null,n.rev_tree):t(Q(B))}},
|
|
866
870
|
// This function removes revisions of document docId
|
|
867
871
|
// which are listed in revs and sets this document
|
|
868
872
|
// revision to to rev_tree
|
|
869
|
-
e._doCompaction=function(e,t,n){var r=
|
|
870
|
-
t(null,n)):t(
|
|
871
|
-
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=
|
|
872
|
-
n(null,s)}:n(
|
|
873
|
+
e._doCompaction=function(e,t,n){var r=Qt(o,[Dt,Mt,Bt,Nt],"readwrite");if(r.error)return n(r.error);var i=r.txn;i.objectStore(Dt).get(e).onsuccess=function(n){var r=Jt(n.target.result);qe(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(Dt).put(Kt(r,o,s))},i.onabort=Ht(n),i.oncomplete=function(){n()}},e._getLocal=function(e,t){var n=Qt(o,[Ut],"readonly");if(n.error)return t(n.error);var r=n.txn.objectStore(Ut).get(e);r.onerror=Ht(t),r.onsuccess=function(e){var n=e.target.result;n?(delete n._doc_id_rev,// for backwards compat
|
|
874
|
+
t(null,n)):t(Q(B))}},e._putLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),delete e._revisions;// ignore this, trust the rev
|
|
875
|
+
var r=e._rev,i=e._id;e._rev=r?"0-"+(parseInt(r.split("-")[1],10)+1):"0-1";var s,a=t.ctx;if(!a){var u=Qt(o,[Ut],"readwrite");if(u.error)return n(u.error);(a=u.txn).onerror=Ht(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
|
|
876
|
+
n(null,s)}:n(Q(N))}:(// new doc
|
|
873
877
|
(c=f.add(e)).onerror=function(e){
|
|
874
878
|
// constraint error, already exists
|
|
875
|
-
n(
|
|
879
|
+
n(Q(N)),e.preventDefault(),// avoid transaction abort
|
|
876
880
|
e.stopPropagation()},c.onsuccess=function(){s={ok:!0,id:e._id,rev:e._rev},t.ctx&&// return immediately
|
|
877
|
-
n(null,s)})},e._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={});var r,i=t.ctx;if(!i){var s=
|
|
878
|
-
n(null,r)):n(
|
|
881
|
+
n(null,s)})},e._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={});var r,i=t.ctx;if(!i){var s=Qt(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=Ht(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
|
|
882
|
+
n(null,r)):n(Q(B))}},e._destroy=function(e,t){Yt.removeAllListeners(r);
|
|
879
883
|
//Close open request for "dbName" database to fix ie delay.
|
|
880
|
-
var n=
|
|
884
|
+
var n=cn.get(r);n&&n.result&&(n.result.close(),un.delete(r));var o=indexedDB.deleteDatabase(r);o.onsuccess=function(){
|
|
881
885
|
//Remove open request from the list.
|
|
882
|
-
|
|
886
|
+
cn.delete(r),q()&&r in localStorage&&delete localStorage[r],t(null,{ok:!0})},o.onerror=Ht(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(Dt,{keyPath:"id"});e.createObjectStore(Mt,{autoIncrement:!0}).createIndex("_doc_id_rev","_doc_id_rev",{unique:!0}),e.createObjectStore(Bt,{keyPath:"digest"}),e.createObjectStore(It,{keyPath:"id",autoIncrement:!1}),e.createObjectStore($t),
|
|
883
887
|
// added in v2
|
|
884
888
|
t.createIndex("deletedOrLocal","deletedOrLocal",{unique:!1}),
|
|
885
889
|
// added in v3
|
|
886
|
-
e.createObjectStore(
|
|
890
|
+
e.createObjectStore(Ut,{keyPath:"_id"});
|
|
887
891
|
// added in v4
|
|
888
|
-
var n=e.createObjectStore(
|
|
892
|
+
var n=e.createObjectStore(Nt,{autoIncrement:!0});n.createIndex("seq","seq"),n.createIndex("digestSeq","digestSeq",{unique:!0})}(t);// new db, initial schema
|
|
889
893
|
// do migrations
|
|
890
894
|
var n=e.currentTarget.transaction;
|
|
891
895
|
// these migrations have to be done in this function, before
|
|
892
896
|
// control is returned to the event loop, because IndexedDB
|
|
893
|
-
e.oldVersion<3&&function(e){e.createObjectStore(
|
|
897
|
+
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(Nt,{autoIncrement:!0});t.createIndex("seq","seq"),t.createIndex("digestSeq","digestSeq",{unique:!0})}(t);var r=[i,// v1 -> v2
|
|
894
898
|
a,// v2 -> v3
|
|
895
899
|
u,// v3 -> v4
|
|
896
|
-
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(),
|
|
900
|
+
c],o=e.oldVersion;!function e(){var t=r[o-1];o++,t&&t(n,e)}()},l.onsuccess=function(t){(o=t.target.result).onversionchange=function(){o.close(),un.delete(r)},o.onabort=function(e){A("error","Database has a global failure",e.target.error),o.close(),un.delete(r)};
|
|
897
901
|
// Do a few setup operations (in parallel as much as possible):
|
|
898
902
|
// 1. Fetch meta doc
|
|
899
903
|
// 2. Check blob support
|
|
900
904
|
// 3. Calculate docCount
|
|
901
905
|
// 4. Generate an instanceId if necessary
|
|
902
906
|
// 5. Store docCount and instanceId on meta doc
|
|
903
|
-
var i,s,a,u,c=o.transaction([
|
|
907
|
+
var i,s,a,u,c=o.transaction([It,$t,Dt],"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=Te(),i.docCount=s,c.objectStore(It).put(i)}}
|
|
904
908
|
// fetch or generate the instanceId
|
|
905
|
-
c.objectStore(
|
|
909
|
+
c.objectStore(It).get(It).onsuccess=function(e){i=e.target.result||{id:It},d()},
|
|
906
910
|
// countDocs
|
|
907
|
-
function(e,t){e.objectStore(
|
|
911
|
+
function(e,t){e.objectStore(Dt).index("deletedOrLocal").count(IDBKeyRange.only("0")).onsuccess=function(e){!function(e){s=e,d()}(e.target.result)}}(c),
|
|
908
912
|
// check blob support
|
|
909
|
-
|
|
913
|
+
an||(
|
|
910
914
|
// make sure blob support is only checked once
|
|
911
|
-
|
|
915
|
+
an=function(e){return new Promise((function(t){var n=pe([""]),r=e.objectStore($t).put(n,"key");r.onsuccess=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);
|
|
912
916
|
// MS Edge pretends to be Chrome 42:
|
|
913
917
|
// https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx
|
|
914
918
|
t(n||!e||parseInt(e[1],10)>=43)},r.onerror=e.onabort=function(e){
|
|
915
919
|
// If the transaction aborts now its due to not being able to
|
|
916
920
|
// write to the database, likely due to the disk being full
|
|
917
921
|
e.preventDefault(),e.stopPropagation(),t(!1)}})).catch((function(){return!1;// error, so assume unsupported
|
|
918
|
-
}))}(c)),
|
|
922
|
+
}))}(c)),an.then((function(e){a=e,l()})),
|
|
919
923
|
// only when the metadata put transaction has completed,
|
|
920
924
|
// consider the setup done
|
|
921
|
-
c.oncomplete=function(){f=!0,l()},c.onabort=
|
|
925
|
+
c.oncomplete=function(){f=!0,l()},c.onabort=Ht(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?",A("error",t),n(Q(z,t))}}(n,e,t)}),t,n.constructor)}fn.valid=function(){
|
|
922
926
|
// Following #7085 buggy idb versions (typically Safari < 10.1) are
|
|
923
927
|
// considered valid.
|
|
924
928
|
// On Firefox SecurityError is thrown while referencing indexedDB if cookies
|
|
@@ -926,40 +930,40 @@ c.oncomplete=function(){f=!0,l()},c.onabort=Ft(n)},l.onerror=function(e){var t=e
|
|
|
926
930
|
try{
|
|
927
931
|
// some outdated implementations of IDB that appear on Samsung
|
|
928
932
|
// and HTC Android devices <4.4 are missing IDBKeyRange
|
|
929
|
-
return"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}};var
|
|
933
|
+
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()}
|
|
930
934
|
// Get all the information you possibly can about the URI given by name and
|
|
931
935
|
// return it as a suitable object.
|
|
932
936
|
// Generate a URL with the host data given by opts and the given path
|
|
933
|
-
function
|
|
937
|
+
function yn(e,t){return gn(e,e.db+"/"+t)}
|
|
934
938
|
// Generate a URL with the host data given by opts and the given path
|
|
935
|
-
function
|
|
939
|
+
function gn(e,t){
|
|
936
940
|
// If the host already has a path, then we need to have a path delimiter
|
|
937
941
|
// Otherwise, the path delimiter is the empty string
|
|
938
942
|
var n=e.path?"/":"";
|
|
939
943
|
// If the host already has a path, then we need to have a path delimiter
|
|
940
944
|
// Otherwise, the path delimiter is the empty string
|
|
941
|
-
return e.protocol+"://"+e.host+(e.port?":"+e.port:"")+"/"+e.path+n+t}function
|
|
945
|
+
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("&")}
|
|
942
946
|
// Implements the PouchDB API for dealing with CouchDB instances over HTTP
|
|
943
|
-
function
|
|
947
|
+
function mn(e,t){
|
|
944
948
|
// The functions that will be publicly available for HttpPouch
|
|
945
949
|
var r=this,o=function(e,t){
|
|
946
950
|
// encode db name if opts.prefix is a url (#5574)
|
|
947
|
-
if(function(e){if(!e.prefix)return!1;var t=
|
|
951
|
+
if(function(e){if(!e.prefix)return!1;var t=ce(e.prefix).protocol;return"http"===t||"https"===t}(t)){var n=t.name.substr(t.prefix.length);
|
|
948
952
|
// Ensure prefix has a trailing slash
|
|
949
|
-
e=t.prefix.replace(/\/?$/,"/")+encodeURIComponent(n)}var r=
|
|
953
|
+
e=t.prefix.replace(/\/?$/,"/")+encodeURIComponent(n)}var r=ce(e);(r.user||r.password)&&(r.auth={username:r.user,password:r.password});
|
|
950
954
|
// Split the path part of the URI into parts using '/' as the delimiter
|
|
951
955
|
// after removing any leading '/' and any trailing '/'
|
|
952
956
|
var o=r.path.replace(/(^\/|\/$)/g,"").split("/");return r.db=o.pop(),
|
|
953
957
|
// Prevent double encoding of URI component
|
|
954
|
-
-1===r.db.indexOf("%")&&(r.db=encodeURIComponent(r.db)),r.path=o.join("/"),r}(e.name,e),i=
|
|
958
|
+
-1===r.db.indexOf("%")&&(r.db=encodeURIComponent(r.db)),r.path=o.join("/"),r}(e.name,e),i=yn(o,"");e=w(e);var 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])})),
|
|
955
959
|
/* istanbul ignore if */
|
|
956
|
-
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||
|
|
960
|
+
function(e){var t="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",n=-1!==t.indexOf("msie"),r=-1!==t.indexOf("trident"),o=-1!==t.indexOf("edge"),i=!("method"in e)||"GET"===e.method;return(n||r||o)&&i}(n)&&(t+=(-1===t.indexOf("?")?"?":"&")+"_nonce="+Date.now()),(e.fetch||et)(t,n)};function c(e,t){return P(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=Y(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?Y(e):e}))),!n)return r;n(null,r.data)}))}function d(){return e.skip_setup?Promise.resolve():
|
|
957
961
|
// If there is a setup in process or previous successful setup
|
|
958
962
|
// done then we will use that
|
|
959
963
|
// If previous setups have been rejected we will try again
|
|
960
964
|
a||((a=l(i).catch((function(e){return e&&e.status&&404===e.status?(
|
|
961
965
|
// Doesnt exist, create it
|
|
962
|
-
|
|
966
|
+
x(404,"PouchDB is just detecting if the remote exists."),l(i,{method:"PUT"})):Promise.reject(e)})).catch((function(e){
|
|
963
967
|
// If we try to create a database that already exists, skipped in
|
|
964
968
|
// istanbul since its catching a race condition.
|
|
965
969
|
/* istanbul ignore if */
|
|
@@ -967,33 +971,33 @@ return!(!e||!e.status||412!==e.status)||Promise.reject(e)}))).catch((function(){
|
|
|
967
971
|
// Get the attachment
|
|
968
972
|
s((function(){t(null,r)})),r._remote=!0,
|
|
969
973
|
/* istanbul ignore next */
|
|
970
|
-
r.type=function(){return"http"},r.id=c("id",(function(e){u(
|
|
974
|
+
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){
|
|
971
975
|
// Bad response or missing `uuid` should not prevent ID generation.
|
|
972
|
-
var n=t&&t.uuid?t.uuid+o.db:
|
|
976
|
+
var n=t&&t.uuid?t.uuid+o.db:yn(o,"");e(null,n)}))})),
|
|
973
977
|
// Sends a POST request to the host calling the couchdb _compact function
|
|
974
978
|
// version: The version of CouchDB it is running
|
|
975
|
-
r.compact=c("compact",(function(e,t){"function"==typeof e&&(t=e,e={}),e=
|
|
979
|
+
r.compact=c("compact",(function(e,t){"function"==typeof e&&(t=e,e={}),e=w(e),l(yn(o,"_compact"),{method:"POST"}).then((function(){
|
|
976
980
|
// Ping the http if it's finished compaction
|
|
977
981
|
!function n(){r.info((function(r,o){
|
|
978
982
|
// CouchDB may send a "compact_running:true" if it's
|
|
979
983
|
// already compacting. PouchDB Server doesn't.
|
|
980
984
|
/* istanbul ignore else */
|
|
981
|
-
o&&!o.compact_running?t(null,{ok:!0}):setTimeout(n,e.interval||200)}))}()}))})),r.bulkGet=
|
|
982
|
-
/* istanbul ignore next */n.attachments=!0),e.latest&&(n.latest=!0),l(
|
|
985
|
+
o&&!o.compact_running?t(null,{ok:!0}):setTimeout(n,e.interval||200)}))}()}))})),r.bulkGet=P("bulkGet",(function(e,t){var n=this;function r(t){var n={};e.revs&&(n.revs=!0),e.attachments&&(
|
|
986
|
+
/* istanbul ignore next */n.attachments=!0),e.latest&&(n.latest=!0),l(yn(o,"_bulk_get"+_n(n)),{method:"POST",body:JSON.stringify({docs:e.docs})}).then((function(n){e.attachments&&e.binary&&n.data.results.forEach((function(e){e.docs.forEach(hn)})),t(null,n.data)})).catch(t)}
|
|
983
987
|
/* istanbul ignore next */function i(){
|
|
984
988
|
// avoid "url too long error" by splitting up into multiple requests
|
|
985
989
|
var r=Math.ceil(e.docs.length/50),o=0,i=new Array(r);function s(e){return function(n,s){
|
|
986
990
|
// err is impossible because shim returns a list of errs in that case
|
|
987
|
-
i[e]=s.results,++o===r&&t(null,{results:
|
|
991
|
+
i[e]=s.results,++o===r&&t(null,{results:ee(i)})}}for(var a=0;a<r;a++){var u=S(e,["revs","attachments","binary","latest"]);u.docs=e.docs.slice(50*a,Math.min(e.docs.length,50*(a+1))),E(n,u,s(a))}}
|
|
988
992
|
// mark the whole database as either supporting or not supporting _bulk_get
|
|
989
|
-
var s=
|
|
993
|
+
var s=gn(o,""),a=dn[s];
|
|
990
994
|
/* istanbul ignore next */"boolean"!=typeof a?
|
|
991
995
|
// check if this database supports _bulk_get
|
|
992
|
-
r((function(e,n){e?(
|
|
996
|
+
r((function(e,n){e?(dn[s]=!1,x(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()})),
|
|
993
997
|
// Calls GET on the host, which gets back a JSON string containing
|
|
994
998
|
// couchdb: A welcome string
|
|
995
999
|
// version: The version of CouchDB it is running
|
|
996
|
-
r._info=function(e){d().then((function(){return u(
|
|
1000
|
+
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)}))},
|
|
997
1001
|
// Get the document with the given id from the database given by host.
|
|
998
1002
|
// The id could be solely the _id in the database, or it may be a
|
|
999
1003
|
// _design/ID or _local/ID path
|
|
@@ -1014,45 +1018,45 @@ r?n(r):t():l()}function c(){o--,u()}
|
|
|
1014
1018
|
// Sync Gateway would normally send it back as multipart/mixed,
|
|
1015
1019
|
// which we cannot parse. Also, this is more efficient than
|
|
1016
1020
|
// receiving attachments as base64-encoded strings.
|
|
1017
|
-
return function(r){var i=n[r],s=
|
|
1018
|
-
/* istanbul ignore if */),t.update_seq&&(r.update_seq=t.update_seq),e=
|
|
1021
|
+
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
|
|
1022
|
+
/* istanbul ignore if */),t.update_seq&&(r.update_seq=t.update_seq),e=pn(e),l(yn(o,e+_n(r))).then((function(e){return Promise.resolve().then((function(){if(t.attachments)return n=e.data,Array.isArray(n)?Promise.all(n.map((function(e){if(e.ok)return i(e.ok)}))):i(n);var n})).then((function(){n(null,e.data)}))})).catch((function(t){t.docId=e,n(t)}))})),
|
|
1019
1023
|
// Delete the document given by doc from the database given by host.
|
|
1020
1024
|
r.remove=c("remove",(function(e,t,n,r){var i;"string"==typeof t?(
|
|
1021
1025
|
// id, rev, opts, callback style
|
|
1022
1026
|
i={_id:e,_rev:t},"function"==typeof n&&(r=n,n={})):(
|
|
1023
1027
|
// doc, opts, callback style
|
|
1024
|
-
i=e,"function"==typeof t?(r=t,n={}):(r=n,n=t));var s=i._rev||n.rev;l(
|
|
1028
|
+
i=e,"function"==typeof t?(r=t,n={}):(r=n,n=t));var s=i._rev||n.rev;l(yn(o,pn(i._id))+"?rev="+s,{method:"DELETE"},r).catch(r)})),r.getAttachment=c("getAttachment",(function(e,t,r,i){"function"==typeof r&&(i=r,r={});var s,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){
|
|
1025
1029
|
// TODO: also remove
|
|
1026
1030
|
void 0===n||n.browser||(e.type=s),i(null,e)})).catch((function(e){i(e)}))})),
|
|
1027
1031
|
// Remove the attachment given by the id and rev
|
|
1028
|
-
r.removeAttachment=c("removeAttachment",(function(e,t,n,r){l(
|
|
1032
|
+
r.removeAttachment=c("removeAttachment",(function(e,t,n,r){l(yn(o,pn(e)+"/"+h(t))+"?rev="+n,{method:"DELETE"},r).catch(r)})),
|
|
1029
1033
|
// Add the attachment given by blob and its contentType property
|
|
1030
1034
|
// to the document with the given id, the revision given by rev, and
|
|
1031
1035
|
// add it to the database given by host.
|
|
1032
|
-
r.putAttachment=c("putAttachment",(function(e,t,n,r,i,s){"function"==typeof i&&(s=i,i=r,r=n,n=null);var a=
|
|
1036
|
+
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){
|
|
1033
1037
|
// input is assumed to be a base64 string
|
|
1034
|
-
var c;try{c=
|
|
1038
|
+
var c;try{c=de(r)}catch(e){return s(Q(H,"Attachment is not a valid base64 string"))}r=c?ye(c,i):""}
|
|
1035
1039
|
// Add the attachment
|
|
1036
|
-
l(u,{headers:new
|
|
1040
|
+
l(u,{headers:new tt({"Content-Type":i}),method:"PUT",body:r},s).catch(s)})),
|
|
1037
1041
|
// Update/create multiple documents given by req in the database
|
|
1038
1042
|
// given by host.
|
|
1039
1043
|
r._bulkDocs=function(e,t,n){
|
|
1040
1044
|
// If new_edits=false then it prevents the database from creating
|
|
1041
1045
|
// new revision numbers for the documents. Instead it just uses
|
|
1042
1046
|
// the old ones. This is used in database replication.
|
|
1043
|
-
e.new_edits=t.new_edits,d().then((function(){return Promise.all(e.docs.map(
|
|
1047
|
+
e.new_edits=t.new_edits,d().then((function(){return Promise.all(e.docs.map(vn))})).then((function(){
|
|
1044
1048
|
// Update/create the documents
|
|
1045
|
-
return l(
|
|
1049
|
+
return l(yn(o,"_bulk_docs"),{method:"POST",body:JSON.stringify(e)},n)})).catch(n)},
|
|
1046
1050
|
// Update/create document
|
|
1047
|
-
r._put=function(e,t,n){d().then((function(){return
|
|
1051
|
+
r._put=function(e,t,n){d().then((function(){return vn(e)})).then((function(){return l(yn(o,pn(e._id)),{method:"PUT",body:JSON.stringify(e)})})).then((function(e){n(null,e.data)})).catch((function(t){t.docId=e&&e._id,n(t)}))},
|
|
1048
1052
|
// Get a listing of the documents in the database given
|
|
1049
1053
|
// by host and ordered by increasing id.
|
|
1050
1054
|
r.allDocs=c("allDocs",(function(e,t){"function"==typeof e&&(t=e,e={});
|
|
1051
1055
|
// List of parameters to add to the GET request
|
|
1052
|
-
var n,r={},i="GET";(e=
|
|
1056
|
+
var n,r={},i="GET";(e=w(e)).conflicts&&(r.conflicts=!0
|
|
1053
1057
|
/* istanbul ignore if */),e.update_seq&&(r.update_seq=!0),e.descending&&(r.descending=!0),e.include_docs&&(r.include_docs=!0),
|
|
1054
1058
|
// added in CouchDB 1.6.0
|
|
1055
|
-
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=
|
|
1059
|
+
e.attachments&&(r.attachments=!0),e.key&&(r.key=JSON.stringify(e.key)),e.start_key&&(e.startkey=e.start_key),e.startkey&&(r.startkey=JSON.stringify(e.startkey)),e.end_key&&(e.endkey=e.end_key),e.endkey&&(r.endkey=JSON.stringify(e.endkey)),void 0!==e.inclusive_end&&(r.inclusive_end=!!e.inclusive_end),void 0!==e.limit&&(r.limit=e.limit),void 0!==e.skip&&(r.skip=e.skip);var s=_n(r);void 0!==e.keys&&(i="POST",n={keys:e.keys}),l(yn(o,"_all_docs"+s),{method:i,body:JSON.stringify(n)}).then((function(n){e.include_docs&&e.attachments&&e.binary&&n.data.rows.forEach(hn),t(null,n.data)})).catch(t)})),
|
|
1056
1060
|
// Get a list of changes made to documents in the database given by host.
|
|
1057
1061
|
// TODO According to the README, there should be two other methods here,
|
|
1058
1062
|
// api.changes.addListener and api.changes.removeListener.
|
|
@@ -1061,10 +1065,10 @@ r._changes=function(e){
|
|
|
1061
1065
|
// if there is a large set of changes to be returned we can start
|
|
1062
1066
|
// processing them quicker instead of waiting on the entire
|
|
1063
1067
|
// set of changes to return and attempting to process them at once
|
|
1064
|
-
var t="batch_size"in e?e.batch_size:25;(e=
|
|
1068
|
+
var t="batch_size"in e?e.batch_size:25;(e=w(e)).continuous&&!("heartbeat"in e)&&(e.heartbeat=1e4);var n="timeout"in e?e.timeout:3e4;
|
|
1065
1069
|
// ensure CHANGES_TIMEOUT_BUFFER applies
|
|
1066
|
-
"timeout"in e&&e.timeout&&n-e.timeout<
|
|
1067
|
-
/* istanbul ignore if */),"heartbeat"in e&&e.heartbeat&&n-e.heartbeat<
|
|
1070
|
+
"timeout"in e&&e.timeout&&n-e.timeout<ln&&(n=e.timeout+ln
|
|
1071
|
+
/* istanbul ignore if */),"heartbeat"in e&&e.heartbeat&&n-e.heartbeat<ln&&(n=e.heartbeat+ln);var r={};"timeout"in e&&e.timeout&&(r.timeout=e.timeout);var i=void 0!==e.limit&&e.limit,a=i;
|
|
1068
1072
|
// If opts.query_params exists, pass it through to the changes request.
|
|
1069
1073
|
// These parameters may be used by the filter on the source database.
|
|
1070
1074
|
if(e.style&&(r.style=e.style),(e.include_docs||e.filter&&"function"==typeof e.filter)&&(r.include_docs=!0),e.attachments&&(r.attachments=!0),e.continuous&&(r.feed="longpoll"),e.seq_interval&&(r.seq_interval=e.seq_interval),e.conflicts&&(r.conflicts=!0),e.descending&&(r.descending=!0
|
|
@@ -1075,12 +1079,12 @@ e.query_params.hasOwnProperty(u)&&(r[u]=e.query_params[u]);var c,f="GET";e.doc_i
|
|
|
1075
1079
|
// requires both a "filter" and a "doc_ids" param.
|
|
1076
1080
|
r.filter="_doc_ids",f="POST",c={doc_ids:e.doc_ids}):e.selector&&(
|
|
1077
1081
|
// set this automagically for the user, similar to above
|
|
1078
|
-
r.filter="_selector",f="POST",c={selector:e.selector});var h,p=new
|
|
1082
|
+
r.filter="_selector",f="POST",c={selector:e.selector});var h,p=new Ze,v=function(n,s){if(!e.aborted){r.since=n,
|
|
1079
1083
|
// "since" can be any kind of json object in Cloudant/CouchDB 2.x
|
|
1080
1084
|
/* istanbul ignore next */
|
|
1081
1085
|
"object"==typeof r.since&&(r.since=JSON.stringify(r.since)),e.descending?i&&(r.limit=a):r.limit=!i||a>t?t:a;
|
|
1082
1086
|
// Set the options for the ajax call
|
|
1083
|
-
var u=
|
|
1087
|
+
var u=yn(o,"_changes"+_n(r)),v={signal:p.signal,method:f,body:JSON.stringify(c)};h=n,
|
|
1084
1088
|
/* istanbul ignore if */
|
|
1085
1089
|
e.aborted||
|
|
1086
1090
|
// Get the changes
|
|
@@ -1088,7 +1092,7 @@ d().then((function(){return l(u,v,s)})).catch(s)}},y={results:[]},g=function(n,r
|
|
|
1088
1092
|
// If the result of the ajax call (res) contains changes (res.results)
|
|
1089
1093
|
if(r&&r.results){o=r.results.length,y.last_seq=r.last_seq;var u=null,c=null;
|
|
1090
1094
|
// Attach 'pending' property if server supports it (CouchDB 2.0+)
|
|
1091
|
-
/* 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=
|
|
1095
|
+
/* 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)
|
|
1092
1096
|
// In case of an error, stop listening for changes and call
|
|
1093
1097
|
// opts.complete
|
|
1094
1098
|
return e.aborted=!0,void e.complete(n);
|
|
@@ -1108,22 +1112,22 @@ r.revsDiff=c("revsDiff",(function(e,t,n){
|
|
|
1108
1112
|
// If no options were given, set the callback to be the second parameter
|
|
1109
1113
|
"function"==typeof t&&(n=t,t={}),
|
|
1110
1114
|
// Get the missing document/revision IDs
|
|
1111
|
-
l(
|
|
1115
|
+
l(yn(o,"_revs_diff"),{method:"POST",body:JSON.stringify(e)},n).catch(n)})),r._close=function(e){e()},r._destroy=function(e,t){l(yn(o,""),{method:"DELETE"}).then((function(e){t(null,e)})).catch((function(e){
|
|
1112
1116
|
/* istanbul ignore if */
|
|
1113
1117
|
404===e.status?t(null,{ok:!0}):t(e)}))}}
|
|
1114
1118
|
// HttpPouch is a valid adapter.
|
|
1115
|
-
function
|
|
1119
|
+
function bn(e){this.status=400,this.name="query_parse_error",this.message=e,this.error=!0;try{Error.captureStackTrace(this,bn)}catch(e){}}function wn(e){this.status=404,this.name="not_found",this.message=e,this.error=!0;try{Error.captureStackTrace(this,wn)}catch(e){}}function On(e){this.status=500,this.name="invalid_value",this.message=e,this.error=!0;try{Error.captureStackTrace(this,On)}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 Pn(e,t){return function(){var n=arguments,r=this;return e.add((function(){return t.apply(r,n)}))}}
|
|
1116
1120
|
// uniq an array of strings, order not guaranteed
|
|
1117
1121
|
// similar to underscore/lodash _.uniq
|
|
1118
|
-
function
|
|
1119
|
-
throw
|
|
1122
|
+
function Sn(e){var t=new o(e),n=new Array(t.size),r=-1;return t.forEach((function(e){n[++r]=e})),n}function jn(e){var t=new Array(e.size),n=-1;return e.forEach((function(e,r){t[++n]=r})),t}function Tn(e){return new On("builtin "+e+" function requires map values to be numbers or number arrays")}function En(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
|
|
1123
|
+
throw Tn("_sum");
|
|
1120
1124
|
// lists of numbers are also allowed, sum them separately
|
|
1121
|
-
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
|
|
1122
|
-
t[0]+=o}return t}
|
|
1125
|
+
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 Tn("_sum");void 0===t[i]?t.push(a):t[i]+=a}}else"number"==typeof t?t+=o:// add number to array
|
|
1126
|
+
t[0]+=o}return t}mn.valid=function(){return!0},l(bn,Error),l(wn,Error),l(On,Error);var qn=A.bind(null,"log"),Rn=Array.isArray,An=JSON.parse;function Cn(e,t){return fe("return ("+e.replace(/;\s*$/,"")+");",{emit:t,sum:En,log:qn,isArray:Rn,toJSON:An})}
|
|
1123
1127
|
/*
|
|
1124
1128
|
* Simple task queue to sequentialize actions. Assumes
|
|
1125
1129
|
* callbacks will eventually fire (once).
|
|
1126
|
-
*/function
|
|
1130
|
+
*/function xn(){this.promise=new Promise((function(e){e()}))}function Ln(e){if(!e)return"undefined";// backwards compat for empty reduce
|
|
1127
1131
|
// for backwards compat with mapreduce, functions/strings are stringified
|
|
1128
1132
|
// as-is. everything else is JSON-stringified.
|
|
1129
1133
|
switch(typeof e){case"function":case"string":
|
|
@@ -1131,22 +1135,22 @@ switch(typeof e){case"function":case"string":
|
|
|
1131
1135
|
return e.toString();default:
|
|
1132
1136
|
// e.g. a JSON object in the case of mango queries
|
|
1133
1137
|
return JSON.stringify(e)}}
|
|
1134
|
-
/* create a string signature for a view so we can cache it and uniq it */function
|
|
1138
|
+
/* create a string signature for a view so we can cache it and uniq it */function Dn(e,t,n,r,o,i){var s,a=function(e,t){
|
|
1135
1139
|
// the "undefined" part is for backwards compatibility
|
|
1136
|
-
return
|
|
1140
|
+
return Ln(e)+Ln(t)+"undefined"}(n,r);if(!o&&
|
|
1137
1141
|
// cache this to ensure we don't try to update the same view twice
|
|
1138
|
-
(s=e._cachedViews=e._cachedViews||{})[a])return s[a];var u=e.info().then((function(u){var c=u.db_name+"-mrview-"+(o?"temp":
|
|
1142
|
+
(s=e._cachedViews=e._cachedViews||{})[a])return s[a];var u=e.info().then((function(u){var c=u.db_name+"-mrview-"+(o?"temp":Se(a));
|
|
1139
1143
|
// save the view name in the source db so it can be cleaned up if necessary
|
|
1140
1144
|
// (e.g. when the _design doc is deleted, remove all associated view data)
|
|
1141
|
-
return
|
|
1145
|
+
return le(e,"_local/"+i,(function(e){e.views=e.views||{};var n=t;-1===n.indexOf("/")&&(n=t+"/"+t);var r=e.views[n]=e.views[n]||{};
|
|
1142
1146
|
/* istanbul ignore if */if(!r[c])return r[c]=!0,e})).then((function(){return e.registerDependentDatabase(c).then((function(t){var o=t.db;o.auto_compaction=!0;var i={name:c,db:o,sourceDB:e,adapter:e.adapter,mapFun:n,reduceFun:r};return i.db.get("_local/lastSeq").catch((function(e){
|
|
1143
1147
|
/* istanbul ignore if */
|
|
1144
|
-
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}
|
|
1148
|
+
if(404!==e.status)throw e})).then((function(e){return i.seq=e?e.seq:0,s&&i.db.once("destroyed",(function(){delete s[a]})),i}))}))}))}));return s&&(s[a]=u),u}xn.prototype.add=function(e){return this.promise=this.promise.catch((function(){
|
|
1145
1149
|
// just recover
|
|
1146
|
-
})).then((function(){return e()})),this.promise},
|
|
1150
|
+
})).then((function(){return e()})),this.promise},xn.prototype.finish=function(){return this.promise};var Mn={},Bn=new xn;function Nn(e){
|
|
1147
1151
|
// can be either 'ddocname/viewname' or just 'viewname'
|
|
1148
1152
|
// (where the ddoc name is the same)
|
|
1149
|
-
return-1===e.indexOf("/")?[e,e]:e.split("/")}function
|
|
1153
|
+
return-1===e.indexOf("/")?[e,e]:e.split("/")}function In(e,t){try{e.emit("error",t)}catch(e){A("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."),A("error",t)
|
|
1150
1154
|
/**
|
|
1151
1155
|
* Returns an "abstract" mapreduce object of the form:
|
|
1152
1156
|
*
|
|
@@ -1172,25 +1176,25 @@ return-1===e.indexOf("/")?[e,e]:e.split("/")}function Nn(e,t){try{e.emit("error"
|
|
|
1172
1176
|
* Throws an error if the ddoc or viewName is not valid.
|
|
1173
1177
|
* This could be a way to communicate to the user that the configuration for the
|
|
1174
1178
|
* indexer is invalid.
|
|
1175
|
-
*/}}var
|
|
1179
|
+
*/}}var Un=function(e,t){return En(t)},$n=function(e,t){return t.length},Fn=function(e,t){return{sum:En(t),min:Math.min.apply(null,t),max:Math.max.apply(null,t),count:t.length,sumsqr:
|
|
1176
1180
|
// no need to implement rereduce=true, because Pouch
|
|
1177
1181
|
// will never call it
|
|
1178
|
-
function(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=e[n];t+=o*o}return t}(t)}},
|
|
1182
|
+
function(e){for(var t=0,n=0,r=e.length;n<r;n++){var o=e[n];t+=o*o}return t}(t)}},Hn=function(e,t,n,r){function a(e,t,n){
|
|
1179
1183
|
// emit an event if there was an error thrown by a map function.
|
|
1180
1184
|
// putting try/catches in a single function also avoids deoptimizations.
|
|
1181
|
-
try{t(n)}catch(t){
|
|
1185
|
+
try{t(n)}catch(t){In(e,t)}}function u(e,t,n,r,o){
|
|
1182
1186
|
// same as above, but returning the result or an error. there are two separate
|
|
1183
1187
|
// functions to avoid extra memory allocations since the tryCode() case is used
|
|
1184
1188
|
// for custom map functions (common) vs this function, which is only used for
|
|
1185
1189
|
// custom reduce functions (rare)
|
|
1186
|
-
try{return{output:t(n,r,o)}}catch(t){return
|
|
1190
|
+
try{return{output:t(n,r,o)}}catch(t){return In(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;
|
|
1187
1191
|
// Users can explicitly specify a joined doc _id, or it
|
|
1188
1192
|
// defaults to the doc _id that emitted the key/value.
|
|
1189
|
-
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=
|
|
1193
|
+
return t&&"object"==typeof t&&t._id||e.id}function h(e){return function(t){return e.include_docs&&e.attachments&&e.binary&&function(e){e.rows.forEach((function(e){var t=e.doc&&e.doc._attachments;t&&Object.keys(t).forEach((function(e){var n=t[e];t[e].data=ge(n.data,n.content_type)}))}))}(t),t}}function p(e,t,n,r){
|
|
1190
1194
|
// add an http param from opts to params, optionally json-encoded
|
|
1191
1195
|
var o=t[e];void 0!==o&&(r&&(o=encodeURIComponent(JSON.stringify(o))),n.push(e+"="+o))}function v(e){if(void 0!==e){var t=Number(e);
|
|
1192
1196
|
// prevents e.g. '1foo' or '1.1' being coerced to 1
|
|
1193
|
-
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]&&
|
|
1197
|
+
return isNaN(t)||t!==parseInt(e,10)?e:t}}function y(e,t){var n=e.descending?"endkey":"startkey",r=e.descending?"startkey":"endkey";if(void 0!==e[n]&&void 0!==e[r]&&dt(e[n],e[r])>0)throw new bn("No rows can match your key range, reverse your start_key and end_key or set {descending : true}");if(t.reduce&&!1!==e.reduce){if(e.include_docs)throw new bn("{include_docs:true} is invalid for reduce");if(e.keys&&e.keys.length>1&&!e.group&&!e.group_level)throw new bn("Multi-key fetches for reduce views must use {group: true}")}["group_level","limit","skip"].forEach((function(t){var n=function(e){if(e){if("number"!=typeof e)return new bn('Invalid value for integer: "'+e+'"');if(e<0)return new bn('Invalid value for positive integer: "'+e+'"')}}(e[t]);if(n)throw n}))}function g(e){return function(t){
|
|
1194
1198
|
/* istanbul ignore else */
|
|
1195
1199
|
if(404===t.status)return e;throw t}}
|
|
1196
1200
|
// returns a promise for a list of docs to update, based on the input docId.
|
|
@@ -1199,21 +1203,21 @@ if(404===t.status)return e;throw t}}
|
|
|
1199
1203
|
function _(e,t,n){var r="_local/doc_"+e,i={_id:r,keys:[]},s=n.get(e),a=s[0];return(function(e){
|
|
1200
1204
|
// only return true if the current change is 1-
|
|
1201
1205
|
// and there are no other leafs
|
|
1202
|
-
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=
|
|
1206
|
+
return 1===e.length&&/^1-/.test(e[0].rev)}(s[1])?Promise.resolve(i):t.db.get(r).catch(g(i))).then((function(e){return function(e){return e.keys.length?t.db.allDocs({keys:e.keys,include_docs:!0}):Promise.resolve({rows:[]})}(e).then((function(t){return function(e,t){for(var n=[],r=new o,i=0,s=t.rows.length;i<s;i++){var 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=jn(a);return f.forEach((function(e){if(!r.has(e)){
|
|
1203
1207
|
// new doc
|
|
1204
|
-
var t={_id:e},o=a.get(e);"value"in o&&(t.value=o.value),n.push(t)}})),e.keys=
|
|
1208
|
+
var t={_id:e},o=a.get(e);"value"in o&&(t.value=o.value),n.push(t)}})),e.keys=Sn(f.concat(e.keys)),n.push(e),n}(e,t)}))}))}
|
|
1205
1209
|
// updates all emitted key/value docs and metaDocs in the mrview database
|
|
1206
1210
|
// for the given batch of documents from the source database
|
|
1207
|
-
function m(e){var t="string"==typeof e?e:e.name,n=
|
|
1211
|
+
function m(e){var t="string"==typeof e?e:e.name,n=Mn[t];return n||(n=Mn[t]=new xn),n}function b(e){return Pn(m(e),(function(){return function(e){
|
|
1208
1212
|
// bind the emit function once
|
|
1209
1213
|
var t,n;var r=function(e,t){
|
|
1210
1214
|
// for temp_views one can use emit(doc, emit), see #38
|
|
1211
|
-
if("function"==typeof e&&2===e.length){var n=e;return function(e){return n(e,t)}}return
|
|
1215
|
+
if("function"==typeof e&&2===e.length){var n=e;return function(e){return n(e,t)}}return Cn(e.toString(),t)}(e.mapFun,(function(e,r){var o={id:n._id,key:ht(e)};
|
|
1212
1216
|
// Don't explicitly store the value unless it's defined and non-null.
|
|
1213
1217
|
// This saves on storage space, because often people don't use it.
|
|
1214
|
-
null!=r&&(o.value=
|
|
1218
|
+
null!=r&&(o.value=ht(r)),t.push(o)})),o=e.seq||0;function s(t,n){return function(){return function(e,t,n){var r="_local/lastSeq";return e.db.get(r).catch(g({_id:r,seq:0})).then((function(r){var o=jn(t);return Promise.all(o.map((function(n){return _(n,e,t)}))).then((function(t){var o=ee(t);
|
|
1215
1219
|
// write all docs in a single operation, update the seq once
|
|
1216
|
-
return r.seq=n,o.push(r),e.db.bulkDocs({docs:o})}))}))}(e,t,n)}}var u=new
|
|
1220
|
+
return r.seq=n,o.push(r),e.db.bulkDocs({docs:o})}))}))}(e,t,n)}}var u=new xn;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 Pn(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){
|
|
1217
1221
|
// implicit migration - in older versions of PouchDB,
|
|
1218
1222
|
// we explicitly stored the doc as {id: ..., key: ..., value: ...}
|
|
1219
1223
|
// this is tested in a migration test
|
|
@@ -1223,7 +1227,7 @@ if("value"in e.doc&&"object"==typeof e.doc.value&&null!==e.doc.value){var t=Obje
|
|
|
1223
1227
|
// emitted a value which was an object with these 3 exact keys
|
|
1224
1228
|
if(!(t<n||t>n))return e.doc.value}var r=function(e){
|
|
1225
1229
|
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
|
|
1226
|
-
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=
|
|
1230
|
+
for(var t=[],n=[],r=0;;){var o=e[r++];if("\0"!==o)switch(o){case"1":t.push(null);break;case"2":t.push("1"===e[r]),r++;break;case"3":var i=vt(e,r);t.push(i.num),r+=i.length;break;case"4":
|
|
1227
1231
|
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
|
|
1228
1232
|
for(var s="";;){var a=e[r];if("\0"===a)break;s+=a,r++}
|
|
1229
1233
|
// perform the reverse of the order-preserving replacement
|
|
@@ -1231,21 +1235,21 @@ for(var s="";;){var a=e[r];if("\0"===a)break;s+=a,r++}
|
|
|
1231
1235
|
/* eslint-disable no-control-regex */s=s.replace(/\u0001\u0001/g,"\0").replace(/\u0001\u0002/g,"").replace(/\u0002\u0002/g,""),
|
|
1232
1236
|
/* eslint-enable no-control-regex */
|
|
1233
1237
|
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;
|
|
1234
|
-
/* istanbul ignore next */default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+o)}else{if(1===t.length)return t.pop();
|
|
1238
|
+
/* istanbul ignore next */default:throw new Error("bad collationIndex or unexpectedly reached end of input: "+o)}else{if(1===t.length)return t.pop();yt(t,n)}}}(e.doc._id);return{key:r[0],id:r[1],value:"value"in e.doc?e.doc.value:null}}))}))}function 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 $n;if(/^_stats/.test(e))return Fn;if(/^_/.test(e))throw new Error(e+" is not a supported reduce function.")}(t);return n||Cn(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(
|
|
1235
1239
|
// only set group_level for array keys
|
|
1236
|
-
r&&Array.isArray(n)&&(n=n.slice(0,s)),t&&0===
|
|
1240
|
+
r&&Array.isArray(n)&&(n=n.slice(0,s)),t&&0===dt(t.groupKey,n))return t.keys.push([e.key,e.id]),void t.values.push(e.value);i.push({keys:[[e.key,e.id]],values:[e.value],groupKey:n})})),t=[];for(var 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 On)
|
|
1237
1241
|
// CouchDB returns an error if a built-in errors out
|
|
1238
1242
|
throw d.error;t.push({
|
|
1239
1243
|
// CouchDB just sets the value to null if a non-built-in errors out
|
|
1240
1244
|
value:d.error?null:d.output,key:f.groupKey})}
|
|
1241
1245
|
// no total_rows/offset when reducing
|
|
1242
1246
|
return{rows:l(t,n.limit,n.skip)}}(e,s,t):{total_rows:n,offset:o,rows:s}
|
|
1243
|
-
/* istanbul ignore if */,t.update_seq&&(a.update_seq=e.seq),t.include_docs){var c=
|
|
1247
|
+
/* istanbul ignore if */,t.update_seq&&(a.update_seq=e.seq),t.include_docs){var c=Sn(s.map(d));return e.sourceDB.allDocs({keys:c,include_docs:!0,conflicts:t.conflicts,attachments:t.attachments,binary:t.binary}).then((function(e){var t=new i;return e.rows.forEach((function(e){t.set(e.id,e.doc)})),s.forEach((function(e){var n=d(e),r=t.get(n);r&&(e.doc=r)})),a}))}return a}if(void 0===t.keys||t.keys.length||(
|
|
1244
1248
|
// equivalent query
|
|
1245
|
-
t.limit=0,delete t.keys),void 0!==t.keys){var c=t.keys.map((function(e){var n={startkey:
|
|
1246
|
-
/* istanbul ignore if */return t.update_seq&&(n.update_seq=!0),s(n)}));return Promise.all(c).then(
|
|
1249
|
+
t.limit=0,delete t.keys),void 0!==t.keys){var c=t.keys.map((function(e){var n={startkey:pt([e]),endkey:pt([e,{}])};
|
|
1250
|
+
/* 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'
|
|
1247
1251
|
var f,h,p={descending:t.descending};
|
|
1248
|
-
/* 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?
|
|
1252
|
+
/* istanbul ignore if */if(t.update_seq&&(p.update_seq=!0),"start_key"in t&&(f=t.start_key),"startkey"in t&&(f=t.startkey),"end_key"in t&&(h=t.end_key),"endkey"in t&&(h=t.endkey),void 0!==f&&(p.startkey=t.descending?pt([f,{}]):pt([f])),void 0!==h){var v=!1!==t.inclusive_end;t.descending&&(v=!v),p.endkey=pt(v?[h,{}]:[h])}if(void 0!==t.key){var y=pt([t.key]),g=pt([t.key,{}]);p.descending?(p.endkey=y,p.startkey=g):(p.startkey=y,p.endkey=g)}return r||("number"==typeof t.limit&&(p.limit=t.limit),p.skip=o),s(p).then(a)}(e,t)}))()}function O(t,n,r){
|
|
1249
1253
|
/* istanbul ignore next */
|
|
1250
1254
|
if("function"==typeof t._query)
|
|
1251
1255
|
// custom adapters can define their own api._query
|
|
@@ -1254,7 +1258,7 @@ if("function"==typeof t._query)
|
|
|
1254
1258
|
return function(e,t,n){return new Promise((function(r,o){e._query(t,n,(function(e,t){if(e)return o(e);r(t)}))}))}
|
|
1255
1259
|
// custom adapters can define their own api._viewCleanup
|
|
1256
1260
|
// and override the default behavior
|
|
1257
|
-
/* istanbul ignore next */(t,n,r);if(
|
|
1261
|
+
/* istanbul ignore next */(t,n,r);if(ne(t))return function(e,t,n){
|
|
1258
1262
|
// List of parameters to add to the PUT request
|
|
1259
1263
|
var r,o,i,s=[],a="GET";
|
|
1260
1264
|
// If keys are supplied, issue a POST to circumvent GET query string limits
|
|
@@ -1275,15 +1279,15 @@ u.length+s.length+1<=2e3?
|
|
|
1275
1279
|
s+=("?"===s[0]?"&":"?")+u:(a="POST","string"==typeof t?r={keys:n.keys}:// fun is {map : mapfun}, so append to this
|
|
1276
1280
|
t.keys=n.keys)}
|
|
1277
1281
|
// We are referencing a query defined in the design doc
|
|
1278
|
-
if("string"==typeof t){var c=
|
|
1282
|
+
if("string"==typeof t){var c=Nn(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,Y(e);
|
|
1279
1283
|
// fail the entire request if the result contains an error
|
|
1280
1284
|
return e.rows.forEach((function(e){
|
|
1281
1285
|
/* istanbul ignore if */
|
|
1282
1286
|
if(e.value&&e.value.error&&"builtin_reduce_error"===e.value.error)throw new Error(e.reason)})),e})).then(h(n))}
|
|
1283
1287
|
// We are using a temporary view, terrible for performance, good for testing
|
|
1284
|
-
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
|
|
1288
|
+
return r=r||{},Object.keys(t).forEach((function(e){Array.isArray(t[e])?r[e]=t[e]:r[e]=t[e].toString()})),e.fetch("_temp_view"+s,{headers:new tt({"Content-Type":"application/json"}),method:"POST",body:JSON.stringify(r)}).then((function(e){return o=e.ok,i=e.status,e.json()})).then((function(e){if(!o)throw e.status=i,Y(e);return e})).then(h(n))}(t,n,r);if("string"!=typeof n)
|
|
1285
1289
|
// temp_view
|
|
1286
|
-
return y(r,n),
|
|
1290
|
+
return y(r,n),Bn.add((function(){return Dn(
|
|
1287
1291
|
/* sourceDB */t,
|
|
1288
1292
|
/* viewName */"temp_view/temp_view",
|
|
1289
1293
|
/* mapFun */n.map,
|
|
@@ -1291,30 +1295,30 @@ return y(r,n),Mn.add((function(){return Ln(
|
|
|
1291
1295
|
/* temporary */!0,
|
|
1292
1296
|
/* 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}))}));
|
|
1293
1297
|
// Promise finally util similar to Q.finally
|
|
1294
|
-
var t,n}))})),
|
|
1298
|
+
var t,n}))})),Bn.finish();
|
|
1295
1299
|
// persistent view
|
|
1296
|
-
var o=n,i=
|
|
1300
|
+
var o=n,i=Nn(o),a=i[0],u=i[1];return t.get("_design/"+a).then((function(n){var i=n.views&&n.views[u];if(!i)
|
|
1297
1301
|
// basic validator; it's assumed that every subclass would want this
|
|
1298
|
-
throw new
|
|
1302
|
+
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),Dn(
|
|
1299
1303
|
/* sourceDB */t,
|
|
1300
1304
|
/* viewName */o,
|
|
1301
1305
|
/* mapFun */i.map,
|
|
1302
1306
|
/* reduceFun */i.reduce,
|
|
1303
1307
|
/* temporary */!1,
|
|
1304
|
-
/* 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 k;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 O(r,e,t)}));return
|
|
1305
|
-
/* 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):
|
|
1308
|
+
/* localDocName */e).then((function(e){return"ok"===r.stale||"update_after"===r.stale?("update_after"===r.stale&&s((function(){b(e)})),w(e,r)):b(e).then((function(){return w(e,r)}))}))}))}var k;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 O(r,e,t)}));return kn(o,n),o},viewCleanup:(k=function(){var t=this;
|
|
1309
|
+
/* istanbul ignore next */return"function"==typeof t._viewCleanup?function(e){return new Promise((function(t,n){e._viewCleanup((function(e,r){if(e)return n(e);t(r)}))}))}(t):ne(t)?function(e){return e.fetch("_view_cleanup",{headers:new tt({"Content-Type":"application/json"}),method:"POST"}).then((function(e){return e.json()}))}(t):function(t){return t.get("_local/"+e).then((function(e){var n=new i;Object.keys(e.views).forEach((function(e){var t=Nn(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:jn(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/'
|
|
1306
1310
|
n.get(t.key).forEach((function(n){var i=r+"/"+n;
|
|
1307
1311
|
/* istanbul ignore if */e.views[i]||(
|
|
1308
1312
|
// new format, without slashes, to support PouchDB 2.2.0
|
|
1309
1313
|
// migration test in pouchdb's browser.migration.js verifies this
|
|
1310
1314
|
i=n);var s=Object.keys(e.views[i]),a=t.doc&&t.doc.views&&t.doc.views[n];
|
|
1311
1315
|
// design doc deleted, or view function nonexistent
|
|
1312
|
-
s.forEach((function(e){o[e]=o[e]||a}))}))}));var i=Object.keys(o).filter((function(e){return!o[e]})).map((function(e){return
|
|
1316
|
+
s.forEach((function(e){o[e]=o[e]||a}))}))}));var i=Object.keys(o).filter((function(e){return!o[e]})).map((function(e){return Pn(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=k.apply(this,e);return"function"==typeof t&&kn(n,t),n})))}}("mrviews"),Kn={query:function(e,t,n){return Hn.query.call(this,e,t,n)},viewCleanup:function(e){return Hn.viewCleanup.call(this,e)}};function Jn(e){return/^1-/.test(e)}function Xn(e,t){var n=Object.keys(t._attachments);return Promise.all(n.map((function(n){return e.getAttachment(t._id,n,{rev:t._rev})})))}
|
|
1313
1317
|
// Fetch all the documents from the src as described in the "diffs",
|
|
1314
1318
|
// which is a mapping of docs IDs to revisions. If the state ever
|
|
1315
1319
|
// changes to "cancelled", then the returned promise will be rejected.
|
|
1316
1320
|
// Else it will be resolved with a list of fetched documents.
|
|
1317
|
-
var
|
|
1321
|
+
var Vn="pouchdb";function zn(e,t,n,r,o){return e.get(t).catch((function(n){if(404===n.status)return"http"!==e.adapter&&"https"!==e.adapter||x(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)
|
|
1318
1322
|
// Filter out current entry for this replication
|
|
1319
1323
|
return i.history=(i.history||[]).filter((function(e){return e.session_id!==r})),
|
|
1320
1324
|
// Add the latest checkpoint to history
|
|
@@ -1322,47 +1326,47 @@ i.history.unshift({last_seq:n,session_id:r}),
|
|
|
1322
1326
|
// Just take the last pieces in history, to
|
|
1323
1327
|
// avoid really big checkpoint docs.
|
|
1324
1328
|
// see comment on history size above
|
|
1325
|
-
i.history=i.history.slice(0,5),i.version=1,i.replicator=
|
|
1329
|
+
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)
|
|
1326
1330
|
// retry; someone is trying to write a checkpoint simultaneously
|
|
1327
|
-
return
|
|
1331
|
+
return zn(e,t,n,r,o);throw i}));
|
|
1328
1332
|
// if the checkpoint has not changed, do not update
|
|
1329
|
-
}))}function
|
|
1333
|
+
}))}function Gn(e,t,n,r,o){this.src=e,this.target=t,this.id=n,this.returnValue=r,this.opts=o||{}}Gn.prototype.writeCheckpoint=function(e,t){var n=this;return this.updateTarget(e,t).then((function(){return n.updateSource(e,t)}))},Gn.prototype.updateTarget=function(e,t){return this.opts.writeTargetCheckpoint?zn(this.target,this.id,e,t,this.returnValue):Promise.resolve(!0)},Gn.prototype.updateSource=function(e,t){if(this.opts.writeSourceCheckpoint){var n=this;return zn(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 Wn={undefined:function(e,t){
|
|
1330
1334
|
// This is the previous comparison function
|
|
1331
|
-
return 0===
|
|
1335
|
+
return 0===dt(e.last_seq,t.last_seq)?t.last_seq:0
|
|
1332
1336
|
/* istanbul ignore next */},1:function(e,t){
|
|
1333
1337
|
// This is the comparison function ported from CouchDB
|
|
1334
1338
|
// This checkpoint comparison is ported from CouchDBs source
|
|
1335
1339
|
// they come from here:
|
|
1336
1340
|
// https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906
|
|
1337
|
-
return function(e,t){return e.session_id===t.session_id?{last_seq:e.last_seq,history:e.history}:
|
|
1341
|
+
return function(e,t){return e.session_id===t.session_id?{last_seq:e.last_seq,history:e.history}:Qn(e.history,t.history)}(t,e).last_seq}};function Qn(e,t){
|
|
1338
1342
|
// the erlang loop via function arguments is not so easy to repeat in JS
|
|
1339
1343
|
// therefore, doing this as recursion
|
|
1340
1344
|
var n=e[0],r=e.slice(1),o=t[0],i=t.slice(1);return n&&0!==t.length?
|
|
1341
1345
|
/* istanbul ignore if */
|
|
1342
|
-
|
|
1346
|
+
Yn(n.session_id,t)?{last_seq:n.last_seq,history:e}:Yn(o.session_id,r)?{last_seq:o.last_seq,history:i}:Qn(r,i):{last_seq:0,history:[]}}function Yn(e,t){var n=t[0],r=t.slice(1);return!(!e||0===t.length)&&(e===n.session_id||Yn(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,O=[],k=Te();// list of batches to be processed
|
|
1343
1347
|
o=o||{ok:!0,start_time:(new Date).toISOString(),docs_read:0,docs_written:0,doc_write_failures:0,errors:[]};var P={};function S(){return u?Promise.resolve():
|
|
1344
1348
|
// Generate a unique id particular to this replication.
|
|
1345
1349
|
// Not guaranteed to align perfectly with CouchDB's rep ids.
|
|
1346
|
-
function(e,t,n){var r=n.doc_ids?n.doc_ids.sort(
|
|
1350
|
+
function(e,t,n){var r=n.doc_ids?n.doc_ids.sort(dt):"",o=n.filter?n.filter.toString():"",i="",s="",a="";
|
|
1347
1351
|
// possibility for checkpoints to be lost here as behaviour of
|
|
1348
1352
|
// JSON.stringify is not stable (see #6226)
|
|
1349
|
-
/* 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(
|
|
1353
|
+
/* 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){Pe(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 Gn(e,t,a,r,i)}))}function j(){if(O=[],0!==i.docs.length){var e=i.docs,s={timeout:n.timeout};return t.bulkDocs({docs:e,new_edits:!1},s).then((function(t){
|
|
1350
1354
|
/* istanbul ignore if */
|
|
1351
1355
|
if(r.cancelled)throw x(),new Error("cancelled");
|
|
1352
1356
|
// `res` doesn't include full documents (which live in `docs`), so we create a map of
|
|
1353
1357
|
// (id -> error), and check for errors while iterating over `docs`
|
|
1354
1358
|
var n=Object.create(null);t.forEach((function(e){e.error&&(n[e.id]=e)}));var i=Object.keys(n).length;o.doc_write_failures+=i,o.docs_written+=e.length-i,e.forEach((function(e){var t=n[e._id];if(t){o.errors.push(t);
|
|
1355
1359
|
// Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
|
|
1356
|
-
var i=(t.name||"").toLowerCase();if("unauthorized"!==i&&"forbidden"!==i)throw t;r.emit("denied",
|
|
1360
|
+
var i=(t.name||"").toLowerCase();if("unauthorized"!==i&&"forbidden"!==i)throw t;r.emit("denied",w(t))}else O.push(e)}))}),(function(t){throw o.doc_write_failures+=e.length,t}))}}function T(){if(i.error)throw new Error("There was a problem getting docs.");o.last_seq=p=i.seq;var e=w(o);return O.length&&(e.docs=O,
|
|
1357
1361
|
// Attach 'pending' property if server supports it (CouchDB 2.0+)
|
|
1358
1362
|
/* istanbul ignore if */
|
|
1359
1363
|
"number"==typeof i.pending&&(e.pending=i.pending,delete i.pending),r.emit("change",e)),l=!0,u.writeCheckpoint(i.seq,k).then((function(){
|
|
1360
1364
|
/* istanbul ignore if */
|
|
1361
|
-
if(l=!1,r.cancelled)throw x(),new Error("cancelled");i=void 0,B()})).catch((function(e){throw I(e),e}))}function E(){return function(e,t,n,r){n=
|
|
1365
|
+
if(l=!1,r.cancelled)throw x(),new Error("cancelled");i=void 0,B()})).catch((function(e){throw I(e),e}))}function E(){return function(e,t,n,r){n=w(n);// we do not need to modify this
|
|
1362
1366
|
var o=[],i=!0;function s(t){
|
|
1363
1367
|
// Optimization: fetch gen-1 docs and attachments in
|
|
1364
1368
|
// a single request using _all_docs
|
|
1365
|
-
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||!
|
|
1369
|
+
return e.allDocs({keys:t,include_docs:!0,conflicts:!0}).then((function(e){if(r.cancelled)throw new Error("cancelled");e.rows.forEach((function(e){var t;e.deleted||!e.doc||!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)||(
|
|
1366
1370
|
// strip _conflicts array to appease CSG (#5793)
|
|
1367
1371
|
/* istanbul ignore if */
|
|
1368
1372
|
e.doc._conflicts&&delete e.doc._conflicts,
|
|
@@ -1370,31 +1374,31 @@ e.doc._conflicts&&delete e.doc._conflicts,
|
|
|
1370
1374
|
o.push(e.doc),delete n[e.id])}))}))}return Promise.resolve().then((function(){
|
|
1371
1375
|
// filter out the generation 1 docs and get them
|
|
1372
1376
|
// leaving the non-generation one docs to be got otherwise
|
|
1373
|
-
var e=Object.keys(n).filter((function(e){var t=n[e].missing;return 1===t.length&&
|
|
1377
|
+
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){
|
|
1374
1378
|
/* istanbul ignore if */
|
|
1375
1379
|
if(r.cancelled)throw new Error("cancelled");return Promise.all(n.results.map((function(n){return Promise.all(n.docs.map((function(n){var r=n.ok;return n.error&&(
|
|
1376
1380
|
// when AUTO_COMPACTION is set, docs can be returned which look
|
|
1377
1381
|
// like this: {"missing":"1-7c3ac256b693c462af8442f992b83696"}
|
|
1378
|
-
i=!1),r&&r._attachments?function(e,t,n){var r=
|
|
1382
|
+
i=!1),r&&r._attachments?function(e,t,n){var r=ne(t)&&!ne(e),o=Object.keys(n._attachments);return r?e.get(n._id).then((function(r){return Promise.all(o.map((function(o){return function(e,t,n){return!e._attachments||!e._attachments[n]||e._attachments[n].digest!==t._attachments[n].digest}(r,n,o)?t.getAttachment(n._id,o):e.getAttachment(r._id,o)})))})).catch((function(e){
|
|
1379
1383
|
/* istanbul ignore if */
|
|
1380
|
-
if(404!==e.status)throw e;return
|
|
1384
|
+
if(404!==e.status)throw e;return Xn(t,n)})):Xn(t,n)}(t,e,r).then((function(e){var t=Object.keys(r._attachments);return e.forEach((function(e,n){var o=r._attachments[t[n]];delete o.stub,delete o.length,o.data=e})),r})):r})))}))).then((function(e){o=o.concat(ee(e).filter(Boolean))}))}))})).then((function(){return{ok:i,docs:o}}))}(e,t,i.diffs,r).then((function(e){i.error=!e.ok,e.docs.forEach((function(e){delete i.diffs[e._id],o.docs_read++,i.docs.push(e)}))}))}function q(){var e;r.cancelled||i||(0!==c.length?(i=c.shift(),(e={},i.changes.forEach((function(t){
|
|
1381
1385
|
// Couchbase Sync Gateway emits these, but we can ignore them
|
|
1382
1386
|
/* istanbul ignore if */
|
|
1383
1387
|
"_user/"!==t.id&&(e[t.id]=t.changes.map((function(e){return e.rev})))})),t.revsDiff(e).then((function(e){
|
|
1384
1388
|
/* istanbul ignore if */
|
|
1385
1389
|
if(r.cancelled)throw x(),new Error("cancelled");
|
|
1386
1390
|
// currentBatch.diffs elements are deleted as the documents are written
|
|
1387
|
-
i.diffs=e}))).then(E).then(j).then(T).then(q).catch((function(e){
|
|
1391
|
+
i.diffs=e}))).then(E).then(j).then(T).then(q).catch((function(e){A("batch processing terminated with error",e)}))):R(!0))}function R(e){0!==f.changes.length?(e||d||f.changes.length>=y)&&(c.push(f),f={seq:0,changes:[],docs:[]},"pending"!==r.state&&"stopped"!==r.state||(r.state="active",r.emit("active")),q()):0!==c.length||i||((v&&P.live||d)&&(r.state="pending",r.emit("paused")),d&&x())}function A(e,t){h||(t.message||(t.message=e),o.ok=!1,o.status="aborting",c=[],f={seq:0,changes:[],docs:[]},x(t))}function x(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){
|
|
1388
1392
|
// need to extend the error because Firefox considers ".result" read-only
|
|
1389
|
-
(i=
|
|
1393
|
+
(i=Q(i)).result=o;
|
|
1390
1394
|
// Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
|
|
1391
1395
|
var s=(i.name||"").toLowerCase();"unauthorized"===s||"forbidden"===s?(r.emit("error",i),r.removeAllListeners()):function(e,t,n,r){if(!1===e.retry)return t.emit("error",n),void t.removeAllListeners();
|
|
1392
|
-
/* istanbul ignore if */if("function"!=typeof e.back_off_function&&(e.back_off_function=
|
|
1396
|
+
/* istanbul ignore if */if("function"!=typeof e.back_off_function&&(e.back_off_function=C),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();
|
|
1393
1397
|
/* istanbul ignore if */}function L(e,t,o){
|
|
1394
1398
|
/* istanbul ignore if */
|
|
1395
1399
|
if(r.cancelled)return x();
|
|
1396
1400
|
// Attach 'pending' property if server supports it (CouchDB 2.0+)
|
|
1397
|
-
/* istanbul ignore if */"number"==typeof t&&(f.pending=t),
|
|
1401
|
+
/* istanbul ignore if */"number"==typeof t&&(f.pending=t),Z(n)(e)&&(f.seq=e.seq||o,f.changes.push(e),s((function(){R(0===c.length&&P.live)})))}function D(e){
|
|
1398
1402
|
/* istanbul ignore if */
|
|
1399
1403
|
if(_=!1,r.cancelled)return x();
|
|
1400
1404
|
// if no results were returned then we're done,
|
|
@@ -1403,30 +1407,30 @@ if(e.results.length>0)P.since=e.results[e.results.length-1].seq,B(),R(!0);else{v
|
|
|
1403
1407
|
// update the checkpoint so we start from the right seq next time
|
|
1404
1408
|
i||0!==e.results.length?t():(l=!0,u.writeCheckpoint(e.last_seq,k).then((function(){l=!1,o.last_seq=p=e.last_seq,t()})).catch(I))}}function M(e){
|
|
1405
1409
|
/* istanbul ignore if */
|
|
1406
|
-
if(_=!1,r.cancelled)return x();
|
|
1410
|
+
if(_=!1,r.cancelled)return x();A("changes rejected",e)}function B(){if(!_&&!d&&c.length<g){_=!0,r._changes&&(// remove old changes() and listeners
|
|
1407
1411
|
r.removeListener("cancel",r._abortChanges),r._changes.cancel()),r.once("cancel",o);var t=e.changes(P).on("change",L);t.then(i,i),t.then(D).catch(M),n.retry&&(
|
|
1408
1412
|
// save for later so we can cancel if necessary
|
|
1409
1413
|
r._changes=t,r._abortChanges=o)}function o(){t.cancel()}function i(){r.removeListener("cancel",o)}}function N(){S().then((function(){
|
|
1410
1414
|
/* istanbul ignore if */
|
|
1411
|
-
if(!r.cancelled)return u.getCheckpoint().then((function(e){P={since:p=e,limit:y,batch_size:y,style:"all_docs",doc_ids:m,selector:
|
|
1415
|
+
if(!r.cancelled)return u.getCheckpoint().then((function(e){P={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?
|
|
1412
1416
|
// required for the client-side filter in onChange
|
|
1413
1417
|
P.include_docs=!0:// ddoc filter
|
|
1414
|
-
P.filter=n.filter),"heartbeat"in n&&(P.heartbeat=n.heartbeat),"timeout"in n&&(P.timeout=n.timeout),n.query_params&&(P.query_params=n.query_params),n.view&&(P.view=n.view),B()}));x()})).catch((function(e){
|
|
1415
|
-
/* istanbul ignore next */function I(e){l=!1,
|
|
1418
|
+
P.filter=n.filter),"heartbeat"in n&&(P.heartbeat=n.heartbeat),"timeout"in n&&(P.timeout=n.timeout),n.query_params&&(P.query_params=n.query_params),n.view&&(P.view=n.view),B()}));x()})).catch((function(e){A("getCheckpoint rejected with ",e)}))}
|
|
1419
|
+
/* istanbul ignore next */function I(e){l=!1,A("writeCheckpoint completed with error",e)}
|
|
1416
1420
|
/* istanbul ignore if */r.ready(e,t),r.cancelled?// cancelled immediately
|
|
1417
1421
|
x():(r._addedListeners||(r.once("cancel",x),"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?N():S().then((function(){return l=!0,u.writeCheckpoint(n.since,k)})).then((function(){l=!1,
|
|
1418
1422
|
/* istanbul ignore if */
|
|
1419
1423
|
r.cancelled?x():(p=n.since,N())})).catch(I))}
|
|
1420
1424
|
// We create a basic promise so the caller can cancel the replication possibly
|
|
1421
1425
|
// before we have actually started listening to changes etc
|
|
1422
|
-
function
|
|
1426
|
+
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)},
|
|
1423
1427
|
// As we allow error handling via "error" event as well,
|
|
1424
1428
|
// put a stub in here so that rejecting never throws UnhandledError.
|
|
1425
|
-
e.catch((function(){}))}function
|
|
1429
|
+
e.catch((function(){}))}function nr(e,t){var n=t.PouchConstructor;return"string"==typeof e?new n(e,t):e}function rr(e,t,n,r){if("function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),n.doc_ids&&!Array.isArray(n.doc_ids))throw Q(X,"`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,
|
|
1426
1430
|
/*jshint validthis:true */
|
|
1427
|
-
n.PouchConstructor=n.PouchConstructor||this;var o=new
|
|
1431
|
+
n.PouchConstructor=n.PouchConstructor||this;var o=new tr(n);return er(nr(e,n),nr(t,n),n,o),o}function or(e,t,n,r){return"function"==typeof n&&(r=n,n={}),void 0===n&&(n={}),
|
|
1428
1432
|
/*jshint validthis:true */
|
|
1429
|
-
(n=
|
|
1433
|
+
(n=w(n)).PouchConstructor=n.PouchConstructor||this,new ir(e=nr(e,n),t=nr(t,n),n,r)}function ir(e,t,n,r){var o=this;this.canceled=!1;var i=n.push?L({},n,n.push):n,s=n.pull?L({},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,
|
|
1430
1434
|
/* istanbul ignore if */
|
|
1431
1435
|
o.pullPaused&&o.emit("paused")}function d(){o.pullPaused=!0,
|
|
1432
1436
|
/* istanbul ignore if */
|
|
@@ -1434,7 +1438,7 @@ o.pushPaused&&o.emit("paused")}function h(){o.pushPaused=!1,
|
|
|
1434
1438
|
/* istanbul ignore if */
|
|
1435
1439
|
o.pullPaused&&o.emit("active",{direction:"push"})}function p(){o.pullPaused=!1,
|
|
1436
1440
|
/* istanbul ignore if */
|
|
1437
|
-
o.pushPaused&&o.emit("active",{direction:"pull"})}this.push=
|
|
1441
|
+
o.pushPaused&&o.emit("active",{direction:"pull"})}this.push=rr(e,t,i),this.pull=rr(t,e,s),this.pushPaused=!0,this.pullPaused=!0;var v={};function y(e){// type is 'push' or 'pull'
|
|
1438
1442
|
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&&
|
|
1439
1443
|
// both push and pull have asked to be removed
|
|
1440
1444
|
o.removeAllListeners(t))}}function g(e,t,n){-1==e.listeners(t).indexOf(n)&&e.on(t,n)}n.live&&(this.push.on("complete",o.pull.cancel.bind(o.pull)),this.pull.on("complete",o.push.cancel.bind(o.push))),this.on("newListener",(function(e){"change"===e?(g(o.pull,"change",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?
|
|
@@ -1446,123 +1450,15 @@ r(e):
|
|
|
1446
1450
|
// due to 'error' being a special event in EventEmitters
|
|
1447
1451
|
o.emit("error",e),o.removeAllListeners(),r)
|
|
1448
1452
|
// no sense throwing if we're already emitting an 'error' event
|
|
1449
|
-
throw e}));this.then=function(e,t){return _.then(e,t)},this.catch=function(e){return _.catch(e)}}
|
|
1453
|
+
throw e}));this.then=function(e,t){return _.then(e,t)},this.catch=function(e){return _.catch(e)}}Gn.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){
|
|
1450
1454
|
/* istanbul ignore if */
|
|
1451
1455
|
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){
|
|
1452
1456
|
// Since we can't migrate an old version doc to a new one
|
|
1453
1457
|
// (no session id), we just go with the lowest seq in this case
|
|
1454
1458
|
/* istanbul ignore if */
|
|
1455
|
-
return t.version!==e.version?0:(n=t.version?t.version.toString():"undefined")in
|
|
1456
|
-
/* 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
|
|
1457
|
-
/* istanbul ignore next */}));throw n}))})).catch((function(e){if(404!==e.status)throw e;return 0}))},l(
|
|
1458
|
-
// implementation from standard node.js 'util' module
|
|
1459
|
-
t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:
|
|
1460
|
-
// old school shim for old browsers
|
|
1461
|
-
t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],12:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;
|
|
1462
|
-
/**
|
|
1463
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
1464
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
1465
|
-
*/
|
|
1466
|
-
const r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).substr(1));n.default=function(e,t){const n=t||0,o=r;// Note: Be careful editing this code! It's been tuned for performance
|
|
1467
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
1468
|
-
return(o[e[n+0]]+o[e[n+1]]+o[e[n+2]]+o[e[n+3]]+"-"+o[e[n+4]]+o[e[n+5]]+"-"+o[e[n+6]]+o[e[n+7]]+"-"+o[e[n+8]]+o[e[n+9]]+"-"+o[e[n+10]]+o[e[n+11]]+o[e[n+12]]+o[e[n+13]]+o[e[n+14]]+o[e[n+15]]).toLowerCase()}},{}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return s.default}});var r=a(e("./v1.js")),o=a(e("./v3.js")),i=a(e("./v4.js")),s=a(e("./v5.js"));function a(e){return e&&e.__esModule?e:{default:e}}},{"./v1.js":17,"./v3.js":18,"./v4.js":20,"./v5.js":21}],14:[function(e,t,n){"use strict";
|
|
1469
|
-
/**
|
|
1470
|
-
* Calculate output length with padding and bit length
|
|
1471
|
-
*/function r(e){return 14+(e+64>>>9<<4)+1}
|
|
1472
|
-
/*
|
|
1473
|
-
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
|
1474
|
-
*/
|
|
1475
|
-
/*
|
|
1476
|
-
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
1477
|
-
* to work around bugs in some JS interpreters.
|
|
1478
|
-
*/function o(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}
|
|
1479
|
-
/*
|
|
1480
|
-
* Bitwise rotate a 32-bit number to the left.
|
|
1481
|
-
*/
|
|
1482
|
-
/*
|
|
1483
|
-
* These functions implement the four basic operations the algorithm uses.
|
|
1484
|
-
*/function i(e,t,n,r,i,s){return o((a=o(o(t,e),o(r,s)))<<(u=i)|a>>>32-u,n);var a,u}function s(e,t,n,r,o,s,a){return i(t&n|~t&r,e,t,o,s,a)}function a(e,t,n,r,o,s,a){return i(t&r|n&~r,e,t,o,s,a)}function u(e,t,n,r,o,s,a){return i(t^n^r,e,t,o,s,a)}function c(e,t,n,r,o,s,a){return i(n^(t|~r),e,t,o,s,a)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=
|
|
1485
|
-
/*
|
|
1486
|
-
* Browser-compatible JavaScript MD5
|
|
1487
|
-
*
|
|
1488
|
-
* Modification of JavaScript MD5
|
|
1489
|
-
* https://github.com/blueimp/JavaScript-MD5
|
|
1490
|
-
*
|
|
1491
|
-
* Copyright 2011, Sebastian Tschan
|
|
1492
|
-
* https://blueimp.net
|
|
1493
|
-
*
|
|
1494
|
-
* Licensed under the MIT license:
|
|
1495
|
-
* https://opensource.org/licenses/MIT
|
|
1496
|
-
*
|
|
1497
|
-
* Based on
|
|
1498
|
-
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
1499
|
-
* Digest Algorithm, as defined in RFC 1321.
|
|
1500
|
-
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
|
1501
|
-
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
1502
|
-
* Distributed under the BSD License
|
|
1503
|
-
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
1504
|
-
*/
|
|
1505
|
-
function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));// UTF8 escape
|
|
1506
|
-
e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}
|
|
1507
|
-
/*
|
|
1508
|
-
* Convert an array of little-endian words to an array of bytes
|
|
1509
|
-
*/return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(i)}return t}(function(e,t){
|
|
1510
|
-
/* append padding */
|
|
1511
|
-
e[t>>5]|=128<<t%32,e[r(t)-1]=t;let n=1732584193,i=-271733879,f=-1732584194,l=271733878;for(let t=0;t<e.length;t+=16){const r=n,d=i,h=f,p=l;n=s(n,i,f,l,e[t],7,-680876936),l=s(l,n,i,f,e[t+1],12,-389564586),f=s(f,l,n,i,e[t+2],17,606105819),i=s(i,f,l,n,e[t+3],22,-1044525330),n=s(n,i,f,l,e[t+4],7,-176418897),l=s(l,n,i,f,e[t+5],12,1200080426),f=s(f,l,n,i,e[t+6],17,-1473231341),i=s(i,f,l,n,e[t+7],22,-45705983),n=s(n,i,f,l,e[t+8],7,1770035416),l=s(l,n,i,f,e[t+9],12,-1958414417),f=s(f,l,n,i,e[t+10],17,-42063),i=s(i,f,l,n,e[t+11],22,-1990404162),n=s(n,i,f,l,e[t+12],7,1804603682),l=s(l,n,i,f,e[t+13],12,-40341101),f=s(f,l,n,i,e[t+14],17,-1502002290),i=s(i,f,l,n,e[t+15],22,1236535329),n=a(n,i,f,l,e[t+1],5,-165796510),l=a(l,n,i,f,e[t+6],9,-1069501632),f=a(f,l,n,i,e[t+11],14,643717713),i=a(i,f,l,n,e[t],20,-373897302),n=a(n,i,f,l,e[t+5],5,-701558691),l=a(l,n,i,f,e[t+10],9,38016083),f=a(f,l,n,i,e[t+15],14,-660478335),i=a(i,f,l,n,e[t+4],20,-405537848),n=a(n,i,f,l,e[t+9],5,568446438),l=a(l,n,i,f,e[t+14],9,-1019803690),f=a(f,l,n,i,e[t+3],14,-187363961),i=a(i,f,l,n,e[t+8],20,1163531501),n=a(n,i,f,l,e[t+13],5,-1444681467),l=a(l,n,i,f,e[t+2],9,-51403784),f=a(f,l,n,i,e[t+7],14,1735328473),i=a(i,f,l,n,e[t+12],20,-1926607734),n=u(n,i,f,l,e[t+5],4,-378558),l=u(l,n,i,f,e[t+8],11,-2022574463),f=u(f,l,n,i,e[t+11],16,1839030562),i=u(i,f,l,n,e[t+14],23,-35309556),n=u(n,i,f,l,e[t+1],4,-1530992060),l=u(l,n,i,f,e[t+4],11,1272893353),f=u(f,l,n,i,e[t+7],16,-155497632),i=u(i,f,l,n,e[t+10],23,-1094730640),n=u(n,i,f,l,e[t+13],4,681279174),l=u(l,n,i,f,e[t],11,-358537222),f=u(f,l,n,i,e[t+3],16,-722521979),i=u(i,f,l,n,e[t+6],23,76029189),n=u(n,i,f,l,e[t+9],4,-640364487),l=u(l,n,i,f,e[t+12],11,-421815835),f=u(f,l,n,i,e[t+15],16,530742520),i=u(i,f,l,n,e[t+2],23,-995338651),n=c(n,i,f,l,e[t],6,-198630844),l=c(l,n,i,f,e[t+7],10,1126891415),f=c(f,l,n,i,e[t+14],15,-1416354905),i=c(i,f,l,n,e[t+5],21,-57434055),n=c(n,i,f,l,e[t+12],6,1700485571),l=c(l,n,i,f,e[t+3],10,-1894986606),f=c(f,l,n,i,e[t+10],15,-1051523),i=c(i,f,l,n,e[t+1],21,-2054922799),n=c(n,i,f,l,e[t+8],6,1873313359),l=c(l,n,i,f,e[t+15],10,-30611744),f=c(f,l,n,i,e[t+6],15,-1560198380),i=c(i,f,l,n,e[t+13],21,1309151649),n=c(n,i,f,l,e[t+4],6,-145523070),l=c(l,n,i,f,e[t+11],10,-1120210379),f=c(f,l,n,i,e[t+2],15,718787259),i=c(i,f,l,n,e[t+9],21,-343485551),n=o(n,r),i=o(i,d),f=o(f,h),l=o(l,p)}return[n,i,f,l]}
|
|
1512
|
-
/*
|
|
1513
|
-
* Convert an array bytes to an array of little-endian words
|
|
1514
|
-
* Characters >255 have their high-byte silently ignored.
|
|
1515
|
-
*/(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}},{}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)};
|
|
1516
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
1517
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
1518
|
-
// generators (like Math.random()).
|
|
1519
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
1520
|
-
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
1521
|
-
const r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16)},{}],16:[function(e,t,n){"use strict";
|
|
1522
|
-
// Adapted from Chris Veness' SHA1 code at
|
|
1523
|
-
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
1524
|
-
function r(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1: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
|
|
1525
|
-
e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}e.push(128);const i=e.length/4+2,s=Math.ceil(i/16),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}}
|
|
1526
|
-
// **`v1()` - Generate time-based UUID**
|
|
1527
|
-
// Inspired by https://github.com/LiosK/UUID.js
|
|
1528
|
-
// and http://docs.python.org/library/uuid.html
|
|
1529
|
-
let s,a,u=0,c=0;n.default=// See https://github.com/uuidjs/uuid for API details
|
|
1530
|
-
function(e,t,n){let i=t&&n||0;const f=t||[];let l=(e=e||{}).node||s,d=void 0!==e.clockseq?e.clockseq:a;// node and clockseq need to be initialized to random values if they're not
|
|
1531
|
-
// specified. We do this lazily to minimize issues related to insufficient
|
|
1532
|
-
// system entropy. See #189
|
|
1533
|
-
if(null==l||null==d){const t=e.random||(e.rng||r.default)();null==l&&(
|
|
1534
|
-
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
1535
|
-
l=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==d&&(
|
|
1536
|
-
// Per 4.2.2, randomize (14 bit) clockseq
|
|
1537
|
-
d=a=16383&(t[6]<<8|t[7]))}// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
1538
|
-
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
1539
|
-
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
1540
|
-
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
1541
|
-
let h=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:c+1;// Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
1542
|
-
// cycle to simulate higher resolution clock
|
|
1543
|
-
// Time since last uuid creation (in msecs)
|
|
1544
|
-
const v=h-u+(p-c)/1e4;// Per 4.2.1.2, Bump clockseq on clock regression
|
|
1545
|
-
// Per 4.2.1.2 Throw error if too many uuids are requested
|
|
1546
|
-
if(v<0&&void 0===e.clockseq&&(d=d+1&16383),// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
1547
|
-
// time interval
|
|
1548
|
-
(v<0||h>u)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=h,c=p,a=d,// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
1549
|
-
h+=122192928e5;// `time_low`
|
|
1550
|
-
const y=(1e4*(268435455&h)+p)%4294967296;f[i++]=y>>>24&255,f[i++]=y>>>16&255,f[i++]=y>>>8&255,f[i++]=255&y;// `time_mid`
|
|
1551
|
-
const g=h/4294967296*1e4&268435455;f[i++]=g>>>8&255,f[i++]=255&g,// `time_high_and_version`
|
|
1552
|
-
f[i++]=g>>>24&15|16,// include version
|
|
1553
|
-
f[i++]=g>>>16&255,// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
1554
|
-
f[i++]=d>>>8|128,// `clock_seq_low`
|
|
1555
|
-
f[i++]=255&d;// `node`
|
|
1556
|
-
for(let e=0;e<6;++e)f[i+e]=l[e];return t||(0,o.default)(f)}},{"./bytesToUuid.js":12,"./rng.js":15}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./v35.js")),o=i(e("./md5.js"));function i(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,o.default);n.default=s},{"./md5.js":14,"./v35.js":19}],19:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){function r(e,r,i,s){const a=i&&s||0;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));// UTF8 escape
|
|
1557
|
-
const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=function(e){
|
|
1558
|
-
// Note: We assume we're being passed a valid uuid string
|
|
1559
|
-
const t=[];return e.replace(/[a-fA-F0-9]{2}/g,(function(e){t.push(parseInt(e,16))})),t}(r)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(r)||16!==r.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");// Per 4.3
|
|
1560
|
-
const u=n(r.concat(e));if(u[6]=15&u[6]|t,u[8]=63&u[8]|128,i)for(let e=0;e<16;++e)i[a+e]=u[e];return i||(0,o.default)(u)}// Function#name is not settable on some platforms (#270)
|
|
1561
|
-
try{r.name=e;// eslint-disable-next-line no-empty
|
|
1562
|
-
}catch(e){}// For CommonJS default export support
|
|
1563
|
-
return r.DNS=i,r.URL=s,r},n.URL=n.DNS=void 0;var r,o=(r=e("./bytesToUuid.js"))&&r.__esModule?r:{default:r};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";n.DNS=i;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";n.URL=s},{"./bytesToUuid.js":12}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./rng.js")),o=i(e("./bytesToUuid.js"));function i(e){return e&&e.__esModule?e:{default:e}}n.default=function(e,t,n){"string"==typeof e&&(t="binary"===e?new Uint8Array(16):null,e=null);const i=(e=e||{}).random||(e.rng||r.default)();// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
1564
|
-
// Copy bytes to buffer, if provided
|
|
1565
|
-
if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){const e=n||0;for(let n=0;n<16;++n)t[e+n]=i[n];return t}return(0,o.default)(i)}},{"./bytesToUuid.js":12,"./rng.js":15}],21:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./v35.js")),o=i(e("./sha1.js"));function i(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,o.default);n.default=s},{"./sha1.js":16,"./v35.js":19}],22:[function(e,t,n){
|
|
1459
|
+
return t.version!==e.version?0:(n=t.version?t.version.toString():"undefined")in Wn?Wn[n](t,e):0
|
|
1460
|
+
/* istanbul ignore next */;var n}),(function(n){if(404===n.status&&t.last_seq)return e.src.put({_id:e.id,last_seq:0}).then((function(){return 0}),(function(n){return Zn(n)?(e.opts.writeSourceCheckpoint=!1,t.last_seq):0
|
|
1461
|
+
/* istanbul ignore next */}));throw n}))})).catch((function(e){if(404!==e.status)throw e;return 0}))},l(tr,d),tr.prototype.cancel=function(){this.cancelled=!0,this.state="cancelled",this.emit("cancel")},tr.prototype.ready=function(e,t){var n=this;function r(){n.cancel()}n._readyCalled||(n._readyCalled=!0,e.once("destroyed",r),t.once("destroyed",r),n.once("complete",(function(){e.removeListener("destroyed",r),t.removeListener("destroyed",r)})))},l(ir,d),ir.prototype.cancel=function(){this.canceled||(this.canceled=!0,this.push.cancel(),this.pull.cancel())},Ye.plugin((function(e){e.adapter("idb",fn,!0)})).plugin((function(e){e.adapter("http",mn,!1),e.adapter("https",mn,!1)})).plugin(Kn).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=Ye}).call(this)}).call(this,e("_process"))},{_process:12,argsarray:1,events:3,immediate:4,inherits:10,"spark-md5":13,uuid:15,vuvuzela:24}],12:[function(e,t,n){
|
|
1566
1462
|
// shim for using process in browser
|
|
1567
1463
|
var r,o,i=t.exports={};
|
|
1568
1464
|
// cached from whatever global is present so that test runners that stub it
|
|
@@ -1593,7 +1489,7 @@ return o.call(null,e)}catch(t){
|
|
|
1593
1489
|
return o.call(this,e)}}}(e)}}
|
|
1594
1490
|
// v8 likes predictible objects
|
|
1595
1491
|
function v(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new v(e,t)),1!==f.length||l||u(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",// empty string to avoid regexp issues
|
|
1596
|
-
i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],
|
|
1492
|
+
i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],13:[function(e,t,n){!function(e){if("object"==typeof n)
|
|
1597
1493
|
// Node/CommonJS
|
|
1598
1494
|
t.exports=e();else{
|
|
1599
1495
|
// Browser globals (with support for web workers)
|
|
@@ -1773,7 +1669,111 @@ f.ArrayBuffer.hash=function(e,t){var r=a(function(e){var t,r,i,s,a,u,c=e.length,
|
|
|
1773
1669
|
// https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue
|
|
1774
1670
|
for(r=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)i[t>>2]|=e[t]<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(n(f,i),t=0;t<16;t+=1)i[t]=0;
|
|
1775
1671
|
// Beware that the final length might not fit in 32 bits so we take care of that
|
|
1776
|
-
return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,i[14]=a,i[15]=u,n(f,i),f}(new Uint8Array(e)));return t?c(r):r},f}))},{}],
|
|
1672
|
+
return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,i[14]=a,i[15]=u,n(f,i),f}(new Uint8Array(e)));return t?c(r):r},f}))},{}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;
|
|
1673
|
+
/**
|
|
1674
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
1675
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
1676
|
+
*/
|
|
1677
|
+
const r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).substr(1));n.default=function(e,t){const n=t||0,o=r;// Note: Be careful editing this code! It's been tuned for performance
|
|
1678
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
1679
|
+
return(o[e[n+0]]+o[e[n+1]]+o[e[n+2]]+o[e[n+3]]+"-"+o[e[n+4]]+o[e[n+5]]+"-"+o[e[n+6]]+o[e[n+7]]+"-"+o[e[n+8]]+o[e[n+9]]+"-"+o[e[n+10]]+o[e[n+11]]+o[e[n+12]]+o[e[n+13]]+o[e[n+14]]+o[e[n+15]]).toLowerCase()}},{}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return s.default}});var r=a(e("./v1.js")),o=a(e("./v3.js")),i=a(e("./v4.js")),s=a(e("./v5.js"));function a(e){return e&&e.__esModule?e:{default:e}}},{"./v1.js":19,"./v3.js":20,"./v4.js":22,"./v5.js":23}],16:[function(e,t,n){"use strict";
|
|
1680
|
+
/**
|
|
1681
|
+
* Calculate output length with padding and bit length
|
|
1682
|
+
*/function r(e){return 14+(e+64>>>9<<4)+1}
|
|
1683
|
+
/*
|
|
1684
|
+
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
|
1685
|
+
*/
|
|
1686
|
+
/*
|
|
1687
|
+
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
1688
|
+
* to work around bugs in some JS interpreters.
|
|
1689
|
+
*/function o(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}
|
|
1690
|
+
/*
|
|
1691
|
+
* Bitwise rotate a 32-bit number to the left.
|
|
1692
|
+
*/
|
|
1693
|
+
/*
|
|
1694
|
+
* These functions implement the four basic operations the algorithm uses.
|
|
1695
|
+
*/function i(e,t,n,r,i,s){return o((a=o(o(t,e),o(r,s)))<<(u=i)|a>>>32-u,n);var a,u}function s(e,t,n,r,o,s,a){return i(t&n|~t&r,e,t,o,s,a)}function a(e,t,n,r,o,s,a){return i(t&r|n&~r,e,t,o,s,a)}function u(e,t,n,r,o,s,a){return i(t^n^r,e,t,o,s,a)}function c(e,t,n,r,o,s,a){return i(n^(t|~r),e,t,o,s,a)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=
|
|
1696
|
+
/*
|
|
1697
|
+
* Browser-compatible JavaScript MD5
|
|
1698
|
+
*
|
|
1699
|
+
* Modification of JavaScript MD5
|
|
1700
|
+
* https://github.com/blueimp/JavaScript-MD5
|
|
1701
|
+
*
|
|
1702
|
+
* Copyright 2011, Sebastian Tschan
|
|
1703
|
+
* https://blueimp.net
|
|
1704
|
+
*
|
|
1705
|
+
* Licensed under the MIT license:
|
|
1706
|
+
* https://opensource.org/licenses/MIT
|
|
1707
|
+
*
|
|
1708
|
+
* Based on
|
|
1709
|
+
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
1710
|
+
* Digest Algorithm, as defined in RFC 1321.
|
|
1711
|
+
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
|
1712
|
+
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
1713
|
+
* Distributed under the BSD License
|
|
1714
|
+
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
1715
|
+
*/
|
|
1716
|
+
function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));// UTF8 escape
|
|
1717
|
+
e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}
|
|
1718
|
+
/*
|
|
1719
|
+
* Convert an array of little-endian words to an array of bytes
|
|
1720
|
+
*/return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(i)}return t}(function(e,t){
|
|
1721
|
+
/* append padding */
|
|
1722
|
+
e[t>>5]|=128<<t%32,e[r(t)-1]=t;let n=1732584193,i=-271733879,f=-1732584194,l=271733878;for(let t=0;t<e.length;t+=16){const r=n,d=i,h=f,p=l;n=s(n,i,f,l,e[t],7,-680876936),l=s(l,n,i,f,e[t+1],12,-389564586),f=s(f,l,n,i,e[t+2],17,606105819),i=s(i,f,l,n,e[t+3],22,-1044525330),n=s(n,i,f,l,e[t+4],7,-176418897),l=s(l,n,i,f,e[t+5],12,1200080426),f=s(f,l,n,i,e[t+6],17,-1473231341),i=s(i,f,l,n,e[t+7],22,-45705983),n=s(n,i,f,l,e[t+8],7,1770035416),l=s(l,n,i,f,e[t+9],12,-1958414417),f=s(f,l,n,i,e[t+10],17,-42063),i=s(i,f,l,n,e[t+11],22,-1990404162),n=s(n,i,f,l,e[t+12],7,1804603682),l=s(l,n,i,f,e[t+13],12,-40341101),f=s(f,l,n,i,e[t+14],17,-1502002290),i=s(i,f,l,n,e[t+15],22,1236535329),n=a(n,i,f,l,e[t+1],5,-165796510),l=a(l,n,i,f,e[t+6],9,-1069501632),f=a(f,l,n,i,e[t+11],14,643717713),i=a(i,f,l,n,e[t],20,-373897302),n=a(n,i,f,l,e[t+5],5,-701558691),l=a(l,n,i,f,e[t+10],9,38016083),f=a(f,l,n,i,e[t+15],14,-660478335),i=a(i,f,l,n,e[t+4],20,-405537848),n=a(n,i,f,l,e[t+9],5,568446438),l=a(l,n,i,f,e[t+14],9,-1019803690),f=a(f,l,n,i,e[t+3],14,-187363961),i=a(i,f,l,n,e[t+8],20,1163531501),n=a(n,i,f,l,e[t+13],5,-1444681467),l=a(l,n,i,f,e[t+2],9,-51403784),f=a(f,l,n,i,e[t+7],14,1735328473),i=a(i,f,l,n,e[t+12],20,-1926607734),n=u(n,i,f,l,e[t+5],4,-378558),l=u(l,n,i,f,e[t+8],11,-2022574463),f=u(f,l,n,i,e[t+11],16,1839030562),i=u(i,f,l,n,e[t+14],23,-35309556),n=u(n,i,f,l,e[t+1],4,-1530992060),l=u(l,n,i,f,e[t+4],11,1272893353),f=u(f,l,n,i,e[t+7],16,-155497632),i=u(i,f,l,n,e[t+10],23,-1094730640),n=u(n,i,f,l,e[t+13],4,681279174),l=u(l,n,i,f,e[t],11,-358537222),f=u(f,l,n,i,e[t+3],16,-722521979),i=u(i,f,l,n,e[t+6],23,76029189),n=u(n,i,f,l,e[t+9],4,-640364487),l=u(l,n,i,f,e[t+12],11,-421815835),f=u(f,l,n,i,e[t+15],16,530742520),i=u(i,f,l,n,e[t+2],23,-995338651),n=c(n,i,f,l,e[t],6,-198630844),l=c(l,n,i,f,e[t+7],10,1126891415),f=c(f,l,n,i,e[t+14],15,-1416354905),i=c(i,f,l,n,e[t+5],21,-57434055),n=c(n,i,f,l,e[t+12],6,1700485571),l=c(l,n,i,f,e[t+3],10,-1894986606),f=c(f,l,n,i,e[t+10],15,-1051523),i=c(i,f,l,n,e[t+1],21,-2054922799),n=c(n,i,f,l,e[t+8],6,1873313359),l=c(l,n,i,f,e[t+15],10,-30611744),f=c(f,l,n,i,e[t+6],15,-1560198380),i=c(i,f,l,n,e[t+13],21,1309151649),n=c(n,i,f,l,e[t+4],6,-145523070),l=c(l,n,i,f,e[t+11],10,-1120210379),f=c(f,l,n,i,e[t+2],15,718787259),i=c(i,f,l,n,e[t+9],21,-343485551),n=o(n,r),i=o(i,d),f=o(f,h),l=o(l,p)}return[n,i,f,l]}
|
|
1723
|
+
/*
|
|
1724
|
+
* Convert an array bytes to an array of little-endian words
|
|
1725
|
+
* Characters >255 have their high-byte silently ignored.
|
|
1726
|
+
*/(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}},{}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)};
|
|
1727
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
1728
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
1729
|
+
// generators (like Math.random()).
|
|
1730
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
1731
|
+
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
1732
|
+
const r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16)},{}],18:[function(e,t,n){"use strict";
|
|
1733
|
+
// Adapted from Chris Veness' SHA1 code at
|
|
1734
|
+
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
1735
|
+
function r(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function 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
|
|
1736
|
+
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]]}},{}],19:[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}}
|
|
1737
|
+
// **`v1()` - Generate time-based UUID**
|
|
1738
|
+
// Inspired by https://github.com/LiosK/UUID.js
|
|
1739
|
+
// and http://docs.python.org/library/uuid.html
|
|
1740
|
+
let s,a,u=0,c=0;n.default=// See https://github.com/uuidjs/uuid for API details
|
|
1741
|
+
function(e,t,n){let i=t&&n||0;const f=t||[];let l=(e=e||{}).node||s,d=void 0!==e.clockseq?e.clockseq:a;// node and clockseq need to be initialized to random values if they're not
|
|
1742
|
+
// specified. We do this lazily to minimize issues related to insufficient
|
|
1743
|
+
// system entropy. See #189
|
|
1744
|
+
if(null==l||null==d){const t=e.random||(e.rng||r.default)();null==l&&(
|
|
1745
|
+
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
|
1746
|
+
l=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==d&&(
|
|
1747
|
+
// Per 4.2.2, randomize (14 bit) clockseq
|
|
1748
|
+
d=a=16383&(t[6]<<8|t[7]))}// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
|
1749
|
+
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
|
1750
|
+
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
|
1751
|
+
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
|
1752
|
+
let h=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:c+1;// Per 4.2.1.2, use count of uuid's generated during the current clock
|
|
1753
|
+
// cycle to simulate higher resolution clock
|
|
1754
|
+
// Time since last uuid creation (in msecs)
|
|
1755
|
+
const v=h-u+(p-c)/1e4;// Per 4.2.1.2, Bump clockseq on clock regression
|
|
1756
|
+
// Per 4.2.1.2 Throw error if too many uuids are requested
|
|
1757
|
+
if(v<0&&void 0===e.clockseq&&(d=d+1&16383),// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
|
1758
|
+
// time interval
|
|
1759
|
+
(v<0||h>u)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=h,c=p,a=d,// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
|
1760
|
+
h+=122192928e5;// `time_low`
|
|
1761
|
+
const y=(1e4*(268435455&h)+p)%4294967296;f[i++]=y>>>24&255,f[i++]=y>>>16&255,f[i++]=y>>>8&255,f[i++]=255&y;// `time_mid`
|
|
1762
|
+
const g=h/4294967296*1e4&268435455;f[i++]=g>>>8&255,f[i++]=255&g,// `time_high_and_version`
|
|
1763
|
+
f[i++]=g>>>24&15|16,// include version
|
|
1764
|
+
f[i++]=g>>>16&255,// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
|
1765
|
+
f[i++]=d>>>8|128,// `clock_seq_low`
|
|
1766
|
+
f[i++]=255&d;// `node`
|
|
1767
|
+
for(let e=0;e<6;++e)f[i+e]=l[e];return t||(0,o.default)(f)}},{"./bytesToUuid.js":14,"./rng.js":17}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./v35.js")),o=i(e("./md5.js"));function i(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v3",48,o.default);n.default=s},{"./md5.js":16,"./v35.js":21}],21:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){function r(e,r,i,s){const a=i&&s||0;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));// UTF8 escape
|
|
1768
|
+
const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=function(e){
|
|
1769
|
+
// Note: We assume we're being passed a valid uuid string
|
|
1770
|
+
const t=[];return e.replace(/[a-fA-F0-9]{2}/g,(function(e){t.push(parseInt(e,16))})),t}(r)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(r)||16!==r.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");// Per 4.3
|
|
1771
|
+
const u=n(r.concat(e));if(u[6]=15&u[6]|t,u[8]=63&u[8]|128,i)for(let e=0;e<16;++e)i[a+e]=u[e];return i||(0,o.default)(u)}// Function#name is not settable on some platforms (#270)
|
|
1772
|
+
try{r.name=e;// eslint-disable-next-line no-empty
|
|
1773
|
+
}catch(e){}// For CommonJS default export support
|
|
1774
|
+
return r.DNS=i,r.URL=s,r},n.URL=n.DNS=void 0;var r,o=(r=e("./bytesToUuid.js"))&&r.__esModule?r:{default:r};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";n.DNS=i;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";n.URL=s},{"./bytesToUuid.js":14}],22:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./rng.js")),o=i(e("./bytesToUuid.js"));function i(e){return e&&e.__esModule?e:{default:e}}n.default=function(e,t,n){"string"==typeof e&&(t="binary"===e?new Uint8Array(16):null,e=null);const i=(e=e||{}).random||(e.rng||r.default)();// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
1775
|
+
// Copy bytes to buffer, if provided
|
|
1776
|
+
if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){const e=n||0;for(let n=0;n<16;++n)t[e+n]=i[n];return t}return(0,o.default)(i)}},{"./bytesToUuid.js":14,"./rng.js":17}],23:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./v35.js")),o=i(e("./sha1.js"));function i(e){return e&&e.__esModule?e:{default:e}}var s=(0,r.default)("v5",80,o.default);n.default=s},{"./sha1.js":18,"./v35.js":21}],24:[function(e,t,n){"use strict";
|
|
1777
1777
|
/**
|
|
1778
1778
|
* Stringify/parse functions that don't operate
|
|
1779
1779
|
* recursively, so they avoid call stack exceeded
|
|
@@ -1789,7 +1789,7 @@ n.pop(),r=n[n.length-1]);var o=r.element,i=r.index;Array.isArray(o)?o.push(e):i=
|
|
|
1789
1789
|
a=[],r)r.hasOwnProperty(u)&&a.push(u);for(t.push({val:"}"}),i=a.length-1;i>=0;i--)f=r[c=a[i]],l=i>0?",":"",l+=JSON.stringify(c)+":",t.push({obj:f,prefix:l});t.push({val:"{"})}return d},n.parse=function(e){for(var t,n,o,i,s,a,u,c,f,l=[],d=[],h=0;;)if("}"!==(t=e[h++])&&"]"!==t&&void 0!==t)switch(t){case" ":case"\t":case"\n":case":":case",":break;case"n":h+=3,// 'ull'
|
|
1790
1790
|
r(null,l,d);break;case"t":h+=3,// 'rue'
|
|
1791
1791
|
r(!0,l,d);break;case"f":h+=4,// 'alse'
|
|
1792
|
-
r(!1,l,d);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",h--;;){if(o=e[h++],!/[\d\.\-e\+]/.test(o)){h--;break}n+=o}r(parseFloat(n),l,d);break;case'"':for(i="",s=void 0,a=0;'"'!==(u=e[h++])||"\\"===s&&a%2==1;)i+=u,"\\"===(s=u)?a++:a=0;r(JSON.parse('"'+i+'"'),l,d);break;case"[":c={element:[],index:l.length},l.push(c.element),d.push(c);break;case"{":f={element:{},index:l.length},l.push(f.element),d.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();r(l.pop(),l,d)}}},{}]},{},[10])(10)})),define("persist/impl/pouchDBPersistenceStore",["../PersistenceStore","../impl/storageUtils","pouchdb","./logger"],(function(e,t,n,r){"use strict";var o=function(t){e.call(this,t)};(o.prototype=new e).Init=function(e){this._version=e&&e.version||"0";var t=this._name+this._version,o=e?e.adapter:null,i=this._extractDBOptions(e);if(o)try{o.plugin&&n.plugin(o.plugin),(i=i||{}).adapter=o.name,this._dbOptions=i,this._db=new n(t,i)}catch(e){return r.log("Error creating PouchDB instance with adapter "+o+": ",e.message),r.log("Please make sure the needed plugin and adapter are installed."),Promise.reject(e)}else i?(this._dbOptions=i,this._db=new n(t,i)):(this._dbOptions=null,this._db=new n(t));return e&&e.index&&(Array.isArray(e.index)?(this._index=e.index.filter((function(e){return"key"!==e})),0===this._index.length&&(this._index=null)):r.log("index must be an array")),this._createIndex()},o.prototype._extractDBOptions=function(e){var t=null;if(e){var n=this;Object.keys(e).forEach((function(r){n._isPersistenceStoreKey(r)||(t||(t={}),t[r]=e[r])}))}return t},o.prototype._isPersistenceStoreKey=function(e){return"version"===e||"adapter"===e||"index"===e||"skipMetadata"===e},o.prototype._createIndex=function(){if(this._index&&this._db.createIndex){var e=this,t=e._name+e._index.toString().replace(",","").replace(".",""),n={index:{fields:e._index,name:t}};return e._db.createIndex(n).catch((function(t){r.error("creating index on "+e._index.toString()+" failed with error "+t)}))}return Promise.resolve()},o.prototype.upsert=function(e,t,n,o){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsert() for key: "+e);var s=this,a=e.toString();return s._db.get(a).then((function(e){return i(o,e)?e:Promise.reject({status:409})})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)})).then((function(e){return s._put(a,t,n,o,e)}))},o.prototype._put=function(e,t,n,r,o){var i=[],s=this._prepareUpsert(n,i),a={_id:e,key:e,metadata:t,value:s?null:n};o&&(a._rev=o._rev);var u=this;return u._db.put(a).then((function(t){return u._addAttachments(e,t.rev,i)})).catch((function(e){if(409!==e.status)throw e}))};var i=function(e,t){return!e||t.metadata.versionIdentifier===e};o.prototype._addAttachments=function(e,t,n){if(n&&n.length){var o=this,i=n.map((function(n){var r;return r=n.value instanceof Blob?n.value:new Blob([n.value]),o._db.putAttachment(e,n.path,t,r,"binary")}),this);return Promise.all(i).catch((function(t){r.error("store: "+o._name+" failed add attachment for doc "+e)}))}return Promise.resolve()},o.prototype.upsertAll=function(e){if(r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsertAll()"),e&&e.length){var t=this,n={},o=e.map((function(e){var r=e.key.toString(),o=e.value,i=[],s=t._prepareUpsert(o,i);i.length>0&&(n[r]=i);var a={_id:r,key:e.key,metadata:e.metadata,value:s?null:o};return t._db.get(r).then((function(e){return a._rev=e._rev,a})).catch((function(e){if(404===e.status&&"missing"===e.message)return a;throw e}))}));return Promise.all(o).then((function(e){return t._db.bulkDocs(e)})).then((function(e){var o=[];if(e.forEach((function(e,i){if(e.ok){var s=n[e.id];s&&o.push(t._addAttachments(e.id,e.rev,s))}else 409===e.status&&r.log("conflict error")})),o.length>0)return Promise.all(o)})).catch((function(e){r.log("error in upsertAll")}))}return Promise.resolve()},o.prototype.find=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: find() for expression: "+JSON.stringify(e));var n=this;if(e=e||{},n._db.find){var o=n._prepareFind(e);return n._db.find(o).then((function(e){if(e&&e.docs&&e.docs.length){var t=e.docs.map(n._findResultCallback(o.fields),n);return Promise.all(t)}return[]})).catch((function(e){if(404===e.status&&"missing"===e.message)return[];throw e}))}return n._db.allDocs({include_docs:!0}).then((function(r){if(r&&r.rows&&r.rows.length){var o=r.rows.filter((function(n){var r=n.doc;return!(s(n)||!t.satisfy(e.selector,r))}));if(o.length){var i=o.map((function(e){return n._fixKey(e.doc),e.doc})),a=t.sortRows(i,e.sort).map((function(r){return n._fixBinaryValue(r).then((function(n){return e.fields?t.assembleObject(n,e.fields):n.value}))}));return Promise.all(a)}return[]}return[]})).catch((function(e){return r.log("error retrieving all documents from pouch db, returns empty list as find operation.",e),[]}))},o.prototype._findResultCallback=function(e){return function(t){return this._fixValue(t).then((function(t){return e?t:t.value}))}},o.prototype._fixValue=function(e){return this._fixKey(e),this._fixBinaryValue(e)},o.prototype._fixBinaryValue=function(e){var t=e._id||e.id||e.key,n=e._attachments;if(n){var o=this,i=Object.keys(n)[0];return o._db.getAttachment(t,i).then((function(t){if("rootpath"===i)e.value=t;else{for(var n=i.split("."),r=e.value,o=0;o<n.length-1;o++)r=r[n[o]];r[n[n.length-1]]=t}return e})).catch((function(e){r.error("store: "+o._name+" error getting attachment. ")}))}return Promise.resolve(e)},o.prototype.findByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: findByKey() for key: "+e);var t=this,n=e.toString();return t._db.get(n,{attachments:!0}).then((function(e){return t._fixBinaryValue(e)})).then((function(e){return e.value})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)}))},o.prototype.removeByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: removeByKey() for key: "+e);var t=this;if(!e)return Promise.resolve(!1);var n=e.toString();return t._db.get(n).then((function(e){return t._db.remove(e)})).then((function(){return!0})).catch((function(e){return(404!==e.status||"missing"!==e.message)&&Promise.reject(e)}))},o.prototype.delete=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: delete() for expression: "+JSON.stringify(e));var t=this;if(e){var o=e;return o.fields=["_id","_rev"],t.find(o).then((function(e){if(e&&e.length){var n=e.map((function(e){return{_id:e._id,_rev:e._rev,_deleted:!0}}));return t._db.bulkDocs(n)}})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))}return t._db.destroy().then((function(){var e=t._name+t._version;return t._dbOptions?t._db=new n(e,t._dbOptions):t._db=new n(e),t._createIndex()})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))},o.prototype.keys=function(){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: keys()");var e=this;return e._db.allDocs().then((function(e){var t=e.rows,n=[];if(t&&t.length)for(var r=0;r<t.length;r++)s(t[r])||n.push(t[r].id);return n})).catch((function(t){r.error("store: "+e._name+" error getting all the docs for keys ")}))},o.prototype._prepareFind=function(e){var t={},n=e.selector;n?n&&(t.selector=n):t.selector={_id:{$gt:null}};var r=e.fields;return r&&r.length&&(t.fields=r,-1!==r.indexOf("key")&&-1===r.indexOf("_id")&&t.fields.push("_id")),t},o.prototype._prepareUpsert=function(e,t){return!!e&&(e instanceof Blob||e instanceof ArrayBuffer?(t.push({path:"rootpath",value:e}),!0):(this._inspectValue("",e,t),!1))},o.prototype._inspectValue=function(e,t,n){for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(o&&"object"==typeof o)if(o instanceof Blob||o instanceof ArrayBuffer){var i=e;i.length>0&&(i+=".");var s={path:i+r,value:o};n.push(s),t.key=null}else if(void 0===o.length){var a=e;e.length>0&&(e+="."),e+=r,this._inspectValue(e,o,n),e=a}}},o.prototype.updateKey=function(e,t){r.log("Offline Persistence Toolkit PouchDBPersistenceStore: updateKey() with currentKey: "+e+" and new key: "+t);var n=this;return n._db.get(e).then((function(e){return e?n.upsert(t,e.metadata,e.value):Promise.reject("No existing key found to update")})).then((function(){return n.removeByKey(e)})).catch((function(){r.error("store: "+n._name+" error updating key")}))};var s=function(e){return e.id.startsWith("_design/")};return o.prototype._fixKey=function(e){var t=e._id||e.id||e.key;t&&(e.key=t)},o})),define("persist/pouchDBPersistenceStoreFactory",["./impl/pouchDBPersistenceStore"],(function(e){"use strict";return{createPersistenceStore:function(t,n){return function(t,n){var r=new e(t);return r.Init(n).then((function(){return r}))}(t,n)}}})),define("persist/persistenceStoreManager",["./impl/logger","./impl/PersistenceStoreMetadata","./pouchDBPersistenceStoreFactory"],(function(e,t,n){"use strict";var r=function(){Object.defineProperty(this,"_stores",{value:{},writable:!0}),Object.defineProperty(this,"_factories",{value:{},writable:!0}),Object.defineProperty(this,"_DEFAULT_STORE_FACTORY_NAME",{value:"_defaultFactory",writable:!1}),Object.defineProperty(this,"_METADATA_STORE_NAME",{value:"systemCache-metadataStore",writable:!1}),Object.defineProperty(this,"_storeNameMapping",{value:{},writable:!0})};return r.prototype.registerStoreFactory=function(e,t){if(!t)throw TypeError("A valid factory must be provided.");if(!e)throw TypeError("A valid name must be provided.");var n=this._mapStoreName(e),r=this._factories[n];if(r&&r!==t)throw TypeError("A factory with the same name has already been registered.");this._factories[n]=t},r.prototype.registerDefaultStoreFactory=function(e){this.registerStoreFactory(this._DEFAULT_STORE_FACTORY_NAME,e)},r.prototype.openStore=function(t,n){e.log("Offline Persistence Toolkit PersistenceStoreManager: openStore() for name: "+t);var r=this._mapStoreName(t),o=this._stores[r],i=n&&n.version||"0";if(o&&o[i])return Promise.resolve(o[i]);var s=this._factories[r];if(s||(s=this._factories[this._DEFAULT_STORE_FACTORY_NAME]),!s)return Promise.reject(new Error("no factory is registered to create the store."));var a=this;return e.log("Offline Persistence Toolkit PersistenceStoreManager: Calling createPersistenceStore on factory"),s.createPersistenceStore(r,n).then((function(t){return(o=o||{})[i]=t,a._stores[r]=o,n&&n.skipMetadata?t:a._updateStoreMetadata(r,i).then((function(){return t})).catch((function(n){return e.log("updating store metadata for store "+r+" failed"),t}))}))},r.prototype._updateStoreMetadata=function(e,t){var n=this;return n._getStoresMetadata(e).then((function(r){var o=null;if(r?r.versions.indexOf(t)<0&&(r.versions.push(t),o=r.versions):o=[t],o){var i=n._encodeString(e);return n._metadataStore.upsert(i,{},o)}}))},r.prototype.hasStore=function(e,t){var n=this._mapStoreName(e),r=this._stores[n];return!(!r||0===Object.keys(r).length||t&&t.version&&!r[t.version])},r.prototype.deleteStore=function(t,n){e.log("Offline Persistence Toolkit PersistenceStoreManager: deleteStore() for name: "+t);var r=this,o=this._mapStoreName(t);return r._getStoresMetadata(o).then((function(i){if(i){var s=[],a=[],u=i.versions;if(n&&n.version){var c=u.indexOf(n.version);c<0?a=u:(u.splice(c,1),a=u,s.push(n.version))}else s=u;return!!s.length&&(l=s.map((function(e){var t=this;return t.openStore(o,{version:e,skipMetadata:!0}).then((function(n){return delete t._stores[o][e],n.delete()}))}),r),Promise.all(l).then((function(){var e=r._encodeString(o);return a.length?r._metadataStore.upsert(e,{},a):r._metadataStore.removeByKey(e)})).then((function(){return!0})).catch((function(t){return e.log("failed deleting store "+o),!1})))}var f=[];if(n&&n.version?r._stores[o]&&r._stores[o][n.version]&&(f.push(r._stores[o][n.version]),delete r._stores[o][n.version]):r._stores[o]&&(f=Object.values(r._stores[o]),r._stores[o]={}),f.length){var l=f.map((function(e){return e.delete()}));return Promise.all(l).then((function(){return!0})).catch((function(n){return e.log("failed deleting store "+t),!1}))}return!1}))},r.prototype.getStoresMetadata=function(){var n=this,r=new Map;return this._getMetadataStore().then((function(e){return e.find({fields:["key","value"]})})).then((function(e){return e&&e.length>0&&e.forEach((function(e){var o=n._decodeString(e.key),i=n._factories[o];i||(i=n._factories[n._DEFAULT_STORE_FACTORY_NAME]),r.set(o,new t(o,i,e.value))})),r})).catch((function(t){return e.log("error occured getting store metadata."),r}))},r.prototype._getStoresMetadata=function(n){var r=this;return r._getMetadataStore().then((function(e){var t=r._encodeString(n);return e.findByKey(t)})).then((function(e){if(e){var o=r._factories[n];return o||(o=r._factories[r._DEFAULT_STORE_FACTORY_NAME]),new t(n,o,e)}return null})).catch((function(t){return e.log("error getting store metadata for store "+n),null}))},r.prototype._mapStoreName=function(e,t){var n=this._storeNameMapping[e];return n||(n=e.replace(/(.*):\/\/(.*)/gi,"$1$2"),this._storeNameMapping[e]=n,n)},r.prototype._getMetadataStore=function(){var e=this;return e._metadataStore?Promise.resolve(e._metadataStore):(this._factories[this._DEFAULT_STORE_FACTORY_NAME]||(this._factories[e._METADATA_STORE_NAME]=n),this.openStore(e._METADATA_STORE_NAME,{skipMetadata:!0}).then((function(t){return e._metadataStore=t,e._metadataStore})))},r.prototype._encodeString=function(e){for(var t=[],n=0;n<e.length;n++){var r=Number(e.charCodeAt(n)).toString(16);t.push(r)}return t.join("")},r.prototype._decodeString=function(e){var t,n=e.toString(),r="";for(t=0;t<n.length;t+=2)r+=String.fromCharCode(parseInt(n.substr(t,2),16));return r},new r})),define("persist/impl/defaultCacheHandler",["../persistenceUtils","../persistenceStoreManager","./logger"],(function(e,t,n){"use strict";function r(){Object.defineProperty(this,"_endpointToOptionsMap",{value:{},writable:!0})}function o(e){for(var t=e.name,n=e.resourceIdentifier,r=e.keys,o=[],i=(new Date).toUTCString(),s=0;s<r.length;s++){var a={key:r[s],metadata:{lastUpdated:i,resourceIdentifier:n},value:e.data[s]};o.push(a)}var u={};return u[t]=o,u}r.prototype.constructRequestResponseCacheData=function(t,r){var o=this,i={};return n.log("Offline Persistence Toolkit DefaultCacheHandler: constructRequestResponseCacheData()"),e.requestToJSON(t).then((function(n){i.requestData=n;var s=o.hasShredder(t);return e.responseToJSON(r,{excludeBody:s})})).then((function(e){return i.responseData=e,{key:o._constructCacheKey(t,r),metadata:o.constructMetadata(t),value:i}}))},r.prototype.constructShreddedData=function(e,t){n.log("Offline Persistence Toolkit DefaultCacheHandler: constructShreddedData()");var r=this._getShredder(e);return r?r(t).then((function(e){return e&&Array.isArray(e)?e.map(o):null})):Promise.resolve()},r.prototype.shredResponse=function(e,t){n.log("Offline Persistence Toolkit DefaultCacheHandler: shredResponse()");var r=this._getShredder(e);return r?r(t):Promise.resolve()},r.prototype.cacheShreddedData=function(e,r){n.log("Offline Persistence Toolkit DefaultCacheHandler: cacheShreddedData()");var i=e.map(o),s=this;return function(e){var r=e.map((function(e){var r=Object.keys(e)[0],o=e[r];return o&&o.length?function(e,r){return n.log("Offline Persistence Toolkit DefaultCacheHandler: Updating store with shredded data"),t.openStore(e).then((function(e){return e.upsertAll(r)}))}(r,o):Promise.resolve()}));return Promise.all(r)}(i).then((function(){if(s._isCompleteCollection(r,e))return function(e){var n=e.map((function(e){var n=e.name,r={selector:{key:{$nin:e.keys}}};return t.openStore(n).then((function(e){return e.delete(r)}))}));return Promise.all(n)}(e)}))},r.prototype._isCompleteCollection=function(e,t){if(!e||"GET"!==e.method&&"HEAD"!==e.method)return!1;if(!function(e){if(!e)return!1;for(var t=0;t<e.length;t++)if("collection"!==e[t].resourceType)return!1;return!0}(t))return!1;if(e.url===e.baseUrl)return!0;var n=this._getQueryHandler(e.url);if(!n||"function"!=typeof n.normalizeQueryParameter)return!1;var r=n.normalizeQueryParameter(e.url);if(r.searchCriteria||0!==r.offset)return!1;var o=r.limit;return o<0||t[0].keys.length<o},r.prototype._constructCacheKey=function(e,t){var n=e.url+"$"+e.method+"$";if(t){var r=t.headers;if(r&&(a=r.get("vary")))if("*"===a)n=1e3*(new Date).getTime()+Math.floor(1e3*Math.random());else for(var o=e.headers,i=a.split(","),s=0;s<i.length;s++){var a,u=i[s];n+=(u=u.trim())+"="+(a=o&&o.get(u)?o.get(u):"undefined")+";"}}return n},r.prototype.getMatchedCacheKeys=function(e,t,n){var r,o;return r=t&&t.ignoreSearch?i(e.url):e.url,t&&t.ignoreMethod||(o=e.method),n.filter((function(n){var a=n.split("$");if(1===a.length){if(n.slice(0,r.length)!==r)return!1;if(t&&t.ignoreSearch&&"/"===n[r.length])return!1;if(o&&-1===(t&&t.ignoreSearch?n.slice(r.length):n.slice(r.length,r.length+e.method.length)).indexOf(o))return!1;if(!t||!t.ignoreVary){var u=n;if(!(u=o?(u=u.split(o))[u.length-1]:s(u)))return!0;var c=u.split("="),f=e.headers;if(2===c){if((h=f&&f.get(c[0])?f.get(c[0]):"undefined")!==c[1])return!1}else for(var l=0;l<c.length-1;l++){var d=c[l],h=f&&f.get(d)?f.get(d):"undefined",p=c[l+1].split(h);if(2!==p.length&&""!==p[0])return!1;if(p[1]&&p[1].startsWith(","))return!1;c[l+1]=p[1]}}return!0}if((t&&t.ignoreSearch?i(a[0]):a[0])!==r)return!1;if(o&&a[1]!==o)return!1;if(!t||!t.ignoreVary){if(!(u=a[2]))return!0;var v=u.split(";");if(1===v.length)return!1;for(f=e.headers,l=0;l<v.length-1;l++)if(d=v[l].split("="),(h=f&&f.get(d[0])?f.get(d[0]):"undefined")!=d[1])return!1}return!0}))},r.prototype.constructMetadata=function(e){var t=(new Date).getTime(),n=i(e.url);return{url:e.url,method:e.method,baseUrl:n,created:t,lastupdated:t}},r.prototype.constructResponse=function(t){return n.log("Offline Persistence Toolkit DefaultCacheHandler: constructResponse()"),e.responseFromJSON(t).then((function(t){return e.isCachedResponse(t)||t.headers.set("x-oracle-jscpt-cache-expiration-date",""),t}))},r.prototype.constructSearchCriteria=function(e,t){n.log("Offline Persistence Toolkit DefaultCacheHandler: constructSearchCriteria()");var r=!1;t&&void 0!==t.ignoreSearch&&(r=t.ignoreSearch);var o,s=!1;return t&&void 0!==t.ignoreMethod&&(s=t.ignoreMethod),o=r?{"metadata.baseUrl":i(e.url)}:{"metadata.url":e.url},s||(o["metadata.method"]=e.method),{selector:o,sort:["metadata.created"]}},r.prototype.registerEndpointOptions=function(e,t){if(!e)throw new Error({message:"a valid endpointKey must be provided."});if(this._endpointToOptionsMap[e])throw new Error({message:"endpointKey can only be registered once."});this._endpointToOptionsMap[e]=t},r.prototype.unregisterEndpointOptions=function(e){if(!e)throw new Error({message:"a valid endpointKey must be provided."});delete this._endpointToOptionsMap[e]},r.prototype.hasShredder=function(e){return null!==this._getShredder(e)},r.prototype._getShredder=function(e){var t=this._getJsonProcessor(e.url);return t?t.shredder:null},r.prototype._getUnshredder=function(e){var t=this._getJsonProcessor(e.url);return t?t.unshredder:null},r.prototype._getJsonProcessor=function(e){for(var t=Object.keys(this._endpointToOptionsMap),n=0;n<t.length;n++){var r=t[n];if(e===JSON.parse(r).url){var o=this._endpointToOptionsMap[r];return o&&o.jsonProcessor&&o.jsonProcessor.shredder&&o.jsonProcessor.unshredder?o.jsonProcessor:null}}return null},r.prototype._getQueryHandler=function(e){for(var t=Object.keys(this._endpointToOptionsMap),n=0;n<t.length;n++){var r=t[n];if(e===JSON.parse(r).url){var o=this._endpointToOptionsMap[r];return o&&o.queryHandler?o.queryHandler:null}}return null},r.prototype.fillResponseBodyWithShreddedData=function(e,r,o){n.log("Offline Persistence Toolkit DefaultCacheHandler: fillResponseBodyWithShreddedData()"),null!=e.url&&e.url.length>0&&null==o.headers.get("x-oracle-jscpt-response-url")&&o.headers.set("x-oracle-jscpt-response-url",e.url),r&&1===r.length&&"single"===r[0].resourceType&&o.headers.set("x-oracle-jscpt-resource-type","single");var i=this._getUnshredder(e),s=this._getShredder(e);if(!(i&&s&&o&&r&&r.length))return Promise.resolve(o);var a=r.map((function(e){return r=(n=e).name,t.openStore(r).then((function(e){if(n.keys&&n.keys.length){if(1===n.keys.length)return e.findByKey(n.keys[0]);var t={selector:{$or:n.keys.map((function(e){return{key:{$eq:e}}}))}};return e.find(t)}return[]})).then((function(e){return Array.isArray(e)||(e=[e]),n.data=e,n}));var n,r}));return Promise.all(a).then((function(e){return i(e,o)}))},r.prototype.deleteShreddedData=function(e){var n=[];return e.forEach((function(e){var r=e.name,o=e.keys;if(r&&o&&o.length){var i=t.openStore(r).then((function(e){var t={selector:{$or:o.map((function(e){return{key:{$eq:e}}}))}};return e.delete(t)}));n.push(i)}})),Promise.all(n)};var i=function(e){if(!e||"string"!=typeof e)return"";var t=/([^?]*)\?/.exec(e);return t&&2===t.length?t[1]:e},s=function(e){if(!e||"string"!=typeof e)return"";var t=e.split("").reverse().join(""),n=/(.*?)(TEG|TUP|ETELED|TSOP|HCTAP|TCENNOC|SNOITPO|ECART)/.exec(t);return n&&3===n.length?n[1].split("").reverse().join(""):e};return new r})),define("persist/impl/PersistenceSyncManager",["require","../persistenceUtils","../persistenceStoreManager","./defaultCacheHandler","./logger"],(function(e,t,n,r,o){"use strict";function i(e,t,n){Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_isOnline",{value:e}),Object.defineProperty(this,"_browserFetch",{value:t}),Object.defineProperty(this,"_cache",{value:n})}function s(e){return"stop"===(e=e||{}).action}function a(e,t){var r,o,i,s,a,u=[];e instanceof Array||(e=[e]);var c=e.length,f=function(l){if(!(l<c))return Promise.resolve();if(i=e[l].storeName,o=e[l].operation,s=e[l].undoRedoData,"upsert"==o||"remove"==o&&t){for(u=[],a=s.length,r=0;r<a;r++)t?u.push({key:s[r].key,value:s[r].undo}):u.push({key:s[r].key,value:s[r].redo});return n.openStore(i).then((function(e){return 1==u.length&&null==u[0].value&&null!=u[0].key?e.removeByKey(u[0].key).then((function(){return f(++l)})):e.upsertAll(u).then((function(){return f(++l)}))}))}return"remove"==o?n.openStore(i).then((function(e){return e.removeByKey(s[0].key).then((function(){return f(++l)}))})):void 0};return f(0)}function u(e,t,n,r){return c(n,e._eventListeners.filter(function(e,t){return function(n){return e.toLowerCase()==n.type&&(null!=t&&t.match(n.scope)||null==t||null==n.scope)}}(t,r)))}function c(e,t){return t.length>0?t[0].listener(e).then((function(e){return null!=e?Promise.resolve(e):t.length>1?c(t.slice(1)):void 0})):Promise.resolve(null)}function f(e){return n.openStore(e,{index:["key"],skipMetadata:!0})}function l(){return f("syncLog")}function d(){return f("redoUndoLog")}return i.prototype.addEventListener=function(e,t,n){o.log("Offline Persistence Toolkit PersistenceSyncManager: addEventListener() for type: "+e+" and scope: "+n),this._eventListeners.push({type:e.toLowerCase(),listener:t,scope:n})},i.prototype.removeEventListener=function(e,t,n){o.log("Offline Persistence Toolkit PersistenceSyncManager: removeEventListener() for type: "+e+" and scope: "+n),this._eventListeners=this._eventListeners.filter((function(r){return e.toLowerCase()!=r.type||t!=r.listener||n!=r.scope}))},i.prototype.getSyncLog=function(){var e;return o.log("Offline Persistence Toolkit PersistenceSyncManager: getSyncLog()"),this._readingSyncLog||(this._readingSyncLog=(e=this,l().then((function(e){return e.find((t={},n=[],(r=[]).push("key"),t.sort=r,n.push("key"),n.push("value"),t.fields=n,t));var t,n,r})).then((function(e){return function(e){var n,r,o=[],i=function(e){return e&&0!=e.length?(n=e[0].key,r=e[0].value,t.requestFromJSON(r).then((function(t){return o.push(function(e,t){return{requestId:e,request:t,undo:function(){return function(e){return d().then((function(t){return t.findByKey(e)})).then((function(e){return null!=e&&a(e,!0).then((function(){return!0}))}))}(e)},redo:function(){return function(e){return d().then((function(t){return t.findByKey(e)})).then((function(e){return null!=e&&a(e,!1).then((function(){return!0}))}))}(e)}}}(n,t)),e.shift(),i(e)}))):Promise.resolve(o)};return i(e)}(e)})).then((function(t){return e._readingSyncLog=null,t})))),this._readingSyncLog},i.prototype.insertRequest=function(e,n){o.log("Offline Persistence Toolkit PersistenceSyncManager: insertRequest() for Request with url: "+e.url);var i={};return l().then((function(n){return i.store=n,t.requestToJSON(e,{_noClone:!0})})).then((function(t){return i.requestData=t,i.metadata=r.constructMetadata(e),i.requestId=i.metadata.created.toString(),i.store.upsert(i.requestId,i.metadata,i.requestData)})).then((function(){if(null!=n){var e=n.undoRedoDataArray;return null!=e?d().then((function(t){var n=function(r){return r<e.length&&null!=e[r]?t.upsert(i.requestId,i.metadata,e[r]).then((function(){return n(++r)})):Promise.resolve()};return n(0)})):Promise.resolve()}return Promise.resolve()}))},i.prototype.removeRequest=function(e){o.log("Offline Persistence Toolkit PersistenceSyncManager: removeRequest() for Request with requestId: "+e);var n=this,r={};return l().then((function(n){return r.store=n,function(e,n){return n.findByKey(e).then((function(e){if(e)return t.requestFromJSON(e)}))}(e,n)})).then((function(t){return t?n._internalRemoveRequest(e,t,r.store):void 0}))},i.prototype._internalRemoveRequest=function(e,t,n){var r=[];return n?r.push(n.removeByKey(e)):r.push(l().then((function(t){return t.removeByKey(e)}))),"GET"!==t.method&&"HEAD"!==t.method&&r.push(d().then((function(t){return t.removeByKey(e)}))),Promise.all(r).then((function(){return t})).catch((function(t){o.log("Offline Persistence Toolkit PersistenceSyncManager: removeRequest() error for Request with requestId: "+e)}))},i.prototype.updateRequest=function(e,n){return o.log("Offline Persistence Toolkit PersistenceSyncManager: updateRequest() for Request with requestId: "+e),Promise.all([l(),t.requestToJSON(n)]).then((function(t){var o=t[0],i=t[1],s=r.constructMetadata(n);return o.upsert(e,s,i)}))},i.prototype.sync=function(e){o.log("Offline Persistence Toolkit PersistenceSyncManager: sync()"),this._options=e||{};var n=this;return this._syncing?Promise.reject("Cannot start sync while sync is in progress"):(this._syncing=!0,new Promise((function(e,r){n.getSyncLog().then((function(i){var a,c,f;o.log("Offline Persistence Toolkit PersistenceSyncManager: Processing sync");var l=function(i){0==i.length&&(o.log("Offline Persistence Toolkit PersistenceSyncManager: Sync finished, no requests in sync log"),e()),i.length>0&&(o.log("Offline Persistence Toolkit PersistenceSyncManager: Processing sync, # of requests in sync log: "+i.length),a=i[0].requestId,c=i[0].request,f=c.clone(),o.log("Offline Persistence Toolkit PersistenceSyncManager: Dispatching beforeSyncRequest event"),u(n,"beforeSyncRequest",{requestId:a,request:f.clone()},c.url).then((function(d){if(s(d))return o.log("Offline Persistence Toolkit PersistenceSyncManager: Sync stopped by beforeSyncRequest event listener"),void e();"skip"!==(d=d||{}).action?("replay"===d.action&&(o.log("Offline Persistence Toolkit PersistenceSyncManager: Replay request from beforeSyncRequest event listener"),c=d.request),f=c.clone(),function(e,t){var n,r=e,i=r._options.preflightOptionsRequest,s=r._options.preflightOptionsRequestTimeout;if(null!=t.url&&"disabled"!=i&&null!=t.url.match(i)){if(o.log("Offline Persistence Toolkit PersistenceSyncManager: Checking URL based on preflightOptionsRequest"),r._pingedURLs){if(r._pingedURLs.indexOf(t.url)>=0)return Promise.resolve(!0)}else r._pingedURLs=[];return r._preflightOptionsRequestId=(new Date).getTime(),new Promise((n=r._preflightOptionsRequestId,function(e,o){r._repliedOptionsRequest=!1;var i=new Request(t.url,{method:"OPTIONS"}),a=6e4;null!=s&&(a=s),setTimeout((function(){r._repliedOptionsRequest||r._preflightOptionsRequestId!=n||o(!1)}),a),r._browserFetch(i).then((function(n){r._repliedOptionsRequest=!0,r._pingedURLs||(r._pingedURLs=[]),r._pingedURLs.push(t.url),e(!0)}),(function(t){r._repliedOptionsRequest=!0,e(!0)}))}))}return Promise.resolve(!0)}(n,c).then((function(){t.markReplayRequest(c,!0),o.log("Offline Persistence Toolkit PersistenceSyncManager: Replaying request with url: "+c.url),("undefined"!=typeof window&&null!=window?fetch:n._browserFetch)(c).then((function(d){d.status>=400?r({error:d.statusText,requestId:a,request:f.clone(),response:d.clone()}):t._cloneResponse(d,{url:c.url}).then((function(t){o.log("Offline Persistence Toolkit PersistenceSyncManager: Dispatching syncRequest event"),u(n,"syncRequest",{requestId:a,request:f.clone(),response:t.clone()},c.url).then((function(t){s(t)?e():(o.log("Offline Persistence Toolkit PersistenceSyncManager: Removing replayed request"),n._internalRemoveRequest(a,c).then((function(){i.shift(),l(i)}),(function(e){r({error:e,requestId:a,request:f.clone()})})))}))}))}),(function(e){r({error:e,requestId:a,request:f.clone()})}))}),(function(e){r(!1===e?{error:"Preflight OPTIONS request timed out",requestId:a,request:f.clone(),response:new Response(null,{status:504,statusText:"Preflight OPTIONS request timed out"})}:{error:e,requestId:a,request:f.clone()})}))):(o.log("Offline Persistence Toolkit PersistenceSyncManager: Removing skipped request"),n._internalRemoveRequest(a,c).then((function(){i.shift(),l(i)}),(function(e){r({error:e,requestId:a,request:f.clone()})})))})))};i=function(e){if(e&&e.length>0){var t,n,r=[];for(t=0;t<e.length;t++)"GET"!=(n=e[t].request).method&&"HEAD"!=n.method&&r.push(e[t]);for(t=0;t<e.length;t++)"GET"!=(n=e[t].request).method&&"HEAD"!=n.method||r.push(e[t]);return r}return e}(i),l(i)}))})).finally((function(e){n._syncing=!1,n._pingedURLs=null})))},i})),define("persist/impl/OfflineCache",["./defaultCacheHandler","../persistenceStoreManager","../persistenceUtils","./logger"],(function(e,t,n,r){"use strict";function o(e,t){if(!e)throw TypeError("A name must be provided to create an OfflineCache!");if(!t)throw TypeError("A persistence store must be provided to create an OfflineCache!");this._name=e,this._storeName=t,this._shreddedNamesStoreName=this._storeName+"_OPT_INT_SHRED_STORE_NAMES_",this._store=null,this._cacheKeys=[],this._createStorePromise}function i(e,t,n){if(n&&n.length)for(var r=0;r<n.length;r++){var o=n[r];if(a(e,t,o.value))return o}return null}function s(e,t,n){return function(r){var o;return o=n?r[n]:r,a(e,t,o)}}function a(e,t,n){if(e)return!0;if(!n||!t)return!1;var o=n.requestData.headers,i=n.responseData.headers,s=t.headers,a=i.vary;if(r.log("Offline Persistence Toolkit OfflineCache: Processing HTTP Vary header"),!a)return!0;if("*"===a.trim())return!1;for(var u=a.split(","),c=0;c<u.length;c++){var f=u[c].toLowerCase();f=f.trim();var l=s.get(f),d=o[f];if(r.log("Offline Persistence Toolkit OfflineCache: HTTP Vary header name: "+f),r.log("Offline Persistence Toolkit OfflineCache: Request HTTP Vary header value: "+l),r.log("Offline Persistence Toolkit OfflineCache: Cached HTTP Vary header value: "+d),!(!d&&!l||d&&l&&d===l))return!1}return!0}function u(t,n,o){if(n){r.log("Offline Persistence Toolkit OfflineCache: Converting cached entry to Response object");var i=!1;o&&o.ignoreBody&&(i=!0);var s=n.bodyAbstract;return e.constructResponse(n).then((function(n){if(null!=t.url&&t.url.length>0&&null==n.headers.get("x-oracle-jscpt-response-url")&&n.headers.set("x-oracle-jscpt-response-url",t.url),!i&&s){var o;try{o=JSON.parse(s)}catch(e){r.error("error parsing json "+s)}return e.fillResponseBodyWithShreddedData(t,o,n)}return n}))}return Promise.resolve()}function c(t,n,r){if(n){var o=e.constructSearchCriteria(n,r);o.fields=["key","value"];var i=r&&r.ignoreVary;return t.find(o).then((function(e){return e&&e.length?e.filter(s(i,n,"value")).map((function(e){return e.key})):[]}))}return t.keys()}return o.prototype.getName=function(){return this._name},o.prototype.add=function(e){r.log("Offline Persistence Toolkit OfflineCache: add()");var t=this;return fetch(e).then((function(n){return t.put(e,n)}))},o.prototype.addAll=function(e){r.log("Offline Persistence Toolkit OfflineCache: addAll()");var t=e.map(this.add,this);return Promise.all(t)},o.prototype.match=function(e,t){return r.log("Offline Persistence Toolkit OfflineCache: match() for Request with url: "+e.url),this._getCacheEntries(e,t).then((function(n){var r=i(t&&t.ignoreVary,e,n);if(r)return u(e,r.value.responseData,t)})).catch((function(t){r.log("error finding match for request with url: "+e.url)}))},o.prototype._getCacheEntries=function(t,n){var r=this;return this._getStore().then((function(o){var i=e.getMatchedCacheKeys(t,n,r._cacheKeys);if(i&&i.length){var s=i.map((function(e){return o.findByKey(e).then((function(t){return{key:e,value:t}}))}));return Promise.all(s)}var a=e.constructSearchCriteria(t,n);return a.fields=["key","value"],o.find(a)}))},o.prototype._matchByKey=function(e,t,n){return this._getStore().then((function(e){return e.findByKey(t)})).then((function(t){return t?u(e,t.responseData,n):void 0}))},o.prototype._internalMatch=function(t,n){var o=this;return o._getStore().then((function(r){var i=e.getMatchedCacheKeys(t,n,o._cacheKeys);if(i&&i.length){var s=i.map((function(e){return r.findByKey(e)}));return Promise.all(s).then((function(e){return e.map((function(e,t){return{key:i[t],value:e}}))}))}var a=e.constructSearchCriteria(t,n);return a.fields=["key","value"],r.find(a)})).then((function(e){if(e){var o=i(n&&n.ignoreVary,t,e);if(o){var s={key:o.key},a=o.value.responseData.bodyAbstract;if(a)try{var u=JSON.parse(a);u?1===u.length&&"single"===u[0].resourceType?s.resourceType="single":s.resourceType="collection":s.resourceType="unknown"}catch(e){return void r.log("internal error: invalid body abstract")}else s.resourceType="unknown";return s}}})).catch((function(e){r.log("error finding match internal")}))},o.prototype.matchAll=function(e,t){return r.log("Offline Persistence Toolkit OfflineCache: matchAll() for Request with url: "+e.url),this._getCacheEntries(e,t).then((function(n){var r=function(e,t,n){var r=[];return n&&n.length&&(r=n.filter(s(e,t,"value")).map((function(e){return e.value.responseData}))),r}(t&&t.ignoreVary,e,n);return function(e,t,n){if(t&&t.length){var r=t.map((function(t){return u(e,t,n)}));return Promise.all(r)}return Promise.resolve()}(e,r,t)})).catch((function(t){r.log("error finding all matches for request with url: "+e.url)}))},o.prototype._getStore=function(){var e,n=this;return n._store?Promise.resolve(n._store):(n._createStorePromise||(n._createStorePromise=t.openStore(n._storeName,{index:["metadata.baseUrl","metadata.url","metadata.created"],skipMetadata:!0}).then((function(t){return e=t,t.keys()})).then((function(t){return n._cacheKeys=t,n._store=e,n._store}))),n._createStorePromise)},o.prototype._getShreddedNamesStore=function(){var e=this;return e._shreddedNamesStore?Promise.resolve(e._shreddedNamesStore):(e._createShreddedNamesStorePromise||(e._createShreddedNamesStorePromise=t.openStore(e._shreddedNamesStoreName,{index:["metadata.baseUrl","metadata.url","metadata.created"],skipMetadata:!0}).then((function(t){return e._shreddedNamesStore=t,e._shreddedNamesStore}))),e._createShreddedNamesStorePromise)},o.prototype.put=function(t,n){r.log("Offline Persistence Toolkit OfflineCache: put() for Request with url: "+t.url);var o,i=this;return i._getStore().then((function(){return e.constructRequestResponseCacheData(t,n)})).then((function(s){var a=i._store;return o=s.key,e.hasShredder(t)?e.shredResponse(t,n).then((function(t){if(t){var n=[];return s.value.responseData.bodyAbstract=function(e){var t=e.map((function(e){return{name:e.name,keys:e.keys?e.keys.reduce((function(e,t){return t?e.push(t):r.warn("should not have undefined key in the shredded data"),e}),[]):e.keys,resourceType:e.resourceType}}));return JSON.stringify(t)}(t),n.push(a.upsert(s.key,s.metadata,s.value)),n.push(e.cacheShreddedData(t,s.metadata)),i._updateShreddedStoreNames(t.map((function(e){return e.name}))).then((function(){return Promise.all(n)}))}o=null})):a.upsert(s.key,s.metadata,s.value)})).then((function(){o&&i._cacheKeys.indexOf(o)<0&&i._cacheKeys.push(o)})).catch((function(e){r.error("error in cache.put() for Request with url: "+t.url)}))},o.prototype._updateShreddedStoreNames=function(e){return this._getShreddedNamesStore().then((function(t){return e?t.keys().then((function(n){var r=[];if(e.forEach((function(e){n.indexOf(e)<0&&r.push(e)})),r.length>0){var o=[];return r.forEach((function(e){o.push({key:e,metadata:{},value:{}})})),t.upsertAll(o)}})):t.delete()}))},o.prototype._getShreddedStoreNames=function(){return this._getShreddedNamesStore().then((function(e){return e.keys()}))},o.prototype.delete=function(t,n){if(!t)return r.warn("Offline Persistence Toolkit OfflineCache: delete() request is a required parameter. To clear the cache, please call clear()"),Promise.resolve(!1);r.log("Offline Persistence Toolkit OfflineCache: delete() for Request with url: "+t.url);var o=this;return o._getStore().then((function(i){if(e.hasShredder(t)){var a=e.constructSearchCriteria(t,n);a.fields=["key","value"];var u=n&&n.ignoreVary;return i.find(a).then((function(n){if(n&&n.length){var a=n.filter(s(u,t,"value")),c=[];return a.forEach((function(t){c.push(i.removeByKey(t.key));var n=o._cacheKeys.indexOf(t.key);n>=0&&o._cacheKeys.splice(n,1),t.value.responseData.bodyAbstract&&t.value.responseData.bodyAbstract.length&&c.push(e.deleteShreddedData(JSON.parse(t.value.responseData.bodyAbstract)))})),Promise.all(c).then((function(){return r.log("Offline Persistence Toolkit OfflineCache: all matching entries are deleted from both the cache store and the shredded store."),!0}))}return!1}))}return c(i,t,n).then((function(e){if(e&&e.length){var t=e.map((function(e){var t=o._cacheKeys.indexOf(e);return t>=0&&o._cacheKeys.splice(t,1),i.removeByKey(e)}));return Promise.all(t)}return[]})).then((function(e){return!(!e||!e.length)}))})).catch((function(e){return r.log("Offline Persistence Toolkit OfflineCache: error occurred delete() for Request with url: "+t.url),!1}))},o.prototype.keys=function(e,t){e?r.log("Offline Persistence Toolkit OfflineCache: keys() for Request with url: "+e.url):r.log("Offline Persistence Toolkit OfflineCache: keys()");var o=this;return o._getStore().then((function(){return c(o._store,e,t)})).then((function(e){var t=[];return e.forEach((function(e){t.push(o._store.findByKey(e).then((function(e){return n.requestFromJSON(e.requestData)})))})),Promise.all(t)})).catch((function(t){return r.log("Offline Persistence Toolkit OfflineCache: keys() error for Request with url: "+e.url),[]}))},o.prototype.hasMatch=function(e,t){return r.log("Offline Persistence Toolkit OfflineCache: hasMatch() for Request with url: "+e.url),this._getCacheEntries(e,t).then((function(n){return null!==i(t&&t.ignoreVary,e,n)}))},o.prototype.clear=function(){r.log("Offline Persistence Toolkit OfflineCache: clear()");var e=this;return e._getStore().then((function(n){var r=[];return r.push(n.delete()),e._getShreddedStoreNames().then((function(n){return n.forEach((function(e){r.push(t.deleteStore(e))})),Promise.all(r).then((function(t){return e._updateShreddedStoreNames(null)})).then((function(){return e._cacheKeys=[],!0}))}))})).catch((function(e){r.log("Offline Persistence Toolkit OfflineCache: clear() error")}))},o})),define("persist/impl/offlineCacheManager",["./OfflineCache","./logger"],(function(e,t){"use strict";function n(){this._prefix="offlineCaches-",this._caches={},this._cachesArray=[]}return n.prototype.open=function(n){t.log("Offline Persistence Toolkit OfflineCacheManager: open() with name: "+n);var r=this._caches[n];return r||(r=new e(n,this._prefix+n),this._caches[n]=r,this._cachesArray.push(r)),r},n.prototype.match=function(e,n){t.log("Offline Persistence Toolkit OfflineCacheManager: match() for Request with url: "+e.url);var r=function(t,o){return o===t.length?Promise.resolve():t[o].match(e,n).then((function(e){return e?e.clone():r(t,o+1)}))};return r(this._cachesArray,0)},n.prototype.has=function(e){return t.log("Offline Persistence Toolkit OfflineCacheManager: has() for name: "+e),this._caches[e]?Promise.resolve(!0):Promise.resolve(!1)},n.prototype.delete=function(e){t.log("Offline Persistence Toolkit OfflineCacheManager: delete() for name: "+e);var n=this,r=n._caches[e];return r?r.clear().then((function(){return n._cachesArray.splice(n._cachesArray.indexOf(e),1),delete n._caches[e],!0})):Promise.resolve(!1)},n.prototype.keys=function(){t.log("Offline Persistence Toolkit OfflineCacheManager: keys()");for(var e=[],n=0;n<this._cachesArray.length;n++)e.push(this._cachesArray[n].getName());return Promise.resolve(e)},new n})),function(e){"use strict";if(!e.fetch){var t="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,i="ArrayBuffer"in e;if(i)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(e){return e&&DataView.prototype.isPrototypeOf(e)},u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};p.prototype.append=function(e,t){e=l(e),t=d(t);var n=this.map[e];this.map[e]=n?n+","+t:t},p.prototype.delete=function(e){delete this.map[l(e)]},p.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},p.prototype.set=function(e,t){this.map[l(e)]=d(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);
|
|
1792
|
+
r(!1,l,d);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",h--;;){if(o=e[h++],!/[\d\.\-e\+]/.test(o)){h--;break}n+=o}r(parseFloat(n),l,d);break;case'"':for(i="",s=void 0,a=0;'"'!==(u=e[h++])||"\\"===s&&a%2==1;)i+=u,"\\"===(s=u)?a++:a=0;r(JSON.parse('"'+i+'"'),l,d);break;case"[":c={element:[],index:l.length},l.push(c.element),d.push(c);break;case"{":f={element:{},index:l.length},l.push(f.element),d.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();r(l.pop(),l,d)}}},{}]},{},[11])(11)})),define("persist/impl/pouchDBPersistenceStore",["../PersistenceStore","../impl/storageUtils","pouchdb","./logger"],(function(e,t,n,r){"use strict";var o=function(t){e.call(this,t)};(o.prototype=new e).Init=function(e){this._version=e&&e.version||"0";var t=this._name+this._version,o=e?e.adapter:null,i=this._extractDBOptions(e);if(o)try{o.plugin&&n.plugin(o.plugin),(i=i||{}).adapter=o.name,this._dbOptions=i,this._db=new n(t,i)}catch(e){return r.log("Error creating PouchDB instance with adapter "+o+": ",e.message),r.log("Please make sure the needed plugin and adapter are installed."),Promise.reject(e)}else i?(this._dbOptions=i,this._db=new n(t,i)):(this._dbOptions=null,this._db=new n(t));return e&&e.index&&(Array.isArray(e.index)?(this._index=e.index.filter((function(e){return"key"!==e})),0===this._index.length&&(this._index=null)):r.log("index must be an array")),this._createIndex()},o.prototype._extractDBOptions=function(e){var t=null;if(e){var n=this;Object.keys(e).forEach((function(r){n._isPersistenceStoreKey(r)||(t||(t={}),t[r]=e[r])}))}return t},o.prototype._isPersistenceStoreKey=function(e){return"version"===e||"adapter"===e||"index"===e||"skipMetadata"===e},o.prototype._createIndex=function(){if(this._index&&this._db.createIndex){var e=this,t=e._name+e._index.toString().replace(",","").replace(".",""),n={index:{fields:e._index,name:t}};return e._db.createIndex(n).catch((function(t){r.error("creating index on "+e._index.toString()+" failed with error "+t)}))}return Promise.resolve()},o.prototype.upsert=function(e,t,n,o){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsert() for key: "+e);var s=this,a=e.toString();return s._db.get(a).then((function(e){return i(o,e)?e:Promise.reject({status:409})})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)})).then((function(e){return s._put(a,t,n,o,e)}))},o.prototype._put=function(e,t,n,r,o){var i=[],s=this._prepareUpsert(n,i),a={_id:e,key:e,metadata:t,value:s?null:n};o&&(a._rev=o._rev);var u=this;return u._db.put(a).then((function(t){return u._addAttachments(e,t.rev,i)})).catch((function(e){if(409!==e.status)throw e}))};var i=function(e,t){return!e||t.metadata.versionIdentifier===e};o.prototype._addAttachments=function(e,t,n){if(n&&n.length){var o=this,i=n.map((function(n){var r;return r=n.value instanceof Blob?n.value:new Blob([n.value]),o._db.putAttachment(e,n.path,t,r,"binary")}),this);return Promise.all(i).catch((function(t){r.error("store: "+o._name+" failed add attachment for doc "+e)}))}return Promise.resolve()},o.prototype.upsertAll=function(e){if(r.log("Offline Persistence Toolkit pouchDBPersistenceStore: upsertAll()"),e&&e.length){var t=this,n={},o=e.map((function(e){var r=e.key.toString(),o=e.value,i=[],s=t._prepareUpsert(o,i);i.length>0&&(n[r]=i);var a={_id:r,key:e.key,metadata:e.metadata,value:s?null:o};return t._db.get(r).then((function(e){return a._rev=e._rev,a})).catch((function(e){if(404===e.status&&"missing"===e.message)return a;throw e}))}));return Promise.all(o).then((function(e){return t._db.bulkDocs(e)})).then((function(e){var o=[];if(e.forEach((function(e,i){if(e.ok){var s=n[e.id];s&&o.push(t._addAttachments(e.id,e.rev,s))}else 409===e.status&&r.log("conflict error")})),o.length>0)return Promise.all(o)})).catch((function(e){r.log("error in upsertAll")}))}return Promise.resolve()},o.prototype.find=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: find() for expression: "+JSON.stringify(e));var n=this;if(e=e||{},n._db.find){var o=n._prepareFind(e);return n._db.find(o).then((function(e){if(e&&e.docs&&e.docs.length){var t=e.docs.map(n._findResultCallback(o.fields),n);return Promise.all(t)}return[]})).catch((function(e){if(404===e.status&&"missing"===e.message)return[];throw e}))}return n._db.allDocs({include_docs:!0}).then((function(r){if(r&&r.rows&&r.rows.length){var o=r.rows.filter((function(n){var r=n.doc;return!(s(n)||!t.satisfy(e.selector,r))}));if(o.length){var i=o.map((function(e){return n._fixKey(e.doc),e.doc})),a=t.sortRows(i,e.sort).map((function(r){return n._fixBinaryValue(r).then((function(n){return e.fields?t.assembleObject(n,e.fields):n.value}))}));return Promise.all(a)}return[]}return[]})).catch((function(e){return r.log("error retrieving all documents from pouch db, returns empty list as find operation.",e),[]}))},o.prototype._findResultCallback=function(e){return function(t){return this._fixValue(t).then((function(t){return e?t:t.value}))}},o.prototype._fixValue=function(e){return this._fixKey(e),this._fixBinaryValue(e)},o.prototype._fixBinaryValue=function(e){var t=e._id||e.id||e.key,n=e._attachments;if(n){var o=this,i=Object.keys(n)[0];return o._db.getAttachment(t,i).then((function(t){if("rootpath"===i)e.value=t;else{for(var n=i.split("."),r=e.value,o=0;o<n.length-1;o++)r=r[n[o]];r[n[n.length-1]]=t}return e})).catch((function(e){r.error("store: "+o._name+" error getting attachment. ")}))}return Promise.resolve(e)},o.prototype.findByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: findByKey() for key: "+e);var t=this,n=e.toString();return t._db.get(n,{attachments:!0}).then((function(e){return t._fixBinaryValue(e)})).then((function(e){return e.value})).catch((function(e){return 404===e.status&&"missing"===e.message?void 0:Promise.reject(e)}))},o.prototype.removeByKey=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: removeByKey() for key: "+e);var t=this;if(!e)return Promise.resolve(!1);var n=e.toString();return t._db.get(n).then((function(e){return t._db.remove(e)})).then((function(){return!0})).catch((function(e){return(404!==e.status||"missing"!==e.message)&&Promise.reject(e)}))},o.prototype.delete=function(e){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: delete() for expression: "+JSON.stringify(e));var t=this;if(e){var o=e;return o.fields=["_id","_rev"],t.find(o).then((function(e){if(e&&e.length){var n=e.map((function(e){return{_id:e._id,_rev:e._rev,_deleted:!0}}));return t._db.bulkDocs(n)}})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))}return t._db.destroy().then((function(){var e=t._name+t._version;return t._dbOptions?t._db=new n(e,t._dbOptions):t._db=new n(e),t._createIndex()})).catch((function(e){r.error("store: "+t._name+" error deleting....")}))},o.prototype.keys=function(){r.log("Offline Persistence Toolkit pouchDBPersistenceStore: keys()");var e=this;return e._db.allDocs().then((function(e){var t=e.rows,n=[];if(t&&t.length)for(var r=0;r<t.length;r++)s(t[r])||n.push(t[r].id);return n})).catch((function(t){r.error("store: "+e._name+" error getting all the docs for keys ")}))},o.prototype._prepareFind=function(e){var t={},n=e.selector;n?n&&(t.selector=n):t.selector={_id:{$gt:null}};var r=e.fields;return r&&r.length&&(t.fields=r,-1!==r.indexOf("key")&&-1===r.indexOf("_id")&&t.fields.push("_id")),t},o.prototype._prepareUpsert=function(e,t){return!!e&&(e instanceof Blob||e instanceof ArrayBuffer?(t.push({path:"rootpath",value:e}),!0):(this._inspectValue("",e,t),!1))},o.prototype._inspectValue=function(e,t,n){for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(o&&"object"==typeof o)if(o instanceof Blob||o instanceof ArrayBuffer){var i=e;i.length>0&&(i+=".");var s={path:i+r,value:o};n.push(s),t.key=null}else if(void 0===o.length){var a=e;e.length>0&&(e+="."),e+=r,this._inspectValue(e,o,n),e=a}}},o.prototype.updateKey=function(e,t){r.log("Offline Persistence Toolkit PouchDBPersistenceStore: updateKey() with currentKey: "+e+" and new key: "+t);var n=this;return n._db.get(e).then((function(e){return e?n.upsert(t,e.metadata,e.value):Promise.reject("No existing key found to update")})).then((function(){return n.removeByKey(e)})).catch((function(){r.error("store: "+n._name+" error updating key")}))};var s=function(e){return e.id.startsWith("_design/")};return o.prototype._fixKey=function(e){var t=e._id||e.id||e.key;t&&(e.key=t)},o})),define("persist/pouchDBPersistenceStoreFactory",["./impl/pouchDBPersistenceStore"],(function(e){"use strict";return{createPersistenceStore:function(t,n){return function(t,n){var r=new e(t);return r.Init(n).then((function(){return r}))}(t,n)}}})),define("persist/persistenceStoreManager",["./impl/logger","./impl/PersistenceStoreMetadata","./pouchDBPersistenceStoreFactory"],(function(e,t,n){"use strict";var r=function(){Object.defineProperty(this,"_stores",{value:{},writable:!0}),Object.defineProperty(this,"_factories",{value:{},writable:!0}),Object.defineProperty(this,"_DEFAULT_STORE_FACTORY_NAME",{value:"_defaultFactory",writable:!1}),Object.defineProperty(this,"_METADATA_STORE_NAME",{value:"systemCache-metadataStore",writable:!1}),Object.defineProperty(this,"_storeNameMapping",{value:{},writable:!0})};return r.prototype.registerStoreFactory=function(e,t){if(!t)throw TypeError("A valid factory must be provided.");if(!e)throw TypeError("A valid name must be provided.");var n=this._mapStoreName(e),r=this._factories[n];if(r&&r!==t)throw TypeError("A factory with the same name has already been registered.");this._factories[n]=t},r.prototype.registerDefaultStoreFactory=function(e){this.registerStoreFactory(this._DEFAULT_STORE_FACTORY_NAME,e)},r.prototype.openStore=function(t,n){e.log("Offline Persistence Toolkit PersistenceStoreManager: openStore() for name: "+t);var r=this._mapStoreName(t),o=this._stores[r],i=n&&n.version||"0";if(o&&o[i])return Promise.resolve(o[i]);var s=this._factories[r];if(s||(s=this._factories[this._DEFAULT_STORE_FACTORY_NAME]),!s)return Promise.reject(new Error("no factory is registered to create the store."));var a=this;return e.log("Offline Persistence Toolkit PersistenceStoreManager: Calling createPersistenceStore on factory"),s.createPersistenceStore(r,n).then((function(t){return(o=o||{})[i]=t,a._stores[r]=o,n&&n.skipMetadata?t:a._updateStoreMetadata(r,i).then((function(){return t})).catch((function(n){return e.log("updating store metadata for store "+r+" failed"),t}))}))},r.prototype._updateStoreMetadata=function(e,t){var n=this;return n._getStoresMetadata(e).then((function(r){var o=null;if(r?r.versions.indexOf(t)<0&&(r.versions.push(t),o=r.versions):o=[t],o){var i=n._encodeString(e);return n._metadataStore.upsert(i,{},o)}}))},r.prototype.hasStore=function(e,t){var n=this._mapStoreName(e),r=this._stores[n];return!(!r||0===Object.keys(r).length||t&&t.version&&!r[t.version])},r.prototype.deleteStore=function(t,n){e.log("Offline Persistence Toolkit PersistenceStoreManager: deleteStore() for name: "+t);var r=this,o=this._mapStoreName(t);return r._getStoresMetadata(o).then((function(i){if(i){var s=[],a=[],u=i.versions;if(n&&n.version){var c=u.indexOf(n.version);c<0?a=u:(u.splice(c,1),a=u,s.push(n.version))}else s=u;return!!s.length&&(l=s.map((function(e){var t=this;return t.openStore(o,{version:e,skipMetadata:!0}).then((function(n){return delete t._stores[o][e],n.delete()}))}),r),Promise.all(l).then((function(){var e=r._encodeString(o);return a.length?r._metadataStore.upsert(e,{},a):r._metadataStore.removeByKey(e)})).then((function(){return!0})).catch((function(t){return e.log("failed deleting store "+o),!1})))}var f=[];if(n&&n.version?r._stores[o]&&r._stores[o][n.version]&&(f.push(r._stores[o][n.version]),delete r._stores[o][n.version]):r._stores[o]&&(f=Object.values(r._stores[o]),r._stores[o]={}),f.length){var l=f.map((function(e){return e.delete()}));return Promise.all(l).then((function(){return!0})).catch((function(n){return e.log("failed deleting store "+t),!1}))}return!1}))},r.prototype.getStoresMetadata=function(){var n=this,r=new Map;return this._getMetadataStore().then((function(e){return e.find({fields:["key","value"]})})).then((function(e){return e&&e.length>0&&e.forEach((function(e){var o=n._decodeString(e.key),i=n._factories[o];i||(i=n._factories[n._DEFAULT_STORE_FACTORY_NAME]),r.set(o,new t(o,i,e.value))})),r})).catch((function(t){return e.log("error occured getting store metadata."),r}))},r.prototype._getStoresMetadata=function(n){var r=this;return r._getMetadataStore().then((function(e){var t=r._encodeString(n);return e.findByKey(t)})).then((function(e){if(e){var o=r._factories[n];return o||(o=r._factories[r._DEFAULT_STORE_FACTORY_NAME]),new t(n,o,e)}return null})).catch((function(t){return e.log("error getting store metadata for store "+n),null}))},r.prototype._mapStoreName=function(e,t){var n=this._storeNameMapping[e];return n||(n=e.replace(/(.*):\/\/(.*)/gi,"$1$2"),this._storeNameMapping[e]=n,n)},r.prototype._getMetadataStore=function(){var e=this;return e._metadataStore?Promise.resolve(e._metadataStore):(this._factories[this._DEFAULT_STORE_FACTORY_NAME]||(this._factories[e._METADATA_STORE_NAME]=n),this.openStore(e._METADATA_STORE_NAME,{skipMetadata:!0}).then((function(t){return e._metadataStore=t,e._metadataStore})))},r.prototype._encodeString=function(e){for(var t=[],n=0;n<e.length;n++){var r=Number(e.charCodeAt(n)).toString(16);t.push(r)}return t.join("")},r.prototype._decodeString=function(e){var t,n=e.toString(),r="";for(t=0;t<n.length;t+=2)r+=String.fromCharCode(parseInt(n.substr(t,2),16));return r},new r})),define("persist/impl/defaultCacheHandler",["../persistenceUtils","../persistenceStoreManager","./logger"],(function(e,t,n){"use strict";function r(){Object.defineProperty(this,"_endpointToOptionsMap",{value:{},writable:!0})}function o(e){for(var t=e.name,n=e.resourceIdentifier,r=e.keys,o=[],i=(new Date).toUTCString(),s=0;s<r.length;s++){var a={key:r[s],metadata:{lastUpdated:i,resourceIdentifier:n},value:e.data[s]};o.push(a)}var u={};return u[t]=o,u}r.prototype.constructRequestResponseCacheData=function(t,r){var o=this,i={};return n.log("Offline Persistence Toolkit DefaultCacheHandler: constructRequestResponseCacheData()"),e.requestToJSON(t).then((function(n){i.requestData=n;var s=o.hasShredder(t);return e.responseToJSON(r,{excludeBody:s})})).then((function(e){return i.responseData=e,{key:o._constructCacheKey(t,r),metadata:o.constructMetadata(t),value:i}}))},r.prototype.constructShreddedData=function(e,t){n.log("Offline Persistence Toolkit DefaultCacheHandler: constructShreddedData()");var r=this._getShredder(e);return r?r(t).then((function(e){return e&&Array.isArray(e)?e.map(o):null})):Promise.resolve()},r.prototype.shredResponse=function(e,t){n.log("Offline Persistence Toolkit DefaultCacheHandler: shredResponse()");var r=this._getShredder(e);return r?r(t):Promise.resolve()},r.prototype.cacheShreddedData=function(e,r){n.log("Offline Persistence Toolkit DefaultCacheHandler: cacheShreddedData()");var i=e.map(o),s=this;return function(e){var r=e.map((function(e){var r=Object.keys(e)[0],o=e[r];return o&&o.length?function(e,r){return n.log("Offline Persistence Toolkit DefaultCacheHandler: Updating store with shredded data"),t.openStore(e).then((function(e){return e.upsertAll(r)}))}(r,o):Promise.resolve()}));return Promise.all(r)}(i).then((function(){if(s._isCompleteCollection(r,e))return function(e){var n=e.map((function(e){var n=e.name,r={selector:{key:{$nin:e.keys}}};return t.openStore(n).then((function(e){return e.delete(r)}))}));return Promise.all(n)}(e)}))},r.prototype._isCompleteCollection=function(e,t){if(!e||"GET"!==e.method&&"HEAD"!==e.method)return!1;if(!function(e){if(!e)return!1;for(var t=0;t<e.length;t++)if("collection"!==e[t].resourceType)return!1;return!0}(t))return!1;if(e.url===e.baseUrl)return!0;var n=this._getQueryHandler(e.url);if(!n||"function"!=typeof n.normalizeQueryParameter)return!1;var r=n.normalizeQueryParameter(e.url);if(r.searchCriteria||0!==r.offset)return!1;var o=r.limit;return o<0||t[0].keys.length<o},r.prototype._constructCacheKey=function(e,t){var n=e.url+"$"+e.method+"$";if(t){var r=t.headers;if(r&&(a=r.get("vary")))if("*"===a)n=1e3*(new Date).getTime()+Math.floor(1e3*Math.random());else for(var o=e.headers,i=a.split(","),s=0;s<i.length;s++){var a,u=i[s];n+=(u=u.trim())+"="+(a=o&&o.get(u)?o.get(u):"undefined")+";"}}return n},r.prototype.getMatchedCacheKeys=function(e,t,n){var r,o;return r=t&&t.ignoreSearch?i(e.url):e.url,t&&t.ignoreMethod||(o=e.method),n.filter((function(n){var a=n.split("$");if(1===a.length){if(n.slice(0,r.length)!==r)return!1;if(t&&t.ignoreSearch&&"/"===n[r.length])return!1;if(o&&-1===(t&&t.ignoreSearch?n.slice(r.length):n.slice(r.length,r.length+e.method.length)).indexOf(o))return!1;if(!t||!t.ignoreVary){var u=n;if(!(u=o?(u=u.split(o))[u.length-1]:s(u)))return!0;var c=u.split("="),f=e.headers;if(2===c){if((h=f&&f.get(c[0])?f.get(c[0]):"undefined")!==c[1])return!1}else for(var l=0;l<c.length-1;l++){var d=c[l],h=f&&f.get(d)?f.get(d):"undefined",p=c[l+1].split(h);if(2!==p.length&&""!==p[0])return!1;if(p[1]&&p[1].startsWith(","))return!1;c[l+1]=p[1]}}return!0}if((t&&t.ignoreSearch?i(a[0]):a[0])!==r)return!1;if(o&&a[1]!==o)return!1;if(!t||!t.ignoreVary){if(!(u=a[2]))return!0;var v=u.split(";");if(1===v.length)return!1;for(f=e.headers,l=0;l<v.length-1;l++)if(d=v[l].split("="),(h=f&&f.get(d[0])?f.get(d[0]):"undefined")!=d[1])return!1}return!0}))},r.prototype.constructMetadata=function(e){var t=(new Date).getTime(),n=i(e.url);return{url:e.url,method:e.method,baseUrl:n,created:t,lastupdated:t}},r.prototype.constructResponse=function(t){return n.log("Offline Persistence Toolkit DefaultCacheHandler: constructResponse()"),e.responseFromJSON(t).then((function(t){return e.isCachedResponse(t)||t.headers.set("x-oracle-jscpt-cache-expiration-date",""),t}))},r.prototype.constructSearchCriteria=function(e,t){n.log("Offline Persistence Toolkit DefaultCacheHandler: constructSearchCriteria()");var r=!1;t&&void 0!==t.ignoreSearch&&(r=t.ignoreSearch);var o,s=!1;return t&&void 0!==t.ignoreMethod&&(s=t.ignoreMethod),o=r?{"metadata.baseUrl":i(e.url)}:{"metadata.url":e.url},s||(o["metadata.method"]=e.method),{selector:o,sort:["metadata.created"]}},r.prototype.registerEndpointOptions=function(e,t){if(!e)throw new Error({message:"a valid endpointKey must be provided."});if(this._endpointToOptionsMap[e])throw new Error({message:"endpointKey can only be registered once."});this._endpointToOptionsMap[e]=t},r.prototype.unregisterEndpointOptions=function(e){if(!e)throw new Error({message:"a valid endpointKey must be provided."});delete this._endpointToOptionsMap[e]},r.prototype.hasShredder=function(e){return null!==this._getShredder(e)},r.prototype._getShredder=function(e){var t=this._getJsonProcessor(e.url);return t?t.shredder:null},r.prototype._getUnshredder=function(e){var t=this._getJsonProcessor(e.url);return t?t.unshredder:null},r.prototype._getJsonProcessor=function(e){for(var t=Object.keys(this._endpointToOptionsMap),n=0;n<t.length;n++){var r=t[n];if(e===JSON.parse(r).url){var o=this._endpointToOptionsMap[r];return o&&o.jsonProcessor&&o.jsonProcessor.shredder&&o.jsonProcessor.unshredder?o.jsonProcessor:null}}return null},r.prototype._getQueryHandler=function(e){for(var t=Object.keys(this._endpointToOptionsMap),n=0;n<t.length;n++){var r=t[n];if(e===JSON.parse(r).url){var o=this._endpointToOptionsMap[r];return o&&o.queryHandler?o.queryHandler:null}}return null},r.prototype.fillResponseBodyWithShreddedData=function(e,r,o){n.log("Offline Persistence Toolkit DefaultCacheHandler: fillResponseBodyWithShreddedData()"),null!=e.url&&e.url.length>0&&null==o.headers.get("x-oracle-jscpt-response-url")&&o.headers.set("x-oracle-jscpt-response-url",e.url),r&&1===r.length&&"single"===r[0].resourceType&&o.headers.set("x-oracle-jscpt-resource-type","single");var i=this._getUnshredder(e),s=this._getShredder(e);if(!(i&&s&&o&&r&&r.length))return Promise.resolve(o);var a=r.map((function(e){return r=(n=e).name,t.openStore(r).then((function(e){if(n.keys&&n.keys.length){if(1===n.keys.length)return e.findByKey(n.keys[0]);var t={selector:{$or:n.keys.map((function(e){return{key:{$eq:e}}}))}};return e.find(t)}return[]})).then((function(e){return Array.isArray(e)||(e=[e]),n.data=e,n}));var n,r}));return Promise.all(a).then((function(e){return i(e,o)}))},r.prototype.deleteShreddedData=function(e){var n=[];return e.forEach((function(e){var r=e.name,o=e.keys;if(r&&o&&o.length){var i=t.openStore(r).then((function(e){var t={selector:{$or:o.map((function(e){return{key:{$eq:e}}}))}};return e.delete(t)}));n.push(i)}})),Promise.all(n)};var i=function(e){if(!e||"string"!=typeof e)return"";var t=/([^?]*)\?/.exec(e);return t&&2===t.length?t[1]:e},s=function(e){if(!e||"string"!=typeof e)return"";var t=e.split("").reverse().join(""),n=/(.*?)(TEG|TUP|ETELED|TSOP|HCTAP|TCENNOC|SNOITPO|ECART)/.exec(t);return n&&3===n.length?n[1].split("").reverse().join(""):e};return new r})),define("persist/impl/PersistenceSyncManager",["require","../persistenceUtils","../persistenceStoreManager","./defaultCacheHandler","./logger"],(function(e,t,n,r,o){"use strict";function i(e,t,n){Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_isOnline",{value:e}),Object.defineProperty(this,"_browserFetch",{value:t}),Object.defineProperty(this,"_cache",{value:n})}function s(e){return"stop"===(e=e||{}).action}function a(e,t){var r,o,i,s,a,u=[];e instanceof Array||(e=[e]);var c=e.length,f=function(l){if(!(l<c))return Promise.resolve();if(i=e[l].storeName,o=e[l].operation,s=e[l].undoRedoData,"upsert"==o||"remove"==o&&t){for(u=[],a=s.length,r=0;r<a;r++)t?u.push({key:s[r].key,value:s[r].undo}):u.push({key:s[r].key,value:s[r].redo});return n.openStore(i).then((function(e){return 1==u.length&&null==u[0].value&&null!=u[0].key?e.removeByKey(u[0].key).then((function(){return f(++l)})):e.upsertAll(u).then((function(){return f(++l)}))}))}return"remove"==o?n.openStore(i).then((function(e){return e.removeByKey(s[0].key).then((function(){return f(++l)}))})):void 0};return f(0)}function u(e,t,n,r){var o=e._eventListeners.filter(function(e,t){return function(n){return e.toLowerCase()==n.type&&(null!=t&&t.match(n.scope)||null==t||null==n.scope)}}(t,r));return c(n,o)}function c(e,t){return t.length>0?t[0].listener(e).then((function(e){return null!=e?Promise.resolve(e):t.length>1?c(t.slice(1)):void 0})):Promise.resolve(null)}function f(e){return n.openStore(e,{index:["key"],skipMetadata:!0})}function l(){return f("syncLog")}function d(){return f("redoUndoLog")}return i.prototype.addEventListener=function(e,t,n){o.log("Offline Persistence Toolkit PersistenceSyncManager: addEventListener() for type: "+e+" and scope: "+n),this._eventListeners.push({type:e.toLowerCase(),listener:t,scope:n})},i.prototype.removeEventListener=function(e,t,n){o.log("Offline Persistence Toolkit PersistenceSyncManager: removeEventListener() for type: "+e+" and scope: "+n),this._eventListeners=this._eventListeners.filter((function(r){return e.toLowerCase()!=r.type||t!=r.listener||n!=r.scope}))},i.prototype.getSyncLog=function(){var e;return o.log("Offline Persistence Toolkit PersistenceSyncManager: getSyncLog()"),this._readingSyncLog||(this._readingSyncLog=(e=this,l().then((function(e){return e.find((t={},n=[],(r=[]).push("key"),t.sort=r,n.push("key"),n.push("value"),t.fields=n,t));var t,n,r})).then((function(e){return function(e){var n,r,o=[],i=function(e){return e&&0!=e.length?(n=e[0].key,r=e[0].value,t.requestFromJSON(r).then((function(t){return o.push(function(e,t){return{requestId:e,request:t,undo:function(){return function(e){return d().then((function(t){return t.findByKey(e)})).then((function(e){return null!=e&&a(e,!0).then((function(){return!0}))}))}(e)},redo:function(){return function(e){return d().then((function(t){return t.findByKey(e)})).then((function(e){return null!=e&&a(e,!1).then((function(){return!0}))}))}(e)}}}(n,t)),e.shift(),i(e)}))):Promise.resolve(o)};return i(e)}(e)})).then((function(t){return e._readingSyncLog=null,t})))),this._readingSyncLog},i.prototype.insertRequest=function(e,n){o.log("Offline Persistence Toolkit PersistenceSyncManager: insertRequest() for Request with url: "+e.url);var i={};return l().then((function(n){return i.store=n,t.requestToJSON(e,{_noClone:!0})})).then((function(t){return i.requestData=t,i.metadata=r.constructMetadata(e),i.requestId=i.metadata.created.toString(),i.store.upsert(i.requestId,i.metadata,i.requestData)})).then((function(){if(null!=n){var e=n.undoRedoDataArray;return null!=e?d().then((function(t){var n=function(r){return r<e.length&&null!=e[r]?t.upsert(i.requestId,i.metadata,e[r]).then((function(){return n(++r)})):Promise.resolve()};return n(0)})):Promise.resolve()}return Promise.resolve()}))},i.prototype.removeRequest=function(e){o.log("Offline Persistence Toolkit PersistenceSyncManager: removeRequest() for Request with requestId: "+e);var n=this,r={};return l().then((function(n){return r.store=n,function(e,n){return n.findByKey(e).then((function(e){if(e)return t.requestFromJSON(e)}))}(e,n)})).then((function(t){return t?n._internalRemoveRequest(e,t,r.store):void 0}))},i.prototype._internalRemoveRequest=function(e,t,n){var r=[];return n?r.push(n.removeByKey(e)):r.push(l().then((function(t){return t.removeByKey(e)}))),"GET"!==t.method&&"HEAD"!==t.method&&r.push(d().then((function(t){return t.removeByKey(e)}))),Promise.all(r).then((function(){return t})).catch((function(t){o.log("Offline Persistence Toolkit PersistenceSyncManager: removeRequest() error for Request with requestId: "+e)}))},i.prototype.updateRequest=function(e,n){return o.log("Offline Persistence Toolkit PersistenceSyncManager: updateRequest() for Request with requestId: "+e),Promise.all([l(),t.requestToJSON(n)]).then((function(t){var o=t[0],i=t[1],s=r.constructMetadata(n);return o.upsert(e,s,i)}))},i.prototype.sync=function(e){o.log("Offline Persistence Toolkit PersistenceSyncManager: sync()"),this._options=e||{};var n=this;return this._syncing?Promise.reject("Cannot start sync while sync is in progress"):(this._syncing=!0,new Promise((function(e,r){n.getSyncLog().then((function(i){var a,c,f;o.log("Offline Persistence Toolkit PersistenceSyncManager: Processing sync");var l=function(i){0==i.length&&(o.log("Offline Persistence Toolkit PersistenceSyncManager: Sync finished, no requests in sync log"),e()),i.length>0&&(o.log("Offline Persistence Toolkit PersistenceSyncManager: Processing sync, # of requests in sync log: "+i.length),a=i[0].requestId,c=i[0].request,f=c.clone(),o.log("Offline Persistence Toolkit PersistenceSyncManager: Dispatching beforeSyncRequest event"),u(n,"beforeSyncRequest",{requestId:a,request:f.clone()},c.url).then((function(d){if(s(d))return o.log("Offline Persistence Toolkit PersistenceSyncManager: Sync stopped by beforeSyncRequest event listener"),void e();"skip"!==(d=d||{}).action?("replay"===d.action&&(o.log("Offline Persistence Toolkit PersistenceSyncManager: Replay request from beforeSyncRequest event listener"),c=d.request),f=c.clone(),function(e,t){var n,r=e,i=r._options.preflightOptionsRequest,s=r._options.preflightOptionsRequestTimeout;if(null!=t.url&&"disabled"!=i&&null!=t.url.match(i)){if(o.log("Offline Persistence Toolkit PersistenceSyncManager: Checking URL based on preflightOptionsRequest"),r._pingedURLs){if(r._pingedURLs.indexOf(t.url)>=0)return Promise.resolve(!0)}else r._pingedURLs=[];return r._preflightOptionsRequestId=(new Date).getTime(),new Promise((n=r._preflightOptionsRequestId,function(e,o){r._repliedOptionsRequest=!1;var i=new Request(t.url,{method:"OPTIONS"}),a=6e4;null!=s&&(a=s),setTimeout((function(){r._repliedOptionsRequest||r._preflightOptionsRequestId!=n||o(!1)}),a),r._browserFetch(i).then((function(n){r._repliedOptionsRequest=!0,r._pingedURLs||(r._pingedURLs=[]),r._pingedURLs.push(t.url),e(!0)}),(function(t){r._repliedOptionsRequest=!0,e(!0)}))}))}return Promise.resolve(!0)}(n,c).then((function(){t.markReplayRequest(c,!0),o.log("Offline Persistence Toolkit PersistenceSyncManager: Replaying request with url: "+c.url),("undefined"!=typeof window&&null!=window?fetch:n._browserFetch)(c).then((function(d){d.status>=400?r({error:d.statusText,requestId:a,request:f.clone(),response:d.clone()}):t._cloneResponse(d,{url:c.url}).then((function(t){o.log("Offline Persistence Toolkit PersistenceSyncManager: Dispatching syncRequest event"),u(n,"syncRequest",{requestId:a,request:f.clone(),response:t.clone()},c.url).then((function(t){s(t)?e():(o.log("Offline Persistence Toolkit PersistenceSyncManager: Removing replayed request"),n._internalRemoveRequest(a,c).then((function(){i.shift(),l(i)}),(function(e){r({error:e,requestId:a,request:f.clone()})})))}))}))}),(function(e){r({error:e,requestId:a,request:f.clone()})}))}),(function(e){r(!1===e?{error:"Preflight OPTIONS request timed out",requestId:a,request:f.clone(),response:new Response(null,{status:504,statusText:"Preflight OPTIONS request timed out"})}:{error:e,requestId:a,request:f.clone()})}))):(o.log("Offline Persistence Toolkit PersistenceSyncManager: Removing skipped request"),n._internalRemoveRequest(a,c).then((function(){i.shift(),l(i)}),(function(e){r({error:e,requestId:a,request:f.clone()})})))})))};i=function(e){if(e&&e.length>0){var t,n,r=[];for(t=0;t<e.length;t++)"GET"!=(n=e[t].request).method&&"HEAD"!=n.method&&r.push(e[t]);for(t=0;t<e.length;t++)"GET"!=(n=e[t].request).method&&"HEAD"!=n.method||r.push(e[t]);return r}return e}(i),l(i)}))})).finally((function(e){n._syncing=!1,n._pingedURLs=null})))},i})),define("persist/impl/OfflineCache",["./defaultCacheHandler","../persistenceStoreManager","../persistenceUtils","./logger"],(function(e,t,n,r){"use strict";function o(e,t){if(!e)throw TypeError("A name must be provided to create an OfflineCache!");if(!t)throw TypeError("A persistence store must be provided to create an OfflineCache!");this._name=e,this._storeName=t,this._shreddedNamesStoreName=this._storeName+"_OPT_INT_SHRED_STORE_NAMES_",this._store=null,this._cacheKeys=[],this._createStorePromise}function i(e,t,n){if(n&&n.length)for(var r=0;r<n.length;r++){var o=n[r];if(a(e,t,o.value))return o}return null}function s(e,t,n){return function(r){var o;return o=n?r[n]:r,a(e,t,o)}}function a(e,t,n){if(e)return!0;if(!n||!t)return!1;var o=n.requestData.headers,i=n.responseData.headers,s=t.headers,a=i.vary;if(r.log("Offline Persistence Toolkit OfflineCache: Processing HTTP Vary header"),!a)return!0;if("*"===a.trim())return!1;for(var u=a.split(","),c=0;c<u.length;c++){var f=u[c].toLowerCase();f=f.trim();var l=s.get(f),d=o[f];if(r.log("Offline Persistence Toolkit OfflineCache: HTTP Vary header name: "+f),r.log("Offline Persistence Toolkit OfflineCache: Request HTTP Vary header value: "+l),r.log("Offline Persistence Toolkit OfflineCache: Cached HTTP Vary header value: "+d),!(!d&&!l||d&&l&&d===l))return!1}return!0}function u(t,n,o){if(n){r.log("Offline Persistence Toolkit OfflineCache: Converting cached entry to Response object");var i=!1;o&&o.ignoreBody&&(i=!0);var s=n.bodyAbstract;return e.constructResponse(n).then((function(n){if(null!=t.url&&t.url.length>0&&null==n.headers.get("x-oracle-jscpt-response-url")&&n.headers.set("x-oracle-jscpt-response-url",t.url),!i&&s){var o;try{o=JSON.parse(s)}catch(e){r.error("error parsing json "+s)}return e.fillResponseBodyWithShreddedData(t,o,n)}return n}))}return Promise.resolve()}function c(t,n,r){if(n){var o=e.constructSearchCriteria(n,r);o.fields=["key","value"];var i=r&&r.ignoreVary;return t.find(o).then((function(e){return e&&e.length?e.filter(s(i,n,"value")).map((function(e){return e.key})):[]}))}return t.keys()}return o.prototype.getName=function(){return this._name},o.prototype.add=function(e){r.log("Offline Persistence Toolkit OfflineCache: add()");var t=this;return fetch(e).then((function(n){return t.put(e,n)}))},o.prototype.addAll=function(e){r.log("Offline Persistence Toolkit OfflineCache: addAll()");var t=e.map(this.add,this);return Promise.all(t)},o.prototype.match=function(e,t){return r.log("Offline Persistence Toolkit OfflineCache: match() for Request with url: "+e.url),this._getCacheEntries(e,t).then((function(n){var r=i(t&&t.ignoreVary,e,n);if(r)return u(e,r.value.responseData,t)})).catch((function(t){r.log("error finding match for request with url: "+e.url)}))},o.prototype._getCacheEntries=function(t,n){var r=this;return this._getStore().then((function(o){var i=e.getMatchedCacheKeys(t,n,r._cacheKeys);if(i&&i.length){var s=i.map((function(e){return o.findByKey(e).then((function(t){return{key:e,value:t}}))}));return Promise.all(s)}var a=e.constructSearchCriteria(t,n);return a.fields=["key","value"],o.find(a)}))},o.prototype._matchByKey=function(e,t,n){return this._getStore().then((function(e){return e.findByKey(t)})).then((function(t){return t?u(e,t.responseData,n):void 0}))},o.prototype._internalMatch=function(t,n){var o=this;return o._getStore().then((function(r){var i=e.getMatchedCacheKeys(t,n,o._cacheKeys);if(i&&i.length){var s=i.map((function(e){return r.findByKey(e)}));return Promise.all(s).then((function(e){return e.map((function(e,t){return{key:i[t],value:e}}))}))}var a=e.constructSearchCriteria(t,n);return a.fields=["key","value"],r.find(a)})).then((function(e){if(e){var o=i(n&&n.ignoreVary,t,e);if(o){var s={key:o.key},a=o.value.responseData.bodyAbstract;if(a)try{var u=JSON.parse(a);u?1===u.length&&"single"===u[0].resourceType?s.resourceType="single":s.resourceType="collection":s.resourceType="unknown"}catch(e){return void r.log("internal error: invalid body abstract")}else s.resourceType="unknown";return s}}})).catch((function(e){r.log("error finding match internal")}))},o.prototype.matchAll=function(e,t){return r.log("Offline Persistence Toolkit OfflineCache: matchAll() for Request with url: "+e.url),this._getCacheEntries(e,t).then((function(n){var r=function(e,t,n){var r=[];return n&&n.length&&(r=n.filter(s(e,t,"value")).map((function(e){return e.value.responseData}))),r}(t&&t.ignoreVary,e,n);return function(e,t,n){if(t&&t.length){var r=t.map((function(t){return u(e,t,n)}));return Promise.all(r)}return Promise.resolve()}(e,r,t)})).catch((function(t){r.log("error finding all matches for request with url: "+e.url)}))},o.prototype._getStore=function(){var e,n=this;return n._store?Promise.resolve(n._store):(n._createStorePromise||(n._createStorePromise=t.openStore(n._storeName,{index:["metadata.baseUrl","metadata.url","metadata.created"],skipMetadata:!0}).then((function(t){return e=t,t.keys()})).then((function(t){return n._cacheKeys=t,n._store=e,n._store}))),n._createStorePromise)},o.prototype._getShreddedNamesStore=function(){var e=this;return e._shreddedNamesStore?Promise.resolve(e._shreddedNamesStore):(e._createShreddedNamesStorePromise||(e._createShreddedNamesStorePromise=t.openStore(e._shreddedNamesStoreName,{index:["metadata.baseUrl","metadata.url","metadata.created"],skipMetadata:!0}).then((function(t){return e._shreddedNamesStore=t,e._shreddedNamesStore}))),e._createShreddedNamesStorePromise)},o.prototype.put=function(t,n){r.log("Offline Persistence Toolkit OfflineCache: put() for Request with url: "+t.url);var o,i=this;return i._getStore().then((function(){return e.constructRequestResponseCacheData(t,n)})).then((function(s){var a=i._store;return o=s.key,e.hasShredder(t)?e.shredResponse(t,n).then((function(t){if(t){var n=[];return s.value.responseData.bodyAbstract=function(e){var t=e.map((function(e){return{name:e.name,keys:e.keys?e.keys.reduce((function(e,t){return t?e.push(t):r.warn("should not have undefined key in the shredded data"),e}),[]):e.keys,resourceType:e.resourceType}}));return JSON.stringify(t)}(t),n.push(a.upsert(s.key,s.metadata,s.value)),n.push(e.cacheShreddedData(t,s.metadata)),i._updateShreddedStoreNames(t.map((function(e){return e.name}))).then((function(){return Promise.all(n)}))}o=null})):a.upsert(s.key,s.metadata,s.value)})).then((function(){o&&i._cacheKeys.indexOf(o)<0&&i._cacheKeys.push(o)})).catch((function(e){r.error("error in cache.put() for Request with url: "+t.url)}))},o.prototype._updateShreddedStoreNames=function(e){return this._getShreddedNamesStore().then((function(t){return e?t.keys().then((function(n){var r=[];if(e.forEach((function(e){n.indexOf(e)<0&&r.push(e)})),r.length>0){var o=[];return r.forEach((function(e){o.push({key:e,metadata:{},value:{}})})),t.upsertAll(o)}})):t.delete()}))},o.prototype._getShreddedStoreNames=function(){return this._getShreddedNamesStore().then((function(e){return e.keys()}))},o.prototype.delete=function(t,n){if(!t)return r.warn("Offline Persistence Toolkit OfflineCache: delete() request is a required parameter. To clear the cache, please call clear()"),Promise.resolve(!1);r.log("Offline Persistence Toolkit OfflineCache: delete() for Request with url: "+t.url);var o=this;return o._getStore().then((function(i){if(e.hasShredder(t)){var a=e.constructSearchCriteria(t,n);a.fields=["key","value"];var u=n&&n.ignoreVary;return i.find(a).then((function(n){if(n&&n.length){var a=n.filter(s(u,t,"value")),c=[];return a.forEach((function(t){c.push(i.removeByKey(t.key));var n=o._cacheKeys.indexOf(t.key);n>=0&&o._cacheKeys.splice(n,1),t.value.responseData.bodyAbstract&&t.value.responseData.bodyAbstract.length&&c.push(e.deleteShreddedData(JSON.parse(t.value.responseData.bodyAbstract)))})),Promise.all(c).then((function(){return r.log("Offline Persistence Toolkit OfflineCache: all matching entries are deleted from both the cache store and the shredded store."),!0}))}return!1}))}return c(i,t,n).then((function(e){if(e&&e.length){var t=e.map((function(e){var t=o._cacheKeys.indexOf(e);return t>=0&&o._cacheKeys.splice(t,1),i.removeByKey(e)}));return Promise.all(t)}return[]})).then((function(e){return!(!e||!e.length)}))})).catch((function(e){return r.log("Offline Persistence Toolkit OfflineCache: error occurred delete() for Request with url: "+t.url),!1}))},o.prototype.keys=function(e,t){e?r.log("Offline Persistence Toolkit OfflineCache: keys() for Request with url: "+e.url):r.log("Offline Persistence Toolkit OfflineCache: keys()");var o=this;return o._getStore().then((function(){return c(o._store,e,t)})).then((function(e){var t=[];return e.forEach((function(e){t.push(o._store.findByKey(e).then((function(e){return n.requestFromJSON(e.requestData)})))})),Promise.all(t)})).catch((function(t){return r.log("Offline Persistence Toolkit OfflineCache: keys() error for Request with url: "+e.url),[]}))},o.prototype.hasMatch=function(e,t){return r.log("Offline Persistence Toolkit OfflineCache: hasMatch() for Request with url: "+e.url),this._getCacheEntries(e,t).then((function(n){return null!==i(t&&t.ignoreVary,e,n)}))},o.prototype.clear=function(){r.log("Offline Persistence Toolkit OfflineCache: clear()");var e=this;return e._getStore().then((function(n){var r=[];return r.push(n.delete()),e._getShreddedStoreNames().then((function(n){return n.forEach((function(e){r.push(t.deleteStore(e))})),Promise.all(r).then((function(t){return e._updateShreddedStoreNames(null)})).then((function(){return e._cacheKeys=[],!0}))}))})).catch((function(e){r.log("Offline Persistence Toolkit OfflineCache: clear() error")}))},o})),define("persist/impl/offlineCacheManager",["./OfflineCache","./logger"],(function(e,t){"use strict";function n(){this._prefix="offlineCaches-",this._caches={},this._cachesArray=[]}return n.prototype.open=function(n){t.log("Offline Persistence Toolkit OfflineCacheManager: open() with name: "+n);var r=this._caches[n];return r||(r=new e(n,this._prefix+n),this._caches[n]=r,this._cachesArray.push(r)),r},n.prototype.match=function(e,n){t.log("Offline Persistence Toolkit OfflineCacheManager: match() for Request with url: "+e.url);var r=function(t,o){return o===t.length?Promise.resolve():t[o].match(e,n).then((function(e){return e?e.clone():r(t,o+1)}))};return r(this._cachesArray,0)},n.prototype.has=function(e){return t.log("Offline Persistence Toolkit OfflineCacheManager: has() for name: "+e),this._caches[e]?Promise.resolve(!0):Promise.resolve(!1)},n.prototype.delete=function(e){t.log("Offline Persistence Toolkit OfflineCacheManager: delete() for name: "+e);var n=this,r=n._caches[e];return r?r.clear().then((function(){return n._cachesArray.splice(n._cachesArray.indexOf(e),1),delete n._caches[e],!0})):Promise.resolve(!1)},n.prototype.keys=function(){t.log("Offline Persistence Toolkit OfflineCacheManager: keys()");for(var e=[],n=0;n<this._cachesArray.length;n++)e.push(this._cachesArray[n].getName());return Promise.resolve(e)},new n})),function(e){"use strict";if(!e.fetch){var t="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,i="ArrayBuffer"in e;if(i)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(e){return e&&DataView.prototype.isPrototypeOf(e)},u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};p.prototype.append=function(e,t){e=l(e),t=d(t);var n=this.map[e];this.map[e]=n?n+","+t:t},p.prototype.delete=function(e){delete this.map[l(e)]},p.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},p.prototype.set=function(e,t){this.map[l(e)]=d(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);
|
|
1793
1793
|
// HTTP methods whose capitalization should be normalized
|
|
1794
1794
|
var c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var f=[301,302,303,307,308];O.redirect=function(e,t){if(-1===f.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})},e.Headers=p,e.Request=b,e.Response=O,e.fetch=function(e,t){return new Promise((function(n,o){var i=new b(e,t),s=new XMLHttpRequest;// @HTMLUpdateOK
|
|
1795
1795
|
s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;n(new O(o,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.open(i.method,i.url,!0),"include"===i.credentials&&(s.withCredentials=!0),"responseType"in s&&r&&(s.responseType="blob"),i.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===i._bodyInit?null:i._bodyInit)}))},e.fetch.polyfill=!0}function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}
|
|
@@ -1799,4 +1799,4 @@ function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,valu
|
|
|
1799
1799
|
}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t]);// @XSSFalsePositive
|
|
1800
1800
|
}),this)}function v(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function _(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(r&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(o&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(i&&r&&a(e))this._bodyArrayBuffer=_(e.buffer),
|
|
1801
1801
|
// IE 10-11 can't handle a DataView body.
|
|
1802
|
-
this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!i||!ArrayBuffer.prototype.isPrototypeOf(e)&&!u(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=_(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=v(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?v(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,n,r=v(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=y(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this._bodyFormData?Promise.resolve(this._bodyFormData):this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),c.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function O(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this),define("persist/impl/fetch",(function(){})),define("persist/persistenceManager",["./impl/PersistenceXMLHttpRequest","./impl/PersistenceSyncManager","./impl/offlineCacheManager","./impl/logger","./impl/fetch"],(function(e,t,n,r){"use strict";function o(){Object.defineProperty(this,"_registrations",{value:[],writable:!0}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_forceOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_isOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_cache",{value:null,writable:!0}),Object.defineProperty(this,"_persistenceSyncManager",{value:new t(this.isOnline.bind(this),this.browserFetch.bind(this),this.getCache.bind(this))})}function i(){return"undefined"!=typeof window&&null!=window}function s(e,t){Object.defineProperty(this,"scope",{value:e,enumerable:!0}),Object.defineProperty(this,"_persistenceManager",{value:t}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0})}function a(e){return function t(n,o){var i=this,s=n,a=o;if(r.log("Offline Persistence Toolkit persistenceRequest: Create New Request"),n._input){for(var c in r.log("Offline Persistence Toolkit persistenceRequest: Input is a PersistenceRequest"),s=n._input,a=Object.assign({},n._init),o)o.hasOwnProperty(c)&&(a[c]=o[c]);if(n.headers&&a&&a.body&&a.body instanceof FormData)if(a.headers){var f=n.headers.get("Content-Type");a.headers.set("Content-Type",f)}else a.headers=n.headers}this._browserRequest=new e._browserRequestConstructor(s,a),this._input=s,this._init=a;var l,d=function(e){var t=Object.getOwnPropertyDescriptor(i._browserRequest,e);t&&(t.writable||t.set)?Object.defineProperty(i,e,{get:function(){return i._browserRequest[e]},set:function(t){i._browserRequest[e]=t},enumerable:!0}):Object.defineProperty(i,e,{get:function(){return i._browserRequest[e]},enumerable:!0})};for(l in this._browserRequest)"body"!=l&&"function"==typeof this._browserRequest[l]||d(l);var h=this.headers.get("Content-Type");null!=h&&h.indexOf("boundary=")>-1&&h.indexOf("form-data")>-1&&(h=h.split("boundary="),this._boundary="--"+h[h.length-1]),this.arrayBuffer=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called arrayBuffer()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?u(e._init.body,e._boundary).then((function(e){var t;return t=e,(new TextEncoder).encode(t).buffer})):e._browserRequest.arrayBuffer()}catch(e){return Promise.reject(e)}},this.blob=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called blob()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?u(e._init.body,e._boundary).then((function(t){return new Blob([t],{type:e.headers.get("Content-Type")})})):e._browserRequest.blob()}catch(e){return Promise.reject(e)}},this.formData=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called formData()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?Promise.resolve(e._init.body):e._browserRequest.formData()}catch(e){return Promise.reject(e)}},this.json=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called json()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?Promise.reject(new SyntaxError("Unexpected number in JSON at position 1")):e._browserRequest.json()}catch(e){return Promise.reject(e)}},this.text=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called text()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?u(e._init.body,e._boundary):e._browserRequest.text()}catch(e){return Promise.reject(e)}},this.clone=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called clone()");var e=this;e.headers&&e._init&&e._init.body&&e._init.body instanceof FormData&&(e._init.headers=e.headers);var n=new t(e._input,e._init);return n._browserRequest=e._browserRequest.clone(),n},this.toString=function(){return r.log("Offline Persistence Toolkit persistenceRequest:requestToString()"),this._input.url?this._input.url:this._input}}}function u(e,t){return new Promise((function(n,r){var o=[],i=t;e.forEach((function(e,n){o.push(function(e,t,n){return new Promise((function(r,o){var i;switch(e.constructor.name){case"File":var s=new FileReader;s.onload=function(o){i='\r\nContent-Disposition: form-data; name="'+t.toString()+'"; filename="'+e.name+'"\r\nContent-Type: '+e.type+"\r\n\r\n"+o.target.result+"\r\n"+n,r(i)},s.onerror=function(){s.abort(),o(new DOMException("Problem parsing input file."))},s.readAsText(e);break;case"String":r(i='\r\nContent-Disposition: form-data; name="'+t+'"\r\n\r\n'+e+"\r\n"+n);break;default:i='\r\nContent-Disposition: form-data; name="'+t.toString()+'"\r\n\r\n'+e.toString()+"\r\n"+n,r(i)}}))}(e,n,t))})),Promise.all(o).then((function(e){e.forEach((function(e){i+=e})),n(i+="--")})).catch((function(e){r(e)}))}))}return o.prototype.init=function(){return r.log("Offline Persistence Toolkit PersistenceManager: Initilizing"),function(t){var n,o;n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=/\((iPad|iPhone)/i.test(navigator.userAgent),!n&&!o||t._browserRequestConstructor||t._persistenceRequestConstructor||(r.log("Offline Persistence Toolkit PersistenceManager: Replacing Safari Browser APIs"),Object.defineProperty(t,"_browserRequestConstructor",{value:self.Request,writable:!1}),Object.defineProperty(t,"_persistenceRequestConstructor",{value:a(t),writable:!1}),self.Request=t._persistenceRequestConstructor,i()||t._browserFetchFunc||(Object.defineProperty(t,"_browserFetchFunc",{value:self.fetch,writable:!1}),self.fetch=function(e){function t(e){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:e,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return t.prototype.respondWith=function(e){var t=this;if(e instanceof Promise)e.then((function(e){t._resolveCallback(e)}),(function(e){t._rejectCallback(e)}));else if("function"==typeof e){var n=e();t._resolveCallback(n)}},t.prototype._setPromiseCallbacks=function(e,t){this._resolveCallback=e,this._rejectCallback=t},function(t,n){var o;return o=Request.prototype.isPrototypeOf(t)&&!n?t:new Request(t,n),r.log("Offline Persistence Toolkit serviceWorkerFetch:"+o.url),o._browserRequest&&(o=o._browserRequest),new Promise((function(t,n){e._browserFetchFunc.call(self,o).then((function(e){t(e)}),(function(e){n(e)}))}))}}(t))),!i()||t._browserFetchFunc||t._browserXMLHttpRequest||(r.log("Offline Persistence Toolkit PersistenceManager: Replacing browser APIs"),Object.defineProperty(t,"_browserFetchFunc",{value:window.fetch,writable:!1}),Object.defineProperty(t,"_browserXMLHttpRequest",{value:window.XMLHttpRequest,writable:!1}),window.fetch=function(e){function t(e){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:e,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return t.prototype.respondWith=function(e){var t=this;if(e instanceof Promise)e.then((function(e){t._resolveCallback(e)}),(function(e){t._rejectCallback(e)}));else if("function"==typeof e){var n=e();t._resolveCallback(n)}},t.prototype._setPromiseCallbacks=function(e,t){this._resolveCallback=e,this._rejectCallback=t},function(n,o){var i;return i=Request.prototype.isPrototypeOf(n)&&!o?n:new Request(n,o),e.getRegistration(i.url).then((function(n){if(null!=n){var o=new t(i),s=function(e,t,n){var o,i,s,a,u=null,c=e._registrations,f=null!=c?c.length:0;for(o=0;o<f;o++)if(s=c[o],null!=n.request.url.match(s.scope)){for(a=s._eventListeners.length,i=0;i<a;i++)s._eventListeners[i].type==t&&(null===u&&n._setPromiseCallbacks instanceof Function&&(u=new Promise((function(e,t){n._setPromiseCallbacks(e,t)}))),r.log("Offline Persistence Toolkit PersistenceManager: Calling fetch event listener"),s._eventListeners[i].listener(n));if(null!=u)return u}return!0}(e,"fetch",o);if(null!=s&&s instanceof Promise)return s}return e.browserFetch(i)}))}}(t),window.XMLHttpRequest=function(){return null!=t._browserFetchRequest?new t._browserXMLHttpRequest:new e(t._browserXMLHttpRequest)})}(this),function(e){var t=e;i()&&!t._addedBrowserEventListeners&&(r.log("Offline Persistence Toolkit PersistenceManager: Adding browser event listeners"),window.addEventListener("offline",(function(e){t._isOffline=!0}),!1),window.addEventListener("online",(function(e){t._isOffline=!1}),!1),t._addedBrowserEventListeners=!0)}(this),this._cache=n.open("systemCache"),Promise.resolve()},o.prototype.forceOffline=function(e){r.log("Offline Persistence Toolkit PersistenceManager: forceOffline is called with value: "+e),this._forceOffline=e},o.prototype.getCache=function(){return this._cache},o.prototype.isOnline=function(){var e=navigator.onLine;return navigator.network&&navigator.network.connection&&navigator.network.connection.type==Connection.NONE&&(e=!1,r.log("Offline Persistence Toolkit PersistenceManager: Cordova network info plugin is returning online value: "+e)),e&&!this._isOffline&&!this._forceOffline},o.prototype.register=function(e){var t=new s((e=e||{}).scope,this);return this._registrations.push(t),Promise.resolve(t)},o.prototype.getRegistration=function(e){var t,n,r=this._registrations.length;for(t=0;t<r;t++)if(n=this._registrations[t],e.match(n.scope))return Promise.resolve(n);return Promise.resolve()},o.prototype.getRegistrations=function(){return Promise.resolve(this._registrations.slice())},o.prototype.getSyncManager=function(){return this._persistenceSyncManager},o.prototype.browserFetch=function(e){var t=this;r.log("Offline Persistence Toolkit PersistenceManager: browserFetch() for Request with url: "+e.url);var n=e;return i()?(Object.defineProperty(this,"_browserFetchRequest",{value:e,writable:!0}),new Promise((function(o,i){r.log("Offline Persistence Toolkit PersistenceManager: Calling browser fetch function for Request with url: "+e.url),e._browserRequest&&(n=e._browserRequest),t._browserFetchFunc.call(window,n).then((function(e){o(e)}),(function(e){i(e)})),t._browserFetchRequest=null}))):(e._browserRequest&&(n=e._browserRequest),fetch(n))},s.prototype.addEventListener=function(e,t){this._eventListeners.push({type:e.toLowerCase(),listener:t})},s.prototype.unregister=function(){return Promise.resolve(function(e,t){var n=e,r=n._registrations.indexOf(t);return r>-1&&(n._registrations.splice(r,1),!0)}(this._persistenceManager,this))},new o}));
|
|
1802
|
+
this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!i||!ArrayBuffer.prototype.isPrototypeOf(e)&&!u(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=_(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=v(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?v(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,n,r=v(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=y(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this._bodyFormData?Promise.resolve(this._bodyFormData):this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),c.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function O(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this),define("persist/impl/fetch",(function(){})),define("persist/persistenceManager",["./impl/PersistenceXMLHttpRequest","./impl/PersistenceSyncManager","./impl/offlineCacheManager","./impl/logger","./impl/fetch"],(function(e,t,n,r){"use strict";function o(){Object.defineProperty(this,"_registrations",{value:[],writable:!0}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_forceOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_isOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_cache",{value:null,writable:!0}),Object.defineProperty(this,"_persistenceSyncManager",{value:new t(this.isOnline.bind(this),this.browserFetch.bind(this),this.getCache.bind(this))})}function i(){return"undefined"!=typeof window&&null!=window}function s(e,t){Object.defineProperty(this,"scope",{value:e,enumerable:!0}),Object.defineProperty(this,"_persistenceManager",{value:t}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0})}function a(e){return function t(n,o){var i=this,s=n,a=o;if(r.log("Offline Persistence Toolkit persistenceRequest: Create New Request"),n._input){for(var f in r.log("Offline Persistence Toolkit persistenceRequest: Input is a PersistenceRequest"),s=n._input,a=Object.assign({},n._init),o)o.hasOwnProperty(f)&&(a[f]=o[f]);if(n.headers&&a&&a.body&&a.body instanceof FormData)if(a.headers){var l=n.headers.get("Content-Type");a.headers.set("Content-Type",l)}else a.headers=n.headers}this._browserRequest=new e._browserRequestConstructor(s,a),this._input=s,this._init=a;var d,h=function(e){var t=Object.getOwnPropertyDescriptor(i._browserRequest,e);t&&(t.writable||t.set)?Object.defineProperty(i,e,{get:function(){return i._browserRequest[e]},set:function(t){i._browserRequest[e]=t},enumerable:!0}):Object.defineProperty(i,e,{get:function(){return i._browserRequest[e]},enumerable:!0})};for(d in this._browserRequest)"body"!=d&&"function"==typeof this._browserRequest[d]||h(d);var p=this.headers.get("Content-Type");null!=p&&p.indexOf("boundary=")>-1&&p.indexOf("form-data")>-1&&(p=p.split("boundary="),this._boundary="--"+p[p.length-1]),this.arrayBuffer=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called arrayBuffer()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?function(e,t){return new Promise((function(n,r){var o=[],i=new TextEncoder,s=i.encode(t).buffer,a=i.encode("--").buffer;e.forEach((function(e,n){o.push(function(e,t,n){return new Promise((function(r,o){var i=new TextEncoder,s=i.encode("\r\n"+n).buffer;switch(e.constructor.name){case"File":var a=new FileReader;a.onload=function(n){var o=c([i.encode('\r\nContent-Disposition: form-data; name="'+t.toString()+'"; filename="'+e.name+'"\r\nContent-Type: '+e.type+"\r\n\r\n").buffer,n.target.result,s]);r(o)},a.onerror=function(){a.abort(),o(new DOMException("Problem parsing input file."))},a.readAsArrayBuffer(e);break;case"String":var u=c([i.encode('\r\nContent-Disposition: form-data; name="'+t+'"\r\n\r\n').buffer,i.encode(e).buffer,s]);r(u);break;default:u=c([i.encode('\r\nContent-Disposition: form-data; name="'+t.toString()+'"\r\n\r\n').buffer,i.encode(e.toString()).buffer,s]),r(u)}}))}(e,n,t))})),Promise.all(o).then((function(e){e.forEach((function(e){s=c([s,e])}));var t=c([s,a]);n(t)})).catch((function(e){r(e)}))}))}(e._init.body,e._boundary):e._browserRequest.arrayBuffer()}catch(e){return Promise.reject(e)}},this.blob=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called blob()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?u(e._init.body,e._boundary).then((function(t){return new Blob([t],{type:e.headers.get("Content-Type")})})):e._browserRequest.blob()}catch(e){return Promise.reject(e)}},this.formData=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called formData()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?Promise.resolve(e._init.body):e._browserRequest.formData()}catch(e){return Promise.reject(e)}},this.json=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called json()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?Promise.reject(new SyntaxError("Unexpected number in JSON at position 1")):e._browserRequest.json()}catch(e){return Promise.reject(e)}},this.text=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called text()");var e=this;try{return e._init&&e._init.body&&e._init.body instanceof FormData?u(e._init.body,e._boundary):e._browserRequest.text()}catch(e){return Promise.reject(e)}},this.clone=function(){r.log("Offline Persistence Toolkit persistenceRequest: Called clone()");var e=this;e.headers&&e._init&&e._init.body&&e._init.body instanceof FormData&&(e._init.headers=e.headers);var n=new t(e._input,e._init);return n._browserRequest=e._browserRequest.clone(),n},this.toString=function(){return r.log("Offline Persistence Toolkit persistenceRequest:requestToString()"),this._input.url?this._input.url:this._input}}}function u(e,t){return new Promise((function(n,r){var o=[],i=t;e.forEach((function(e,n){o.push(function(e,t,n){return new Promise((function(r,o){var i;switch(e.constructor.name){case"File":var s=new FileReader;s.onload=function(o){i='\r\nContent-Disposition: form-data; name="'+t.toString()+'"; filename="'+e.name+'"\r\nContent-Type: '+e.type+"\r\n\r\n"+o.target.result+"\r\n"+n,r(i)},s.onerror=function(){s.abort(),o(new DOMException("Problem parsing input file."))},s.readAsText(e);break;case"String":r(i='\r\nContent-Disposition: form-data; name="'+t+'"\r\n\r\n'+e+"\r\n"+n);break;default:i='\r\nContent-Disposition: form-data; name="'+t.toString()+'"\r\n\r\n'+e.toString()+"\r\n"+n,r(i)}}))}(e,n,t))})),Promise.all(o).then((function(e){e.forEach((function(e){i+=e})),n(i+="--")})).catch((function(e){r(e)}))}))}function c(e){var t=new Uint8Array(0);return e.forEach((function(e){var n=new Uint8Array(t.byteLength+e.byteLength);n.set(new Uint8Array(t),0),n.set(new Uint8Array(e),t.byteLength),t=n})),t.buffer}return o.prototype.init=function(){return r.log("Offline Persistence Toolkit PersistenceManager: Initilizing"),function(t){!function(){var e=navigator.userAgent.match(/^(?:(?!chrome|android|iphone|ipad).)*\/([0-9\.]*) safari.*$/i);if(e)return!((t=e[1].split("."))[0]>14||14==t[0]&&0!=t[1]);var t,n=navigator.userAgent.match(/(?:iPad|iPhone).*?os ([0-9\_]*)/i);return!!n&&!((t=n[1].split("_"))[0]>14||14==t[0]&&t[1]>=3)}()||t._browserRequestConstructor||t._persistenceRequestConstructor||(r.log("Offline Persistence Toolkit PersistenceManager: Replacing Safari Browser APIs"),Object.defineProperty(t,"_browserRequestConstructor",{value:self.Request,writable:!1}),Object.defineProperty(t,"_persistenceRequestConstructor",{value:a(t),writable:!1}),self.Request=t._persistenceRequestConstructor,i()||t._browserFetchFunc||(Object.defineProperty(t,"_browserFetchFunc",{value:self.fetch,writable:!1}),self.fetch=function(e){function t(e){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:e,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return t.prototype.respondWith=function(e){var t=this;if(e instanceof Promise)e.then((function(e){t._resolveCallback(e)}),(function(e){t._rejectCallback(e)}));else if("function"==typeof e){var n=e();t._resolveCallback(n)}},t.prototype._setPromiseCallbacks=function(e,t){this._resolveCallback=e,this._rejectCallback=t},function(t,n){var o;return o=Request.prototype.isPrototypeOf(t)&&!n?t:new Request(t,n),r.log("Offline Persistence Toolkit serviceWorkerFetch:"+o.url),o._browserRequest&&(o=o._browserRequest),new Promise((function(t,n){e._browserFetchFunc.call(self,o).then((function(e){t(e)}),(function(e){n(e)}))}))}}(t))),!i()||t._browserFetchFunc||t._browserXMLHttpRequest||(r.log("Offline Persistence Toolkit PersistenceManager: Replacing browser APIs"),Object.defineProperty(t,"_browserFetchFunc",{value:window.fetch,writable:!1}),Object.defineProperty(t,"_browserXMLHttpRequest",{value:window.XMLHttpRequest,writable:!1}),window.fetch=function(e){function t(e){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:e,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return t.prototype.respondWith=function(e){var t=this;if(e instanceof Promise)e.then((function(e){t._resolveCallback(e)}),(function(e){t._rejectCallback(e)}));else if("function"==typeof e){var n=e();t._resolveCallback(n)}},t.prototype._setPromiseCallbacks=function(e,t){this._resolveCallback=e,this._rejectCallback=t},function(n,o){var i;return i=Request.prototype.isPrototypeOf(n)&&!o?n:new Request(n,o),e.getRegistration(i.url).then((function(n){if(null!=n){var o=new t(i),s=function(e,t,n){var o,i,s,a,u=null,c=e._registrations,f=null!=c?c.length:0;for(o=0;o<f;o++)if(s=c[o],null!=n.request.url.match(s.scope)){for(a=s._eventListeners.length,i=0;i<a;i++)s._eventListeners[i].type==t&&(null===u&&n._setPromiseCallbacks instanceof Function&&(u=new Promise((function(e,t){n._setPromiseCallbacks(e,t)}))),r.log("Offline Persistence Toolkit PersistenceManager: Calling fetch event listener"),s._eventListeners[i].listener(n));if(null!=u)return u}return!0}(e,"fetch",o);if(null!=s&&s instanceof Promise)return s}return e.browserFetch(i)}))}}(t),window.XMLHttpRequest=function(){return null!=t._browserFetchRequest?new t._browserXMLHttpRequest:new e(t._browserXMLHttpRequest)})}(this),function(e){var t=e;i()&&!t._addedBrowserEventListeners&&(r.log("Offline Persistence Toolkit PersistenceManager: Adding browser event listeners"),window.addEventListener("offline",(function(e){t._isOffline=!0}),!1),window.addEventListener("online",(function(e){t._isOffline=!1}),!1),t._addedBrowserEventListeners=!0)}(this),this._cache=n.open("systemCache"),Promise.resolve()},o.prototype.forceOffline=function(e){r.log("Offline Persistence Toolkit PersistenceManager: forceOffline is called with value: "+e),this._forceOffline=e},o.prototype.getCache=function(){return this._cache},o.prototype.isOnline=function(){var e=navigator.onLine;return navigator.network&&navigator.network.connection&&navigator.network.connection.type==Connection.NONE&&(e=!1,r.log("Offline Persistence Toolkit PersistenceManager: Cordova network info plugin is returning online value: "+e)),e&&!this._isOffline&&!this._forceOffline},o.prototype.register=function(e){var t=new s((e=e||{}).scope,this);return this._registrations.push(t),Promise.resolve(t)},o.prototype.getRegistration=function(e){var t,n,r=this._registrations.length;for(t=0;t<r;t++)if(n=this._registrations[t],e.match(n.scope))return Promise.resolve(n);return Promise.resolve()},o.prototype.getRegistrations=function(){return Promise.resolve(this._registrations.slice())},o.prototype.getSyncManager=function(){return this._persistenceSyncManager},o.prototype.browserFetch=function(e){var t=this;r.log("Offline Persistence Toolkit PersistenceManager: browserFetch() for Request with url: "+e.url);var n=e;return i()?(Object.defineProperty(this,"_browserFetchRequest",{value:e,writable:!0}),new Promise((function(o,i){r.log("Offline Persistence Toolkit PersistenceManager: Calling browser fetch function for Request with url: "+e.url),e._browserRequest&&(n=e._browserRequest),t._browserFetchFunc.call(window,n).then((function(e){o(e)}),(function(e){i(e)})),t._browserFetchRequest=null}))):(e._browserRequest&&(n=e._browserRequest),fetch(n))},s.prototype.addEventListener=function(e,t){this._eventListeners.push({type:e.toLowerCase(),listener:t})},s.prototype.unregister=function(){return Promise.resolve(function(e,t){var n=e,r=n._registrations.indexOf(t);return r>-1&&(n._registrations.splice(r,1),!0)}(this._persistenceManager,this))},new o}));
|