@ozdao/martyrs 0.2.585 → 0.2.586
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/dist/auth.server.js +161 -96
- package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
- package/dist/chats.server.js +2 -2
- package/dist/community.server.js +1 -1
- package/dist/core.server.js +191 -2
- package/dist/{core.websocket-C2FxNmZ1.js → core.websocket-Cl76z2wT.js} +41 -5
- package/dist/{crud-q1ye5IhV.js → crud-DpOXTZep.js} +1 -1
- package/dist/events.server.js +2 -2
- package/dist/files.server.js +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/index-kvBwwb0w.js +427 -0
- package/dist/inventory.server.js +2 -2
- package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
- package/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +863 -865
- package/dist/marketplace.server.js +1 -1
- package/dist/martyrs/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +192 -38
- package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
- package/dist/martyrs/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +2 -2
- package/dist/martyrs/dist/{web-BA6h6Z8P.js.map → web-O7lXcjg0.js.map} +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +8 -7
- package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js +1 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
- package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js +17 -22
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -1
- package/dist/martyrs/src/modules/auth/auth.client.js +18 -24
- package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +178 -0
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +53 -45
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +198 -14
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +70 -29
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +86 -30
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js +100 -0
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js +2 -31
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -14
- package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -56
- package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js +5 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +0 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +74 -0
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +63 -47
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +0 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +0 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +0 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +0 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +0 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.js +1 -1
- package/dist/notifications.server.js +1 -1
- package/dist/orders.server.js +7 -6
- package/dist/organizations.server.js +2 -2
- package/dist/products.server.js +2 -2
- package/dist/profile.schema-C31Lynn3.js +21 -0
- package/dist/rents.server.js +1 -1
- package/dist/sessions.service-COcwjd0f.js +86 -0
- package/dist/style.css +178 -108
- package/dist/{tickets.controller-B7r0mK-5.js → tickets.controller-DdF85W-i.js} +1 -1
- package/dist/visitors.service-B1dhhuSo.js +83 -0
- package/dist/wallet.server.js +2 -2
- package/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +1 -1
- package/package.json +5 -1
- package/src/cli/commands/create.js +106 -0
- package/src/cli/index.js +25 -0
- package/src/cli/templates/app/.env.development.mustache +14 -0
- package/src/cli/templates/app/.env.production.mustache +14 -0
- package/src/cli/templates/app/Dockerfile +36 -0
- package/src/cli/templates/app/babel.config.js +14 -0
- package/src/cli/templates/app/env.js +3 -0
- package/src/cli/templates/app/index.js +46 -0
- package/src/cli/templates/app/mongodb.config.js +18 -0
- package/src/cli/templates/app/package.json.mustache +65 -0
- package/src/cli/templates/app/src/client.js +22 -0
- package/src/cli/templates/app/src/components/pages/Index.vue +11 -0
- package/src/cli/templates/app/src/configs/global.config.js.mustache +40 -0
- package/src/cli/templates/app/src/localization/extensions.js +2 -0
- package/src/cli/templates/app/src/localization/index.js +44 -0
- package/src/cli/templates/app/src/localization/overrides.js +2 -0
- package/src/cli/templates/app/src/localization/translations.js +10 -0
- package/src/cli/templates/app/src/models/index.js +9 -0
- package/src/cli/templates/app/src/router/index.js +48 -0
- package/src/cli/templates/app/src/scss/theme.scss +18 -0
- package/src/cli/templates/app/src/server.js +68 -0
- package/src/cli/templates/app/src/store/index.js +9 -0
- package/src/cli/templates/docker-compose.yaml.mustache +47 -0
- package/src/cli/templates/nginx/Dockerfile +5 -0
- package/src/cli/templates/nginx/default.conf.mustache +55 -0
- package/src/cli/templates/public/favicon/.gitkeep +0 -0
- package/src/cli/templates/start-dev.sh.mustache +131 -0
- package/src/cli/templates/start-prod.sh.mustache +12 -0
- package/src/components/Button/Button.vue +61 -15
- package/src/components/Loader/Loader.vue +1 -1
- package/src/components/Tooltip/Tooltip.vue +31 -23
- package/src/modules/TASKS.MD +30 -1
- package/src/modules/auth/CLAUDE.md +381 -0
- package/src/modules/auth/FIXES.md +0 -38
- package/src/modules/auth/auth.client.js +4 -6
- package/src/modules/auth/auth.server.js +4 -15
- package/src/modules/auth/controllers/middlewares/authJwt.js +59 -17
- package/src/modules/auth/controllers/middlewares/index.js +4 -1
- package/src/modules/auth/controllers/middlewares/otp.middleware.js +166 -0
- package/src/modules/auth/controllers/middlewares/verifySignUp.js +0 -1
- package/src/modules/auth/controllers/middlewares/verifyUser.js +58 -11
- package/src/modules/auth/controllers/routes/auth.routes.js +48 -6
- package/src/modules/auth/controllers/routes/users.routes.js +29 -8
- package/src/modules/auth/controllers/services/auth.service.js +62 -12
- package/src/modules/auth/controllers/services/otp.service.js +109 -0
- package/src/modules/auth/controllers/services/users.service.js +46 -6
- package/src/modules/auth/models/otp.model.js +20 -0
- package/src/modules/auth/views/components/blocks/OtpDialog.vue +168 -0
- package/src/modules/auth/views/components/pages/Profile.vue +18 -13
- package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +199 -45
- package/src/modules/auth/views/components/pages/ResetPassword.vue +170 -132
- package/src/modules/auth/views/components/pages/SignIn.vue +2 -1
- package/src/modules/auth/views/components/pages/SignUp.vue +203 -147
- package/src/modules/auth/views/plugins/otp.plugin.js +104 -0
- package/src/modules/auth/views/router/auth.router.js +1 -24
- package/src/modules/auth/views/router/users.router.js +1 -12
- package/src/modules/auth/views/store/auth.js +0 -68
- package/src/modules/auth/views/store/users.js +6 -2
- package/src/modules/core/controllers/classes/core.websocket.js +57 -6
- package/src/modules/core/controllers/middlewares/visitor.logger.js +49 -0
- package/src/modules/core/controllers/services/requests.service.js +53 -0
- package/src/modules/core/controllers/services/sessions.service.js +98 -0
- package/src/modules/core/controllers/services/visitors.service.js +102 -0
- package/src/modules/core/controllers/utils/mailing.js +16 -3
- package/src/modules/core/core.server.js +45 -3
- package/src/modules/core/models/request.model.js +30 -0
- package/src/modules/core/models/session.model.js +43 -0
- package/src/modules/core/models/visitor.model.js +28 -0
- package/src/modules/core/views/components/elements/OnlineIndicator.vue +115 -0
- package/src/modules/core/views/components/layouts/App.vue +2 -2
- package/src/modules/core/views/components/layouts/Client.vue +443 -477
- package/src/modules/orders/controllers/orders.controller.js +3 -3
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/dist/_virtual/alignment-pattern.js +0 -5
- package/dist/_virtual/alignment-pattern.js.map +0 -1
- package/dist/_virtual/browser.js +0 -8
- package/dist/_virtual/browser.js.map +0 -1
- package/dist/_virtual/browser2.js +0 -5
- package/dist/_virtual/browser2.js.map +0 -1
- package/dist/_virtual/canvas.js +0 -5
- package/dist/_virtual/canvas.js.map +0 -1
- package/dist/_virtual/dijkstra.js +0 -5
- package/dist/_virtual/dijkstra.js.map +0 -1
- package/dist/_virtual/error-correction-code.js +0 -5
- package/dist/_virtual/error-correction-code.js.map +0 -1
- package/dist/_virtual/error-correction-level.js +0 -5
- package/dist/_virtual/error-correction-level.js.map +0 -1
- package/dist/_virtual/finder-pattern.js +0 -5
- package/dist/_virtual/finder-pattern.js.map +0 -1
- package/dist/_virtual/format-info.js +0 -5
- package/dist/_virtual/format-info.js.map +0 -1
- package/dist/_virtual/galois-field.js +0 -5
- package/dist/_virtual/galois-field.js.map +0 -1
- package/dist/_virtual/mask-pattern.js +0 -5
- package/dist/_virtual/mask-pattern.js.map +0 -1
- package/dist/_virtual/mode.js +0 -5
- package/dist/_virtual/mode.js.map +0 -1
- package/dist/_virtual/polynomial.js +0 -5
- package/dist/_virtual/polynomial.js.map +0 -1
- package/dist/_virtual/qrcode.js +0 -5
- package/dist/_virtual/qrcode.js.map +0 -1
- package/dist/_virtual/regex.js +0 -5
- package/dist/_virtual/regex.js.map +0 -1
- package/dist/_virtual/segments.js +0 -5
- package/dist/_virtual/segments.js.map +0 -1
- package/dist/_virtual/svg-tag.js +0 -5
- package/dist/_virtual/svg-tag.js.map +0 -1
- package/dist/_virtual/utils.js +0 -5
- package/dist/_virtual/utils.js.map +0 -1
- package/dist/_virtual/utils2.js +0 -5
- package/dist/_virtual/utils2.js.map +0 -1
- package/dist/_virtual/version-check.js +0 -5
- package/dist/_virtual/version-check.js.map +0 -1
- package/dist/_virtual/version.js +0 -5
- package/dist/_virtual/version.js.map +0 -1
- package/dist/index-_Edcmck_.js +0 -170
- package/dist/martyrs/dist/main-xL-jtBkT.js.map +0 -1
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -1336
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js.map +0 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +0 -166
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +0 -118
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +0 -360
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/store/twofa.js +0 -40
- package/dist/martyrs/src/modules/auth/views/store/twofa.js.map +0 -1
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +0 -43
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +0 -47
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +0 -29
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +0 -89
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +0 -136
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +0 -238
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js +0 -9
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js +0 -134
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js.map +0 -1
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +0 -106
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +0 -79
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +0 -43
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -85
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +0 -40
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +0 -34
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +0 -36
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +0 -367
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +0 -52
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +0 -25
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +0 -24
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +0 -46
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +0 -149
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +0 -90
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +0 -41
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +0 -44
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +0 -279
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +0 -33
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +0 -201
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +0 -84
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +0 -107
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +0 -61
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +0 -64
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +0 -87
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js.map +0 -1
- package/dist/profile.schema-CjLOfG7b.js +0 -92
- package/src/modules/auth/controllers/middlewares/visitor.logger.js +0 -75
- package/src/modules/auth/controllers/routes/twofa.routes.js +0 -8
- package/src/modules/auth/controllers/services/twofa.service.js +0 -30
- package/src/modules/auth/models/request.model.js +0 -14
- package/src/modules/auth/models/visitor.model.js +0 -11
- package/src/modules/auth/views/components/pages/EnterCode.vue +0 -204
- package/src/modules/auth/views/components/pages/EnterPassword.vue +0 -123
- package/src/modules/auth/views/components/sections/ProfileEditCredentials.vue +0 -329
- package/src/modules/auth/views/store/twofa.js +0 -70
- package/src/modules/auth//320/220/320/240/320/245/320/230/320/242/320/225/320/232/320/242/320/243/320/240/320/220.md +0 -445
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"qrcode.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js"],"sourcesContent":["const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n// http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n// http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n const size = matrix.size\n const pos = FinderPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -1; r <= 7; r++) {\n if (row + r <= -1 || size <= row + r) continue\n\n for (let c = -1; c <= 7; c++) {\n if (col + c <= -1 || size <= col + c) continue\n\n if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n const size = matrix.size\n\n for (let r = 8; r < size - 8; r++) {\n const value = r % 2 === 0\n matrix.set(r, 6, value, true)\n matrix.set(6, r, value, true)\n }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n const pos = AlignmentPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -2; r <= 2; r++) {\n for (let c = -2; c <= 2; c++) {\n if (r === -2 || r === 2 || c === -2 || c === 2 ||\n (r === 0 && c === 0)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n const size = matrix.size\n const bits = Version.getEncodedBits(version)\n let row, col, mod\n\n for (let i = 0; i < 18; i++) {\n row = Math.floor(i / 3)\n col = i % 3 + size - 8 - 3\n mod = ((bits >> i) & 1) === 1\n\n matrix.set(row, col, mod, true)\n matrix.set(col, row, mod, true)\n }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {Number} maskPattern Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n const size = matrix.size\n const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n let i, mod\n\n for (i = 0; i < 15; i++) {\n mod = ((bits >> i) & 1) === 1\n\n // vertical\n if (i < 6) {\n matrix.set(i, 8, mod, true)\n } else if (i < 8) {\n matrix.set(i + 1, 8, mod, true)\n } else {\n matrix.set(size - 15 + i, 8, mod, true)\n }\n\n // horizontal\n if (i < 8) {\n matrix.set(8, size - i - 1, mod, true)\n } else if (i < 9) {\n matrix.set(8, 15 - i - 1 + 1, mod, true)\n } else {\n matrix.set(8, 15 - i - 1, mod, true)\n }\n }\n\n // fixed module\n matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Uint8Array} data Data codewords\n */\nfunction setupData (matrix, data) {\n const size = matrix.size\n let inc = -1\n let row = size - 1\n let bitIndex = 7\n let byteIndex = 0\n\n for (let col = size - 1; col > 0; col -= 2) {\n if (col === 6) col--\n\n while (true) {\n for (let c = 0; c < 2; c++) {\n if (!matrix.isReserved(row, col - c)) {\n let dark = false\n\n if (byteIndex < data.length) {\n dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n }\n\n matrix.set(row, col - c, dark)\n bitIndex--\n\n if (bitIndex === -1) {\n byteIndex++\n bitIndex = 7\n }\n }\n }\n\n row += inc\n\n if (row < 0 || size <= row) {\n row -= inc\n inc = -inc\n break\n }\n }\n }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {ByteData} data Data input\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n // Prepare data buffer\n const buffer = new BitBuffer()\n\n segments.forEach(function (data) {\n // prefix data with mode indicator (4 bits)\n buffer.put(data.mode.bit, 4)\n\n // Prefix data with character count indicator.\n // The character count indicator is a string of bits that represents the\n // number of characters that are being encoded.\n // The character count indicator must be placed after the mode indicator\n // and must be a certain number of bits long, depending on the QR version\n // and data mode\n // @see {@link Mode.getCharCountIndicator}.\n buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n // add binary data sequence to buffer\n data.write(buffer)\n })\n\n // Calculate required number of bits\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n // Add a terminator.\n // If the bit string is shorter than the total number of required bits,\n // a terminator of up to four 0s must be added to the right side of the string.\n // If the bit string is more than four bits shorter than the required number of bits,\n // add four 0s to the end.\n if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n buffer.put(0, 4)\n }\n\n // If the bit string is fewer than four bits shorter, add only the number of 0s that\n // are needed to reach the required number of bits.\n\n // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n // pad the string on the right with 0s to make the string's length a multiple of 8.\n while (buffer.getLengthInBits() % 8 !== 0) {\n buffer.putBit(0)\n }\n\n // Add pad bytes if the string is still shorter than the total number of required bits.\n // Extend the buffer to fill the data capacity of the symbol corresponding to\n // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n // and 00010001 (0x11) alternately.\n const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n for (let i = 0; i < remainingByte; i++) {\n buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n }\n\n return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param {BitBuffer} bitBuffer Data to encode\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n // Total number of blocks\n const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n // Calculate how many blocks each group should contain\n const blocksInGroup2 = totalCodewords % ecTotalBlocks\n const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n // Number of EC codewords is the same for both groups\n const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n const rs = new ReedSolomonEncoder(ecCount)\n\n let offset = 0\n const dcData = new Array(ecTotalBlocks)\n const ecData = new Array(ecTotalBlocks)\n let maxDataSize = 0\n const buffer = new Uint8Array(bitBuffer.buffer)\n\n // Divide the buffer into the required number of blocks\n for (let b = 0; b < ecTotalBlocks; b++) {\n const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n // extract a block of data from buffer\n dcData[b] = buffer.slice(offset, offset + dataSize)\n\n // Calculate EC codewords for this data block\n ecData[b] = rs.encode(dcData[b])\n\n offset += dataSize\n maxDataSize = Math.max(maxDataSize, dataSize)\n }\n\n // Create final data\n // Interleave the data and error correction codewords from each block\n const data = new Uint8Array(totalCodewords)\n let index = 0\n let i, r\n\n // Add data codewords\n for (i = 0; i < maxDataSize; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n if (i < dcData[r].length) {\n data[index++] = dcData[r][i]\n }\n }\n }\n\n // Apped EC codewords\n for (i = 0; i < ecCount; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n data[index++] = ecData[r][i]\n }\n }\n\n return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @param {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param {MaskPattern} maskPattern Mask pattern\n * @return {Object} Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n let segments\n\n if (Array.isArray(data)) {\n segments = Segments.fromArray(data)\n } else if (typeof data === 'string') {\n let estimatedVersion = version\n\n if (!estimatedVersion) {\n const rawSegments = Segments.rawSplit(data)\n\n // Estimate best version that can contain raw splitted segments\n estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n }\n\n // Build optimized segments\n // If estimated version is undefined, try with the highest version\n segments = Segments.fromString(data, estimatedVersion || 40)\n } else {\n throw new Error('Invalid data')\n }\n\n // Get the min version that can contain data\n const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n // If no version is found, data cannot be stored\n if (!bestVersion) {\n throw new Error('The amount of data is too big to be stored in a QR Code')\n }\n\n // If not specified, use min version as default\n if (!version) {\n version = bestVersion\n\n // Check if the specified version can contain the data\n } else if (version < bestVersion) {\n throw new Error('\\n' +\n 'The chosen QR Code version cannot contain this amount of data.\\n' +\n 'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n )\n }\n\n const dataBits = createData(version, errorCorrectionLevel, segments)\n\n // Allocate matrix buffer\n const moduleCount = Utils.getSymbolSize(version)\n const modules = new BitMatrix(moduleCount)\n\n // Add function modules\n setupFinderPattern(modules, version)\n setupTimingPattern(modules)\n setupAlignmentPattern(modules, version)\n\n // Add temporary dummy bits for format info just to set them as reserved.\n // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n // since the masking operation must be performed only on the encoding region.\n // These blocks will be replaced with correct values later in code.\n setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n if (version >= 7) {\n setupVersionInfo(modules, version)\n }\n\n // Add data codewords\n setupData(modules, dataBits)\n\n if (isNaN(maskPattern)) {\n // Find best mask pattern\n maskPattern = MaskPattern.getBestMask(modules,\n setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n }\n\n // Apply mask pattern\n MaskPattern.applyMask(maskPattern, modules)\n\n // Replace format info bits with correct values\n setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n return {\n modules: modules,\n version: version,\n errorCorrectionLevel: errorCorrectionLevel,\n maskPattern: maskPattern,\n segments: segments\n }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data Input data\n * @param {Object} options Optional configurations\n * @param {Number} options.version QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n if (typeof data === 'undefined' || data === '') {\n throw new Error('No input text')\n }\n\n let errorCorrectionLevel = ECLevel.M\n let version\n let mask\n\n if (typeof options !== 'undefined') {\n // Use higher error correction level as default\n errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n version = Version.from(options.version)\n mask = MaskPattern.from(options.maskPattern)\n\n if (options.toSJISFunc) {\n Utils.setToSJISFunction(options.toSJISFunc)\n }\n }\n\n return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n"],"names":["require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,QAAM,QAAQA,aAAA;AACd,QAAM,UAAUC,4BAAA;AAChB,QAAM,YAAYC,iBAAA;AAClB,QAAM,YAAYC,iBAAA;AAClB,QAAM,mBAAmBC,wBAAA;AACzB,QAAM,gBAAgBC,qBAAA;AACtB,QAAM,cAAcC,mBAAA;AACpB,QAAM,SAASC,2BAAA;AACf,QAAM,qBAAqBC,0BAAA;AAC3B,QAAM,UAAUC,eAAA;A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node_modules/qrcode/lib/core/reed-solomon-encoder.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { __require as requirePolynomial } from "./polynomial.js";
|
|
2
|
-
var reedSolomonEncoder;
|
|
3
|
-
var hasRequiredReedSolomonEncoder;
|
|
4
|
-
function requireReedSolomonEncoder() {
|
|
5
|
-
if (hasRequiredReedSolomonEncoder) return reedSolomonEncoder;
|
|
6
|
-
hasRequiredReedSolomonEncoder = 1;
|
|
7
|
-
const Polynomial = requirePolynomial();
|
|
8
|
-
function ReedSolomonEncoder(degree) {
|
|
9
|
-
this.genPoly = void 0;
|
|
10
|
-
this.degree = degree;
|
|
11
|
-
if (this.degree) this.initialize(this.degree);
|
|
12
|
-
}
|
|
13
|
-
ReedSolomonEncoder.prototype.initialize = function initialize(degree) {
|
|
14
|
-
this.degree = degree;
|
|
15
|
-
this.genPoly = Polynomial.generateECPolynomial(this.degree);
|
|
16
|
-
};
|
|
17
|
-
ReedSolomonEncoder.prototype.encode = function encode(data) {
|
|
18
|
-
if (!this.genPoly) {
|
|
19
|
-
throw new Error("Encoder not initialized");
|
|
20
|
-
}
|
|
21
|
-
const paddedData = new Uint8Array(data.length + this.degree);
|
|
22
|
-
paddedData.set(data);
|
|
23
|
-
const remainder = Polynomial.mod(paddedData, this.genPoly);
|
|
24
|
-
const start = this.degree - remainder.length;
|
|
25
|
-
if (start > 0) {
|
|
26
|
-
const buff = new Uint8Array(this.degree);
|
|
27
|
-
buff.set(remainder, start);
|
|
28
|
-
return buff;
|
|
29
|
-
}
|
|
30
|
-
return remainder;
|
|
31
|
-
};
|
|
32
|
-
reedSolomonEncoder = ReedSolomonEncoder;
|
|
33
|
-
return reedSolomonEncoder;
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
requireReedSolomonEncoder as __require
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=reed-solomon-encoder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reed-solomon-encoder.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js"],"sourcesContent":["const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n this.genPoly = undefined\n this.degree = degree\n\n if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n // create an irreducible generator polynomial\n this.degree = degree\n this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param {Uint8Array} data Buffer containing input data\n * @return {Uint8Array} Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n if (!this.genPoly) {\n throw new Error('Encoder not initialized')\n }\n\n // Calculate EC for this data block\n // extends data size to data+genPoly size\n const paddedData = new Uint8Array(data.length + this.degree)\n paddedData.set(data)\n\n // The error correction codewords are the remainder after dividing the data codewords\n // by a generator polynomial\n const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n // return EC data blocks (last n byte, where n is the degree of genPoly)\n // If coefficients number in remainder are less than genPoly degree,\n // pad with 0s to the left to reach the needed number of coefficients\n const start = this.degree - remainder.length\n if (start > 0) {\n const buff = new Uint8Array(this.degree)\n buff.set(remainder, start)\n\n return buff\n }\n\n return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n"],"names":["require$$0"],"mappings":";;;;;;AAAA,QAAM,aAAaA,kBAAA;AAEnB,WAAS,mBAAoB,QAAQ;AACnC,SAAK,UAAU;AACf,SAAK,SAAS;AAEd,QAAI,KAAK,OAAQ,MAAK,WAAW,KAAK,MAAM;AAAA,EAC9C;AAQA,qBAAmB,UAAU,aAAa,SAAS,WAAY,QAAQ;AAErE,SAAK,SAAS;AACd,SAAK,UAAU,WAAW,qBAAqB,KAAK,MAAM;AAAA,EAC5D;AAQA,qBAAmB,UAAU,SAAS,SAAS,OAAQ,MAAM;AAC3D,QAAI,CAAC,KAAK,SAAS;AACjB,YAAM,IAAI,MAAM,yBAAyB;AAAA,IAC7C;AAIE,UAAM,aAAa,IAAI,WAAW,KAAK,SAAS,KAAK,MAAM;AAC3D,eAAW,IAAI,IAAI;AAInB,UAAM,YAAY,WAAW,IAAI,YAAY,KAAK,OAAO;AAKzD,UAAM,QAAQ,KAAK,SAAS,UAAU;AACtC,QAAI,QAAQ,GAAG;AACb,YAAM,OAAO,IAAI,WAAW,KAAK,MAAM;AACvC,WAAK,IAAI,WAAW,KAAK;AAEzB,aAAO;AAAA,IACX;AAEE,WAAO;AAAA,EACT;AAEA,uBAAiB;;;","x_google_ignoreList":[0]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { __exports as regex } from "../../../../../../../_virtual/regex.js";
|
|
2
|
-
var hasRequiredRegex;
|
|
3
|
-
function requireRegex() {
|
|
4
|
-
if (hasRequiredRegex) return regex;
|
|
5
|
-
hasRequiredRegex = 1;
|
|
6
|
-
const numeric = "[0-9]+";
|
|
7
|
-
const alphanumeric = "[A-Z $%*+\\-./:]+";
|
|
8
|
-
let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
9
|
-
kanji = kanji.replace(/u/g, "\\u");
|
|
10
|
-
const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+";
|
|
11
|
-
regex.KANJI = new RegExp(kanji, "g");
|
|
12
|
-
regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
13
|
-
regex.BYTE = new RegExp(byte, "g");
|
|
14
|
-
regex.NUMERIC = new RegExp(numeric, "g");
|
|
15
|
-
regex.ALPHANUMERIC = new RegExp(alphanumeric, "g");
|
|
16
|
-
const TEST_KANJI = new RegExp("^" + kanji + "$");
|
|
17
|
-
const TEST_NUMERIC = new RegExp("^" + numeric + "$");
|
|
18
|
-
const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
19
|
-
regex.testKanji = function testKanji(str) {
|
|
20
|
-
return TEST_KANJI.test(str);
|
|
21
|
-
};
|
|
22
|
-
regex.testNumeric = function testNumeric(str) {
|
|
23
|
-
return TEST_NUMERIC.test(str);
|
|
24
|
-
};
|
|
25
|
-
regex.testAlphanumeric = function testAlphanumeric(str) {
|
|
26
|
-
return TEST_ALPHANUMERIC.test(str);
|
|
27
|
-
};
|
|
28
|
-
return regex;
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
requireRegex as __require
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=regex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"regex.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js"],"sourcesContent":["const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n return TEST_ALPHANUMERIC.test(str)\n}\n"],"names":[],"mappings":";;;;;AAAA,QAAM,UAAU;AAChB,QAAM,eAAe;AACrB,MAAI,QAAQ;AAIZ,UAAQ,MAAM,QAAQ,MAAM,KAAK;AAEjC,QAAM,OAAO,+BAA+B,QAAQ;AAEpD,QAAA,QAAgB,IAAI,OAAO,OAAO,GAAG;AACrC,QAAA,aAAqB,IAAI,OAAO,yBAAyB,GAAG;AAC5D,QAAA,OAAe,IAAI,OAAO,MAAM,GAAG;AACnC,QAAA,UAAkB,IAAI,OAAO,SAAS,GAAG;AACzC,QAAA,eAAuB,IAAI,OAAO,cAAc,GAAG;AAEnD,QAAM,aAAa,IAAI,OAAO,MAAM,QAAQ,GAAG;AAC/C,QAAM,eAAe,IAAI,OAAO,MAAM,UAAU,GAAG;AACnD,QAAM,oBAAoB,IAAI,OAAO,wBAAwB;AAE7D,QAAA,YAAoB,SAAS,UAAW,KAAK;AAC3C,WAAO,WAAW,KAAK,GAAG;AAAA,EAC5B;AAEA,QAAA,cAAsB,SAAS,YAAa,KAAK;AAC/C,WAAO,aAAa,KAAK,GAAG;AAAA,EAC9B;AAEA,QAAA,mBAA2B,SAAS,iBAAkB,KAAK;AACzD,WAAO,kBAAkB,KAAK,GAAG;AAAA,EACnC;;;","x_google_ignoreList":[0]}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { __exports as segments } from "../../../../../../../_virtual/segments.js";
|
|
2
|
-
import { __require as requireMode } from "./mode.js";
|
|
3
|
-
import { __require as requireNumericData } from "./numeric-data.js";
|
|
4
|
-
import { __require as requireAlphanumericData } from "./alphanumeric-data.js";
|
|
5
|
-
import { __require as requireByteData } from "./byte-data.js";
|
|
6
|
-
import { __require as requireKanjiData } from "./kanji-data.js";
|
|
7
|
-
import { __require as requireRegex } from "./regex.js";
|
|
8
|
-
import { __require as requireUtils } from "./utils.js";
|
|
9
|
-
import { __require as requireDijkstra } from "../../../../../dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js";
|
|
10
|
-
var hasRequiredSegments;
|
|
11
|
-
function requireSegments() {
|
|
12
|
-
if (hasRequiredSegments) return segments;
|
|
13
|
-
hasRequiredSegments = 1;
|
|
14
|
-
(function(exports) {
|
|
15
|
-
const Mode = requireMode();
|
|
16
|
-
const NumericData = requireNumericData();
|
|
17
|
-
const AlphanumericData = requireAlphanumericData();
|
|
18
|
-
const ByteData = requireByteData();
|
|
19
|
-
const KanjiData = requireKanjiData();
|
|
20
|
-
const Regex = requireRegex();
|
|
21
|
-
const Utils = requireUtils();
|
|
22
|
-
const dijkstra = requireDijkstra();
|
|
23
|
-
function getStringByteLength(str) {
|
|
24
|
-
return unescape(encodeURIComponent(str)).length;
|
|
25
|
-
}
|
|
26
|
-
function getSegments(regex, mode, str) {
|
|
27
|
-
const segments2 = [];
|
|
28
|
-
let result;
|
|
29
|
-
while ((result = regex.exec(str)) !== null) {
|
|
30
|
-
segments2.push({
|
|
31
|
-
data: result[0],
|
|
32
|
-
index: result.index,
|
|
33
|
-
mode,
|
|
34
|
-
length: result[0].length
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return segments2;
|
|
38
|
-
}
|
|
39
|
-
function getSegmentsFromString(dataStr) {
|
|
40
|
-
const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr);
|
|
41
|
-
const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr);
|
|
42
|
-
let byteSegs;
|
|
43
|
-
let kanjiSegs;
|
|
44
|
-
if (Utils.isKanjiModeEnabled()) {
|
|
45
|
-
byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr);
|
|
46
|
-
kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr);
|
|
47
|
-
} else {
|
|
48
|
-
byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr);
|
|
49
|
-
kanjiSegs = [];
|
|
50
|
-
}
|
|
51
|
-
const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs);
|
|
52
|
-
return segs.sort(function(s1, s2) {
|
|
53
|
-
return s1.index - s2.index;
|
|
54
|
-
}).map(function(obj) {
|
|
55
|
-
return {
|
|
56
|
-
data: obj.data,
|
|
57
|
-
mode: obj.mode,
|
|
58
|
-
length: obj.length
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function getSegmentBitsLength(length, mode) {
|
|
63
|
-
switch (mode) {
|
|
64
|
-
case Mode.NUMERIC:
|
|
65
|
-
return NumericData.getBitsLength(length);
|
|
66
|
-
case Mode.ALPHANUMERIC:
|
|
67
|
-
return AlphanumericData.getBitsLength(length);
|
|
68
|
-
case Mode.KANJI:
|
|
69
|
-
return KanjiData.getBitsLength(length);
|
|
70
|
-
case Mode.BYTE:
|
|
71
|
-
return ByteData.getBitsLength(length);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function mergeSegments(segs) {
|
|
75
|
-
return segs.reduce(function(acc, curr) {
|
|
76
|
-
const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null;
|
|
77
|
-
if (prevSeg && prevSeg.mode === curr.mode) {
|
|
78
|
-
acc[acc.length - 1].data += curr.data;
|
|
79
|
-
return acc;
|
|
80
|
-
}
|
|
81
|
-
acc.push(curr);
|
|
82
|
-
return acc;
|
|
83
|
-
}, []);
|
|
84
|
-
}
|
|
85
|
-
function buildNodes(segs) {
|
|
86
|
-
const nodes = [];
|
|
87
|
-
for (let i = 0; i < segs.length; i++) {
|
|
88
|
-
const seg = segs[i];
|
|
89
|
-
switch (seg.mode) {
|
|
90
|
-
case Mode.NUMERIC:
|
|
91
|
-
nodes.push([
|
|
92
|
-
seg,
|
|
93
|
-
{ data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },
|
|
94
|
-
{ data: seg.data, mode: Mode.BYTE, length: seg.length }
|
|
95
|
-
]);
|
|
96
|
-
break;
|
|
97
|
-
case Mode.ALPHANUMERIC:
|
|
98
|
-
nodes.push([
|
|
99
|
-
seg,
|
|
100
|
-
{ data: seg.data, mode: Mode.BYTE, length: seg.length }
|
|
101
|
-
]);
|
|
102
|
-
break;
|
|
103
|
-
case Mode.KANJI:
|
|
104
|
-
nodes.push([
|
|
105
|
-
seg,
|
|
106
|
-
{ data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
|
|
107
|
-
]);
|
|
108
|
-
break;
|
|
109
|
-
case Mode.BYTE:
|
|
110
|
-
nodes.push([
|
|
111
|
-
{ data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
|
|
112
|
-
]);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return nodes;
|
|
116
|
-
}
|
|
117
|
-
function buildGraph(nodes, version) {
|
|
118
|
-
const table = {};
|
|
119
|
-
const graph = { start: {} };
|
|
120
|
-
let prevNodeIds = ["start"];
|
|
121
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
122
|
-
const nodeGroup = nodes[i];
|
|
123
|
-
const currentNodeIds = [];
|
|
124
|
-
for (let j = 0; j < nodeGroup.length; j++) {
|
|
125
|
-
const node = nodeGroup[j];
|
|
126
|
-
const key = "" + i + j;
|
|
127
|
-
currentNodeIds.push(key);
|
|
128
|
-
table[key] = { node, lastCount: 0 };
|
|
129
|
-
graph[key] = {};
|
|
130
|
-
for (let n = 0; n < prevNodeIds.length; n++) {
|
|
131
|
-
const prevNodeId = prevNodeIds[n];
|
|
132
|
-
if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
|
|
133
|
-
graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode);
|
|
134
|
-
table[prevNodeId].lastCount += node.length;
|
|
135
|
-
} else {
|
|
136
|
-
if (table[prevNodeId]) table[prevNodeId].lastCount = node.length;
|
|
137
|
-
graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode.getCharCountIndicator(node.mode, version);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
prevNodeIds = currentNodeIds;
|
|
142
|
-
}
|
|
143
|
-
for (let n = 0; n < prevNodeIds.length; n++) {
|
|
144
|
-
graph[prevNodeIds[n]].end = 0;
|
|
145
|
-
}
|
|
146
|
-
return { map: graph, table };
|
|
147
|
-
}
|
|
148
|
-
function buildSingleSegment(data, modesHint) {
|
|
149
|
-
let mode;
|
|
150
|
-
const bestMode = Mode.getBestModeForData(data);
|
|
151
|
-
mode = Mode.from(modesHint, bestMode);
|
|
152
|
-
if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {
|
|
153
|
-
throw new Error('"' + data + '" cannot be encoded with mode ' + Mode.toString(mode) + ".\n Suggested mode is: " + Mode.toString(bestMode));
|
|
154
|
-
}
|
|
155
|
-
if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {
|
|
156
|
-
mode = Mode.BYTE;
|
|
157
|
-
}
|
|
158
|
-
switch (mode) {
|
|
159
|
-
case Mode.NUMERIC:
|
|
160
|
-
return new NumericData(data);
|
|
161
|
-
case Mode.ALPHANUMERIC:
|
|
162
|
-
return new AlphanumericData(data);
|
|
163
|
-
case Mode.KANJI:
|
|
164
|
-
return new KanjiData(data);
|
|
165
|
-
case Mode.BYTE:
|
|
166
|
-
return new ByteData(data);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
exports.fromArray = function fromArray(array) {
|
|
170
|
-
return array.reduce(function(acc, seg) {
|
|
171
|
-
if (typeof seg === "string") {
|
|
172
|
-
acc.push(buildSingleSegment(seg, null));
|
|
173
|
-
} else if (seg.data) {
|
|
174
|
-
acc.push(buildSingleSegment(seg.data, seg.mode));
|
|
175
|
-
}
|
|
176
|
-
return acc;
|
|
177
|
-
}, []);
|
|
178
|
-
};
|
|
179
|
-
exports.fromString = function fromString(data, version) {
|
|
180
|
-
const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
|
|
181
|
-
const nodes = buildNodes(segs);
|
|
182
|
-
const graph = buildGraph(nodes, version);
|
|
183
|
-
const path = dijkstra.find_path(graph.map, "start", "end");
|
|
184
|
-
const optimizedSegs = [];
|
|
185
|
-
for (let i = 1; i < path.length - 1; i++) {
|
|
186
|
-
optimizedSegs.push(graph.table[path[i]].node);
|
|
187
|
-
}
|
|
188
|
-
return exports.fromArray(mergeSegments(optimizedSegs));
|
|
189
|
-
};
|
|
190
|
-
exports.rawSplit = function rawSplit(data) {
|
|
191
|
-
return exports.fromArray(
|
|
192
|
-
getSegmentsFromString(data, Utils.isKanjiModeEnabled())
|
|
193
|
-
);
|
|
194
|
-
};
|
|
195
|
-
})(segments);
|
|
196
|
-
return segments;
|
|
197
|
-
}
|
|
198
|
-
export {
|
|
199
|
-
requireSegments as __require
|
|
200
|
-
};
|
|
201
|
-
//# sourceMappingURL=segments.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"segments.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js"],"sourcesContent":["const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param {String} str Input string\n * @return {Number} Number of byte\n */\nfunction getStringByteLength (str) {\n return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param {Mode} mode Segment mode\n * @param {String} str String to process\n * @return {Array} Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n const segments = []\n let result\n\n while ((result = regex.exec(str)) !== null) {\n segments.push({\n data: result[0],\n index: result.index,\n mode: mode,\n length: result[0].length\n })\n }\n\n return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param {String} dataStr Input string\n * @return {Array} Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n let byteSegs\n let kanjiSegs\n\n if (Utils.isKanjiModeEnabled()) {\n byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n } else {\n byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n kanjiSegs = []\n }\n\n const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n return segs\n .sort(function (s1, s2) {\n return s1.index - s2.index\n })\n .map(function (obj) {\n return {\n data: obj.data,\n mode: obj.mode,\n length: obj.length\n }\n })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param {Number} length String length\n * @param {Mode} mode Segment mode\n * @return {Number} Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n switch (mode) {\n case Mode.NUMERIC:\n return NumericData.getBitsLength(length)\n case Mode.ALPHANUMERIC:\n return AlphanumericData.getBitsLength(length)\n case Mode.KANJI:\n return KanjiData.getBitsLength(length)\n case Mode.BYTE:\n return ByteData.getBitsLength(length)\n }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction mergeSegments (segs) {\n return segs.reduce(function (acc, curr) {\n const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n if (prevSeg && prevSeg.mode === curr.mode) {\n acc[acc.length - 1].data += curr.data\n return acc\n }\n\n acc.push(curr)\n return acc\n }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction buildNodes (segs) {\n const nodes = []\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n\n switch (seg.mode) {\n case Mode.NUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.ALPHANUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.KANJI:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n break\n case Mode.BYTE:\n nodes.push([\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n }\n }\n\n return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param {Array} nodes Array of object with segments data\n * @param {Number} version QR Code version\n * @return {Object} Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n const table = {}\n const graph = { start: {} }\n let prevNodeIds = ['start']\n\n for (let i = 0; i < nodes.length; i++) {\n const nodeGroup = nodes[i]\n const currentNodeIds = []\n\n for (let j = 0; j < nodeGroup.length; j++) {\n const node = nodeGroup[j]\n const key = '' + i + j\n\n currentNodeIds.push(key)\n table[key] = { node: node, lastCount: 0 }\n graph[key] = {}\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n const prevNodeId = prevNodeIds[n]\n\n if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n graph[prevNodeId][key] =\n getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n table[prevNodeId].lastCount += node.length\n } else {\n if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n }\n }\n }\n\n prevNodeIds = currentNodeIds\n }\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n graph[prevNodeIds[n]].end = 0\n }\n\n return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param {String} data Input data\n * @param {Mode | String} modesHint Data mode\n * @return {Segment} Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n let mode\n const bestMode = Mode.getBestModeForData(data)\n\n mode = Mode.from(modesHint, bestMode)\n\n // Make sure data can be encoded\n if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n throw new Error('\"' + data + '\"' +\n ' cannot be encoded with mode ' + Mode.toString(mode) +\n '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n }\n\n // Use Mode.BYTE if Kanji support is disabled\n if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n mode = Mode.BYTE\n }\n\n switch (mode) {\n case Mode.NUMERIC:\n return new NumericData(data)\n\n case Mode.ALPHANUMERIC:\n return new AlphanumericData(data)\n\n case Mode.KANJI:\n return new KanjiData(data)\n\n case Mode.BYTE:\n return new ByteData(data)\n }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param {Array} array Array of objects with segments data\n * @return {Array} Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n return array.reduce(function (acc, seg) {\n if (typeof seg === 'string') {\n acc.push(buildSingleSegment(seg, null))\n } else if (seg.data) {\n acc.push(buildSingleSegment(seg.data, seg.mode))\n }\n\n return acc\n }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @return {Array} Array of segments\n */\nexports.fromString = function fromString (data, version) {\n const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n const nodes = buildNodes(segs)\n const graph = buildGraph(nodes, version)\n const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n const optimizedSegs = []\n for (let i = 1; i < path.length - 1; i++) {\n optimizedSegs.push(graph.table[path[i]].node)\n }\n\n return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param {string} data Input string\n * @return {Array} Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n return exports.fromArray(\n getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n )\n}\n"],"names":["require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","segments"],"mappings":";;;;;;;;;;;;;;AAAA,UAAM,OAAOA,YAAA;AACb,UAAM,cAAcC,mBAAA;AACpB,UAAM,mBAAmBC,wBAAA;AACzB,UAAM,WAAWC,gBAAA;AACjB,UAAM,YAAYC,iBAAA;AAClB,UAAM,QAAQC,aAAA;AACd,UAAM,QAAQC,aAAA;AACd,UAAM,WAAWC,gBAAA;AAQjB,aAAS,oBAAqB,KAAK;AACjC,aAAO,SAAS,mBAAmB,GAAG,CAAC,EAAE;AAAA,IAC3C;AA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AK,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI;AAAA,MAChD;AAEE,aAAO,QAAQ,UAAU,cAAc,aAAa,CAAC;AAAA,IACvD;AAYA,YAAA,WAAmB,SAAS,SAAU,MAAM;AAC1C,aAAO,QAAQ;AAAA,QACb,sBAAsB,MAAM,MAAM,mBAAkB,CAAE;AAAA,MAC1D;AAAA,IACA;AAAA;;;","x_google_ignoreList":[0]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { __exports as utils } from "../../../../../../../_virtual/utils2.js";
|
|
2
|
-
var hasRequiredUtils;
|
|
3
|
-
function requireUtils() {
|
|
4
|
-
if (hasRequiredUtils) return utils;
|
|
5
|
-
hasRequiredUtils = 1;
|
|
6
|
-
let toSJISFunction;
|
|
7
|
-
const CODEWORDS_COUNT = [
|
|
8
|
-
0,
|
|
9
|
-
// Not used
|
|
10
|
-
26,
|
|
11
|
-
44,
|
|
12
|
-
70,
|
|
13
|
-
100,
|
|
14
|
-
134,
|
|
15
|
-
172,
|
|
16
|
-
196,
|
|
17
|
-
242,
|
|
18
|
-
292,
|
|
19
|
-
346,
|
|
20
|
-
404,
|
|
21
|
-
466,
|
|
22
|
-
532,
|
|
23
|
-
581,
|
|
24
|
-
655,
|
|
25
|
-
733,
|
|
26
|
-
815,
|
|
27
|
-
901,
|
|
28
|
-
991,
|
|
29
|
-
1085,
|
|
30
|
-
1156,
|
|
31
|
-
1258,
|
|
32
|
-
1364,
|
|
33
|
-
1474,
|
|
34
|
-
1588,
|
|
35
|
-
1706,
|
|
36
|
-
1828,
|
|
37
|
-
1921,
|
|
38
|
-
2051,
|
|
39
|
-
2185,
|
|
40
|
-
2323,
|
|
41
|
-
2465,
|
|
42
|
-
2611,
|
|
43
|
-
2761,
|
|
44
|
-
2876,
|
|
45
|
-
3034,
|
|
46
|
-
3196,
|
|
47
|
-
3362,
|
|
48
|
-
3532,
|
|
49
|
-
3706
|
|
50
|
-
];
|
|
51
|
-
utils.getSymbolSize = function getSymbolSize(version) {
|
|
52
|
-
if (!version) throw new Error('"version" cannot be null or undefined');
|
|
53
|
-
if (version < 1 || version > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
54
|
-
return version * 4 + 17;
|
|
55
|
-
};
|
|
56
|
-
utils.getSymbolTotalCodewords = function getSymbolTotalCodewords(version) {
|
|
57
|
-
return CODEWORDS_COUNT[version];
|
|
58
|
-
};
|
|
59
|
-
utils.getBCHDigit = function(data) {
|
|
60
|
-
let digit = 0;
|
|
61
|
-
while (data !== 0) {
|
|
62
|
-
digit++;
|
|
63
|
-
data >>>= 1;
|
|
64
|
-
}
|
|
65
|
-
return digit;
|
|
66
|
-
};
|
|
67
|
-
utils.setToSJISFunction = function setToSJISFunction(f) {
|
|
68
|
-
if (typeof f !== "function") {
|
|
69
|
-
throw new Error('"toSJISFunc" is not a valid function.');
|
|
70
|
-
}
|
|
71
|
-
toSJISFunction = f;
|
|
72
|
-
};
|
|
73
|
-
utils.isKanjiModeEnabled = function() {
|
|
74
|
-
return typeof toSJISFunction !== "undefined";
|
|
75
|
-
};
|
|
76
|
-
utils.toSJIS = function toSJIS(kanji) {
|
|
77
|
-
return toSJISFunction(kanji);
|
|
78
|
-
};
|
|
79
|
-
return utils;
|
|
80
|
-
}
|
|
81
|
-
export {
|
|
82
|
-
requireUtils as __require
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js"],"sourcesContent":["let toSJISFunction\nconst CODEWORDS_COUNT = [\n 0, // Not used\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param {Number} version QR Code version\n * @return {Number} size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n if (!version) throw new Error('\"version\" cannot be null or undefined')\n if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param {Number} version QR Code version\n * @return {Number} Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param {Number} data Value to encode\n * @return {Number} Encoded value\n */\nexports.getBCHDigit = function (data) {\n let digit = 0\n\n while (data !== 0) {\n digit++\n data >>>= 1\n }\n\n return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n if (typeof f !== 'function') {\n throw new Error('\"toSJISFunc\" is not a valid function.')\n }\n\n toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n return toSJISFunction(kanji)\n}\n"],"names":[],"mappings":";;;;;AAAA,MAAI;AACJ,QAAM,kBAAkB;AAAA,IACtB;AAAA;AAAA,IACA;AAAA,IAAI;AAAA,IAAI;AAAA,IAAI;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAC1C;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAC7C;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IACtD;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,EACxD;AAQA,QAAA,gBAAwB,SAAS,cAAe,SAAS;AACvD,QAAI,CAAC,QAAS,OAAM,IAAI,MAAM,uCAAuC;AACrE,QAAI,UAAU,KAAK,UAAU,GAAI,OAAM,IAAI,MAAM,2CAA2C;AAC5F,WAAO,UAAU,IAAI;AAAA,EACvB;AAQA,QAAA,0BAAkC,SAAS,wBAAyB,SAAS;AAC3E,WAAO,gBAAgB,OAAO;AAAA,EAChC;AAQA,QAAA,cAAsB,SAAU,MAAM;AACpC,QAAI,QAAQ;AAEZ,WAAO,SAAS,GAAG;AACjB;AACA,gBAAU;AAAA,IACd;AAEE,WAAO;AAAA,EACT;AAEA,QAAA,oBAA4B,SAAS,kBAAmB,GAAG;AACzD,QAAI,OAAO,MAAM,YAAY;AAC3B,YAAM,IAAI,MAAM,uCAAuC;AAAA,IAC3D;AAEE,qBAAiB;AAAA,EACnB;AAEA,QAAA,qBAA6B,WAAY;AACvC,WAAO,OAAO,mBAAmB;AAAA,EACnC;AAEA,QAAA,SAAiB,SAAS,OAAQ,OAAO;AACvC,WAAO,eAAe,KAAK;AAAA,EAC7B;;;","x_google_ignoreList":[0]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { __exports as versionCheck } from "../../../../../../../_virtual/version-check.js";
|
|
2
|
-
var hasRequiredVersionCheck;
|
|
3
|
-
function requireVersionCheck() {
|
|
4
|
-
if (hasRequiredVersionCheck) return versionCheck;
|
|
5
|
-
hasRequiredVersionCheck = 1;
|
|
6
|
-
versionCheck.isValid = function isValid(version) {
|
|
7
|
-
return !isNaN(version) && version >= 1 && version <= 40;
|
|
8
|
-
};
|
|
9
|
-
return versionCheck;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
requireVersionCheck as __require
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=version-check.js.map
|
package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version-check.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js"],"sourcesContent":["/**\n * Check if QR Code version is valid\n *\n * @param {Number} version QR Code version\n * @return {Boolean} true if valid version, false otherwise\n */\nexports.isValid = function isValid (version) {\n return !isNaN(version) && version >= 1 && version <= 40\n}\n"],"names":[],"mappings":";;;;;AAMA,eAAA,UAAkB,SAAS,QAAS,SAAS;AAC3C,WAAO,CAAC,MAAM,OAAO,KAAK,WAAW,KAAK,WAAW;AAAA,EACvD;;;","x_google_ignoreList":[0]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { __exports as version } from "../../../../../../../_virtual/version.js";
|
|
2
|
-
import { __require as requireUtils } from "./utils.js";
|
|
3
|
-
import { __require as requireErrorCorrectionCode } from "./error-correction-code.js";
|
|
4
|
-
import { __require as requireErrorCorrectionLevel } from "./error-correction-level.js";
|
|
5
|
-
import { __require as requireMode } from "./mode.js";
|
|
6
|
-
import { __require as requireVersionCheck } from "./version-check.js";
|
|
7
|
-
var hasRequiredVersion;
|
|
8
|
-
function requireVersion() {
|
|
9
|
-
if (hasRequiredVersion) return version;
|
|
10
|
-
hasRequiredVersion = 1;
|
|
11
|
-
(function(exports) {
|
|
12
|
-
const Utils = requireUtils();
|
|
13
|
-
const ECCode = requireErrorCorrectionCode();
|
|
14
|
-
const ECLevel = requireErrorCorrectionLevel();
|
|
15
|
-
const Mode = requireMode();
|
|
16
|
-
const VersionCheck = requireVersionCheck();
|
|
17
|
-
const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
|
|
18
|
-
const G18_BCH = Utils.getBCHDigit(G18);
|
|
19
|
-
function getBestVersionForDataLength(mode, length, errorCorrectionLevel) {
|
|
20
|
-
for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
|
|
21
|
-
if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
|
|
22
|
-
return currentVersion;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return void 0;
|
|
26
|
-
}
|
|
27
|
-
function getReservedBitsCount(mode, version2) {
|
|
28
|
-
return Mode.getCharCountIndicator(mode, version2) + 4;
|
|
29
|
-
}
|
|
30
|
-
function getTotalBitsFromDataArray(segments, version2) {
|
|
31
|
-
let totalBits = 0;
|
|
32
|
-
segments.forEach(function(data) {
|
|
33
|
-
const reservedBits = getReservedBitsCount(data.mode, version2);
|
|
34
|
-
totalBits += reservedBits + data.getBitsLength();
|
|
35
|
-
});
|
|
36
|
-
return totalBits;
|
|
37
|
-
}
|
|
38
|
-
function getBestVersionForMixedData(segments, errorCorrectionLevel) {
|
|
39
|
-
for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
|
|
40
|
-
const length = getTotalBitsFromDataArray(segments, currentVersion);
|
|
41
|
-
if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
|
|
42
|
-
return currentVersion;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return void 0;
|
|
46
|
-
}
|
|
47
|
-
exports.from = function from(value, defaultValue) {
|
|
48
|
-
if (VersionCheck.isValid(value)) {
|
|
49
|
-
return parseInt(value, 10);
|
|
50
|
-
}
|
|
51
|
-
return defaultValue;
|
|
52
|
-
};
|
|
53
|
-
exports.getCapacity = function getCapacity(version2, errorCorrectionLevel, mode) {
|
|
54
|
-
if (!VersionCheck.isValid(version2)) {
|
|
55
|
-
throw new Error("Invalid QR Code version");
|
|
56
|
-
}
|
|
57
|
-
if (typeof mode === "undefined") mode = Mode.BYTE;
|
|
58
|
-
const totalCodewords = Utils.getSymbolTotalCodewords(version2);
|
|
59
|
-
const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel);
|
|
60
|
-
const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
|
|
61
|
-
if (mode === Mode.MIXED) return dataTotalCodewordsBits;
|
|
62
|
-
const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version2);
|
|
63
|
-
switch (mode) {
|
|
64
|
-
case Mode.NUMERIC:
|
|
65
|
-
return Math.floor(usableBits / 10 * 3);
|
|
66
|
-
case Mode.ALPHANUMERIC:
|
|
67
|
-
return Math.floor(usableBits / 11 * 2);
|
|
68
|
-
case Mode.KANJI:
|
|
69
|
-
return Math.floor(usableBits / 13);
|
|
70
|
-
case Mode.BYTE:
|
|
71
|
-
default:
|
|
72
|
-
return Math.floor(usableBits / 8);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel) {
|
|
76
|
-
let seg;
|
|
77
|
-
const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
|
|
78
|
-
if (Array.isArray(data)) {
|
|
79
|
-
if (data.length > 1) {
|
|
80
|
-
return getBestVersionForMixedData(data, ecl);
|
|
81
|
-
}
|
|
82
|
-
if (data.length === 0) {
|
|
83
|
-
return 1;
|
|
84
|
-
}
|
|
85
|
-
seg = data[0];
|
|
86
|
-
} else {
|
|
87
|
-
seg = data;
|
|
88
|
-
}
|
|
89
|
-
return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl);
|
|
90
|
-
};
|
|
91
|
-
exports.getEncodedBits = function getEncodedBits(version2) {
|
|
92
|
-
if (!VersionCheck.isValid(version2) || version2 < 7) {
|
|
93
|
-
throw new Error("Invalid QR Code version");
|
|
94
|
-
}
|
|
95
|
-
let d = version2 << 12;
|
|
96
|
-
while (Utils.getBCHDigit(d) - G18_BCH >= 0) {
|
|
97
|
-
d ^= G18 << Utils.getBCHDigit(d) - G18_BCH;
|
|
98
|
-
}
|
|
99
|
-
return version2 << 12 | d;
|
|
100
|
-
};
|
|
101
|
-
})(version);
|
|
102
|
-
return version;
|
|
103
|
-
}
|
|
104
|
-
export {
|
|
105
|
-
requireVersion as __require
|
|
106
|
-
};
|
|
107
|
-
//# sourceMappingURL=version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js"],"sourcesContent":["const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n // Character count indicator + mode indicator bits\n return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n let totalBits = 0\n\n segments.forEach(function (data) {\n const reservedBits = getReservedBitsCount(data.mode, version)\n totalBits += reservedBits + data.getBitsLength()\n })\n\n return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n const length = getTotalBitsFromDataArray(segments, currentVersion)\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param {Number|String} value QR Code version\n * @param {Number} defaultValue Fallback value\n * @return {Number} QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n if (VersionCheck.isValid(value)) {\n return parseInt(value, 10)\n }\n\n return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param {Number} version QR Code version (1-40)\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid QR Code version')\n }\n\n // Use Byte mode as default\n if (typeof mode === 'undefined') mode = Mode.BYTE\n\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n // Return max number of storable codewords\n switch (mode) {\n case Mode.NUMERIC:\n return Math.floor((usableBits / 10) * 3)\n\n case Mode.ALPHANUMERIC:\n return Math.floor((usableBits / 11) * 2)\n\n case Mode.KANJI:\n return Math.floor(usableBits / 13)\n\n case Mode.BYTE:\n default:\n return Math.floor(usableBits / 8)\n }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param {Segment} data Segment of data\n * @param {Number} [errorCorrectionLevel=H] Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n let seg\n\n const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n if (Array.isArray(data)) {\n if (data.length > 1) {\n return getBestVersionForMixedData(data, ecl)\n }\n\n if (data.length === 0) {\n return 1\n }\n\n seg = data[0]\n } else {\n seg = data\n }\n\n return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param {Number} version QR Code version\n * @return {Number} Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n if (!VersionCheck.isValid(version) || version < 7) {\n throw new Error('Invalid QR Code version')\n }\n\n let d = version << 12\n\n while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n }\n\n return (version << 12) | d\n}\n"],"names":["require$$0","require$$1","require$$2","require$$3","require$$4","version"],"mappings":";;;;;;;;;;;AAAA,UAAM,QAAQA,aAAA;AACd,UAAM,SAASC,2BAAA;AACf,UAAM,UAAUC,4BAAA;AAChB,UAAM,OAAOC,YAAA;AACb,UAAM,eAAeC,oBAAA;AAGrB,UAAM,MAAO,KAAK,KAAO,KAAK,KAAO,KAAK,KAAO,KAAK,IAAM,KAAK,IAAM,KAAK,IAAM,KAAK,IAAM,KAAK;AAClG,UAAM,UAAU,MAAM,YAAY,GAAG;AAErC,aAAS,4BAA6B,MAAM,QAAQ,sBAAsB;AACxE,eAAS,iBAAiB,GAAG,kBAAkB,IAAI,kBAAkB;AACnE,YAAI,UAAU,QAAQ,YAAY,gBAAgB,sBAAsB,IAAI,GAAG;AAC7E,iBAAO;AAAA,QACb;AAAA,MACA;AAEE,aAAO;AAAA,IACT;AAEA,aAAS,qBAAsB,MAAMC,UAAS;AAE5C,aAAO,KAAK,sBAAsB,MAAMA,QAAO,IAAI;AAAA,IACrD;AAEA,aAAS,0BAA2B,UAAUA,UAAS;AACrD,UAAI,YAAY;AAEhB,eAAS,QAAQ,SAAU,MAAM;AAC/B,cAAM,eAAe,qBAAqB,KAAK,MAAMA,QAAO;AAC5D,qBAAa,eAAe,KAAK,cAAa;AAAA,MAClD,CAAG;AAED,aAAO;AAAA,IACT;AAEA,aAAS,2BAA4B,UAAU,sBAAsB;AACnE,eAAS,iBAAiB,GAAG,kBAAkB,IAAI,kBAAkB;AACnE,cAAM,SAAS,0BAA0B,UAAU,cAAc;AACjE,YAAI,UAAU,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