mario-core 2.0.2 → 2.0.3-release
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/Dashboard-C8i4BvyG.js +1 -0
- package/dist/Dashboard-CZW-qGyN.mjs +206 -0
- package/dist/EmailTemplateDetail-CITCgbC8.mjs +417 -0
- package/dist/EmailTemplateDetail-mdYeUDJg.js +1 -0
- package/dist/EmailTemplateList-BV-QOv5K.mjs +168 -0
- package/dist/EmailTemplateList-Dgf0hucr.js +1 -0
- package/dist/GalleryList-BYwvWx1S.js +1 -0
- package/dist/GalleryList-JJbcEbTi.mjs +329 -0
- package/dist/Login-BWsVc8Np.mjs +1384 -0
- package/dist/Login-SxZya_gO.js +1 -0
- package/dist/NotificationList-BDtxAveg.js +2 -0
- package/dist/NotificationList-BFTZrMUI.mjs +3878 -0
- package/dist/SchoolList-CClJ_UPT.js +1 -0
- package/dist/SchoolList-JmrmL2zE.mjs +5 -0
- package/dist/SkillList-B8uw4QZF.mjs +386 -0
- package/dist/SkillList-D_tQAQqL.js +1 -0
- package/dist/TeacherSelector-BKSay316.mjs +30 -0
- package/dist/TeacherSelector-DXv_vBJI.js +1 -0
- package/dist/TheContent-CDVWxnOm.js +1 -0
- package/dist/TheContent-mTUR10lr.mjs +28 -0
- package/dist/UserContainer-CilrSMeD.mjs +2771 -0
- package/dist/UserContainer-DuoEITq2.js +5 -0
- package/dist/UserDetail-GaRReB9G.mjs +902 -0
- package/dist/UserDetail-qXX-264Q.js +1 -0
- package/dist/UserList-7gE8aU_I.js +5 -0
- package/dist/UserList-B7sk8bc6.mjs +1162 -0
- package/dist/assets/Images.d.ts +14 -14
- package/dist/components/Alerts/CommonAlert.d.ts +3 -3
- package/dist/components/Alerts/EmptyDataAlert.d.ts +8 -8
- package/dist/components/Alerts/ErrorHandler.d.ts +6 -6
- package/dist/components/Alerts/SandboxAlert.d.ts +3 -0
- package/dist/components/Buttons/AddButton.d.ts +7 -7
- package/dist/components/Buttons/AddButtonIcon.d.ts +6 -6
- package/dist/components/Buttons/CloseButton.d.ts +8 -8
- package/dist/components/Buttons/DeleteButtonIcon.d.ts +7 -6
- package/dist/components/Buttons/DetailActionButtons.d.ts +8 -8
- package/dist/components/Buttons/EditButtonIcon.d.ts +7 -6
- package/dist/components/Buttons/LinkEditButton.d.ts +7 -7
- package/dist/components/Buttons/LoginNavButton.d.ts +8 -8
- package/dist/components/Buttons/SyncButton.d.ts +8 -0
- package/dist/components/Buttons/ToggleButton.d.ts +10 -10
- package/dist/components/Buttons/UploadFileButton.d.ts +13 -13
- package/dist/components/Headers/CommonHeader.d.ts +7 -7
- package/dist/components/Image/UploadImage.d.ts +2 -3
- package/dist/components/Inputs/FileInput.d.ts +8 -8
- package/dist/components/Inputs/PasswordInput.d.ts +9 -8
- package/dist/components/Inputs/SearchBox.d.ts +10 -10
- package/dist/components/Inputs/SearchBoxContainer.d.ts +9 -10
- package/dist/components/Labels/RequiredLabel.d.ts +6 -6
- package/dist/components/Loading/Loading.d.ts +3 -3
- package/dist/components/Modals/CommonModal.d.ts +2 -3
- package/dist/components/Modals/NotificationLogoutModal.d.ts +2 -0
- package/dist/components/Modals/NotificationModal.d.ts +2 -3
- package/dist/components/Others/QuitPrompt.d.ts +5 -2
- package/dist/components/Pagination/CustomPagination.d.ts +2 -3
- package/dist/components/Scroll/ScrollToTop.d.ts +3 -0
- package/dist/components/Selectors/AcademicClassSelector.d.ts +2 -3
- package/dist/components/Selectors/CategorySelector.d.ts +2 -0
- package/dist/components/Selectors/CreatableSelector.d.ts +2 -3
- package/dist/components/Selectors/CustomSelector.d.ts +2 -3
- package/dist/components/Selectors/MailCategorySelectors.d.ts +2 -3
- package/dist/components/Selectors/QuestionCategorySelector.d.ts +2 -3
- package/dist/components/Selectors/QuestionTypeSelector.d.ts +2 -3
- package/dist/components/Selectors/StarRatingSelector.d.ts +2 -3
- package/dist/components/Selectors/SuggestionCategorySelector.d.ts +2 -3
- package/dist/components/Selectors/constants/constant.d.ts +10 -0
- package/dist/components/Selectors/hooks/useCategorySelector.d.ts +5 -0
- package/dist/components/Tabs/CustomTab.d.ts +2 -3
- package/dist/components/Tabs/TabsWithComponent.d.ts +10 -0
- package/dist/configs/editorConfig.d.ts +7 -7
- package/dist/constants-CGewtxeZ.mjs +320 -0
- package/dist/constants-CNvNsffe.js +1 -0
- package/dist/containers/Commons/NotFound.d.ts +3 -3
- package/dist/containers/DistrictSchools/views/SchoolList.d.ts +3 -3
- package/dist/containers/EmailTemplate/components/AttachmentFile.d.ts +7 -7
- package/dist/containers/EmailTemplate/components/MailParam.d.ts +7 -7
- package/dist/containers/EmailTemplate/configs/emailTemplateSchema.d.ts +13 -13
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +28 -28
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateList.d.ts +11 -12
- package/dist/containers/EmailTemplate/views/EmailTemplateDetail.d.ts +3 -3
- package/dist/containers/EmailTemplate/views/EmailTemplateList.d.ts +3 -3
- package/dist/containers/Gallery/components/ActionModal.d.ts +2 -3
- package/dist/containers/Gallery/components/Filter.d.ts +8 -8
- package/dist/containers/Gallery/components/Media.d.ts +7 -8
- package/dist/containers/Gallery/components/MediaDetail.d.ts +6 -7
- package/dist/containers/Gallery/components/MediaList.d.ts +7 -7
- package/dist/containers/Gallery/components/MediaNav.d.ts +17 -18
- package/dist/containers/Gallery/constants/gallery.types.d.ts +21 -20
- package/dist/containers/Gallery/extensions/helpers.d.ts +4 -4
- package/dist/containers/Gallery/hooks/useGalleryList.d.ts +30 -31
- package/dist/containers/Gallery/views/GalleryList.d.ts +6 -6
- package/dist/containers/Login/constant/authConfig.d.ts +38 -0
- package/dist/containers/Login/constant/types.d.ts +34 -0
- package/dist/containers/Login/hooks/useCreatePassword.d.ts +12 -0
- package/dist/containers/Login/hooks/useForgotPassword.d.ts +22 -21
- package/dist/containers/Login/hooks/useLogin.d.ts +29 -16
- package/dist/containers/Login/hooks/useLoginTwoFactor.d.ts +4 -4
- package/dist/containers/Login/views/Dashboard.d.ts +3 -3
- package/dist/containers/Login/views/Login.d.ts +9 -9
- package/dist/containers/Login/views/block/BlockBackground.d.ts +7 -0
- package/dist/containers/Login/views/block/BlockCreatePassword.d.ts +2 -0
- package/dist/containers/Login/views/block/BlockForgetPassword.d.ts +6 -3
- package/dist/containers/Login/views/block/BlockLogin.d.ts +21 -7
- package/dist/containers/Login/views/block/BlockResetPassword.d.ts +2 -3
- package/dist/containers/Login/views/block/BlockSelectTeacher.d.ts +10 -0
- package/dist/containers/Login/views/block/BlockTwoFactorLogin.d.ts +2 -3
- package/dist/containers/Login/views/block/CloseBlock.d.ts +6 -6
- package/dist/containers/Login/views/block/ContentHomePage.d.ts +5 -5
- package/dist/containers/Login/views/block/IconContent.d.ts +7 -7
- package/dist/containers/Login/views/block/QuoteContent.d.ts +2 -7
- package/dist/containers/Notifications/components/NotificationButton.d.ts +5 -5
- package/dist/containers/Notifications/components/NotificationStatusSelector.d.ts +6 -7
- package/dist/containers/Notifications/hooks/useNotificationList.d.ts +17 -14
- package/dist/containers/Notifications/hooks/useUnreadNotification.d.ts +4 -4
- package/dist/containers/Notifications/views/NotificationList.d.ts +2 -3
- package/dist/containers/Skill/components/SkillDetailModal.d.ts +2 -3
- package/dist/containers/Skill/components/SkillSelector.d.ts +2 -3
- package/dist/containers/Skill/hooks/useSkillDetail.d.ts +19 -20
- package/dist/containers/Skill/hooks/useSkillList.d.ts +9 -10
- package/dist/containers/Skill/views/SkillList.d.ts +3 -3
- package/dist/containers/User/components/AssignStudentModal.d.ts +20 -0
- package/dist/containers/User/components/DeleteBulkModel copy.d.ts +4 -0
- package/dist/containers/User/components/DeleteBulkModel.d.ts +3 -0
- package/dist/containers/User/components/FilterPopover.d.ts +21 -0
- package/dist/containers/User/components/HeaderCell.d.ts +19 -0
- package/dist/containers/User/components/RemoveAssistant.d.ts +3 -0
- package/dist/containers/User/components/RemoveCounselor.d.ts +3 -0
- package/dist/containers/User/components/RemoveSupportTeacher.d.ts +3 -0
- package/dist/containers/User/components/RemoveTeacher.d.ts +3 -0
- package/dist/containers/User/components/SwitchDataTeacherModel.d.ts +12 -0
- package/dist/containers/User/components/SwitchTeacherModal.d.ts +2 -0
- package/dist/containers/User/components/TableHeader.d.ts +15 -0
- package/dist/containers/User/components/TeacherSelector.d.ts +2 -0
- package/dist/containers/User/components/UploadCSVButton.d.ts +11 -0
- package/dist/containers/User/components/UserDeletedModal.d.ts +2 -0
- package/dist/containers/User/configs/changePasswordSchema.d.ts +11 -0
- package/dist/containers/User/configs/userSchema.d.ts +13 -15
- package/dist/containers/User/configs/utils.d.ts +8 -0
- package/dist/containers/User/constants/constants.d.ts +63 -0
- package/dist/containers/User/constants/types.d.ts +265 -0
- package/dist/containers/User/hooks/useAssignStudent.d.ts +44 -0
- package/dist/containers/User/hooks/useAssignStudentList.d.ts +36 -0
- package/dist/containers/User/hooks/useAssistantList.d.ts +9 -0
- package/dist/containers/User/hooks/useCSVImport.d.ts +37 -0
- package/dist/containers/User/hooks/useCSVImportTab.d.ts +45 -0
- package/dist/containers/User/hooks/useClickOutside.d.ts +2 -0
- package/dist/containers/User/hooks/useCounselorList.d.ts +9 -0
- package/dist/containers/User/hooks/useExportUsersCsv.d.ts +5 -0
- package/dist/containers/User/hooks/useFilterPopover.d.ts +37 -0
- package/dist/containers/User/hooks/useResendMail.d.ts +5 -0
- package/dist/containers/User/hooks/useRosterUserSelector.d.ts +8 -0
- package/dist/containers/User/hooks/useSecondaryTeacherList.d.ts +9 -0
- package/dist/containers/User/hooks/useTableHeader.d.ts +20 -0
- package/dist/containers/User/hooks/useTeacherList.d.ts +9 -0
- package/dist/containers/User/hooks/useUserDeletedList.d.ts +21 -0
- package/dist/containers/User/hooks/useUserDeletedModal.d.ts +13 -0
- package/dist/containers/User/hooks/useUserDetail.d.ts +41 -22
- package/dist/containers/User/hooks/useUserList.d.ts +18 -11
- package/dist/containers/User/hooks/userFilters.d.ts +7 -0
- package/dist/containers/User/views/AssignStudentList.d.ts +2 -0
- package/dist/containers/User/views/CSVImport.d.ts +3 -0
- package/dist/containers/User/views/RosterUserSelector.d.ts +8 -0
- package/dist/containers/User/views/UserContainer.d.ts +2 -0
- package/dist/containers/User/views/UserDeletedList.d.ts +2 -0
- package/dist/containers/User/views/UserDetail.d.ts +2 -3
- package/dist/containers/User/views/UserList.d.ts +2 -3
- package/dist/hooks/useFilters.d.ts +7 -0
- package/dist/hooks/useLanguages.d.ts +9 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index-B4U_4-fu.js +15 -0
- package/dist/index-CFvswiRi.mjs +17591 -0
- package/dist/index.css +1037 -296
- package/dist/index.d.ts +114 -101
- package/dist/index.esm-B63qcj54.js +1 -0
- package/dist/index.esm-D6Zacg53.mjs +19 -0
- package/dist/index.js +24 -7493
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +28540 -6956
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/TheContent.d.ts +2 -3
- package/dist/mailCategoryService-CEgGm2FV.js +1 -0
- package/dist/mailCategoryService-Dis1n9kR.mjs +11 -0
- package/dist/mario-core.css +1 -0
- package/dist/redux/assessments/action.d.ts +1 -1
- package/dist/redux/assessments/reducer.d.ts +10 -5
- package/dist/redux/assignment/action.d.ts +1 -1
- package/dist/redux/assignment/reducer.d.ts +4 -2
- package/dist/redux/assistants/action.d.ts +1 -1
- package/dist/redux/assistants/reducer.d.ts +4 -2
- package/dist/redux/badges/action.d.ts +1 -1
- package/dist/redux/badges/reducer.d.ts +4 -2
- package/dist/redux/bandScores/action.d.ts +1 -1
- package/dist/redux/bandScores/reducer.d.ts +4 -2
- package/dist/redux/certificate/action.d.ts +1 -1
- package/dist/redux/certificate/reducer.d.ts +4 -2
- package/dist/redux/classes/action.d.ts +1 -1
- package/dist/redux/classes/reducer.d.ts +4 -2
- package/dist/redux/commons/action.d.ts +23 -8
- package/dist/redux/commons/reducer.d.ts +4 -2
- package/dist/redux/conferenceRubrics/action.d.ts +1 -1
- package/dist/redux/conferenceRubrics/reducer.d.ts +4 -2
- package/dist/redux/customAlert/action.d.ts +1 -1
- package/dist/redux/customAlert/reducer.d.ts +4 -2
- package/dist/redux/dashboard/action.d.ts +5 -4
- package/dist/redux/dashboard/reducer.d.ts +4 -2
- package/dist/redux/dataPlayer/action.d.ts +2 -2
- package/dist/redux/dataPlayer/reducer.d.ts +4 -2
- package/dist/redux/emailTemplates/action.d.ts +1 -1
- package/dist/redux/emailTemplates/reducer.d.ts +4 -2
- package/dist/redux/faqs/action.d.ts +1 -1
- package/dist/redux/faqs/reducer.d.ts +4 -2
- package/dist/redux/feedback/action.d.ts +1 -1
- package/dist/redux/feedback/reducer.d.ts +4 -2
- package/dist/redux/gallery/action.d.ts +2 -2
- package/dist/redux/gallery/reducer.d.ts +4 -2
- package/dist/redux/goalExamples/action.d.ts +1 -1
- package/dist/redux/goalExamples/reducer.d.ts +4 -2
- package/dist/redux/improveMyClass/action.d.ts +1 -1
- package/dist/redux/improveMyClass/reducer.d.ts +4 -2
- package/dist/redux/learningStrategies/action.d.ts +1 -1
- package/dist/redux/learningStrategies/reducer.d.ts +4 -2
- package/dist/redux/learningSupportCategories/action.d.ts +1 -1
- package/dist/redux/learningSupportCategories/reducer.d.ts +4 -2
- package/dist/redux/mailCategories/action.d.ts +1 -1
- package/dist/redux/mailCategories/reducer.d.ts +4 -2
- package/dist/redux/navMobile/action.d.ts +1 -0
- package/dist/redux/navMobile/reducer.d.ts +4 -0
- package/dist/redux/notifications/action.d.ts +3 -3
- package/dist/redux/notifications/reducer.d.ts +4 -2
- package/dist/redux/questionBanks/action.d.ts +1 -1
- package/dist/redux/questionBanks/reducer.d.ts +4 -2
- package/dist/redux/questionByCategory/action.d.ts +8 -8
- package/dist/redux/questionByCategory/reducer.d.ts +4 -2
- package/dist/redux/questionCategory/action.d.ts +1 -1
- package/dist/redux/questionCategory/reducer.d.ts +4 -2
- package/dist/redux/reflectionForms/action.d.ts +1 -1
- package/dist/redux/reflectionForms/reducer.d.ts +4 -2
- package/dist/redux/reflectionResults/action.d.ts +1 -1
- package/dist/redux/reflectionResults/reducer.d.ts +4 -2
- package/dist/redux/schoolBlankDays/action.d.ts +1 -1
- package/dist/redux/schoolBlankDays/reducer.d.ts +4 -2
- package/dist/redux/semester/action.d.ts +1 -1
- package/dist/redux/semester/reducer.d.ts +4 -2
- package/dist/redux/sessionPlayers/action.d.ts +5 -4
- package/dist/redux/sessionPlayers/reducer.d.ts +4 -2
- package/dist/redux/sessionTemplateGeneralClasses/action.d.ts +1 -1
- package/dist/redux/sessionTemplateGeneralClasses/reducer.d.ts +4 -2
- package/dist/redux/sessionTemplates/action.d.ts +1 -1
- package/dist/redux/sessionTemplates/reducer.d.ts +4 -2
- package/dist/redux/skills/action.d.ts +1 -1
- package/dist/redux/skills/reducer.d.ts +4 -2
- package/dist/redux/subjects/action.d.ts +1 -1
- package/dist/redux/subjects/reducer.d.ts +4 -2
- package/dist/redux/suggestionBanks/action.d.ts +1 -1
- package/dist/redux/suggestionBanks/reducer.d.ts +4 -2
- package/dist/redux/teacher/myStudent/action.d.ts +1 -1
- package/dist/redux/teacher/myStudent/reducer.d.ts +4 -2
- package/dist/redux/tutorialScreen/action.d.ts +1 -1
- package/dist/redux/tutorialScreen/reducer.d.ts +10 -5
- package/dist/redux/users/action.d.ts +2 -2
- package/dist/redux/users/reducer.d.ts +4 -2
- package/dist/redux/weeklyQuests/action.d.ts +2 -0
- package/dist/redux/weeklyQuests/reducer.d.ts +12 -0
- package/dist/redux/widget/action.d.ts +1 -1
- package/dist/redux/widget/reducer.d.ts +4 -2
- package/dist/rootReducer.d.ts +106 -48
- package/dist/services/accountService.d.ts +22 -8
- package/dist/services/api.d.ts +3 -3
- package/dist/services/classService.d.ts +1 -1
- package/dist/services/csvImportService.d.ts +9 -0
- package/dist/services/csvService.d.ts +8 -0
- package/dist/services/emailTemplateService.d.ts +7 -6
- package/dist/services/fileServices.d.ts +13 -13
- package/dist/services/galleryService.d.ts +2 -2
- package/dist/services/mailCategoryService.d.ts +1 -1
- package/dist/services/notificationService.d.ts +7 -6
- package/dist/services/questionCategoryService.d.ts +3 -1
- package/dist/services/schoolService.d.ts +2 -0
- package/dist/services/skillService.d.ts +6 -6
- package/dist/services/suggestionCategoryService.d.ts +1 -1
- package/dist/services/userService.d.ts +37 -7
- package/dist/store.d.ts +3 -3
- package/dist/types/Conversation.d.ts +8 -8
- package/dist/types/ConversationMember.d.ts +5 -5
- package/dist/types/Dashboard.d.ts +5 -5
- package/dist/types/Filter.d.ts +16 -10
- package/dist/types/Language.d.ts +8 -0
- package/dist/types/Message.d.ts +13 -13
- package/dist/types/Notification.d.ts +8 -8
- package/dist/types/Payload.d.ts +17 -0
- package/dist/types/user.d.ts +3 -0
- package/dist/types-BvnbDeJF.mjs +5 -0
- package/dist/types-CTFcZUFS.js +1 -0
- package/dist/utils/canAccessRoute.d.ts +2 -2
- package/dist/utils/constants.d.ts +87 -57
- package/dist/utils/debounce.d.ts +2 -2
- package/dist/utils/domHelpers.d.ts +2 -2
- package/dist/utils/encodeParams.d.ts +2 -2
- package/dist/utils/firstCheckToken.d.ts +2 -2
- package/dist/utils/generateRandomString.d.ts +2 -2
- package/dist/utils/getAccessToken.d.ts +2 -2
- package/dist/utils/getCookieValue.d.ts +2 -0
- package/dist/utils/getFileUrl.d.ts +2 -2
- package/dist/utils/getStaticFileUrl.d.ts +2 -0
- package/dist/utils/getTextFromHTML.d.ts +2 -2
- package/dist/utils/utcToLocalTime.d.ts +1 -2
- package/package.json +79 -63
- package/dist/components/Alerts/ReactNotification.d.ts +0 -4
- package/dist/containers/Faq/components/FaqDetailModal.d.ts +0 -3
- package/dist/containers/Faq/hooks/useFaqDetail.d.ts +0 -18
- package/dist/containers/Faq/hooks/useFaqList.d.ts +0 -10
- package/dist/containers/Faq/views/FaqList.d.ts +0 -3
- package/dist/layouts/TheFooter.d.ts +0 -3
- package/dist/layouts/TheHeader.d.ts +0 -3
- package/dist/layouts/TheHeaderDropdown.d.ts +0 -3
- package/dist/layouts/TheLayout.d.ts +0 -3
- package/dist/layouts/TheSidebar.d.ts +0 -3
- package/dist/services/faqService.d.ts +0 -6
|
@@ -0,0 +1,3878 @@
|
|
|
1
|
+
import { jsx as Pt, jsxs as ce } from "react/jsx-runtime";
|
|
2
|
+
import { Row as vn, Col as Ye, Input as Bn, Table as _i } from "reactstrap";
|
|
3
|
+
import { c as bi } from "./index.esm-D6Zacg53.mjs";
|
|
4
|
+
import { X as mi, i as mn, B as wi, b as Dn, al as Si, c as yn, J as zn, _ as Ci, a9 as Ti, s as Pi, P as Ai, Q as Ei } from "./index-CFvswiRi.mjs";
|
|
5
|
+
import { memo as Oi, useState as Hn, useCallback as gn, useEffect as qn } from "react";
|
|
6
|
+
import { useDispatch as ki, useSelector as Pe } from "react-redux";
|
|
7
|
+
import { useParams as Li } from "react-router-dom";
|
|
8
|
+
import { useTranslation as Ri } from "react-i18next";
|
|
9
|
+
const Ni = [
|
|
10
|
+
{ value: !0, label: "Read" },
|
|
11
|
+
{ value: !1, label: "Unread" }
|
|
12
|
+
], ji = ({ value: wt, onChange: ie }) => /* @__PURE__ */ Pt(
|
|
13
|
+
mi,
|
|
14
|
+
{
|
|
15
|
+
defaultValue: wt,
|
|
16
|
+
options: Ni,
|
|
17
|
+
onChange: ie,
|
|
18
|
+
styles: {
|
|
19
|
+
menu: (at) => ({ ...at, zIndex: 10 })
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
), Ui = Oi(ji);
|
|
23
|
+
function Ii(wt) {
|
|
24
|
+
return wt && wt.__esModule && Object.prototype.hasOwnProperty.call(wt, "default") ? wt.default : wt;
|
|
25
|
+
}
|
|
26
|
+
var _n = { exports: {} };
|
|
27
|
+
var Fn;
|
|
28
|
+
function Mi() {
|
|
29
|
+
return Fn || (Fn = 1, (function(wt, ie) {
|
|
30
|
+
(function(at, pt) {
|
|
31
|
+
wt.exports = pt();
|
|
32
|
+
})(window, function() {
|
|
33
|
+
return (
|
|
34
|
+
/******/
|
|
35
|
+
(function(Lt) {
|
|
36
|
+
var at = {};
|
|
37
|
+
function pt(S) {
|
|
38
|
+
if (at[S])
|
|
39
|
+
return at[S].exports;
|
|
40
|
+
var y = at[S] = {
|
|
41
|
+
/******/
|
|
42
|
+
i: S,
|
|
43
|
+
/******/
|
|
44
|
+
l: !1,
|
|
45
|
+
/******/
|
|
46
|
+
exports: {}
|
|
47
|
+
/******/
|
|
48
|
+
};
|
|
49
|
+
return Lt[S].call(y.exports, y, y.exports, pt), y.l = !0, y.exports;
|
|
50
|
+
}
|
|
51
|
+
return pt.m = Lt, pt.c = at, pt.d = function(S, y, Tt) {
|
|
52
|
+
pt.o(S, y) || Object.defineProperty(S, y, { enumerable: !0, get: Tt });
|
|
53
|
+
}, pt.r = function(S) {
|
|
54
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(S, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(S, "__esModule", { value: !0 });
|
|
55
|
+
}, pt.t = function(S, y) {
|
|
56
|
+
if (y & 1 && (S = pt(S)), y & 8 || y & 4 && typeof S == "object" && S && S.__esModule) return S;
|
|
57
|
+
var Tt = /* @__PURE__ */ Object.create(null);
|
|
58
|
+
if (pt.r(Tt), Object.defineProperty(Tt, "default", { enumerable: !0, value: S }), y & 2 && typeof S != "string") for (var tt in S) pt.d(Tt, tt, (function(yt) {
|
|
59
|
+
return S[yt];
|
|
60
|
+
}).bind(null, tt));
|
|
61
|
+
return Tt;
|
|
62
|
+
}, pt.n = function(S) {
|
|
63
|
+
var y = S && S.__esModule ? (
|
|
64
|
+
/******/
|
|
65
|
+
function() {
|
|
66
|
+
return S.default;
|
|
67
|
+
}
|
|
68
|
+
) : (
|
|
69
|
+
/******/
|
|
70
|
+
function() {
|
|
71
|
+
return S;
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
return pt.d(y, "a", y), y;
|
|
75
|
+
}, pt.o = function(S, y) {
|
|
76
|
+
return Object.prototype.hasOwnProperty.call(S, y);
|
|
77
|
+
}, pt.p = "", pt(pt.s = 3);
|
|
78
|
+
})([
|
|
79
|
+
/* 0 */
|
|
80
|
+
/***/
|
|
81
|
+
(function(Lt, at, pt) {
|
|
82
|
+
var S = this && this.__extends || /* @__PURE__ */ (function() {
|
|
83
|
+
var H = function(T, A) {
|
|
84
|
+
return H = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(G, B) {
|
|
85
|
+
G.__proto__ = B;
|
|
86
|
+
} || function(G, B) {
|
|
87
|
+
for (var St in B) B.hasOwnProperty(St) && (G[St] = B[St]);
|
|
88
|
+
}, H(T, A);
|
|
89
|
+
};
|
|
90
|
+
return function(T, A) {
|
|
91
|
+
H(T, A);
|
|
92
|
+
function G() {
|
|
93
|
+
this.constructor = T;
|
|
94
|
+
}
|
|
95
|
+
T.prototype = A === null ? Object.create(A) : (G.prototype = A.prototype, new G());
|
|
96
|
+
};
|
|
97
|
+
})();
|
|
98
|
+
Object.defineProperty(at, "__esModule", { value: !0 });
|
|
99
|
+
var y = 256, Tt = (
|
|
100
|
+
/** @class */
|
|
101
|
+
(function() {
|
|
102
|
+
function H(T) {
|
|
103
|
+
T === void 0 && (T = "="), this._paddingCharacter = T;
|
|
104
|
+
}
|
|
105
|
+
return H.prototype.encodedLength = function(T) {
|
|
106
|
+
return this._paddingCharacter ? (T + 2) / 3 * 4 | 0 : (T * 8 + 5) / 6 | 0;
|
|
107
|
+
}, H.prototype.encode = function(T) {
|
|
108
|
+
for (var A = "", G = 0; G < T.length - 2; G += 3) {
|
|
109
|
+
var B = T[G] << 16 | T[G + 1] << 8 | T[G + 2];
|
|
110
|
+
A += this._encodeByte(B >>> 18 & 63), A += this._encodeByte(B >>> 12 & 63), A += this._encodeByte(B >>> 6 & 63), A += this._encodeByte(B >>> 0 & 63);
|
|
111
|
+
}
|
|
112
|
+
var St = T.length - G;
|
|
113
|
+
if (St > 0) {
|
|
114
|
+
var B = T[G] << 16 | (St === 2 ? T[G + 1] << 8 : 0);
|
|
115
|
+
A += this._encodeByte(B >>> 18 & 63), A += this._encodeByte(B >>> 12 & 63), St === 2 ? A += this._encodeByte(B >>> 6 & 63) : A += this._paddingCharacter || "", A += this._paddingCharacter || "";
|
|
116
|
+
}
|
|
117
|
+
return A;
|
|
118
|
+
}, H.prototype.maxDecodedLength = function(T) {
|
|
119
|
+
return this._paddingCharacter ? T / 4 * 3 | 0 : (T * 6 + 7) / 8 | 0;
|
|
120
|
+
}, H.prototype.decodedLength = function(T) {
|
|
121
|
+
return this.maxDecodedLength(T.length - this._getPaddingLength(T));
|
|
122
|
+
}, H.prototype.decode = function(T) {
|
|
123
|
+
if (T.length === 0)
|
|
124
|
+
return new Uint8Array(0);
|
|
125
|
+
for (var A = this._getPaddingLength(T), G = T.length - A, B = new Uint8Array(this.maxDecodedLength(G)), St = 0, it = 0, Ht = 0, Yt = 0, Dt = 0, Mt = 0, Ut = 0; it < G - 4; it += 4)
|
|
126
|
+
Yt = this._decodeChar(T.charCodeAt(it + 0)), Dt = this._decodeChar(T.charCodeAt(it + 1)), Mt = this._decodeChar(T.charCodeAt(it + 2)), Ut = this._decodeChar(T.charCodeAt(it + 3)), B[St++] = Yt << 2 | Dt >>> 4, B[St++] = Dt << 4 | Mt >>> 2, B[St++] = Mt << 6 | Ut, Ht |= Yt & y, Ht |= Dt & y, Ht |= Mt & y, Ht |= Ut & y;
|
|
127
|
+
if (it < G - 1 && (Yt = this._decodeChar(T.charCodeAt(it)), Dt = this._decodeChar(T.charCodeAt(it + 1)), B[St++] = Yt << 2 | Dt >>> 4, Ht |= Yt & y, Ht |= Dt & y), it < G - 2 && (Mt = this._decodeChar(T.charCodeAt(it + 2)), B[St++] = Dt << 4 | Mt >>> 2, Ht |= Mt & y), it < G - 3 && (Ut = this._decodeChar(T.charCodeAt(it + 3)), B[St++] = Mt << 6 | Ut, Ht |= Ut & y), Ht !== 0)
|
|
128
|
+
throw new Error("Base64Coder: incorrect characters for decoding");
|
|
129
|
+
return B;
|
|
130
|
+
}, H.prototype._encodeByte = function(T) {
|
|
131
|
+
var A = T;
|
|
132
|
+
return A += 65, A += 25 - T >>> 8 & 6, A += 51 - T >>> 8 & -75, A += 61 - T >>> 8 & -15, A += 62 - T >>> 8 & 3, String.fromCharCode(A);
|
|
133
|
+
}, H.prototype._decodeChar = function(T) {
|
|
134
|
+
var A = y;
|
|
135
|
+
return A += (42 - T & T - 44) >>> 8 & -y + T - 43 + 62, A += (46 - T & T - 48) >>> 8 & -y + T - 47 + 63, A += (47 - T & T - 58) >>> 8 & -y + T - 48 + 52, A += (64 - T & T - 91) >>> 8 & -y + T - 65 + 0, A += (96 - T & T - 123) >>> 8 & -y + T - 97 + 26, A;
|
|
136
|
+
}, H.prototype._getPaddingLength = function(T) {
|
|
137
|
+
var A = 0;
|
|
138
|
+
if (this._paddingCharacter) {
|
|
139
|
+
for (var G = T.length - 1; G >= 0 && T[G] === this._paddingCharacter; G--)
|
|
140
|
+
A++;
|
|
141
|
+
if (T.length < 4 || A > 2)
|
|
142
|
+
throw new Error("Base64Coder: incorrect padding");
|
|
143
|
+
}
|
|
144
|
+
return A;
|
|
145
|
+
}, H;
|
|
146
|
+
})()
|
|
147
|
+
);
|
|
148
|
+
at.Coder = Tt;
|
|
149
|
+
var tt = new Tt();
|
|
150
|
+
function yt(H) {
|
|
151
|
+
return tt.encode(H);
|
|
152
|
+
}
|
|
153
|
+
at.encode = yt;
|
|
154
|
+
function xt(H) {
|
|
155
|
+
return tt.decode(H);
|
|
156
|
+
}
|
|
157
|
+
at.decode = xt;
|
|
158
|
+
var vt = (
|
|
159
|
+
/** @class */
|
|
160
|
+
(function(H) {
|
|
161
|
+
S(T, H);
|
|
162
|
+
function T() {
|
|
163
|
+
return H !== null && H.apply(this, arguments) || this;
|
|
164
|
+
}
|
|
165
|
+
return T.prototype._encodeByte = function(A) {
|
|
166
|
+
var G = A;
|
|
167
|
+
return G += 65, G += 25 - A >>> 8 & 6, G += 51 - A >>> 8 & -75, G += 61 - A >>> 8 & -13, G += 62 - A >>> 8 & 49, String.fromCharCode(G);
|
|
168
|
+
}, T.prototype._decodeChar = function(A) {
|
|
169
|
+
var G = y;
|
|
170
|
+
return G += (44 - A & A - 46) >>> 8 & -y + A - 45 + 62, G += (94 - A & A - 96) >>> 8 & -y + A - 95 + 63, G += (47 - A & A - 58) >>> 8 & -y + A - 48 + 52, G += (64 - A & A - 91) >>> 8 & -y + A - 65 + 0, G += (96 - A & A - 123) >>> 8 & -y + A - 97 + 26, G;
|
|
171
|
+
}, T;
|
|
172
|
+
})(Tt)
|
|
173
|
+
);
|
|
174
|
+
at.URLSafeCoder = vt;
|
|
175
|
+
var st = new vt();
|
|
176
|
+
function et(H) {
|
|
177
|
+
return st.encode(H);
|
|
178
|
+
}
|
|
179
|
+
at.encodeURLSafe = et;
|
|
180
|
+
function _t(H) {
|
|
181
|
+
return st.decode(H);
|
|
182
|
+
}
|
|
183
|
+
at.decodeURLSafe = _t, at.encodedLength = function(H) {
|
|
184
|
+
return tt.encodedLength(H);
|
|
185
|
+
}, at.maxDecodedLength = function(H) {
|
|
186
|
+
return tt.maxDecodedLength(H);
|
|
187
|
+
}, at.decodedLength = function(H) {
|
|
188
|
+
return tt.decodedLength(H);
|
|
189
|
+
};
|
|
190
|
+
}),
|
|
191
|
+
/* 1 */
|
|
192
|
+
/***/
|
|
193
|
+
(function(Lt, at, pt) {
|
|
194
|
+
Object.defineProperty(at, "__esModule", { value: !0 });
|
|
195
|
+
var S = "utf8: invalid string", y = "utf8: invalid source encoding";
|
|
196
|
+
function Tt(xt) {
|
|
197
|
+
for (var vt = new Uint8Array(tt(xt)), st = 0, et = 0; et < xt.length; et++) {
|
|
198
|
+
var _t = xt.charCodeAt(et);
|
|
199
|
+
_t < 128 ? vt[st++] = _t : _t < 2048 ? (vt[st++] = 192 | _t >> 6, vt[st++] = 128 | _t & 63) : _t < 55296 ? (vt[st++] = 224 | _t >> 12, vt[st++] = 128 | _t >> 6 & 63, vt[st++] = 128 | _t & 63) : (et++, _t = (_t & 1023) << 10, _t |= xt.charCodeAt(et) & 1023, _t += 65536, vt[st++] = 240 | _t >> 18, vt[st++] = 128 | _t >> 12 & 63, vt[st++] = 128 | _t >> 6 & 63, vt[st++] = 128 | _t & 63);
|
|
200
|
+
}
|
|
201
|
+
return vt;
|
|
202
|
+
}
|
|
203
|
+
at.encode = Tt;
|
|
204
|
+
function tt(xt) {
|
|
205
|
+
for (var vt = 0, st = 0; st < xt.length; st++) {
|
|
206
|
+
var et = xt.charCodeAt(st);
|
|
207
|
+
if (et < 128)
|
|
208
|
+
vt += 1;
|
|
209
|
+
else if (et < 2048)
|
|
210
|
+
vt += 2;
|
|
211
|
+
else if (et < 55296)
|
|
212
|
+
vt += 3;
|
|
213
|
+
else if (et <= 57343) {
|
|
214
|
+
if (st >= xt.length - 1)
|
|
215
|
+
throw new Error(S);
|
|
216
|
+
st++, vt += 4;
|
|
217
|
+
} else
|
|
218
|
+
throw new Error(S);
|
|
219
|
+
}
|
|
220
|
+
return vt;
|
|
221
|
+
}
|
|
222
|
+
at.encodedLength = tt;
|
|
223
|
+
function yt(xt) {
|
|
224
|
+
for (var vt = [], st = 0; st < xt.length; st++) {
|
|
225
|
+
var et = xt[st];
|
|
226
|
+
if (et & 128) {
|
|
227
|
+
var _t = void 0;
|
|
228
|
+
if (et < 224) {
|
|
229
|
+
if (st >= xt.length)
|
|
230
|
+
throw new Error(y);
|
|
231
|
+
var H = xt[++st];
|
|
232
|
+
if ((H & 192) !== 128)
|
|
233
|
+
throw new Error(y);
|
|
234
|
+
et = (et & 31) << 6 | H & 63, _t = 128;
|
|
235
|
+
} else if (et < 240) {
|
|
236
|
+
if (st >= xt.length - 1)
|
|
237
|
+
throw new Error(y);
|
|
238
|
+
var H = xt[++st], T = xt[++st];
|
|
239
|
+
if ((H & 192) !== 128 || (T & 192) !== 128)
|
|
240
|
+
throw new Error(y);
|
|
241
|
+
et = (et & 15) << 12 | (H & 63) << 6 | T & 63, _t = 2048;
|
|
242
|
+
} else if (et < 248) {
|
|
243
|
+
if (st >= xt.length - 2)
|
|
244
|
+
throw new Error(y);
|
|
245
|
+
var H = xt[++st], T = xt[++st], A = xt[++st];
|
|
246
|
+
if ((H & 192) !== 128 || (T & 192) !== 128 || (A & 192) !== 128)
|
|
247
|
+
throw new Error(y);
|
|
248
|
+
et = (et & 15) << 18 | (H & 63) << 12 | (T & 63) << 6 | A & 63, _t = 65536;
|
|
249
|
+
} else
|
|
250
|
+
throw new Error(y);
|
|
251
|
+
if (et < _t || et >= 55296 && et <= 57343)
|
|
252
|
+
throw new Error(y);
|
|
253
|
+
if (et >= 65536) {
|
|
254
|
+
if (et > 1114111)
|
|
255
|
+
throw new Error(y);
|
|
256
|
+
et -= 65536, vt.push(String.fromCharCode(55296 | et >> 10)), et = 56320 | et & 1023;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
vt.push(String.fromCharCode(et));
|
|
260
|
+
}
|
|
261
|
+
return vt.join("");
|
|
262
|
+
}
|
|
263
|
+
at.decode = yt;
|
|
264
|
+
}),
|
|
265
|
+
/* 2 */
|
|
266
|
+
/***/
|
|
267
|
+
(function(Lt, at, pt) {
|
|
268
|
+
(function(S) {
|
|
269
|
+
var y = function(o) {
|
|
270
|
+
var f, a = new Float64Array(16);
|
|
271
|
+
if (o) for (f = 0; f < o.length; f++) a[f] = o[f];
|
|
272
|
+
return a;
|
|
273
|
+
}, Tt = function() {
|
|
274
|
+
throw new Error("no PRNG");
|
|
275
|
+
}, tt = new Uint8Array(16), yt = new Uint8Array(32);
|
|
276
|
+
yt[0] = 9;
|
|
277
|
+
var xt = y(), vt = y([1]), st = y([56129, 1]), et = y([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), _t = y([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), H = y([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), T = y([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), A = y([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]);
|
|
278
|
+
function G(o, f, a, r) {
|
|
279
|
+
o[f] = a >> 24 & 255, o[f + 1] = a >> 16 & 255, o[f + 2] = a >> 8 & 255, o[f + 3] = a & 255, o[f + 4] = r >> 24 & 255, o[f + 5] = r >> 16 & 255, o[f + 6] = r >> 8 & 255, o[f + 7] = r & 255;
|
|
280
|
+
}
|
|
281
|
+
function B(o, f, a, r, c) {
|
|
282
|
+
var l, d = 0;
|
|
283
|
+
for (l = 0; l < c; l++) d |= o[f + l] ^ a[r + l];
|
|
284
|
+
return (1 & d - 1 >>> 8) - 1;
|
|
285
|
+
}
|
|
286
|
+
function St(o, f, a, r) {
|
|
287
|
+
return B(o, f, a, r, 16);
|
|
288
|
+
}
|
|
289
|
+
function it(o, f, a, r) {
|
|
290
|
+
return B(o, f, a, r, 32);
|
|
291
|
+
}
|
|
292
|
+
function Ht(o, f, a, r) {
|
|
293
|
+
for (var c = r[0] & 255 | (r[1] & 255) << 8 | (r[2] & 255) << 16 | (r[3] & 255) << 24, l = a[0] & 255 | (a[1] & 255) << 8 | (a[2] & 255) << 16 | (a[3] & 255) << 24, d = a[4] & 255 | (a[5] & 255) << 8 | (a[6] & 255) << 16 | (a[7] & 255) << 24, _ = a[8] & 255 | (a[9] & 255) << 8 | (a[10] & 255) << 16 | (a[11] & 255) << 24, C = a[12] & 255 | (a[13] & 255) << 8 | (a[14] & 255) << 16 | (a[15] & 255) << 24, I = r[4] & 255 | (r[5] & 255) << 8 | (r[6] & 255) << 16 | (r[7] & 255) << 24, O = f[0] & 255 | (f[1] & 255) << 8 | (f[2] & 255) << 16 | (f[3] & 255) << 24, lt = f[4] & 255 | (f[5] & 255) << 8 | (f[6] & 255) << 16 | (f[7] & 255) << 24, R = f[8] & 255 | (f[9] & 255) << 8 | (f[10] & 255) << 16 | (f[11] & 255) << 24, Y = f[12] & 255 | (f[13] & 255) << 8 | (f[14] & 255) << 16 | (f[15] & 255) << 24, J = r[8] & 255 | (r[9] & 255) << 8 | (r[10] & 255) << 16 | (r[11] & 255) << 24, K = a[16] & 255 | (a[17] & 255) << 8 | (a[18] & 255) << 16 | (a[19] & 255) << 24, q = a[20] & 255 | (a[21] & 255) << 8 | (a[22] & 255) << 16 | (a[23] & 255) << 24, X = a[24] & 255 | (a[25] & 255) << 8 | (a[26] & 255) << 16 | (a[27] & 255) << 24, $ = a[28] & 255 | (a[29] & 255) << 8 | (a[30] & 255) << 16 | (a[31] & 255) << 24, W = r[12] & 255 | (r[13] & 255) << 8 | (r[14] & 255) << 16 | (r[15] & 255) << 24, N = c, M = l, k = d, j = _, U = C, E = I, p = O, x = lt, m = R, g = Y, b = J, w = K, D = q, V = X, Q = $, Z = W, h, ot = 0; ot < 20; ot += 2)
|
|
294
|
+
h = N + D | 0, U ^= h << 7 | h >>> 25, h = U + N | 0, m ^= h << 9 | h >>> 23, h = m + U | 0, D ^= h << 13 | h >>> 19, h = D + m | 0, N ^= h << 18 | h >>> 14, h = E + M | 0, g ^= h << 7 | h >>> 25, h = g + E | 0, V ^= h << 9 | h >>> 23, h = V + g | 0, M ^= h << 13 | h >>> 19, h = M + V | 0, E ^= h << 18 | h >>> 14, h = b + p | 0, Q ^= h << 7 | h >>> 25, h = Q + b | 0, k ^= h << 9 | h >>> 23, h = k + Q | 0, p ^= h << 13 | h >>> 19, h = p + k | 0, b ^= h << 18 | h >>> 14, h = Z + w | 0, j ^= h << 7 | h >>> 25, h = j + Z | 0, x ^= h << 9 | h >>> 23, h = x + j | 0, w ^= h << 13 | h >>> 19, h = w + x | 0, Z ^= h << 18 | h >>> 14, h = N + j | 0, M ^= h << 7 | h >>> 25, h = M + N | 0, k ^= h << 9 | h >>> 23, h = k + M | 0, j ^= h << 13 | h >>> 19, h = j + k | 0, N ^= h << 18 | h >>> 14, h = E + U | 0, p ^= h << 7 | h >>> 25, h = p + E | 0, x ^= h << 9 | h >>> 23, h = x + p | 0, U ^= h << 13 | h >>> 19, h = U + x | 0, E ^= h << 18 | h >>> 14, h = b + g | 0, w ^= h << 7 | h >>> 25, h = w + b | 0, m ^= h << 9 | h >>> 23, h = m + w | 0, g ^= h << 13 | h >>> 19, h = g + m | 0, b ^= h << 18 | h >>> 14, h = Z + Q | 0, D ^= h << 7 | h >>> 25, h = D + Z | 0, V ^= h << 9 | h >>> 23, h = V + D | 0, Q ^= h << 13 | h >>> 19, h = Q + V | 0, Z ^= h << 18 | h >>> 14;
|
|
295
|
+
N = N + c | 0, M = M + l | 0, k = k + d | 0, j = j + _ | 0, U = U + C | 0, E = E + I | 0, p = p + O | 0, x = x + lt | 0, m = m + R | 0, g = g + Y | 0, b = b + J | 0, w = w + K | 0, D = D + q | 0, V = V + X | 0, Q = Q + $ | 0, Z = Z + W | 0, o[0] = N >>> 0 & 255, o[1] = N >>> 8 & 255, o[2] = N >>> 16 & 255, o[3] = N >>> 24 & 255, o[4] = M >>> 0 & 255, o[5] = M >>> 8 & 255, o[6] = M >>> 16 & 255, o[7] = M >>> 24 & 255, o[8] = k >>> 0 & 255, o[9] = k >>> 8 & 255, o[10] = k >>> 16 & 255, o[11] = k >>> 24 & 255, o[12] = j >>> 0 & 255, o[13] = j >>> 8 & 255, o[14] = j >>> 16 & 255, o[15] = j >>> 24 & 255, o[16] = U >>> 0 & 255, o[17] = U >>> 8 & 255, o[18] = U >>> 16 & 255, o[19] = U >>> 24 & 255, o[20] = E >>> 0 & 255, o[21] = E >>> 8 & 255, o[22] = E >>> 16 & 255, o[23] = E >>> 24 & 255, o[24] = p >>> 0 & 255, o[25] = p >>> 8 & 255, o[26] = p >>> 16 & 255, o[27] = p >>> 24 & 255, o[28] = x >>> 0 & 255, o[29] = x >>> 8 & 255, o[30] = x >>> 16 & 255, o[31] = x >>> 24 & 255, o[32] = m >>> 0 & 255, o[33] = m >>> 8 & 255, o[34] = m >>> 16 & 255, o[35] = m >>> 24 & 255, o[36] = g >>> 0 & 255, o[37] = g >>> 8 & 255, o[38] = g >>> 16 & 255, o[39] = g >>> 24 & 255, o[40] = b >>> 0 & 255, o[41] = b >>> 8 & 255, o[42] = b >>> 16 & 255, o[43] = b >>> 24 & 255, o[44] = w >>> 0 & 255, o[45] = w >>> 8 & 255, o[46] = w >>> 16 & 255, o[47] = w >>> 24 & 255, o[48] = D >>> 0 & 255, o[49] = D >>> 8 & 255, o[50] = D >>> 16 & 255, o[51] = D >>> 24 & 255, o[52] = V >>> 0 & 255, o[53] = V >>> 8 & 255, o[54] = V >>> 16 & 255, o[55] = V >>> 24 & 255, o[56] = Q >>> 0 & 255, o[57] = Q >>> 8 & 255, o[58] = Q >>> 16 & 255, o[59] = Q >>> 24 & 255, o[60] = Z >>> 0 & 255, o[61] = Z >>> 8 & 255, o[62] = Z >>> 16 & 255, o[63] = Z >>> 24 & 255;
|
|
296
|
+
}
|
|
297
|
+
function Yt(o, f, a, r) {
|
|
298
|
+
for (var c = r[0] & 255 | (r[1] & 255) << 8 | (r[2] & 255) << 16 | (r[3] & 255) << 24, l = a[0] & 255 | (a[1] & 255) << 8 | (a[2] & 255) << 16 | (a[3] & 255) << 24, d = a[4] & 255 | (a[5] & 255) << 8 | (a[6] & 255) << 16 | (a[7] & 255) << 24, _ = a[8] & 255 | (a[9] & 255) << 8 | (a[10] & 255) << 16 | (a[11] & 255) << 24, C = a[12] & 255 | (a[13] & 255) << 8 | (a[14] & 255) << 16 | (a[15] & 255) << 24, I = r[4] & 255 | (r[5] & 255) << 8 | (r[6] & 255) << 16 | (r[7] & 255) << 24, O = f[0] & 255 | (f[1] & 255) << 8 | (f[2] & 255) << 16 | (f[3] & 255) << 24, lt = f[4] & 255 | (f[5] & 255) << 8 | (f[6] & 255) << 16 | (f[7] & 255) << 24, R = f[8] & 255 | (f[9] & 255) << 8 | (f[10] & 255) << 16 | (f[11] & 255) << 24, Y = f[12] & 255 | (f[13] & 255) << 8 | (f[14] & 255) << 16 | (f[15] & 255) << 24, J = r[8] & 255 | (r[9] & 255) << 8 | (r[10] & 255) << 16 | (r[11] & 255) << 24, K = a[16] & 255 | (a[17] & 255) << 8 | (a[18] & 255) << 16 | (a[19] & 255) << 24, q = a[20] & 255 | (a[21] & 255) << 8 | (a[22] & 255) << 16 | (a[23] & 255) << 24, X = a[24] & 255 | (a[25] & 255) << 8 | (a[26] & 255) << 16 | (a[27] & 255) << 24, $ = a[28] & 255 | (a[29] & 255) << 8 | (a[30] & 255) << 16 | (a[31] & 255) << 24, W = r[12] & 255 | (r[13] & 255) << 8 | (r[14] & 255) << 16 | (r[15] & 255) << 24, N = c, M = l, k = d, j = _, U = C, E = I, p = O, x = lt, m = R, g = Y, b = J, w = K, D = q, V = X, Q = $, Z = W, h, ot = 0; ot < 20; ot += 2)
|
|
299
|
+
h = N + D | 0, U ^= h << 7 | h >>> 25, h = U + N | 0, m ^= h << 9 | h >>> 23, h = m + U | 0, D ^= h << 13 | h >>> 19, h = D + m | 0, N ^= h << 18 | h >>> 14, h = E + M | 0, g ^= h << 7 | h >>> 25, h = g + E | 0, V ^= h << 9 | h >>> 23, h = V + g | 0, M ^= h << 13 | h >>> 19, h = M + V | 0, E ^= h << 18 | h >>> 14, h = b + p | 0, Q ^= h << 7 | h >>> 25, h = Q + b | 0, k ^= h << 9 | h >>> 23, h = k + Q | 0, p ^= h << 13 | h >>> 19, h = p + k | 0, b ^= h << 18 | h >>> 14, h = Z + w | 0, j ^= h << 7 | h >>> 25, h = j + Z | 0, x ^= h << 9 | h >>> 23, h = x + j | 0, w ^= h << 13 | h >>> 19, h = w + x | 0, Z ^= h << 18 | h >>> 14, h = N + j | 0, M ^= h << 7 | h >>> 25, h = M + N | 0, k ^= h << 9 | h >>> 23, h = k + M | 0, j ^= h << 13 | h >>> 19, h = j + k | 0, N ^= h << 18 | h >>> 14, h = E + U | 0, p ^= h << 7 | h >>> 25, h = p + E | 0, x ^= h << 9 | h >>> 23, h = x + p | 0, U ^= h << 13 | h >>> 19, h = U + x | 0, E ^= h << 18 | h >>> 14, h = b + g | 0, w ^= h << 7 | h >>> 25, h = w + b | 0, m ^= h << 9 | h >>> 23, h = m + w | 0, g ^= h << 13 | h >>> 19, h = g + m | 0, b ^= h << 18 | h >>> 14, h = Z + Q | 0, D ^= h << 7 | h >>> 25, h = D + Z | 0, V ^= h << 9 | h >>> 23, h = V + D | 0, Q ^= h << 13 | h >>> 19, h = Q + V | 0, Z ^= h << 18 | h >>> 14;
|
|
300
|
+
o[0] = N >>> 0 & 255, o[1] = N >>> 8 & 255, o[2] = N >>> 16 & 255, o[3] = N >>> 24 & 255, o[4] = E >>> 0 & 255, o[5] = E >>> 8 & 255, o[6] = E >>> 16 & 255, o[7] = E >>> 24 & 255, o[8] = b >>> 0 & 255, o[9] = b >>> 8 & 255, o[10] = b >>> 16 & 255, o[11] = b >>> 24 & 255, o[12] = Z >>> 0 & 255, o[13] = Z >>> 8 & 255, o[14] = Z >>> 16 & 255, o[15] = Z >>> 24 & 255, o[16] = p >>> 0 & 255, o[17] = p >>> 8 & 255, o[18] = p >>> 16 & 255, o[19] = p >>> 24 & 255, o[20] = x >>> 0 & 255, o[21] = x >>> 8 & 255, o[22] = x >>> 16 & 255, o[23] = x >>> 24 & 255, o[24] = m >>> 0 & 255, o[25] = m >>> 8 & 255, o[26] = m >>> 16 & 255, o[27] = m >>> 24 & 255, o[28] = g >>> 0 & 255, o[29] = g >>> 8 & 255, o[30] = g >>> 16 & 255, o[31] = g >>> 24 & 255;
|
|
301
|
+
}
|
|
302
|
+
function Dt(o, f, a, r) {
|
|
303
|
+
Ht(o, f, a, r);
|
|
304
|
+
}
|
|
305
|
+
function Mt(o, f, a, r) {
|
|
306
|
+
Yt(o, f, a, r);
|
|
307
|
+
}
|
|
308
|
+
var Ut = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
|
|
309
|
+
function Je(o, f, a, r, c, l, d) {
|
|
310
|
+
var _ = new Uint8Array(16), C = new Uint8Array(64), I, O;
|
|
311
|
+
for (O = 0; O < 16; O++) _[O] = 0;
|
|
312
|
+
for (O = 0; O < 8; O++) _[O] = l[O];
|
|
313
|
+
for (; c >= 64; ) {
|
|
314
|
+
for (Dt(C, _, d, Ut), O = 0; O < 64; O++) o[f + O] = a[r + O] ^ C[O];
|
|
315
|
+
for (I = 1, O = 8; O < 16; O++)
|
|
316
|
+
I = I + (_[O] & 255) | 0, _[O] = I & 255, I >>>= 8;
|
|
317
|
+
c -= 64, f += 64, r += 64;
|
|
318
|
+
}
|
|
319
|
+
if (c > 0)
|
|
320
|
+
for (Dt(C, _, d, Ut), O = 0; O < c; O++) o[f + O] = a[r + O] ^ C[O];
|
|
321
|
+
return 0;
|
|
322
|
+
}
|
|
323
|
+
function Xe(o, f, a, r, c) {
|
|
324
|
+
var l = new Uint8Array(16), d = new Uint8Array(64), _, C;
|
|
325
|
+
for (C = 0; C < 16; C++) l[C] = 0;
|
|
326
|
+
for (C = 0; C < 8; C++) l[C] = r[C];
|
|
327
|
+
for (; a >= 64; ) {
|
|
328
|
+
for (Dt(d, l, c, Ut), C = 0; C < 64; C++) o[f + C] = d[C];
|
|
329
|
+
for (_ = 1, C = 8; C < 16; C++)
|
|
330
|
+
_ = _ + (l[C] & 255) | 0, l[C] = _ & 255, _ >>>= 8;
|
|
331
|
+
a -= 64, f += 64;
|
|
332
|
+
}
|
|
333
|
+
if (a > 0)
|
|
334
|
+
for (Dt(d, l, c, Ut), C = 0; C < a; C++) o[f + C] = d[C];
|
|
335
|
+
return 0;
|
|
336
|
+
}
|
|
337
|
+
function We(o, f, a, r, c) {
|
|
338
|
+
var l = new Uint8Array(32);
|
|
339
|
+
Mt(l, r, c, Ut);
|
|
340
|
+
for (var d = new Uint8Array(8), _ = 0; _ < 8; _++) d[_] = r[_ + 16];
|
|
341
|
+
return Xe(o, f, a, d, l);
|
|
342
|
+
}
|
|
343
|
+
function Zt(o, f, a, r, c, l, d) {
|
|
344
|
+
var _ = new Uint8Array(32);
|
|
345
|
+
Mt(_, l, d, Ut);
|
|
346
|
+
for (var C = new Uint8Array(8), I = 0; I < 8; I++) C[I] = l[I + 16];
|
|
347
|
+
return Je(o, f, a, r, c, C, _);
|
|
348
|
+
}
|
|
349
|
+
var Qt = function(o) {
|
|
350
|
+
this.buffer = new Uint8Array(16), this.r = new Uint16Array(10), this.h = new Uint16Array(10), this.pad = new Uint16Array(8), this.leftover = 0, this.fin = 0;
|
|
351
|
+
var f, a, r, c, l, d, _, C;
|
|
352
|
+
f = o[0] & 255 | (o[1] & 255) << 8, this.r[0] = f & 8191, a = o[2] & 255 | (o[3] & 255) << 8, this.r[1] = (f >>> 13 | a << 3) & 8191, r = o[4] & 255 | (o[5] & 255) << 8, this.r[2] = (a >>> 10 | r << 6) & 7939, c = o[6] & 255 | (o[7] & 255) << 8, this.r[3] = (r >>> 7 | c << 9) & 8191, l = o[8] & 255 | (o[9] & 255) << 8, this.r[4] = (c >>> 4 | l << 12) & 255, this.r[5] = l >>> 1 & 8190, d = o[10] & 255 | (o[11] & 255) << 8, this.r[6] = (l >>> 14 | d << 2) & 8191, _ = o[12] & 255 | (o[13] & 255) << 8, this.r[7] = (d >>> 11 | _ << 5) & 8065, C = o[14] & 255 | (o[15] & 255) << 8, this.r[8] = (_ >>> 8 | C << 8) & 8191, this.r[9] = C >>> 5 & 127, this.pad[0] = o[16] & 255 | (o[17] & 255) << 8, this.pad[1] = o[18] & 255 | (o[19] & 255) << 8, this.pad[2] = o[20] & 255 | (o[21] & 255) << 8, this.pad[3] = o[22] & 255 | (o[23] & 255) << 8, this.pad[4] = o[24] & 255 | (o[25] & 255) << 8, this.pad[5] = o[26] & 255 | (o[27] & 255) << 8, this.pad[6] = o[28] & 255 | (o[29] & 255) << 8, this.pad[7] = o[30] & 255 | (o[31] & 255) << 8;
|
|
353
|
+
};
|
|
354
|
+
Qt.prototype.blocks = function(o, f, a) {
|
|
355
|
+
for (var r = this.fin ? 0 : 2048, c, l, d, _, C, I, O, lt, R, Y, J, K, q, X, $, W, N, M, k, j = this.h[0], U = this.h[1], E = this.h[2], p = this.h[3], x = this.h[4], m = this.h[5], g = this.h[6], b = this.h[7], w = this.h[8], D = this.h[9], V = this.r[0], Q = this.r[1], Z = this.r[2], h = this.r[3], ot = this.r[4], ft = this.r[5], dt = this.r[6], nt = this.r[7], ut = this.r[8], ht = this.r[9]; a >= 16; )
|
|
356
|
+
c = o[f + 0] & 255 | (o[f + 1] & 255) << 8, j += c & 8191, l = o[f + 2] & 255 | (o[f + 3] & 255) << 8, U += (c >>> 13 | l << 3) & 8191, d = o[f + 4] & 255 | (o[f + 5] & 255) << 8, E += (l >>> 10 | d << 6) & 8191, _ = o[f + 6] & 255 | (o[f + 7] & 255) << 8, p += (d >>> 7 | _ << 9) & 8191, C = o[f + 8] & 255 | (o[f + 9] & 255) << 8, x += (_ >>> 4 | C << 12) & 8191, m += C >>> 1 & 8191, I = o[f + 10] & 255 | (o[f + 11] & 255) << 8, g += (C >>> 14 | I << 2) & 8191, O = o[f + 12] & 255 | (o[f + 13] & 255) << 8, b += (I >>> 11 | O << 5) & 8191, lt = o[f + 14] & 255 | (o[f + 15] & 255) << 8, w += (O >>> 8 | lt << 8) & 8191, D += lt >>> 5 | r, R = 0, Y = R, Y += j * V, Y += U * (5 * ht), Y += E * (5 * ut), Y += p * (5 * nt), Y += x * (5 * dt), R = Y >>> 13, Y &= 8191, Y += m * (5 * ft), Y += g * (5 * ot), Y += b * (5 * h), Y += w * (5 * Z), Y += D * (5 * Q), R += Y >>> 13, Y &= 8191, J = R, J += j * Q, J += U * V, J += E * (5 * ht), J += p * (5 * ut), J += x * (5 * nt), R = J >>> 13, J &= 8191, J += m * (5 * dt), J += g * (5 * ft), J += b * (5 * ot), J += w * (5 * h), J += D * (5 * Z), R += J >>> 13, J &= 8191, K = R, K += j * Z, K += U * Q, K += E * V, K += p * (5 * ht), K += x * (5 * ut), R = K >>> 13, K &= 8191, K += m * (5 * nt), K += g * (5 * dt), K += b * (5 * ft), K += w * (5 * ot), K += D * (5 * h), R += K >>> 13, K &= 8191, q = R, q += j * h, q += U * Z, q += E * Q, q += p * V, q += x * (5 * ht), R = q >>> 13, q &= 8191, q += m * (5 * ut), q += g * (5 * nt), q += b * (5 * dt), q += w * (5 * ft), q += D * (5 * ot), R += q >>> 13, q &= 8191, X = R, X += j * ot, X += U * h, X += E * Z, X += p * Q, X += x * V, R = X >>> 13, X &= 8191, X += m * (5 * ht), X += g * (5 * ut), X += b * (5 * nt), X += w * (5 * dt), X += D * (5 * ft), R += X >>> 13, X &= 8191, $ = R, $ += j * ft, $ += U * ot, $ += E * h, $ += p * Z, $ += x * Q, R = $ >>> 13, $ &= 8191, $ += m * V, $ += g * (5 * ht), $ += b * (5 * ut), $ += w * (5 * nt), $ += D * (5 * dt), R += $ >>> 13, $ &= 8191, W = R, W += j * dt, W += U * ft, W += E * ot, W += p * h, W += x * Z, R = W >>> 13, W &= 8191, W += m * Q, W += g * V, W += b * (5 * ht), W += w * (5 * ut), W += D * (5 * nt), R += W >>> 13, W &= 8191, N = R, N += j * nt, N += U * dt, N += E * ft, N += p * ot, N += x * h, R = N >>> 13, N &= 8191, N += m * Z, N += g * Q, N += b * V, N += w * (5 * ht), N += D * (5 * ut), R += N >>> 13, N &= 8191, M = R, M += j * ut, M += U * nt, M += E * dt, M += p * ft, M += x * ot, R = M >>> 13, M &= 8191, M += m * h, M += g * Z, M += b * Q, M += w * V, M += D * (5 * ht), R += M >>> 13, M &= 8191, k = R, k += j * ht, k += U * ut, k += E * nt, k += p * dt, k += x * ft, R = k >>> 13, k &= 8191, k += m * ot, k += g * h, k += b * Z, k += w * Q, k += D * V, R += k >>> 13, k &= 8191, R = (R << 2) + R | 0, R = R + Y | 0, Y = R & 8191, R = R >>> 13, J += R, j = Y, U = J, E = K, p = q, x = X, m = $, g = W, b = N, w = M, D = k, f += 16, a -= 16;
|
|
357
|
+
this.h[0] = j, this.h[1] = U, this.h[2] = E, this.h[3] = p, this.h[4] = x, this.h[5] = m, this.h[6] = g, this.h[7] = b, this.h[8] = w, this.h[9] = D;
|
|
358
|
+
}, Qt.prototype.finish = function(o, f) {
|
|
359
|
+
var a = new Uint16Array(10), r, c, l, d;
|
|
360
|
+
if (this.leftover) {
|
|
361
|
+
for (d = this.leftover, this.buffer[d++] = 1; d < 16; d++) this.buffer[d] = 0;
|
|
362
|
+
this.fin = 1, this.blocks(this.buffer, 0, 16);
|
|
363
|
+
}
|
|
364
|
+
for (r = this.h[1] >>> 13, this.h[1] &= 8191, d = 2; d < 10; d++)
|
|
365
|
+
this.h[d] += r, r = this.h[d] >>> 13, this.h[d] &= 8191;
|
|
366
|
+
for (this.h[0] += r * 5, r = this.h[0] >>> 13, this.h[0] &= 8191, this.h[1] += r, r = this.h[1] >>> 13, this.h[1] &= 8191, this.h[2] += r, a[0] = this.h[0] + 5, r = a[0] >>> 13, a[0] &= 8191, d = 1; d < 10; d++)
|
|
367
|
+
a[d] = this.h[d] + r, r = a[d] >>> 13, a[d] &= 8191;
|
|
368
|
+
for (a[9] -= 8192, c = (r ^ 1) - 1, d = 0; d < 10; d++) a[d] &= c;
|
|
369
|
+
for (c = ~c, d = 0; d < 10; d++) this.h[d] = this.h[d] & c | a[d];
|
|
370
|
+
for (this.h[0] = (this.h[0] | this.h[1] << 13) & 65535, this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535, this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535, this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535, this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535, this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535, this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535, this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535, l = this.h[0] + this.pad[0], this.h[0] = l & 65535, d = 1; d < 8; d++)
|
|
371
|
+
l = (this.h[d] + this.pad[d] | 0) + (l >>> 16) | 0, this.h[d] = l & 65535;
|
|
372
|
+
o[f + 0] = this.h[0] >>> 0 & 255, o[f + 1] = this.h[0] >>> 8 & 255, o[f + 2] = this.h[1] >>> 0 & 255, o[f + 3] = this.h[1] >>> 8 & 255, o[f + 4] = this.h[2] >>> 0 & 255, o[f + 5] = this.h[2] >>> 8 & 255, o[f + 6] = this.h[3] >>> 0 & 255, o[f + 7] = this.h[3] >>> 8 & 255, o[f + 8] = this.h[4] >>> 0 & 255, o[f + 9] = this.h[4] >>> 8 & 255, o[f + 10] = this.h[5] >>> 0 & 255, o[f + 11] = this.h[5] >>> 8 & 255, o[f + 12] = this.h[6] >>> 0 & 255, o[f + 13] = this.h[6] >>> 8 & 255, o[f + 14] = this.h[7] >>> 0 & 255, o[f + 15] = this.h[7] >>> 8 & 255;
|
|
373
|
+
}, Qt.prototype.update = function(o, f, a) {
|
|
374
|
+
var r, c;
|
|
375
|
+
if (this.leftover) {
|
|
376
|
+
for (c = 16 - this.leftover, c > a && (c = a), r = 0; r < c; r++)
|
|
377
|
+
this.buffer[this.leftover + r] = o[f + r];
|
|
378
|
+
if (a -= c, f += c, this.leftover += c, this.leftover < 16)
|
|
379
|
+
return;
|
|
380
|
+
this.blocks(this.buffer, 0, 16), this.leftover = 0;
|
|
381
|
+
}
|
|
382
|
+
if (a >= 16 && (c = a - a % 16, this.blocks(o, f, c), f += c, a -= c), a) {
|
|
383
|
+
for (r = 0; r < a; r++)
|
|
384
|
+
this.buffer[this.leftover + r] = o[f + r];
|
|
385
|
+
this.leftover += a;
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
function Ae(o, f, a, r, c, l) {
|
|
389
|
+
var d = new Qt(l);
|
|
390
|
+
return d.update(a, r, c), d.finish(o, f), 0;
|
|
391
|
+
}
|
|
392
|
+
function $e(o, f, a, r, c, l) {
|
|
393
|
+
var d = new Uint8Array(16);
|
|
394
|
+
return Ae(d, 0, a, r, c, l), St(o, f, d, 0);
|
|
395
|
+
}
|
|
396
|
+
function Ee(o, f, a, r, c) {
|
|
397
|
+
var l;
|
|
398
|
+
if (a < 32) return -1;
|
|
399
|
+
for (Zt(o, 0, f, 0, a, r, c), Ae(o, 16, o, 32, a - 32, o), l = 0; l < 16; l++) o[l] = 0;
|
|
400
|
+
return 0;
|
|
401
|
+
}
|
|
402
|
+
function Oe(o, f, a, r, c) {
|
|
403
|
+
var l, d = new Uint8Array(32);
|
|
404
|
+
if (a < 32 || (We(d, 0, 32, r, c), $e(f, 16, f, 32, a - 32, d) !== 0)) return -1;
|
|
405
|
+
for (Zt(o, 0, f, 0, a, r, c), l = 0; l < 32; l++) o[l] = 0;
|
|
406
|
+
return 0;
|
|
407
|
+
}
|
|
408
|
+
function Jt(o, f) {
|
|
409
|
+
var a;
|
|
410
|
+
for (a = 0; a < 16; a++) o[a] = f[a] | 0;
|
|
411
|
+
}
|
|
412
|
+
function ye(o) {
|
|
413
|
+
var f, a, r = 1;
|
|
414
|
+
for (f = 0; f < 16; f++)
|
|
415
|
+
a = o[f] + r + 65535, r = Math.floor(a / 65536), o[f] = a - r * 65536;
|
|
416
|
+
o[0] += r - 1 + 37 * (r - 1);
|
|
417
|
+
}
|
|
418
|
+
function te(o, f, a) {
|
|
419
|
+
for (var r, c = ~(a - 1), l = 0; l < 16; l++)
|
|
420
|
+
r = c & (o[l] ^ f[l]), o[l] ^= r, f[l] ^= r;
|
|
421
|
+
}
|
|
422
|
+
function oe(o, f) {
|
|
423
|
+
var a, r, c, l = y(), d = y();
|
|
424
|
+
for (a = 0; a < 16; a++) d[a] = f[a];
|
|
425
|
+
for (ye(d), ye(d), ye(d), r = 0; r < 2; r++) {
|
|
426
|
+
for (l[0] = d[0] - 65517, a = 1; a < 15; a++)
|
|
427
|
+
l[a] = d[a] - 65535 - (l[a - 1] >> 16 & 1), l[a - 1] &= 65535;
|
|
428
|
+
l[15] = d[15] - 32767 - (l[14] >> 16 & 1), c = l[15] >> 16 & 1, l[14] &= 65535, te(d, l, 1 - c);
|
|
429
|
+
}
|
|
430
|
+
for (a = 0; a < 16; a++)
|
|
431
|
+
o[2 * a] = d[a] & 255, o[2 * a + 1] = d[a] >> 8;
|
|
432
|
+
}
|
|
433
|
+
function Ge(o, f) {
|
|
434
|
+
var a = new Uint8Array(32), r = new Uint8Array(32);
|
|
435
|
+
return oe(a, o), oe(r, f), it(a, 0, r, 0);
|
|
436
|
+
}
|
|
437
|
+
function $t(o) {
|
|
438
|
+
var f = new Uint8Array(32);
|
|
439
|
+
return oe(f, o), f[0] & 1;
|
|
440
|
+
}
|
|
441
|
+
function ke(o, f) {
|
|
442
|
+
var a;
|
|
443
|
+
for (a = 0; a < 16; a++) o[a] = f[2 * a] + (f[2 * a + 1] << 8);
|
|
444
|
+
o[15] &= 32767;
|
|
445
|
+
}
|
|
446
|
+
function qt(o, f, a) {
|
|
447
|
+
for (var r = 0; r < 16; r++) o[r] = f[r] + a[r];
|
|
448
|
+
}
|
|
449
|
+
function mt(o, f, a) {
|
|
450
|
+
for (var r = 0; r < 16; r++) o[r] = f[r] - a[r];
|
|
451
|
+
}
|
|
452
|
+
function F(o, f, a) {
|
|
453
|
+
var r, c, l = 0, d = 0, _ = 0, C = 0, I = 0, O = 0, lt = 0, R = 0, Y = 0, J = 0, K = 0, q = 0, X = 0, $ = 0, W = 0, N = 0, M = 0, k = 0, j = 0, U = 0, E = 0, p = 0, x = 0, m = 0, g = 0, b = 0, w = 0, D = 0, V = 0, Q = 0, Z = 0, h = a[0], ot = a[1], ft = a[2], dt = a[3], nt = a[4], ut = a[5], ht = a[6], kt = a[7], gt = a[8], At = a[9], Et = a[10], Ot = a[11], Rt = a[12], Ct = a[13], It = a[14], jt = a[15];
|
|
454
|
+
r = f[0], l += r * h, d += r * ot, _ += r * ft, C += r * dt, I += r * nt, O += r * ut, lt += r * ht, R += r * kt, Y += r * gt, J += r * At, K += r * Et, q += r * Ot, X += r * Rt, $ += r * Ct, W += r * It, N += r * jt, r = f[1], d += r * h, _ += r * ot, C += r * ft, I += r * dt, O += r * nt, lt += r * ut, R += r * ht, Y += r * kt, J += r * gt, K += r * At, q += r * Et, X += r * Ot, $ += r * Rt, W += r * Ct, N += r * It, M += r * jt, r = f[2], _ += r * h, C += r * ot, I += r * ft, O += r * dt, lt += r * nt, R += r * ut, Y += r * ht, J += r * kt, K += r * gt, q += r * At, X += r * Et, $ += r * Ot, W += r * Rt, N += r * Ct, M += r * It, k += r * jt, r = f[3], C += r * h, I += r * ot, O += r * ft, lt += r * dt, R += r * nt, Y += r * ut, J += r * ht, K += r * kt, q += r * gt, X += r * At, $ += r * Et, W += r * Ot, N += r * Rt, M += r * Ct, k += r * It, j += r * jt, r = f[4], I += r * h, O += r * ot, lt += r * ft, R += r * dt, Y += r * nt, J += r * ut, K += r * ht, q += r * kt, X += r * gt, $ += r * At, W += r * Et, N += r * Ot, M += r * Rt, k += r * Ct, j += r * It, U += r * jt, r = f[5], O += r * h, lt += r * ot, R += r * ft, Y += r * dt, J += r * nt, K += r * ut, q += r * ht, X += r * kt, $ += r * gt, W += r * At, N += r * Et, M += r * Ot, k += r * Rt, j += r * Ct, U += r * It, E += r * jt, r = f[6], lt += r * h, R += r * ot, Y += r * ft, J += r * dt, K += r * nt, q += r * ut, X += r * ht, $ += r * kt, W += r * gt, N += r * At, M += r * Et, k += r * Ot, j += r * Rt, U += r * Ct, E += r * It, p += r * jt, r = f[7], R += r * h, Y += r * ot, J += r * ft, K += r * dt, q += r * nt, X += r * ut, $ += r * ht, W += r * kt, N += r * gt, M += r * At, k += r * Et, j += r * Ot, U += r * Rt, E += r * Ct, p += r * It, x += r * jt, r = f[8], Y += r * h, J += r * ot, K += r * ft, q += r * dt, X += r * nt, $ += r * ut, W += r * ht, N += r * kt, M += r * gt, k += r * At, j += r * Et, U += r * Ot, E += r * Rt, p += r * Ct, x += r * It, m += r * jt, r = f[9], J += r * h, K += r * ot, q += r * ft, X += r * dt, $ += r * nt, W += r * ut, N += r * ht, M += r * kt, k += r * gt, j += r * At, U += r * Et, E += r * Ot, p += r * Rt, x += r * Ct, m += r * It, g += r * jt, r = f[10], K += r * h, q += r * ot, X += r * ft, $ += r * dt, W += r * nt, N += r * ut, M += r * ht, k += r * kt, j += r * gt, U += r * At, E += r * Et, p += r * Ot, x += r * Rt, m += r * Ct, g += r * It, b += r * jt, r = f[11], q += r * h, X += r * ot, $ += r * ft, W += r * dt, N += r * nt, M += r * ut, k += r * ht, j += r * kt, U += r * gt, E += r * At, p += r * Et, x += r * Ot, m += r * Rt, g += r * Ct, b += r * It, w += r * jt, r = f[12], X += r * h, $ += r * ot, W += r * ft, N += r * dt, M += r * nt, k += r * ut, j += r * ht, U += r * kt, E += r * gt, p += r * At, x += r * Et, m += r * Ot, g += r * Rt, b += r * Ct, w += r * It, D += r * jt, r = f[13], $ += r * h, W += r * ot, N += r * ft, M += r * dt, k += r * nt, j += r * ut, U += r * ht, E += r * kt, p += r * gt, x += r * At, m += r * Et, g += r * Ot, b += r * Rt, w += r * Ct, D += r * It, V += r * jt, r = f[14], W += r * h, N += r * ot, M += r * ft, k += r * dt, j += r * nt, U += r * ut, E += r * ht, p += r * kt, x += r * gt, m += r * At, g += r * Et, b += r * Ot, w += r * Rt, D += r * Ct, V += r * It, Q += r * jt, r = f[15], N += r * h, M += r * ot, k += r * ft, j += r * dt, U += r * nt, E += r * ut, p += r * ht, x += r * kt, m += r * gt, g += r * At, b += r * Et, w += r * Ot, D += r * Rt, V += r * Ct, Q += r * It, Z += r * jt, l += 38 * M, d += 38 * k, _ += 38 * j, C += 38 * U, I += 38 * E, O += 38 * p, lt += 38 * x, R += 38 * m, Y += 38 * g, J += 38 * b, K += 38 * w, q += 38 * D, X += 38 * V, $ += 38 * Q, W += 38 * Z, c = 1, r = l + c + 65535, c = Math.floor(r / 65536), l = r - c * 65536, r = d + c + 65535, c = Math.floor(r / 65536), d = r - c * 65536, r = _ + c + 65535, c = Math.floor(r / 65536), _ = r - c * 65536, r = C + c + 65535, c = Math.floor(r / 65536), C = r - c * 65536, r = I + c + 65535, c = Math.floor(r / 65536), I = r - c * 65536, r = O + c + 65535, c = Math.floor(r / 65536), O = r - c * 65536, r = lt + c + 65535, c = Math.floor(r / 65536), lt = r - c * 65536, r = R + c + 65535, c = Math.floor(r / 65536), R = r - c * 65536, r = Y + c + 65535, c = Math.floor(r / 65536), Y = r - c * 65536, r = J + c + 65535, c = Math.floor(r / 65536), J = r - c * 65536, r = K + c + 65535, c = Math.floor(r / 65536), K = r - c * 65536, r = q + c + 65535, c = Math.floor(r / 65536), q = r - c * 65536, r = X + c + 65535, c = Math.floor(r / 65536), X = r - c * 65536, r = $ + c + 65535, c = Math.floor(r / 65536), $ = r - c * 65536, r = W + c + 65535, c = Math.floor(r / 65536), W = r - c * 65536, r = N + c + 65535, c = Math.floor(r / 65536), N = r - c * 65536, l += c - 1 + 37 * (c - 1), c = 1, r = l + c + 65535, c = Math.floor(r / 65536), l = r - c * 65536, r = d + c + 65535, c = Math.floor(r / 65536), d = r - c * 65536, r = _ + c + 65535, c = Math.floor(r / 65536), _ = r - c * 65536, r = C + c + 65535, c = Math.floor(r / 65536), C = r - c * 65536, r = I + c + 65535, c = Math.floor(r / 65536), I = r - c * 65536, r = O + c + 65535, c = Math.floor(r / 65536), O = r - c * 65536, r = lt + c + 65535, c = Math.floor(r / 65536), lt = r - c * 65536, r = R + c + 65535, c = Math.floor(r / 65536), R = r - c * 65536, r = Y + c + 65535, c = Math.floor(r / 65536), Y = r - c * 65536, r = J + c + 65535, c = Math.floor(r / 65536), J = r - c * 65536, r = K + c + 65535, c = Math.floor(r / 65536), K = r - c * 65536, r = q + c + 65535, c = Math.floor(r / 65536), q = r - c * 65536, r = X + c + 65535, c = Math.floor(r / 65536), X = r - c * 65536, r = $ + c + 65535, c = Math.floor(r / 65536), $ = r - c * 65536, r = W + c + 65535, c = Math.floor(r / 65536), W = r - c * 65536, r = N + c + 65535, c = Math.floor(r / 65536), N = r - c * 65536, l += c - 1 + 37 * (c - 1), o[0] = l, o[1] = d, o[2] = _, o[3] = C, o[4] = I, o[5] = O, o[6] = lt, o[7] = R, o[8] = Y, o[9] = J, o[10] = K, o[11] = q, o[12] = X, o[13] = $, o[14] = W, o[15] = N;
|
|
455
|
+
}
|
|
456
|
+
function zt(o, f) {
|
|
457
|
+
F(o, f, f);
|
|
458
|
+
}
|
|
459
|
+
function Le(o, f) {
|
|
460
|
+
var a = y(), r;
|
|
461
|
+
for (r = 0; r < 16; r++) a[r] = f[r];
|
|
462
|
+
for (r = 253; r >= 0; r--)
|
|
463
|
+
zt(a, a), r !== 2 && r !== 4 && F(a, a, f);
|
|
464
|
+
for (r = 0; r < 16; r++) o[r] = a[r];
|
|
465
|
+
}
|
|
466
|
+
function Ft(o, f) {
|
|
467
|
+
var a = y(), r;
|
|
468
|
+
for (r = 0; r < 16; r++) a[r] = f[r];
|
|
469
|
+
for (r = 250; r >= 0; r--)
|
|
470
|
+
zt(a, a), r !== 1 && F(a, a, f);
|
|
471
|
+
for (r = 0; r < 16; r++) o[r] = a[r];
|
|
472
|
+
}
|
|
473
|
+
function ue(o, f, a) {
|
|
474
|
+
var r = new Uint8Array(32), c = new Float64Array(80), l, d, _ = y(), C = y(), I = y(), O = y(), lt = y(), R = y();
|
|
475
|
+
for (d = 0; d < 31; d++) r[d] = f[d];
|
|
476
|
+
for (r[31] = f[31] & 127 | 64, r[0] &= 248, ke(c, a), d = 0; d < 16; d++)
|
|
477
|
+
C[d] = c[d], O[d] = _[d] = I[d] = 0;
|
|
478
|
+
for (_[0] = O[0] = 1, d = 254; d >= 0; --d)
|
|
479
|
+
l = r[d >>> 3] >>> (d & 7) & 1, te(_, C, l), te(I, O, l), qt(lt, _, I), mt(_, _, I), qt(I, C, O), mt(C, C, O), zt(O, lt), zt(R, _), F(_, I, _), F(I, C, lt), qt(lt, _, I), mt(_, _, I), zt(C, _), mt(I, O, R), F(_, I, st), qt(_, _, O), F(I, I, _), F(_, O, R), F(O, C, c), zt(C, lt), te(_, C, l), te(I, O, l);
|
|
480
|
+
for (d = 0; d < 16; d++)
|
|
481
|
+
c[d + 16] = _[d], c[d + 32] = I[d], c[d + 48] = C[d], c[d + 64] = O[d];
|
|
482
|
+
var Y = c.subarray(32), J = c.subarray(16);
|
|
483
|
+
return Le(Y, Y), F(J, J, Y), oe(o, J), 0;
|
|
484
|
+
}
|
|
485
|
+
function ge(o, f) {
|
|
486
|
+
return ue(o, f, yt);
|
|
487
|
+
}
|
|
488
|
+
function se(o, f) {
|
|
489
|
+
return Tt(f, 32), ge(o, f);
|
|
490
|
+
}
|
|
491
|
+
function he(o, f, a) {
|
|
492
|
+
var r = new Uint8Array(32);
|
|
493
|
+
return ue(r, a, f), Mt(o, tt, r, Ut);
|
|
494
|
+
}
|
|
495
|
+
var Ke = Ee, Ve = Oe;
|
|
496
|
+
function Ze(o, f, a, r, c, l) {
|
|
497
|
+
var d = new Uint8Array(32);
|
|
498
|
+
return he(d, c, l), Ke(o, f, a, r, d);
|
|
499
|
+
}
|
|
500
|
+
function an(o, f, a, r, c, l) {
|
|
501
|
+
var d = new Uint8Array(32);
|
|
502
|
+
return he(d, c, l), Ve(o, f, a, r, d);
|
|
503
|
+
}
|
|
504
|
+
var Re = [
|
|
505
|
+
1116352408,
|
|
506
|
+
3609767458,
|
|
507
|
+
1899447441,
|
|
508
|
+
602891725,
|
|
509
|
+
3049323471,
|
|
510
|
+
3964484399,
|
|
511
|
+
3921009573,
|
|
512
|
+
2173295548,
|
|
513
|
+
961987163,
|
|
514
|
+
4081628472,
|
|
515
|
+
1508970993,
|
|
516
|
+
3053834265,
|
|
517
|
+
2453635748,
|
|
518
|
+
2937671579,
|
|
519
|
+
2870763221,
|
|
520
|
+
3664609560,
|
|
521
|
+
3624381080,
|
|
522
|
+
2734883394,
|
|
523
|
+
310598401,
|
|
524
|
+
1164996542,
|
|
525
|
+
607225278,
|
|
526
|
+
1323610764,
|
|
527
|
+
1426881987,
|
|
528
|
+
3590304994,
|
|
529
|
+
1925078388,
|
|
530
|
+
4068182383,
|
|
531
|
+
2162078206,
|
|
532
|
+
991336113,
|
|
533
|
+
2614888103,
|
|
534
|
+
633803317,
|
|
535
|
+
3248222580,
|
|
536
|
+
3479774868,
|
|
537
|
+
3835390401,
|
|
538
|
+
2666613458,
|
|
539
|
+
4022224774,
|
|
540
|
+
944711139,
|
|
541
|
+
264347078,
|
|
542
|
+
2341262773,
|
|
543
|
+
604807628,
|
|
544
|
+
2007800933,
|
|
545
|
+
770255983,
|
|
546
|
+
1495990901,
|
|
547
|
+
1249150122,
|
|
548
|
+
1856431235,
|
|
549
|
+
1555081692,
|
|
550
|
+
3175218132,
|
|
551
|
+
1996064986,
|
|
552
|
+
2198950837,
|
|
553
|
+
2554220882,
|
|
554
|
+
3999719339,
|
|
555
|
+
2821834349,
|
|
556
|
+
766784016,
|
|
557
|
+
2952996808,
|
|
558
|
+
2566594879,
|
|
559
|
+
3210313671,
|
|
560
|
+
3203337956,
|
|
561
|
+
3336571891,
|
|
562
|
+
1034457026,
|
|
563
|
+
3584528711,
|
|
564
|
+
2466948901,
|
|
565
|
+
113926993,
|
|
566
|
+
3758326383,
|
|
567
|
+
338241895,
|
|
568
|
+
168717936,
|
|
569
|
+
666307205,
|
|
570
|
+
1188179964,
|
|
571
|
+
773529912,
|
|
572
|
+
1546045734,
|
|
573
|
+
1294757372,
|
|
574
|
+
1522805485,
|
|
575
|
+
1396182291,
|
|
576
|
+
2643833823,
|
|
577
|
+
1695183700,
|
|
578
|
+
2343527390,
|
|
579
|
+
1986661051,
|
|
580
|
+
1014477480,
|
|
581
|
+
2177026350,
|
|
582
|
+
1206759142,
|
|
583
|
+
2456956037,
|
|
584
|
+
344077627,
|
|
585
|
+
2730485921,
|
|
586
|
+
1290863460,
|
|
587
|
+
2820302411,
|
|
588
|
+
3158454273,
|
|
589
|
+
3259730800,
|
|
590
|
+
3505952657,
|
|
591
|
+
3345764771,
|
|
592
|
+
106217008,
|
|
593
|
+
3516065817,
|
|
594
|
+
3606008344,
|
|
595
|
+
3600352804,
|
|
596
|
+
1432725776,
|
|
597
|
+
4094571909,
|
|
598
|
+
1467031594,
|
|
599
|
+
275423344,
|
|
600
|
+
851169720,
|
|
601
|
+
430227734,
|
|
602
|
+
3100823752,
|
|
603
|
+
506948616,
|
|
604
|
+
1363258195,
|
|
605
|
+
659060556,
|
|
606
|
+
3750685593,
|
|
607
|
+
883997877,
|
|
608
|
+
3785050280,
|
|
609
|
+
958139571,
|
|
610
|
+
3318307427,
|
|
611
|
+
1322822218,
|
|
612
|
+
3812723403,
|
|
613
|
+
1537002063,
|
|
614
|
+
2003034995,
|
|
615
|
+
1747873779,
|
|
616
|
+
3602036899,
|
|
617
|
+
1955562222,
|
|
618
|
+
1575990012,
|
|
619
|
+
2024104815,
|
|
620
|
+
1125592928,
|
|
621
|
+
2227730452,
|
|
622
|
+
2716904306,
|
|
623
|
+
2361852424,
|
|
624
|
+
442776044,
|
|
625
|
+
2428436474,
|
|
626
|
+
593698344,
|
|
627
|
+
2756734187,
|
|
628
|
+
3733110249,
|
|
629
|
+
3204031479,
|
|
630
|
+
2999351573,
|
|
631
|
+
3329325298,
|
|
632
|
+
3815920427,
|
|
633
|
+
3391569614,
|
|
634
|
+
3928383900,
|
|
635
|
+
3515267271,
|
|
636
|
+
566280711,
|
|
637
|
+
3940187606,
|
|
638
|
+
3454069534,
|
|
639
|
+
4118630271,
|
|
640
|
+
4000239992,
|
|
641
|
+
116418474,
|
|
642
|
+
1914138554,
|
|
643
|
+
174292421,
|
|
644
|
+
2731055270,
|
|
645
|
+
289380356,
|
|
646
|
+
3203993006,
|
|
647
|
+
460393269,
|
|
648
|
+
320620315,
|
|
649
|
+
685471733,
|
|
650
|
+
587496836,
|
|
651
|
+
852142971,
|
|
652
|
+
1086792851,
|
|
653
|
+
1017036298,
|
|
654
|
+
365543100,
|
|
655
|
+
1126000580,
|
|
656
|
+
2618297676,
|
|
657
|
+
1288033470,
|
|
658
|
+
3409855158,
|
|
659
|
+
1501505948,
|
|
660
|
+
4234509866,
|
|
661
|
+
1607167915,
|
|
662
|
+
987167468,
|
|
663
|
+
1816402316,
|
|
664
|
+
1246189591
|
|
665
|
+
];
|
|
666
|
+
function Qe(o, f, a, r) {
|
|
667
|
+
for (var c = new Int32Array(16), l = new Int32Array(16), d, _, C, I, O, lt, R, Y, J, K, q, X, $, W, N, M, k, j, U, E, p, x, m, g, b, w, D = o[0], V = o[1], Q = o[2], Z = o[3], h = o[4], ot = o[5], ft = o[6], dt = o[7], nt = f[0], ut = f[1], ht = f[2], kt = f[3], gt = f[4], At = f[5], Et = f[6], Ot = f[7], Rt = 0; r >= 128; ) {
|
|
668
|
+
for (U = 0; U < 16; U++)
|
|
669
|
+
E = 8 * U + Rt, c[U] = a[E + 0] << 24 | a[E + 1] << 16 | a[E + 2] << 8 | a[E + 3], l[U] = a[E + 4] << 24 | a[E + 5] << 16 | a[E + 6] << 8 | a[E + 7];
|
|
670
|
+
for (U = 0; U < 80; U++)
|
|
671
|
+
if (d = D, _ = V, C = Q, I = Z, O = h, lt = ot, R = ft, Y = dt, J = nt, K = ut, q = ht, X = kt, $ = gt, W = At, N = Et, M = Ot, p = dt, x = Ot, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = (h >>> 14 | gt << 18) ^ (h >>> 18 | gt << 14) ^ (gt >>> 9 | h << 23), x = (gt >>> 14 | h << 18) ^ (gt >>> 18 | h << 14) ^ (h >>> 9 | gt << 23), m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, p = h & ot ^ ~h & ft, x = gt & At ^ ~gt & Et, m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, p = Re[U * 2], x = Re[U * 2 + 1], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, p = c[U % 16], x = l[U % 16], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, k = b & 65535 | w << 16, j = m & 65535 | g << 16, p = k, x = j, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = (D >>> 28 | nt << 4) ^ (nt >>> 2 | D << 30) ^ (nt >>> 7 | D << 25), x = (nt >>> 28 | D << 4) ^ (D >>> 2 | nt << 30) ^ (D >>> 7 | nt << 25), m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, p = D & V ^ D & Q ^ V & Q, x = nt & ut ^ nt & ht ^ ut & ht, m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, Y = b & 65535 | w << 16, M = m & 65535 | g << 16, p = I, x = X, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = k, x = j, m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, I = b & 65535 | w << 16, X = m & 65535 | g << 16, V = d, Q = _, Z = C, h = I, ot = O, ft = lt, dt = R, D = Y, ut = J, ht = K, kt = q, gt = X, At = $, Et = W, Ot = N, nt = M, U % 16 === 15)
|
|
672
|
+
for (E = 0; E < 16; E++)
|
|
673
|
+
p = c[E], x = l[E], m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = c[(E + 9) % 16], x = l[(E + 9) % 16], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, k = c[(E + 1) % 16], j = l[(E + 1) % 16], p = (k >>> 1 | j << 31) ^ (k >>> 8 | j << 24) ^ k >>> 7, x = (j >>> 1 | k << 31) ^ (j >>> 8 | k << 24) ^ (j >>> 7 | k << 25), m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, k = c[(E + 14) % 16], j = l[(E + 14) % 16], p = (k >>> 19 | j << 13) ^ (j >>> 29 | k << 3) ^ k >>> 6, x = (j >>> 19 | k << 13) ^ (k >>> 29 | j << 3) ^ (j >>> 6 | k << 26), m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, c[E] = b & 65535 | w << 16, l[E] = m & 65535 | g << 16;
|
|
674
|
+
p = D, x = nt, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[0], x = f[0], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[0] = D = b & 65535 | w << 16, f[0] = nt = m & 65535 | g << 16, p = V, x = ut, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[1], x = f[1], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[1] = V = b & 65535 | w << 16, f[1] = ut = m & 65535 | g << 16, p = Q, x = ht, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[2], x = f[2], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[2] = Q = b & 65535 | w << 16, f[2] = ht = m & 65535 | g << 16, p = Z, x = kt, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[3], x = f[3], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[3] = Z = b & 65535 | w << 16, f[3] = kt = m & 65535 | g << 16, p = h, x = gt, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[4], x = f[4], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[4] = h = b & 65535 | w << 16, f[4] = gt = m & 65535 | g << 16, p = ot, x = At, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[5], x = f[5], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[5] = ot = b & 65535 | w << 16, f[5] = At = m & 65535 | g << 16, p = ft, x = Et, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[6], x = f[6], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[6] = ft = b & 65535 | w << 16, f[6] = Et = m & 65535 | g << 16, p = dt, x = Ot, m = x & 65535, g = x >>> 16, b = p & 65535, w = p >>> 16, p = o[7], x = f[7], m += x & 65535, g += x >>> 16, b += p & 65535, w += p >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, o[7] = dt = b & 65535 | w << 16, f[7] = Ot = m & 65535 | g << 16, Rt += 128, r -= 128;
|
|
675
|
+
}
|
|
676
|
+
return r;
|
|
677
|
+
}
|
|
678
|
+
function ee(o, f, a) {
|
|
679
|
+
var r = new Int32Array(8), c = new Int32Array(8), l = new Uint8Array(256), d, _ = a;
|
|
680
|
+
for (r[0] = 1779033703, r[1] = 3144134277, r[2] = 1013904242, r[3] = 2773480762, r[4] = 1359893119, r[5] = 2600822924, r[6] = 528734635, r[7] = 1541459225, c[0] = 4089235720, c[1] = 2227873595, c[2] = 4271175723, c[3] = 1595750129, c[4] = 2917565137, c[5] = 725511199, c[6] = 4215389547, c[7] = 327033209, Qe(r, c, f, a), a %= 128, d = 0; d < a; d++) l[d] = f[_ - a + d];
|
|
681
|
+
for (l[a] = 128, a = 256 - 128 * (a < 112 ? 1 : 0), l[a - 9] = 0, G(l, a - 8, _ / 536870912 | 0, _ << 3), Qe(r, c, l, a), d = 0; d < 8; d++) G(o, 8 * d, r[d], c[d]);
|
|
682
|
+
return 0;
|
|
683
|
+
}
|
|
684
|
+
function _e(o, f) {
|
|
685
|
+
var a = y(), r = y(), c = y(), l = y(), d = y(), _ = y(), C = y(), I = y(), O = y();
|
|
686
|
+
mt(a, o[1], o[0]), mt(O, f[1], f[0]), F(a, a, O), qt(r, o[0], o[1]), qt(O, f[0], f[1]), F(r, r, O), F(c, o[3], f[3]), F(c, c, _t), F(l, o[2], f[2]), qt(l, l, l), mt(d, r, a), mt(_, l, c), qt(C, l, c), qt(I, r, a), F(o[0], d, _), F(o[1], I, C), F(o[2], C, _), F(o[3], d, I);
|
|
687
|
+
}
|
|
688
|
+
function tn(o, f, a) {
|
|
689
|
+
var r;
|
|
690
|
+
for (r = 0; r < 4; r++)
|
|
691
|
+
te(o[r], f[r], a);
|
|
692
|
+
}
|
|
693
|
+
function ae(o, f) {
|
|
694
|
+
var a = y(), r = y(), c = y();
|
|
695
|
+
Le(c, f[2]), F(a, f[0], c), F(r, f[1], c), oe(o, r), o[31] ^= $t(a) << 7;
|
|
696
|
+
}
|
|
697
|
+
function Ne(o, f, a) {
|
|
698
|
+
var r, c;
|
|
699
|
+
for (Jt(o[0], xt), Jt(o[1], vt), Jt(o[2], vt), Jt(o[3], xt), c = 255; c >= 0; --c)
|
|
700
|
+
r = a[c / 8 | 0] >> (c & 7) & 1, tn(o, f, r), _e(f, o), _e(o, o), tn(o, f, r);
|
|
701
|
+
}
|
|
702
|
+
function bt(o, f) {
|
|
703
|
+
var a = [y(), y(), y(), y()];
|
|
704
|
+
Jt(a[0], H), Jt(a[1], T), Jt(a[2], vt), F(a[3], H, T), Ne(o, a, f);
|
|
705
|
+
}
|
|
706
|
+
function je(o, f, a) {
|
|
707
|
+
var r = new Uint8Array(64), c = [y(), y(), y(), y()], l;
|
|
708
|
+
for (a || Tt(f, 32), ee(r, f, 32), r[0] &= 248, r[31] &= 127, r[31] |= 64, bt(c, r), ae(o, c), l = 0; l < 32; l++) f[l + 32] = o[l];
|
|
709
|
+
return 0;
|
|
710
|
+
}
|
|
711
|
+
var be = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]);
|
|
712
|
+
function Ue(o, f) {
|
|
713
|
+
var a, r, c, l;
|
|
714
|
+
for (r = 63; r >= 32; --r) {
|
|
715
|
+
for (a = 0, c = r - 32, l = r - 12; c < l; ++c)
|
|
716
|
+
f[c] += a - 16 * f[r] * be[c - (r - 32)], a = Math.floor((f[c] + 128) / 256), f[c] -= a * 256;
|
|
717
|
+
f[c] += a, f[r] = 0;
|
|
718
|
+
}
|
|
719
|
+
for (a = 0, c = 0; c < 32; c++)
|
|
720
|
+
f[c] += a - (f[31] >> 4) * be[c], a = f[c] >> 8, f[c] &= 255;
|
|
721
|
+
for (c = 0; c < 32; c++) f[c] -= a * be[c];
|
|
722
|
+
for (r = 0; r < 32; r++)
|
|
723
|
+
f[r + 1] += f[r] >> 8, o[r] = f[r] & 255;
|
|
724
|
+
}
|
|
725
|
+
function Ie(o) {
|
|
726
|
+
var f = new Float64Array(64), a;
|
|
727
|
+
for (a = 0; a < 64; a++) f[a] = o[a];
|
|
728
|
+
for (a = 0; a < 64; a++) o[a] = 0;
|
|
729
|
+
Ue(o, f);
|
|
730
|
+
}
|
|
731
|
+
function en(o, f, a, r) {
|
|
732
|
+
var c = new Uint8Array(64), l = new Uint8Array(64), d = new Uint8Array(64), _, C, I = new Float64Array(64), O = [y(), y(), y(), y()];
|
|
733
|
+
ee(c, r, 32), c[0] &= 248, c[31] &= 127, c[31] |= 64;
|
|
734
|
+
var lt = a + 64;
|
|
735
|
+
for (_ = 0; _ < a; _++) o[64 + _] = f[_];
|
|
736
|
+
for (_ = 0; _ < 32; _++) o[32 + _] = c[32 + _];
|
|
737
|
+
for (ee(d, o.subarray(32), a + 32), Ie(d), bt(O, d), ae(o, O), _ = 32; _ < 64; _++) o[_] = r[_];
|
|
738
|
+
for (ee(l, o, a + 64), Ie(l), _ = 0; _ < 64; _++) I[_] = 0;
|
|
739
|
+
for (_ = 0; _ < 32; _++) I[_] = d[_];
|
|
740
|
+
for (_ = 0; _ < 32; _++)
|
|
741
|
+
for (C = 0; C < 32; C++)
|
|
742
|
+
I[_ + C] += l[_] * c[C];
|
|
743
|
+
return Ue(o.subarray(32), I), lt;
|
|
744
|
+
}
|
|
745
|
+
function fn(o, f) {
|
|
746
|
+
var a = y(), r = y(), c = y(), l = y(), d = y(), _ = y(), C = y();
|
|
747
|
+
return Jt(o[2], vt), ke(o[1], f), zt(c, o[1]), F(l, c, et), mt(c, c, o[2]), qt(l, o[2], l), zt(d, l), zt(_, d), F(C, _, d), F(a, C, c), F(a, a, l), Ft(a, a), F(a, a, c), F(a, a, l), F(a, a, l), F(o[0], a, l), zt(r, o[0]), F(r, r, l), Ge(r, c) && F(o[0], o[0], A), zt(r, o[0]), F(r, r, l), Ge(r, c) ? -1 : ($t(o[0]) === f[31] >> 7 && mt(o[0], xt, o[0]), F(o[3], o[0], o[1]), 0);
|
|
748
|
+
}
|
|
749
|
+
function Me(o, f, a, r) {
|
|
750
|
+
var c, l = new Uint8Array(32), d = new Uint8Array(64), _ = [y(), y(), y(), y()], C = [y(), y(), y(), y()];
|
|
751
|
+
if (a < 64 || fn(C, r)) return -1;
|
|
752
|
+
for (c = 0; c < a; c++) o[c] = f[c];
|
|
753
|
+
for (c = 0; c < 32; c++) o[c + 32] = r[c];
|
|
754
|
+
if (ee(d, o, a), Ie(d), Ne(_, C, d), bt(C, f.subarray(32)), _e(_, C), ae(l, _), a -= 64, it(f, 0, l, 0)) {
|
|
755
|
+
for (c = 0; c < a; c++) o[c] = 0;
|
|
756
|
+
return -1;
|
|
757
|
+
}
|
|
758
|
+
for (c = 0; c < a; c++) o[c] = f[c + 64];
|
|
759
|
+
return a;
|
|
760
|
+
}
|
|
761
|
+
var Be = 32, me = 24, ne = 32, Gt = 16, le = 32, we = 32, de = 32, pe = 32, De = 32, Se = me, cn = ne, Xt = Gt, Wt = 64, re = 32, fe = 64, ze = 32, Kt = 64;
|
|
762
|
+
S.lowlevel = {
|
|
763
|
+
crypto_core_hsalsa20: Mt,
|
|
764
|
+
crypto_stream_xor: Zt,
|
|
765
|
+
crypto_stream: We,
|
|
766
|
+
crypto_stream_salsa20_xor: Je,
|
|
767
|
+
crypto_stream_salsa20: Xe,
|
|
768
|
+
crypto_onetimeauth: Ae,
|
|
769
|
+
crypto_onetimeauth_verify: $e,
|
|
770
|
+
crypto_verify_16: St,
|
|
771
|
+
crypto_verify_32: it,
|
|
772
|
+
crypto_secretbox: Ee,
|
|
773
|
+
crypto_secretbox_open: Oe,
|
|
774
|
+
crypto_scalarmult: ue,
|
|
775
|
+
crypto_scalarmult_base: ge,
|
|
776
|
+
crypto_box_beforenm: he,
|
|
777
|
+
crypto_box_afternm: Ke,
|
|
778
|
+
crypto_box: Ze,
|
|
779
|
+
crypto_box_open: an,
|
|
780
|
+
crypto_box_keypair: se,
|
|
781
|
+
crypto_hash: ee,
|
|
782
|
+
crypto_sign: en,
|
|
783
|
+
crypto_sign_keypair: je,
|
|
784
|
+
crypto_sign_open: Me,
|
|
785
|
+
crypto_secretbox_KEYBYTES: Be,
|
|
786
|
+
crypto_secretbox_NONCEBYTES: me,
|
|
787
|
+
crypto_secretbox_ZEROBYTES: ne,
|
|
788
|
+
crypto_secretbox_BOXZEROBYTES: Gt,
|
|
789
|
+
crypto_scalarmult_BYTES: le,
|
|
790
|
+
crypto_scalarmult_SCALARBYTES: we,
|
|
791
|
+
crypto_box_PUBLICKEYBYTES: de,
|
|
792
|
+
crypto_box_SECRETKEYBYTES: pe,
|
|
793
|
+
crypto_box_BEFORENMBYTES: De,
|
|
794
|
+
crypto_box_NONCEBYTES: Se,
|
|
795
|
+
crypto_box_ZEROBYTES: cn,
|
|
796
|
+
crypto_box_BOXZEROBYTES: Xt,
|
|
797
|
+
crypto_sign_BYTES: Wt,
|
|
798
|
+
crypto_sign_PUBLICKEYBYTES: re,
|
|
799
|
+
crypto_sign_SECRETKEYBYTES: fe,
|
|
800
|
+
crypto_sign_SEEDBYTES: ze,
|
|
801
|
+
crypto_hash_BYTES: Kt,
|
|
802
|
+
gf: y,
|
|
803
|
+
D: et,
|
|
804
|
+
L: be,
|
|
805
|
+
pack25519: oe,
|
|
806
|
+
unpack25519: ke,
|
|
807
|
+
M: F,
|
|
808
|
+
A: qt,
|
|
809
|
+
S: zt,
|
|
810
|
+
Z: mt,
|
|
811
|
+
pow2523: Ft,
|
|
812
|
+
add: _e,
|
|
813
|
+
set25519: Jt,
|
|
814
|
+
modL: Ue,
|
|
815
|
+
scalarmult: Ne,
|
|
816
|
+
scalarbase: bt
|
|
817
|
+
};
|
|
818
|
+
function nn(o, f) {
|
|
819
|
+
if (o.length !== Be) throw new Error("bad key size");
|
|
820
|
+
if (f.length !== me) throw new Error("bad nonce size");
|
|
821
|
+
}
|
|
822
|
+
function rn(o, f) {
|
|
823
|
+
if (o.length !== de) throw new Error("bad public key size");
|
|
824
|
+
if (f.length !== pe) throw new Error("bad secret key size");
|
|
825
|
+
}
|
|
826
|
+
function Bt() {
|
|
827
|
+
for (var o = 0; o < arguments.length; o++)
|
|
828
|
+
if (!(arguments[o] instanceof Uint8Array))
|
|
829
|
+
throw new TypeError("unexpected type, use Uint8Array");
|
|
830
|
+
}
|
|
831
|
+
function He(o) {
|
|
832
|
+
for (var f = 0; f < o.length; f++) o[f] = 0;
|
|
833
|
+
}
|
|
834
|
+
S.randomBytes = function(o) {
|
|
835
|
+
var f = new Uint8Array(o);
|
|
836
|
+
return Tt(f, o), f;
|
|
837
|
+
}, S.secretbox = function(o, f, a) {
|
|
838
|
+
Bt(o, f, a), nn(a, f);
|
|
839
|
+
for (var r = new Uint8Array(ne + o.length), c = new Uint8Array(r.length), l = 0; l < o.length; l++) r[l + ne] = o[l];
|
|
840
|
+
return Ee(c, r, r.length, f, a), c.subarray(Gt);
|
|
841
|
+
}, S.secretbox.open = function(o, f, a) {
|
|
842
|
+
Bt(o, f, a), nn(a, f);
|
|
843
|
+
for (var r = new Uint8Array(Gt + o.length), c = new Uint8Array(r.length), l = 0; l < o.length; l++) r[l + Gt] = o[l];
|
|
844
|
+
return r.length < 32 || Oe(c, r, r.length, f, a) !== 0 ? null : c.subarray(ne);
|
|
845
|
+
}, S.secretbox.keyLength = Be, S.secretbox.nonceLength = me, S.secretbox.overheadLength = Gt, S.scalarMult = function(o, f) {
|
|
846
|
+
if (Bt(o, f), o.length !== we) throw new Error("bad n size");
|
|
847
|
+
if (f.length !== le) throw new Error("bad p size");
|
|
848
|
+
var a = new Uint8Array(le);
|
|
849
|
+
return ue(a, o, f), a;
|
|
850
|
+
}, S.scalarMult.base = function(o) {
|
|
851
|
+
if (Bt(o), o.length !== we) throw new Error("bad n size");
|
|
852
|
+
var f = new Uint8Array(le);
|
|
853
|
+
return ge(f, o), f;
|
|
854
|
+
}, S.scalarMult.scalarLength = we, S.scalarMult.groupElementLength = le, S.box = function(o, f, a, r) {
|
|
855
|
+
var c = S.box.before(a, r);
|
|
856
|
+
return S.secretbox(o, f, c);
|
|
857
|
+
}, S.box.before = function(o, f) {
|
|
858
|
+
Bt(o, f), rn(o, f);
|
|
859
|
+
var a = new Uint8Array(De);
|
|
860
|
+
return he(a, o, f), a;
|
|
861
|
+
}, S.box.after = S.secretbox, S.box.open = function(o, f, a, r) {
|
|
862
|
+
var c = S.box.before(a, r);
|
|
863
|
+
return S.secretbox.open(o, f, c);
|
|
864
|
+
}, S.box.open.after = S.secretbox.open, S.box.keyPair = function() {
|
|
865
|
+
var o = new Uint8Array(de), f = new Uint8Array(pe);
|
|
866
|
+
return se(o, f), { publicKey: o, secretKey: f };
|
|
867
|
+
}, S.box.keyPair.fromSecretKey = function(o) {
|
|
868
|
+
if (Bt(o), o.length !== pe)
|
|
869
|
+
throw new Error("bad secret key size");
|
|
870
|
+
var f = new Uint8Array(de);
|
|
871
|
+
return ge(f, o), { publicKey: f, secretKey: new Uint8Array(o) };
|
|
872
|
+
}, S.box.publicKeyLength = de, S.box.secretKeyLength = pe, S.box.sharedKeyLength = De, S.box.nonceLength = Se, S.box.overheadLength = S.secretbox.overheadLength, S.sign = function(o, f) {
|
|
873
|
+
if (Bt(o, f), f.length !== fe)
|
|
874
|
+
throw new Error("bad secret key size");
|
|
875
|
+
var a = new Uint8Array(Wt + o.length);
|
|
876
|
+
return en(a, o, o.length, f), a;
|
|
877
|
+
}, S.sign.open = function(o, f) {
|
|
878
|
+
if (Bt(o, f), f.length !== re)
|
|
879
|
+
throw new Error("bad public key size");
|
|
880
|
+
var a = new Uint8Array(o.length), r = Me(a, o, o.length, f);
|
|
881
|
+
if (r < 0) return null;
|
|
882
|
+
for (var c = new Uint8Array(r), l = 0; l < c.length; l++) c[l] = a[l];
|
|
883
|
+
return c;
|
|
884
|
+
}, S.sign.detached = function(o, f) {
|
|
885
|
+
for (var a = S.sign(o, f), r = new Uint8Array(Wt), c = 0; c < r.length; c++) r[c] = a[c];
|
|
886
|
+
return r;
|
|
887
|
+
}, S.sign.detached.verify = function(o, f, a) {
|
|
888
|
+
if (Bt(o, f, a), f.length !== Wt)
|
|
889
|
+
throw new Error("bad signature size");
|
|
890
|
+
if (a.length !== re)
|
|
891
|
+
throw new Error("bad public key size");
|
|
892
|
+
var r = new Uint8Array(Wt + o.length), c = new Uint8Array(Wt + o.length), l;
|
|
893
|
+
for (l = 0; l < Wt; l++) r[l] = f[l];
|
|
894
|
+
for (l = 0; l < o.length; l++) r[l + Wt] = o[l];
|
|
895
|
+
return Me(c, r, r.length, a) >= 0;
|
|
896
|
+
}, S.sign.keyPair = function() {
|
|
897
|
+
var o = new Uint8Array(re), f = new Uint8Array(fe);
|
|
898
|
+
return je(o, f), { publicKey: o, secretKey: f };
|
|
899
|
+
}, S.sign.keyPair.fromSecretKey = function(o) {
|
|
900
|
+
if (Bt(o), o.length !== fe)
|
|
901
|
+
throw new Error("bad secret key size");
|
|
902
|
+
for (var f = new Uint8Array(re), a = 0; a < f.length; a++) f[a] = o[32 + a];
|
|
903
|
+
return { publicKey: f, secretKey: new Uint8Array(o) };
|
|
904
|
+
}, S.sign.keyPair.fromSeed = function(o) {
|
|
905
|
+
if (Bt(o), o.length !== ze)
|
|
906
|
+
throw new Error("bad seed size");
|
|
907
|
+
for (var f = new Uint8Array(re), a = new Uint8Array(fe), r = 0; r < 32; r++) a[r] = o[r];
|
|
908
|
+
return je(f, a, !0), { publicKey: f, secretKey: a };
|
|
909
|
+
}, S.sign.publicKeyLength = re, S.sign.secretKeyLength = fe, S.sign.seedLength = ze, S.sign.signatureLength = Wt, S.hash = function(o) {
|
|
910
|
+
Bt(o);
|
|
911
|
+
var f = new Uint8Array(Kt);
|
|
912
|
+
return ee(f, o, o.length), f;
|
|
913
|
+
}, S.hash.hashLength = Kt, S.verify = function(o, f) {
|
|
914
|
+
return Bt(o, f), o.length === 0 || f.length === 0 || o.length !== f.length ? !1 : B(o, 0, f, 0, o.length) === 0;
|
|
915
|
+
}, S.setPRNG = function(o) {
|
|
916
|
+
Tt = o;
|
|
917
|
+
}, (function() {
|
|
918
|
+
var o = typeof self < "u" ? self.crypto || self.msCrypto : null;
|
|
919
|
+
if (o && o.getRandomValues) {
|
|
920
|
+
var f = 65536;
|
|
921
|
+
S.setPRNG(function(a, r) {
|
|
922
|
+
var c, l = new Uint8Array(r);
|
|
923
|
+
for (c = 0; c < r; c += f)
|
|
924
|
+
o.getRandomValues(l.subarray(c, c + Math.min(r - c, f)));
|
|
925
|
+
for (c = 0; c < r; c++) a[c] = l[c];
|
|
926
|
+
He(l);
|
|
927
|
+
});
|
|
928
|
+
} else
|
|
929
|
+
o = pt(4), o && o.randomBytes && S.setPRNG(function(a, r) {
|
|
930
|
+
var c, l = o.randomBytes(r);
|
|
931
|
+
for (c = 0; c < r; c++) a[c] = l[c];
|
|
932
|
+
He(l);
|
|
933
|
+
});
|
|
934
|
+
})();
|
|
935
|
+
})(Lt.exports ? Lt.exports : self.nacl = self.nacl || {});
|
|
936
|
+
}),
|
|
937
|
+
/* 3 */
|
|
938
|
+
/***/
|
|
939
|
+
(function(Lt, at, pt) {
|
|
940
|
+
Lt.exports = pt(5).default;
|
|
941
|
+
}),
|
|
942
|
+
/* 4 */
|
|
943
|
+
/***/
|
|
944
|
+
(function(Lt, at) {
|
|
945
|
+
}),
|
|
946
|
+
/* 5 */
|
|
947
|
+
/***/
|
|
948
|
+
(function(Lt, at, pt) {
|
|
949
|
+
pt.r(at);
|
|
950
|
+
var S = (function() {
|
|
951
|
+
function e(t, n) {
|
|
952
|
+
this.lastId = 0, this.prefix = t, this.name = n;
|
|
953
|
+
}
|
|
954
|
+
return e.prototype.create = function(t) {
|
|
955
|
+
this.lastId++;
|
|
956
|
+
var n = this.lastId, i = this.prefix + n, s = this.name + "[" + n + "]", u = !1, v = function() {
|
|
957
|
+
u || (t.apply(null, arguments), u = !0);
|
|
958
|
+
};
|
|
959
|
+
return this[n] = v, { number: n, id: i, name: s, callback: v };
|
|
960
|
+
}, e.prototype.remove = function(t) {
|
|
961
|
+
delete this[t.number];
|
|
962
|
+
}, e;
|
|
963
|
+
})(), y = new S("_pusher_script_", "Pusher.ScriptReceivers"), Tt = {
|
|
964
|
+
VERSION: "7.6.0",
|
|
965
|
+
PROTOCOL: 7,
|
|
966
|
+
wsPort: 80,
|
|
967
|
+
wssPort: 443,
|
|
968
|
+
wsPath: "",
|
|
969
|
+
httpHost: "sockjs.pusher.com",
|
|
970
|
+
httpPort: 80,
|
|
971
|
+
httpsPort: 443,
|
|
972
|
+
httpPath: "/pusher",
|
|
973
|
+
stats_host: "stats.pusher.com",
|
|
974
|
+
authEndpoint: "/pusher/auth",
|
|
975
|
+
authTransport: "ajax",
|
|
976
|
+
activityTimeout: 12e4,
|
|
977
|
+
pongTimeout: 3e4,
|
|
978
|
+
unavailableTimeout: 1e4,
|
|
979
|
+
cluster: "mt1",
|
|
980
|
+
userAuthentication: {
|
|
981
|
+
endpoint: "/pusher/user-auth",
|
|
982
|
+
transport: "ajax"
|
|
983
|
+
},
|
|
984
|
+
channelAuthorization: {
|
|
985
|
+
endpoint: "/pusher/auth",
|
|
986
|
+
transport: "ajax"
|
|
987
|
+
},
|
|
988
|
+
cdn_http: "http://js.pusher.com",
|
|
989
|
+
cdn_https: "https://js.pusher.com",
|
|
990
|
+
dependency_suffix: ""
|
|
991
|
+
}, tt = Tt, yt = (function() {
|
|
992
|
+
function e(t) {
|
|
993
|
+
this.options = t, this.receivers = t.receivers || y, this.loading = {};
|
|
994
|
+
}
|
|
995
|
+
return e.prototype.load = function(t, n, i) {
|
|
996
|
+
var s = this;
|
|
997
|
+
if (s.loading[t] && s.loading[t].length > 0)
|
|
998
|
+
s.loading[t].push(i);
|
|
999
|
+
else {
|
|
1000
|
+
s.loading[t] = [i];
|
|
1001
|
+
var u = rt.createScriptRequest(s.getPath(t, n)), v = s.receivers.create(function(P) {
|
|
1002
|
+
if (s.receivers.remove(v), s.loading[t]) {
|
|
1003
|
+
var z = s.loading[t];
|
|
1004
|
+
delete s.loading[t];
|
|
1005
|
+
for (var L = function(Nt) {
|
|
1006
|
+
Nt || u.cleanup();
|
|
1007
|
+
}, ct = 0; ct < z.length; ct++)
|
|
1008
|
+
z[ct](P, L);
|
|
1009
|
+
}
|
|
1010
|
+
});
|
|
1011
|
+
u.send(v);
|
|
1012
|
+
}
|
|
1013
|
+
}, e.prototype.getRoot = function(t) {
|
|
1014
|
+
var n, i = rt.getDocument().location.protocol;
|
|
1015
|
+
return t && t.useTLS || i === "https:" ? n = this.options.cdn_https : n = this.options.cdn_http, n.replace(/\/*$/, "") + "/" + this.options.version;
|
|
1016
|
+
}, e.prototype.getPath = function(t, n) {
|
|
1017
|
+
return this.getRoot(n) + "/" + t + this.options.suffix + ".js";
|
|
1018
|
+
}, e;
|
|
1019
|
+
})(), xt = yt, vt = new S("_pusher_dependencies", "Pusher.DependenciesReceivers"), st = new xt({
|
|
1020
|
+
cdn_http: tt.cdn_http,
|
|
1021
|
+
cdn_https: tt.cdn_https,
|
|
1022
|
+
version: tt.VERSION,
|
|
1023
|
+
suffix: tt.dependency_suffix,
|
|
1024
|
+
receivers: vt
|
|
1025
|
+
}), et = {
|
|
1026
|
+
baseUrl: "https://pusher.com",
|
|
1027
|
+
urls: {
|
|
1028
|
+
authenticationEndpoint: {
|
|
1029
|
+
path: "/docs/channels/server_api/authenticating_users"
|
|
1030
|
+
},
|
|
1031
|
+
authorizationEndpoint: {
|
|
1032
|
+
path: "/docs/channels/server_api/authorizing-users/"
|
|
1033
|
+
},
|
|
1034
|
+
javascriptQuickStart: {
|
|
1035
|
+
path: "/docs/javascript_quick_start"
|
|
1036
|
+
},
|
|
1037
|
+
triggeringClientEvents: {
|
|
1038
|
+
path: "/docs/client_api_guide/client_events#trigger-events"
|
|
1039
|
+
},
|
|
1040
|
+
encryptedChannelSupport: {
|
|
1041
|
+
fullUrl: "https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
}, _t = function(e) {
|
|
1045
|
+
var t = "See:", n = et.urls[e];
|
|
1046
|
+
if (!n)
|
|
1047
|
+
return "";
|
|
1048
|
+
var i;
|
|
1049
|
+
return n.fullUrl ? i = n.fullUrl : n.path && (i = et.baseUrl + n.path), i ? t + " " + i : "";
|
|
1050
|
+
}, H = { buildLogSuffix: _t }, T;
|
|
1051
|
+
(function(e) {
|
|
1052
|
+
e.UserAuthentication = "user-authentication", e.ChannelAuthorization = "channel-authorization";
|
|
1053
|
+
})(T || (T = {}));
|
|
1054
|
+
var A = /* @__PURE__ */ (function() {
|
|
1055
|
+
var e = function(t, n) {
|
|
1056
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
1057
|
+
i.__proto__ = s;
|
|
1058
|
+
} || function(i, s) {
|
|
1059
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
1060
|
+
}, e(t, n);
|
|
1061
|
+
};
|
|
1062
|
+
return function(t, n) {
|
|
1063
|
+
e(t, n);
|
|
1064
|
+
function i() {
|
|
1065
|
+
this.constructor = t;
|
|
1066
|
+
}
|
|
1067
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
1068
|
+
};
|
|
1069
|
+
})(), G = (function(e) {
|
|
1070
|
+
A(t, e);
|
|
1071
|
+
function t(n) {
|
|
1072
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1073
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1074
|
+
}
|
|
1075
|
+
return t;
|
|
1076
|
+
})(Error), B = (function(e) {
|
|
1077
|
+
A(t, e);
|
|
1078
|
+
function t(n) {
|
|
1079
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1080
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1081
|
+
}
|
|
1082
|
+
return t;
|
|
1083
|
+
})(Error), St = (function(e) {
|
|
1084
|
+
A(t, e);
|
|
1085
|
+
function t(n) {
|
|
1086
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1087
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1088
|
+
}
|
|
1089
|
+
return t;
|
|
1090
|
+
})(Error), it = (function(e) {
|
|
1091
|
+
A(t, e);
|
|
1092
|
+
function t(n) {
|
|
1093
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1094
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1095
|
+
}
|
|
1096
|
+
return t;
|
|
1097
|
+
})(Error), Ht = (function(e) {
|
|
1098
|
+
A(t, e);
|
|
1099
|
+
function t(n) {
|
|
1100
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1101
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1102
|
+
}
|
|
1103
|
+
return t;
|
|
1104
|
+
})(Error), Yt = (function(e) {
|
|
1105
|
+
A(t, e);
|
|
1106
|
+
function t(n) {
|
|
1107
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1108
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1109
|
+
}
|
|
1110
|
+
return t;
|
|
1111
|
+
})(Error), Dt = (function(e) {
|
|
1112
|
+
A(t, e);
|
|
1113
|
+
function t(n) {
|
|
1114
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1115
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1116
|
+
}
|
|
1117
|
+
return t;
|
|
1118
|
+
})(Error), Mt = (function(e) {
|
|
1119
|
+
A(t, e);
|
|
1120
|
+
function t(n) {
|
|
1121
|
+
var i = this.constructor, s = e.call(this, n) || this;
|
|
1122
|
+
return Object.setPrototypeOf(s, i.prototype), s;
|
|
1123
|
+
}
|
|
1124
|
+
return t;
|
|
1125
|
+
})(Error), Ut = (function(e) {
|
|
1126
|
+
A(t, e);
|
|
1127
|
+
function t(n, i) {
|
|
1128
|
+
var s = this.constructor, u = e.call(this, i) || this;
|
|
1129
|
+
return u.status = n, Object.setPrototypeOf(u, s.prototype), u;
|
|
1130
|
+
}
|
|
1131
|
+
return t;
|
|
1132
|
+
})(Error), Je = function(e, t, n, i, s) {
|
|
1133
|
+
var u = rt.createXHR();
|
|
1134
|
+
u.open("POST", n.endpoint, !0), u.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
1135
|
+
for (var v in n.headers)
|
|
1136
|
+
u.setRequestHeader(v, n.headers[v]);
|
|
1137
|
+
if (n.headersProvider != null) {
|
|
1138
|
+
var P = n.headersProvider();
|
|
1139
|
+
for (var v in P)
|
|
1140
|
+
u.setRequestHeader(v, P[v]);
|
|
1141
|
+
}
|
|
1142
|
+
return u.onreadystatechange = function() {
|
|
1143
|
+
if (u.readyState === 4)
|
|
1144
|
+
if (u.status === 200) {
|
|
1145
|
+
var z = void 0, L = !1;
|
|
1146
|
+
try {
|
|
1147
|
+
z = JSON.parse(u.responseText), L = !0;
|
|
1148
|
+
} catch {
|
|
1149
|
+
s(new Ut(200, "JSON returned from " + i.toString() + " endpoint was invalid, yet status code was 200. Data was: " + u.responseText), null);
|
|
1150
|
+
}
|
|
1151
|
+
L && s(null, z);
|
|
1152
|
+
} else {
|
|
1153
|
+
var ct = "";
|
|
1154
|
+
switch (i) {
|
|
1155
|
+
case T.UserAuthentication:
|
|
1156
|
+
ct = H.buildLogSuffix("authenticationEndpoint");
|
|
1157
|
+
break;
|
|
1158
|
+
case T.ChannelAuthorization:
|
|
1159
|
+
ct = "Clients must be authorized to join private or presence channels. " + H.buildLogSuffix("authorizationEndpoint");
|
|
1160
|
+
break;
|
|
1161
|
+
}
|
|
1162
|
+
s(new Ut(u.status, "Unable to retrieve auth string from " + i.toString() + " endpoint - " + ("received status: " + u.status + " from " + n.endpoint + ". " + ct)), null);
|
|
1163
|
+
}
|
|
1164
|
+
}, u.send(t), u;
|
|
1165
|
+
}, Xe = Je;
|
|
1166
|
+
function We(e) {
|
|
1167
|
+
return Oe($e(e));
|
|
1168
|
+
}
|
|
1169
|
+
var Zt = String.fromCharCode, Qt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ae = function(e) {
|
|
1170
|
+
var t = e.charCodeAt(0);
|
|
1171
|
+
return t < 128 ? e : t < 2048 ? Zt(192 | t >>> 6) + Zt(128 | t & 63) : Zt(224 | t >>> 12 & 15) + Zt(128 | t >>> 6 & 63) + Zt(128 | t & 63);
|
|
1172
|
+
}, $e = function(e) {
|
|
1173
|
+
return e.replace(/[^\x00-\x7F]/g, Ae);
|
|
1174
|
+
}, Ee = function(e) {
|
|
1175
|
+
var t = [0, 2, 1][e.length % 3], n = e.charCodeAt(0) << 16 | (e.length > 1 ? e.charCodeAt(1) : 0) << 8 | (e.length > 2 ? e.charCodeAt(2) : 0), i = [
|
|
1176
|
+
Qt.charAt(n >>> 18),
|
|
1177
|
+
Qt.charAt(n >>> 12 & 63),
|
|
1178
|
+
t >= 2 ? "=" : Qt.charAt(n >>> 6 & 63),
|
|
1179
|
+
t >= 1 ? "=" : Qt.charAt(n & 63)
|
|
1180
|
+
];
|
|
1181
|
+
return i.join("");
|
|
1182
|
+
}, Oe = window.btoa || function(e) {
|
|
1183
|
+
return e.replace(/[\s\S]{1,3}/g, Ee);
|
|
1184
|
+
}, Jt = (function() {
|
|
1185
|
+
function e(t, n, i, s) {
|
|
1186
|
+
var u = this;
|
|
1187
|
+
this.clear = n, this.timer = t(function() {
|
|
1188
|
+
u.timer && (u.timer = s(u.timer));
|
|
1189
|
+
}, i);
|
|
1190
|
+
}
|
|
1191
|
+
return e.prototype.isRunning = function() {
|
|
1192
|
+
return this.timer !== null;
|
|
1193
|
+
}, e.prototype.ensureAborted = function() {
|
|
1194
|
+
this.timer && (this.clear(this.timer), this.timer = null);
|
|
1195
|
+
}, e;
|
|
1196
|
+
})(), ye = Jt, te = /* @__PURE__ */ (function() {
|
|
1197
|
+
var e = function(t, n) {
|
|
1198
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
1199
|
+
i.__proto__ = s;
|
|
1200
|
+
} || function(i, s) {
|
|
1201
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
1202
|
+
}, e(t, n);
|
|
1203
|
+
};
|
|
1204
|
+
return function(t, n) {
|
|
1205
|
+
e(t, n);
|
|
1206
|
+
function i() {
|
|
1207
|
+
this.constructor = t;
|
|
1208
|
+
}
|
|
1209
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
1210
|
+
};
|
|
1211
|
+
})();
|
|
1212
|
+
function oe(e) {
|
|
1213
|
+
window.clearTimeout(e);
|
|
1214
|
+
}
|
|
1215
|
+
function Ge(e) {
|
|
1216
|
+
window.clearInterval(e);
|
|
1217
|
+
}
|
|
1218
|
+
var $t = (function(e) {
|
|
1219
|
+
te(t, e);
|
|
1220
|
+
function t(n, i) {
|
|
1221
|
+
return e.call(this, setTimeout, oe, n, function(s) {
|
|
1222
|
+
return i(), null;
|
|
1223
|
+
}) || this;
|
|
1224
|
+
}
|
|
1225
|
+
return t;
|
|
1226
|
+
})(ye), ke = (function(e) {
|
|
1227
|
+
te(t, e);
|
|
1228
|
+
function t(n, i) {
|
|
1229
|
+
return e.call(this, setInterval, Ge, n, function(s) {
|
|
1230
|
+
return i(), s;
|
|
1231
|
+
}) || this;
|
|
1232
|
+
}
|
|
1233
|
+
return t;
|
|
1234
|
+
})(ye), qt = {
|
|
1235
|
+
now: function() {
|
|
1236
|
+
return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).valueOf();
|
|
1237
|
+
},
|
|
1238
|
+
defer: function(e) {
|
|
1239
|
+
return new $t(0, e);
|
|
1240
|
+
},
|
|
1241
|
+
method: function(e) {
|
|
1242
|
+
var t = Array.prototype.slice.call(arguments, 1);
|
|
1243
|
+
return function(n) {
|
|
1244
|
+
return n[e].apply(n, t.concat(arguments));
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
}, mt = qt;
|
|
1248
|
+
function F(e) {
|
|
1249
|
+
for (var t = [], n = 1; n < arguments.length; n++)
|
|
1250
|
+
t[n - 1] = arguments[n];
|
|
1251
|
+
for (var i = 0; i < t.length; i++) {
|
|
1252
|
+
var s = t[i];
|
|
1253
|
+
for (var u in s)
|
|
1254
|
+
s[u] && s[u].constructor && s[u].constructor === Object ? e[u] = F(e[u] || {}, s[u]) : e[u] = s[u];
|
|
1255
|
+
}
|
|
1256
|
+
return e;
|
|
1257
|
+
}
|
|
1258
|
+
function zt() {
|
|
1259
|
+
for (var e = ["Pusher"], t = 0; t < arguments.length; t++)
|
|
1260
|
+
typeof arguments[t] == "string" ? e.push(arguments[t]) : e.push(ae(arguments[t]));
|
|
1261
|
+
return e.join(" : ");
|
|
1262
|
+
}
|
|
1263
|
+
function Le(e, t) {
|
|
1264
|
+
var n = Array.prototype.indexOf;
|
|
1265
|
+
if (e === null)
|
|
1266
|
+
return -1;
|
|
1267
|
+
if (n && e.indexOf === n)
|
|
1268
|
+
return e.indexOf(t);
|
|
1269
|
+
for (var i = 0, s = e.length; i < s; i++)
|
|
1270
|
+
if (e[i] === t)
|
|
1271
|
+
return i;
|
|
1272
|
+
return -1;
|
|
1273
|
+
}
|
|
1274
|
+
function Ft(e, t) {
|
|
1275
|
+
for (var n in e)
|
|
1276
|
+
Object.prototype.hasOwnProperty.call(e, n) && t(e[n], n, e);
|
|
1277
|
+
}
|
|
1278
|
+
function ue(e) {
|
|
1279
|
+
var t = [];
|
|
1280
|
+
return Ft(e, function(n, i) {
|
|
1281
|
+
t.push(i);
|
|
1282
|
+
}), t;
|
|
1283
|
+
}
|
|
1284
|
+
function ge(e) {
|
|
1285
|
+
var t = [];
|
|
1286
|
+
return Ft(e, function(n) {
|
|
1287
|
+
t.push(n);
|
|
1288
|
+
}), t;
|
|
1289
|
+
}
|
|
1290
|
+
function se(e, t, n) {
|
|
1291
|
+
for (var i = 0; i < e.length; i++)
|
|
1292
|
+
t.call(n || window, e[i], i, e);
|
|
1293
|
+
}
|
|
1294
|
+
function he(e, t) {
|
|
1295
|
+
for (var n = [], i = 0; i < e.length; i++)
|
|
1296
|
+
n.push(t(e[i], i, e, n));
|
|
1297
|
+
return n;
|
|
1298
|
+
}
|
|
1299
|
+
function Ke(e, t) {
|
|
1300
|
+
var n = {};
|
|
1301
|
+
return Ft(e, function(i, s) {
|
|
1302
|
+
n[s] = t(i);
|
|
1303
|
+
}), n;
|
|
1304
|
+
}
|
|
1305
|
+
function Ve(e, t) {
|
|
1306
|
+
t = t || function(s) {
|
|
1307
|
+
return !!s;
|
|
1308
|
+
};
|
|
1309
|
+
for (var n = [], i = 0; i < e.length; i++)
|
|
1310
|
+
t(e[i], i, e, n) && n.push(e[i]);
|
|
1311
|
+
return n;
|
|
1312
|
+
}
|
|
1313
|
+
function Ze(e, t) {
|
|
1314
|
+
var n = {};
|
|
1315
|
+
return Ft(e, function(i, s) {
|
|
1316
|
+
(t && t(i, s, e, n) || i) && (n[s] = i);
|
|
1317
|
+
}), n;
|
|
1318
|
+
}
|
|
1319
|
+
function an(e) {
|
|
1320
|
+
var t = [];
|
|
1321
|
+
return Ft(e, function(n, i) {
|
|
1322
|
+
t.push([i, n]);
|
|
1323
|
+
}), t;
|
|
1324
|
+
}
|
|
1325
|
+
function Re(e, t) {
|
|
1326
|
+
for (var n = 0; n < e.length; n++)
|
|
1327
|
+
if (t(e[n], n, e))
|
|
1328
|
+
return !0;
|
|
1329
|
+
return !1;
|
|
1330
|
+
}
|
|
1331
|
+
function Qe(e, t) {
|
|
1332
|
+
for (var n = 0; n < e.length; n++)
|
|
1333
|
+
if (!t(e[n], n, e))
|
|
1334
|
+
return !1;
|
|
1335
|
+
return !0;
|
|
1336
|
+
}
|
|
1337
|
+
function ee(e) {
|
|
1338
|
+
return Ke(e, function(t) {
|
|
1339
|
+
return typeof t == "object" && (t = ae(t)), encodeURIComponent(We(t.toString()));
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
function _e(e) {
|
|
1343
|
+
var t = Ze(e, function(i) {
|
|
1344
|
+
return i !== void 0;
|
|
1345
|
+
}), n = he(an(ee(t)), mt.method("join", "=")).join("&");
|
|
1346
|
+
return n;
|
|
1347
|
+
}
|
|
1348
|
+
function tn(e) {
|
|
1349
|
+
var t = [], n = [];
|
|
1350
|
+
return (function i(s, u) {
|
|
1351
|
+
var v, P, z;
|
|
1352
|
+
switch (typeof s) {
|
|
1353
|
+
case "object":
|
|
1354
|
+
if (!s)
|
|
1355
|
+
return null;
|
|
1356
|
+
for (v = 0; v < t.length; v += 1)
|
|
1357
|
+
if (t[v] === s)
|
|
1358
|
+
return { $ref: n[v] };
|
|
1359
|
+
if (t.push(s), n.push(u), Object.prototype.toString.apply(s) === "[object Array]")
|
|
1360
|
+
for (z = [], v = 0; v < s.length; v += 1)
|
|
1361
|
+
z[v] = i(s[v], u + "[" + v + "]");
|
|
1362
|
+
else {
|
|
1363
|
+
z = {};
|
|
1364
|
+
for (P in s)
|
|
1365
|
+
Object.prototype.hasOwnProperty.call(s, P) && (z[P] = i(s[P], u + "[" + JSON.stringify(P) + "]"));
|
|
1366
|
+
}
|
|
1367
|
+
return z;
|
|
1368
|
+
case "number":
|
|
1369
|
+
case "string":
|
|
1370
|
+
case "boolean":
|
|
1371
|
+
return s;
|
|
1372
|
+
}
|
|
1373
|
+
})(e, "$");
|
|
1374
|
+
}
|
|
1375
|
+
function ae(e) {
|
|
1376
|
+
try {
|
|
1377
|
+
return JSON.stringify(e);
|
|
1378
|
+
} catch {
|
|
1379
|
+
return JSON.stringify(tn(e));
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
var Ne = (function() {
|
|
1383
|
+
function e() {
|
|
1384
|
+
this.globalLog = function(t) {
|
|
1385
|
+
window.console && window.console.log && window.console.log(t);
|
|
1386
|
+
};
|
|
1387
|
+
}
|
|
1388
|
+
return e.prototype.debug = function() {
|
|
1389
|
+
for (var t = [], n = 0; n < arguments.length; n++)
|
|
1390
|
+
t[n] = arguments[n];
|
|
1391
|
+
this.log(this.globalLog, t);
|
|
1392
|
+
}, e.prototype.warn = function() {
|
|
1393
|
+
for (var t = [], n = 0; n < arguments.length; n++)
|
|
1394
|
+
t[n] = arguments[n];
|
|
1395
|
+
this.log(this.globalLogWarn, t);
|
|
1396
|
+
}, e.prototype.error = function() {
|
|
1397
|
+
for (var t = [], n = 0; n < arguments.length; n++)
|
|
1398
|
+
t[n] = arguments[n];
|
|
1399
|
+
this.log(this.globalLogError, t);
|
|
1400
|
+
}, e.prototype.globalLogWarn = function(t) {
|
|
1401
|
+
window.console && window.console.warn ? window.console.warn(t) : this.globalLog(t);
|
|
1402
|
+
}, e.prototype.globalLogError = function(t) {
|
|
1403
|
+
window.console && window.console.error ? window.console.error(t) : this.globalLogWarn(t);
|
|
1404
|
+
}, e.prototype.log = function(t) {
|
|
1405
|
+
var n = zt.apply(this, arguments);
|
|
1406
|
+
if (Te.log)
|
|
1407
|
+
Te.log(n);
|
|
1408
|
+
else if (Te.logToConsole) {
|
|
1409
|
+
var i = t.bind(this);
|
|
1410
|
+
i(n);
|
|
1411
|
+
}
|
|
1412
|
+
}, e;
|
|
1413
|
+
})(), bt = new Ne(), je = function(e, t, n, i, s) {
|
|
1414
|
+
(n.headers !== void 0 || n.headersProvider != null) && bt.warn("To send headers with the " + i.toString() + " request, you must use AJAX, rather than JSONP.");
|
|
1415
|
+
var u = e.nextAuthCallbackID.toString();
|
|
1416
|
+
e.nextAuthCallbackID++;
|
|
1417
|
+
var v = e.getDocument(), P = v.createElement("script");
|
|
1418
|
+
e.auth_callbacks[u] = function(ct) {
|
|
1419
|
+
s(null, ct);
|
|
1420
|
+
};
|
|
1421
|
+
var z = "Pusher.auth_callbacks['" + u + "']";
|
|
1422
|
+
P.src = n.endpoint + "?callback=" + encodeURIComponent(z) + "&" + t;
|
|
1423
|
+
var L = v.getElementsByTagName("head")[0] || v.documentElement;
|
|
1424
|
+
L.insertBefore(P, L.firstChild);
|
|
1425
|
+
}, be = je, Ue = (function() {
|
|
1426
|
+
function e(t) {
|
|
1427
|
+
this.src = t;
|
|
1428
|
+
}
|
|
1429
|
+
return e.prototype.send = function(t) {
|
|
1430
|
+
var n = this, i = "Error loading " + n.src;
|
|
1431
|
+
n.script = document.createElement("script"), n.script.id = t.id, n.script.src = n.src, n.script.type = "text/javascript", n.script.charset = "UTF-8", n.script.addEventListener ? (n.script.onerror = function() {
|
|
1432
|
+
t.callback(i);
|
|
1433
|
+
}, n.script.onload = function() {
|
|
1434
|
+
t.callback(null);
|
|
1435
|
+
}) : n.script.onreadystatechange = function() {
|
|
1436
|
+
(n.script.readyState === "loaded" || n.script.readyState === "complete") && t.callback(null);
|
|
1437
|
+
}, n.script.async === void 0 && document.attachEvent && /opera/i.test(navigator.userAgent) ? (n.errorScript = document.createElement("script"), n.errorScript.id = t.id + "_error", n.errorScript.text = t.name + "('" + i + "');", n.script.async = n.errorScript.async = !1) : n.script.async = !0;
|
|
1438
|
+
var s = document.getElementsByTagName("head")[0];
|
|
1439
|
+
s.insertBefore(n.script, s.firstChild), n.errorScript && s.insertBefore(n.errorScript, n.script.nextSibling);
|
|
1440
|
+
}, e.prototype.cleanup = function() {
|
|
1441
|
+
this.script && (this.script.onload = this.script.onerror = null, this.script.onreadystatechange = null), this.script && this.script.parentNode && this.script.parentNode.removeChild(this.script), this.errorScript && this.errorScript.parentNode && this.errorScript.parentNode.removeChild(this.errorScript), this.script = null, this.errorScript = null;
|
|
1442
|
+
}, e;
|
|
1443
|
+
})(), Ie = Ue, en = (function() {
|
|
1444
|
+
function e(t, n) {
|
|
1445
|
+
this.url = t, this.data = n;
|
|
1446
|
+
}
|
|
1447
|
+
return e.prototype.send = function(t) {
|
|
1448
|
+
if (!this.request) {
|
|
1449
|
+
var n = _e(this.data), i = this.url + "/" + t.number + "?" + n;
|
|
1450
|
+
this.request = rt.createScriptRequest(i), this.request.send(t);
|
|
1451
|
+
}
|
|
1452
|
+
}, e.prototype.cleanup = function() {
|
|
1453
|
+
this.request && this.request.cleanup();
|
|
1454
|
+
}, e;
|
|
1455
|
+
})(), fn = en, Me = function(e, t) {
|
|
1456
|
+
return function(n, i) {
|
|
1457
|
+
var s = "http" + (t ? "s" : "") + "://", u = s + (e.host || e.options.host) + e.options.path, v = rt.createJSONPRequest(u, n), P = rt.ScriptReceivers.create(function(z, L) {
|
|
1458
|
+
y.remove(P), v.cleanup(), L && L.host && (e.host = L.host), i && i(z, L);
|
|
1459
|
+
});
|
|
1460
|
+
v.send(P);
|
|
1461
|
+
};
|
|
1462
|
+
}, Be = {
|
|
1463
|
+
name: "jsonp",
|
|
1464
|
+
getAgent: Me
|
|
1465
|
+
}, me = Be;
|
|
1466
|
+
function ne(e, t, n) {
|
|
1467
|
+
var i = e + (t.useTLS ? "s" : ""), s = t.useTLS ? t.hostTLS : t.hostNonTLS;
|
|
1468
|
+
return i + "://" + s + n;
|
|
1469
|
+
}
|
|
1470
|
+
function Gt(e, t) {
|
|
1471
|
+
var n = "/app/" + e, i = "?protocol=" + tt.PROTOCOL + "&client=js&version=" + tt.VERSION + (t ? "&" + t : "");
|
|
1472
|
+
return n + i;
|
|
1473
|
+
}
|
|
1474
|
+
var le = {
|
|
1475
|
+
getInitial: function(e, t) {
|
|
1476
|
+
var n = (t.httpPath || "") + Gt(e, "flash=false");
|
|
1477
|
+
return ne("ws", t, n);
|
|
1478
|
+
}
|
|
1479
|
+
}, we = {
|
|
1480
|
+
getInitial: function(e, t) {
|
|
1481
|
+
var n = (t.httpPath || "/pusher") + Gt(e);
|
|
1482
|
+
return ne("http", t, n);
|
|
1483
|
+
}
|
|
1484
|
+
}, de = {
|
|
1485
|
+
getInitial: function(e, t) {
|
|
1486
|
+
return ne("http", t, t.httpPath || "/pusher");
|
|
1487
|
+
},
|
|
1488
|
+
getPath: function(e, t) {
|
|
1489
|
+
return Gt(e);
|
|
1490
|
+
}
|
|
1491
|
+
}, pe = (function() {
|
|
1492
|
+
function e() {
|
|
1493
|
+
this._callbacks = {};
|
|
1494
|
+
}
|
|
1495
|
+
return e.prototype.get = function(t) {
|
|
1496
|
+
return this._callbacks[Se(t)];
|
|
1497
|
+
}, e.prototype.add = function(t, n, i) {
|
|
1498
|
+
var s = Se(t);
|
|
1499
|
+
this._callbacks[s] = this._callbacks[s] || [], this._callbacks[s].push({
|
|
1500
|
+
fn: n,
|
|
1501
|
+
context: i
|
|
1502
|
+
});
|
|
1503
|
+
}, e.prototype.remove = function(t, n, i) {
|
|
1504
|
+
if (!t && !n && !i) {
|
|
1505
|
+
this._callbacks = {};
|
|
1506
|
+
return;
|
|
1507
|
+
}
|
|
1508
|
+
var s = t ? [Se(t)] : ue(this._callbacks);
|
|
1509
|
+
n || i ? this.removeCallback(s, n, i) : this.removeAllCallbacks(s);
|
|
1510
|
+
}, e.prototype.removeCallback = function(t, n, i) {
|
|
1511
|
+
se(t, function(s) {
|
|
1512
|
+
this._callbacks[s] = Ve(this._callbacks[s] || [], function(u) {
|
|
1513
|
+
return n && n !== u.fn || i && i !== u.context;
|
|
1514
|
+
}), this._callbacks[s].length === 0 && delete this._callbacks[s];
|
|
1515
|
+
}, this);
|
|
1516
|
+
}, e.prototype.removeAllCallbacks = function(t) {
|
|
1517
|
+
se(t, function(n) {
|
|
1518
|
+
delete this._callbacks[n];
|
|
1519
|
+
}, this);
|
|
1520
|
+
}, e;
|
|
1521
|
+
})(), De = pe;
|
|
1522
|
+
function Se(e) {
|
|
1523
|
+
return "_" + e;
|
|
1524
|
+
}
|
|
1525
|
+
var cn = (function() {
|
|
1526
|
+
function e(t) {
|
|
1527
|
+
this.callbacks = new De(), this.global_callbacks = [], this.failThrough = t;
|
|
1528
|
+
}
|
|
1529
|
+
return e.prototype.bind = function(t, n, i) {
|
|
1530
|
+
return this.callbacks.add(t, n, i), this;
|
|
1531
|
+
}, e.prototype.bind_global = function(t) {
|
|
1532
|
+
return this.global_callbacks.push(t), this;
|
|
1533
|
+
}, e.prototype.unbind = function(t, n, i) {
|
|
1534
|
+
return this.callbacks.remove(t, n, i), this;
|
|
1535
|
+
}, e.prototype.unbind_global = function(t) {
|
|
1536
|
+
return t ? (this.global_callbacks = Ve(this.global_callbacks || [], function(n) {
|
|
1537
|
+
return n !== t;
|
|
1538
|
+
}), this) : (this.global_callbacks = [], this);
|
|
1539
|
+
}, e.prototype.unbind_all = function() {
|
|
1540
|
+
return this.unbind(), this.unbind_global(), this;
|
|
1541
|
+
}, e.prototype.emit = function(t, n, i) {
|
|
1542
|
+
for (var s = 0; s < this.global_callbacks.length; s++)
|
|
1543
|
+
this.global_callbacks[s](t, n);
|
|
1544
|
+
var u = this.callbacks.get(t), v = [];
|
|
1545
|
+
if (i ? v.push(n, i) : n && v.push(n), u && u.length > 0)
|
|
1546
|
+
for (var s = 0; s < u.length; s++)
|
|
1547
|
+
u[s].fn.apply(u[s].context || window, v);
|
|
1548
|
+
else this.failThrough && this.failThrough(t, n);
|
|
1549
|
+
return this;
|
|
1550
|
+
}, e;
|
|
1551
|
+
})(), Xt = cn, Wt = /* @__PURE__ */ (function() {
|
|
1552
|
+
var e = function(t, n) {
|
|
1553
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
1554
|
+
i.__proto__ = s;
|
|
1555
|
+
} || function(i, s) {
|
|
1556
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
1557
|
+
}, e(t, n);
|
|
1558
|
+
};
|
|
1559
|
+
return function(t, n) {
|
|
1560
|
+
e(t, n);
|
|
1561
|
+
function i() {
|
|
1562
|
+
this.constructor = t;
|
|
1563
|
+
}
|
|
1564
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
1565
|
+
};
|
|
1566
|
+
})(), re = (function(e) {
|
|
1567
|
+
Wt(t, e);
|
|
1568
|
+
function t(n, i, s, u, v) {
|
|
1569
|
+
var P = e.call(this) || this;
|
|
1570
|
+
return P.initialize = rt.transportConnectionInitializer, P.hooks = n, P.name = i, P.priority = s, P.key = u, P.options = v, P.state = "new", P.timeline = v.timeline, P.activityTimeout = v.activityTimeout, P.id = P.timeline.generateUniqueID(), P;
|
|
1571
|
+
}
|
|
1572
|
+
return t.prototype.handlesActivityChecks = function() {
|
|
1573
|
+
return !!this.hooks.handlesActivityChecks;
|
|
1574
|
+
}, t.prototype.supportsPing = function() {
|
|
1575
|
+
return !!this.hooks.supportsPing;
|
|
1576
|
+
}, t.prototype.connect = function() {
|
|
1577
|
+
var n = this;
|
|
1578
|
+
if (this.socket || this.state !== "initialized")
|
|
1579
|
+
return !1;
|
|
1580
|
+
var i = this.hooks.urls.getInitial(this.key, this.options);
|
|
1581
|
+
try {
|
|
1582
|
+
this.socket = this.hooks.getSocket(i, this.options);
|
|
1583
|
+
} catch (s) {
|
|
1584
|
+
return mt.defer(function() {
|
|
1585
|
+
n.onError(s), n.changeState("closed");
|
|
1586
|
+
}), !1;
|
|
1587
|
+
}
|
|
1588
|
+
return this.bindListeners(), bt.debug("Connecting", { transport: this.name, url: i }), this.changeState("connecting"), !0;
|
|
1589
|
+
}, t.prototype.close = function() {
|
|
1590
|
+
return this.socket ? (this.socket.close(), !0) : !1;
|
|
1591
|
+
}, t.prototype.send = function(n) {
|
|
1592
|
+
var i = this;
|
|
1593
|
+
return this.state === "open" ? (mt.defer(function() {
|
|
1594
|
+
i.socket && i.socket.send(n);
|
|
1595
|
+
}), !0) : !1;
|
|
1596
|
+
}, t.prototype.ping = function() {
|
|
1597
|
+
this.state === "open" && this.supportsPing() && this.socket.ping();
|
|
1598
|
+
}, t.prototype.onOpen = function() {
|
|
1599
|
+
this.hooks.beforeOpen && this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options)), this.changeState("open"), this.socket.onopen = void 0;
|
|
1600
|
+
}, t.prototype.onError = function(n) {
|
|
1601
|
+
this.emit("error", { type: "WebSocketError", error: n }), this.timeline.error(this.buildTimelineMessage({ error: n.toString() }));
|
|
1602
|
+
}, t.prototype.onClose = function(n) {
|
|
1603
|
+
n ? this.changeState("closed", {
|
|
1604
|
+
code: n.code,
|
|
1605
|
+
reason: n.reason,
|
|
1606
|
+
wasClean: n.wasClean
|
|
1607
|
+
}) : this.changeState("closed"), this.unbindListeners(), this.socket = void 0;
|
|
1608
|
+
}, t.prototype.onMessage = function(n) {
|
|
1609
|
+
this.emit("message", n);
|
|
1610
|
+
}, t.prototype.onActivity = function() {
|
|
1611
|
+
this.emit("activity");
|
|
1612
|
+
}, t.prototype.bindListeners = function() {
|
|
1613
|
+
var n = this;
|
|
1614
|
+
this.socket.onopen = function() {
|
|
1615
|
+
n.onOpen();
|
|
1616
|
+
}, this.socket.onerror = function(i) {
|
|
1617
|
+
n.onError(i);
|
|
1618
|
+
}, this.socket.onclose = function(i) {
|
|
1619
|
+
n.onClose(i);
|
|
1620
|
+
}, this.socket.onmessage = function(i) {
|
|
1621
|
+
n.onMessage(i);
|
|
1622
|
+
}, this.supportsPing() && (this.socket.onactivity = function() {
|
|
1623
|
+
n.onActivity();
|
|
1624
|
+
});
|
|
1625
|
+
}, t.prototype.unbindListeners = function() {
|
|
1626
|
+
this.socket && (this.socket.onopen = void 0, this.socket.onerror = void 0, this.socket.onclose = void 0, this.socket.onmessage = void 0, this.supportsPing() && (this.socket.onactivity = void 0));
|
|
1627
|
+
}, t.prototype.changeState = function(n, i) {
|
|
1628
|
+
this.state = n, this.timeline.info(this.buildTimelineMessage({
|
|
1629
|
+
state: n,
|
|
1630
|
+
params: i
|
|
1631
|
+
})), this.emit(n, i);
|
|
1632
|
+
}, t.prototype.buildTimelineMessage = function(n) {
|
|
1633
|
+
return F({ cid: this.id }, n);
|
|
1634
|
+
}, t;
|
|
1635
|
+
})(Xt), fe = re, ze = (function() {
|
|
1636
|
+
function e(t) {
|
|
1637
|
+
this.hooks = t;
|
|
1638
|
+
}
|
|
1639
|
+
return e.prototype.isSupported = function(t) {
|
|
1640
|
+
return this.hooks.isSupported(t);
|
|
1641
|
+
}, e.prototype.createConnection = function(t, n, i, s) {
|
|
1642
|
+
return new fe(this.hooks, t, n, i, s);
|
|
1643
|
+
}, e;
|
|
1644
|
+
})(), Kt = ze, nn = new Kt({
|
|
1645
|
+
urls: le,
|
|
1646
|
+
handlesActivityChecks: !1,
|
|
1647
|
+
supportsPing: !1,
|
|
1648
|
+
isInitialized: function() {
|
|
1649
|
+
return !!rt.getWebSocketAPI();
|
|
1650
|
+
},
|
|
1651
|
+
isSupported: function() {
|
|
1652
|
+
return !!rt.getWebSocketAPI();
|
|
1653
|
+
},
|
|
1654
|
+
getSocket: function(e) {
|
|
1655
|
+
return rt.createWebSocket(e);
|
|
1656
|
+
}
|
|
1657
|
+
}), rn = {
|
|
1658
|
+
urls: we,
|
|
1659
|
+
handlesActivityChecks: !1,
|
|
1660
|
+
supportsPing: !0,
|
|
1661
|
+
isInitialized: function() {
|
|
1662
|
+
return !0;
|
|
1663
|
+
}
|
|
1664
|
+
}, Bt = F({
|
|
1665
|
+
getSocket: function(e) {
|
|
1666
|
+
return rt.HTTPFactory.createStreamingSocket(e);
|
|
1667
|
+
}
|
|
1668
|
+
}, rn), He = F({
|
|
1669
|
+
getSocket: function(e) {
|
|
1670
|
+
return rt.HTTPFactory.createPollingSocket(e);
|
|
1671
|
+
}
|
|
1672
|
+
}, rn), o = {
|
|
1673
|
+
isSupported: function() {
|
|
1674
|
+
return rt.isXHRSupported();
|
|
1675
|
+
}
|
|
1676
|
+
}, f = new Kt(F({}, Bt, o)), a = new Kt(F({}, He, o)), r = {
|
|
1677
|
+
ws: nn,
|
|
1678
|
+
xhr_streaming: f,
|
|
1679
|
+
xhr_polling: a
|
|
1680
|
+
}, c = r, l = new Kt({
|
|
1681
|
+
file: "sockjs",
|
|
1682
|
+
urls: de,
|
|
1683
|
+
handlesActivityChecks: !0,
|
|
1684
|
+
supportsPing: !1,
|
|
1685
|
+
isSupported: function() {
|
|
1686
|
+
return !0;
|
|
1687
|
+
},
|
|
1688
|
+
isInitialized: function() {
|
|
1689
|
+
return window.SockJS !== void 0;
|
|
1690
|
+
},
|
|
1691
|
+
getSocket: function(e, t) {
|
|
1692
|
+
return new window.SockJS(e, null, {
|
|
1693
|
+
js_path: st.getPath("sockjs", {
|
|
1694
|
+
useTLS: t.useTLS
|
|
1695
|
+
}),
|
|
1696
|
+
ignore_null_origin: t.ignoreNullOrigin
|
|
1697
|
+
});
|
|
1698
|
+
},
|
|
1699
|
+
beforeOpen: function(e, t) {
|
|
1700
|
+
e.send(JSON.stringify({
|
|
1701
|
+
path: t
|
|
1702
|
+
}));
|
|
1703
|
+
}
|
|
1704
|
+
}), d = {
|
|
1705
|
+
isSupported: function(e) {
|
|
1706
|
+
var t = rt.isXDRSupported(e.useTLS);
|
|
1707
|
+
return t;
|
|
1708
|
+
}
|
|
1709
|
+
}, _ = new Kt(F({}, Bt, d)), C = new Kt(F({}, He, d));
|
|
1710
|
+
c.xdr_streaming = _, c.xdr_polling = C, c.sockjs = l;
|
|
1711
|
+
var I = c, O = /* @__PURE__ */ (function() {
|
|
1712
|
+
var e = function(t, n) {
|
|
1713
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
1714
|
+
i.__proto__ = s;
|
|
1715
|
+
} || function(i, s) {
|
|
1716
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
1717
|
+
}, e(t, n);
|
|
1718
|
+
};
|
|
1719
|
+
return function(t, n) {
|
|
1720
|
+
e(t, n);
|
|
1721
|
+
function i() {
|
|
1722
|
+
this.constructor = t;
|
|
1723
|
+
}
|
|
1724
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
1725
|
+
};
|
|
1726
|
+
})(), lt = (function(e) {
|
|
1727
|
+
O(t, e);
|
|
1728
|
+
function t() {
|
|
1729
|
+
var n = e.call(this) || this, i = n;
|
|
1730
|
+
return window.addEventListener !== void 0 && (window.addEventListener("online", function() {
|
|
1731
|
+
i.emit("online");
|
|
1732
|
+
}, !1), window.addEventListener("offline", function() {
|
|
1733
|
+
i.emit("offline");
|
|
1734
|
+
}, !1)), n;
|
|
1735
|
+
}
|
|
1736
|
+
return t.prototype.isOnline = function() {
|
|
1737
|
+
return window.navigator.onLine === void 0 ? !0 : window.navigator.onLine;
|
|
1738
|
+
}, t;
|
|
1739
|
+
})(Xt), R = new lt(), Y = (function() {
|
|
1740
|
+
function e(t, n, i) {
|
|
1741
|
+
this.manager = t, this.transport = n, this.minPingDelay = i.minPingDelay, this.maxPingDelay = i.maxPingDelay, this.pingDelay = void 0;
|
|
1742
|
+
}
|
|
1743
|
+
return e.prototype.createConnection = function(t, n, i, s) {
|
|
1744
|
+
var u = this;
|
|
1745
|
+
s = F({}, s, {
|
|
1746
|
+
activityTimeout: this.pingDelay
|
|
1747
|
+
});
|
|
1748
|
+
var v = this.transport.createConnection(t, n, i, s), P = null, z = function() {
|
|
1749
|
+
v.unbind("open", z), v.bind("closed", L), P = mt.now();
|
|
1750
|
+
}, L = function(ct) {
|
|
1751
|
+
if (v.unbind("closed", L), ct.code === 1002 || ct.code === 1003)
|
|
1752
|
+
u.manager.reportDeath();
|
|
1753
|
+
else if (!ct.wasClean && P) {
|
|
1754
|
+
var Nt = mt.now() - P;
|
|
1755
|
+
Nt < 2 * u.maxPingDelay && (u.manager.reportDeath(), u.pingDelay = Math.max(Nt / 2, u.minPingDelay));
|
|
1756
|
+
}
|
|
1757
|
+
};
|
|
1758
|
+
return v.bind("open", z), v;
|
|
1759
|
+
}, e.prototype.isSupported = function(t) {
|
|
1760
|
+
return this.manager.isAlive() && this.transport.isSupported(t);
|
|
1761
|
+
}, e;
|
|
1762
|
+
})(), J = Y, K = {
|
|
1763
|
+
decodeMessage: function(e) {
|
|
1764
|
+
try {
|
|
1765
|
+
var t = JSON.parse(e.data), n = t.data;
|
|
1766
|
+
if (typeof n == "string")
|
|
1767
|
+
try {
|
|
1768
|
+
n = JSON.parse(t.data);
|
|
1769
|
+
} catch {
|
|
1770
|
+
}
|
|
1771
|
+
var i = {
|
|
1772
|
+
event: t.event,
|
|
1773
|
+
channel: t.channel,
|
|
1774
|
+
data: n
|
|
1775
|
+
};
|
|
1776
|
+
return t.user_id && (i.user_id = t.user_id), i;
|
|
1777
|
+
} catch (s) {
|
|
1778
|
+
throw { type: "MessageParseError", error: s, data: e.data };
|
|
1779
|
+
}
|
|
1780
|
+
},
|
|
1781
|
+
encodeMessage: function(e) {
|
|
1782
|
+
return JSON.stringify(e);
|
|
1783
|
+
},
|
|
1784
|
+
processHandshake: function(e) {
|
|
1785
|
+
var t = K.decodeMessage(e);
|
|
1786
|
+
if (t.event === "pusher:connection_established") {
|
|
1787
|
+
if (!t.data.activity_timeout)
|
|
1788
|
+
throw "No activity timeout specified in handshake";
|
|
1789
|
+
return {
|
|
1790
|
+
action: "connected",
|
|
1791
|
+
id: t.data.socket_id,
|
|
1792
|
+
activityTimeout: t.data.activity_timeout * 1e3
|
|
1793
|
+
};
|
|
1794
|
+
} else {
|
|
1795
|
+
if (t.event === "pusher:error")
|
|
1796
|
+
return {
|
|
1797
|
+
action: this.getCloseAction(t.data),
|
|
1798
|
+
error: this.getCloseError(t.data)
|
|
1799
|
+
};
|
|
1800
|
+
throw "Invalid handshake";
|
|
1801
|
+
}
|
|
1802
|
+
},
|
|
1803
|
+
getCloseAction: function(e) {
|
|
1804
|
+
return e.code < 4e3 ? e.code >= 1002 && e.code <= 1004 ? "backoff" : null : e.code === 4e3 ? "tls_only" : e.code < 4100 ? "refused" : e.code < 4200 ? "backoff" : e.code < 4300 ? "retry" : "refused";
|
|
1805
|
+
},
|
|
1806
|
+
getCloseError: function(e) {
|
|
1807
|
+
return e.code !== 1e3 && e.code !== 1001 ? {
|
|
1808
|
+
type: "PusherError",
|
|
1809
|
+
data: {
|
|
1810
|
+
code: e.code,
|
|
1811
|
+
message: e.reason || e.message
|
|
1812
|
+
}
|
|
1813
|
+
} : null;
|
|
1814
|
+
}
|
|
1815
|
+
}, q = K, X = /* @__PURE__ */ (function() {
|
|
1816
|
+
var e = function(t, n) {
|
|
1817
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
1818
|
+
i.__proto__ = s;
|
|
1819
|
+
} || function(i, s) {
|
|
1820
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
1821
|
+
}, e(t, n);
|
|
1822
|
+
};
|
|
1823
|
+
return function(t, n) {
|
|
1824
|
+
e(t, n);
|
|
1825
|
+
function i() {
|
|
1826
|
+
this.constructor = t;
|
|
1827
|
+
}
|
|
1828
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
1829
|
+
};
|
|
1830
|
+
})(), $ = (function(e) {
|
|
1831
|
+
X(t, e);
|
|
1832
|
+
function t(n, i) {
|
|
1833
|
+
var s = e.call(this) || this;
|
|
1834
|
+
return s.id = n, s.transport = i, s.activityTimeout = i.activityTimeout, s.bindListeners(), s;
|
|
1835
|
+
}
|
|
1836
|
+
return t.prototype.handlesActivityChecks = function() {
|
|
1837
|
+
return this.transport.handlesActivityChecks();
|
|
1838
|
+
}, t.prototype.send = function(n) {
|
|
1839
|
+
return this.transport.send(n);
|
|
1840
|
+
}, t.prototype.send_event = function(n, i, s) {
|
|
1841
|
+
var u = { event: n, data: i };
|
|
1842
|
+
return s && (u.channel = s), bt.debug("Event sent", u), this.send(q.encodeMessage(u));
|
|
1843
|
+
}, t.prototype.ping = function() {
|
|
1844
|
+
this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
|
|
1845
|
+
}, t.prototype.close = function() {
|
|
1846
|
+
this.transport.close();
|
|
1847
|
+
}, t.prototype.bindListeners = function() {
|
|
1848
|
+
var n = this, i = {
|
|
1849
|
+
message: function(u) {
|
|
1850
|
+
var v;
|
|
1851
|
+
try {
|
|
1852
|
+
v = q.decodeMessage(u);
|
|
1853
|
+
} catch (P) {
|
|
1854
|
+
n.emit("error", {
|
|
1855
|
+
type: "MessageParseError",
|
|
1856
|
+
error: P,
|
|
1857
|
+
data: u.data
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
if (v !== void 0) {
|
|
1861
|
+
switch (bt.debug("Event recd", v), v.event) {
|
|
1862
|
+
case "pusher:error":
|
|
1863
|
+
n.emit("error", {
|
|
1864
|
+
type: "PusherError",
|
|
1865
|
+
data: v.data
|
|
1866
|
+
});
|
|
1867
|
+
break;
|
|
1868
|
+
case "pusher:ping":
|
|
1869
|
+
n.emit("ping");
|
|
1870
|
+
break;
|
|
1871
|
+
case "pusher:pong":
|
|
1872
|
+
n.emit("pong");
|
|
1873
|
+
break;
|
|
1874
|
+
}
|
|
1875
|
+
n.emit("message", v);
|
|
1876
|
+
}
|
|
1877
|
+
},
|
|
1878
|
+
activity: function() {
|
|
1879
|
+
n.emit("activity");
|
|
1880
|
+
},
|
|
1881
|
+
error: function(u) {
|
|
1882
|
+
n.emit("error", u);
|
|
1883
|
+
},
|
|
1884
|
+
closed: function(u) {
|
|
1885
|
+
s(), u && u.code && n.handleCloseEvent(u), n.transport = null, n.emit("closed");
|
|
1886
|
+
}
|
|
1887
|
+
}, s = function() {
|
|
1888
|
+
Ft(i, function(u, v) {
|
|
1889
|
+
n.transport.unbind(v, u);
|
|
1890
|
+
});
|
|
1891
|
+
};
|
|
1892
|
+
Ft(i, function(u, v) {
|
|
1893
|
+
n.transport.bind(v, u);
|
|
1894
|
+
});
|
|
1895
|
+
}, t.prototype.handleCloseEvent = function(n) {
|
|
1896
|
+
var i = q.getCloseAction(n), s = q.getCloseError(n);
|
|
1897
|
+
s && this.emit("error", s), i && this.emit(i, { action: i, error: s });
|
|
1898
|
+
}, t;
|
|
1899
|
+
})(Xt), W = $, N = (function() {
|
|
1900
|
+
function e(t, n) {
|
|
1901
|
+
this.transport = t, this.callback = n, this.bindListeners();
|
|
1902
|
+
}
|
|
1903
|
+
return e.prototype.close = function() {
|
|
1904
|
+
this.unbindListeners(), this.transport.close();
|
|
1905
|
+
}, e.prototype.bindListeners = function() {
|
|
1906
|
+
var t = this;
|
|
1907
|
+
this.onMessage = function(n) {
|
|
1908
|
+
t.unbindListeners();
|
|
1909
|
+
var i;
|
|
1910
|
+
try {
|
|
1911
|
+
i = q.processHandshake(n);
|
|
1912
|
+
} catch (s) {
|
|
1913
|
+
t.finish("error", { error: s }), t.transport.close();
|
|
1914
|
+
return;
|
|
1915
|
+
}
|
|
1916
|
+
i.action === "connected" ? t.finish("connected", {
|
|
1917
|
+
connection: new W(i.id, t.transport),
|
|
1918
|
+
activityTimeout: i.activityTimeout
|
|
1919
|
+
}) : (t.finish(i.action, { error: i.error }), t.transport.close());
|
|
1920
|
+
}, this.onClosed = function(n) {
|
|
1921
|
+
t.unbindListeners();
|
|
1922
|
+
var i = q.getCloseAction(n) || "backoff", s = q.getCloseError(n);
|
|
1923
|
+
t.finish(i, { error: s });
|
|
1924
|
+
}, this.transport.bind("message", this.onMessage), this.transport.bind("closed", this.onClosed);
|
|
1925
|
+
}, e.prototype.unbindListeners = function() {
|
|
1926
|
+
this.transport.unbind("message", this.onMessage), this.transport.unbind("closed", this.onClosed);
|
|
1927
|
+
}, e.prototype.finish = function(t, n) {
|
|
1928
|
+
this.callback(F({ transport: this.transport, action: t }, n));
|
|
1929
|
+
}, e;
|
|
1930
|
+
})(), M = N, k = (function() {
|
|
1931
|
+
function e(t, n) {
|
|
1932
|
+
this.timeline = t, this.options = n || {};
|
|
1933
|
+
}
|
|
1934
|
+
return e.prototype.send = function(t, n) {
|
|
1935
|
+
this.timeline.isEmpty() || this.timeline.send(rt.TimelineTransport.getAgent(this, t), n);
|
|
1936
|
+
}, e;
|
|
1937
|
+
})(), j = k, U = /* @__PURE__ */ (function() {
|
|
1938
|
+
var e = function(t, n) {
|
|
1939
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
1940
|
+
i.__proto__ = s;
|
|
1941
|
+
} || function(i, s) {
|
|
1942
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
1943
|
+
}, e(t, n);
|
|
1944
|
+
};
|
|
1945
|
+
return function(t, n) {
|
|
1946
|
+
e(t, n);
|
|
1947
|
+
function i() {
|
|
1948
|
+
this.constructor = t;
|
|
1949
|
+
}
|
|
1950
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
1951
|
+
};
|
|
1952
|
+
})(), E = (function(e) {
|
|
1953
|
+
U(t, e);
|
|
1954
|
+
function t(n, i) {
|
|
1955
|
+
var s = e.call(this, function(u, v) {
|
|
1956
|
+
bt.debug("No callbacks on " + n + " for " + u);
|
|
1957
|
+
}) || this;
|
|
1958
|
+
return s.name = n, s.pusher = i, s.subscribed = !1, s.subscriptionPending = !1, s.subscriptionCancelled = !1, s;
|
|
1959
|
+
}
|
|
1960
|
+
return t.prototype.authorize = function(n, i) {
|
|
1961
|
+
return i(null, { auth: "" });
|
|
1962
|
+
}, t.prototype.trigger = function(n, i) {
|
|
1963
|
+
if (n.indexOf("client-") !== 0)
|
|
1964
|
+
throw new G("Event '" + n + "' does not start with 'client-'");
|
|
1965
|
+
if (!this.subscribed) {
|
|
1966
|
+
var s = H.buildLogSuffix("triggeringClientEvents");
|
|
1967
|
+
bt.warn("Client event triggered before channel 'subscription_succeeded' event . " + s);
|
|
1968
|
+
}
|
|
1969
|
+
return this.pusher.send_event(n, i, this.name);
|
|
1970
|
+
}, t.prototype.disconnect = function() {
|
|
1971
|
+
this.subscribed = !1, this.subscriptionPending = !1;
|
|
1972
|
+
}, t.prototype.handleEvent = function(n) {
|
|
1973
|
+
var i = n.event, s = n.data;
|
|
1974
|
+
if (i === "pusher_internal:subscription_succeeded")
|
|
1975
|
+
this.handleSubscriptionSucceededEvent(n);
|
|
1976
|
+
else if (i === "pusher_internal:subscription_count")
|
|
1977
|
+
this.handleSubscriptionCountEvent(n);
|
|
1978
|
+
else if (i.indexOf("pusher_internal:") !== 0) {
|
|
1979
|
+
var u = {};
|
|
1980
|
+
this.emit(i, s, u);
|
|
1981
|
+
}
|
|
1982
|
+
}, t.prototype.handleSubscriptionSucceededEvent = function(n) {
|
|
1983
|
+
this.subscriptionPending = !1, this.subscribed = !0, this.subscriptionCancelled ? this.pusher.unsubscribe(this.name) : this.emit("pusher:subscription_succeeded", n.data);
|
|
1984
|
+
}, t.prototype.handleSubscriptionCountEvent = function(n) {
|
|
1985
|
+
n.data.subscription_count && (this.subscriptionCount = n.data.subscription_count), this.emit("pusher:subscription_count", n.data);
|
|
1986
|
+
}, t.prototype.subscribe = function() {
|
|
1987
|
+
var n = this;
|
|
1988
|
+
this.subscribed || (this.subscriptionPending = !0, this.subscriptionCancelled = !1, this.authorize(this.pusher.connection.socket_id, function(i, s) {
|
|
1989
|
+
i ? (n.subscriptionPending = !1, bt.error(i.toString()), n.emit("pusher:subscription_error", Object.assign({}, {
|
|
1990
|
+
type: "AuthError",
|
|
1991
|
+
error: i.message
|
|
1992
|
+
}, i instanceof Ut ? { status: i.status } : {}))) : n.pusher.send_event("pusher:subscribe", {
|
|
1993
|
+
auth: s.auth,
|
|
1994
|
+
channel_data: s.channel_data,
|
|
1995
|
+
channel: n.name
|
|
1996
|
+
});
|
|
1997
|
+
}));
|
|
1998
|
+
}, t.prototype.unsubscribe = function() {
|
|
1999
|
+
this.subscribed = !1, this.pusher.send_event("pusher:unsubscribe", {
|
|
2000
|
+
channel: this.name
|
|
2001
|
+
});
|
|
2002
|
+
}, t.prototype.cancelSubscription = function() {
|
|
2003
|
+
this.subscriptionCancelled = !0;
|
|
2004
|
+
}, t.prototype.reinstateSubscription = function() {
|
|
2005
|
+
this.subscriptionCancelled = !1;
|
|
2006
|
+
}, t;
|
|
2007
|
+
})(Xt), p = E, x = /* @__PURE__ */ (function() {
|
|
2008
|
+
var e = function(t, n) {
|
|
2009
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
2010
|
+
i.__proto__ = s;
|
|
2011
|
+
} || function(i, s) {
|
|
2012
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
2013
|
+
}, e(t, n);
|
|
2014
|
+
};
|
|
2015
|
+
return function(t, n) {
|
|
2016
|
+
e(t, n);
|
|
2017
|
+
function i() {
|
|
2018
|
+
this.constructor = t;
|
|
2019
|
+
}
|
|
2020
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
2021
|
+
};
|
|
2022
|
+
})(), m = (function(e) {
|
|
2023
|
+
x(t, e);
|
|
2024
|
+
function t() {
|
|
2025
|
+
return e !== null && e.apply(this, arguments) || this;
|
|
2026
|
+
}
|
|
2027
|
+
return t.prototype.authorize = function(n, i) {
|
|
2028
|
+
return this.pusher.config.channelAuthorizer({
|
|
2029
|
+
channelName: this.name,
|
|
2030
|
+
socketId: n
|
|
2031
|
+
}, i);
|
|
2032
|
+
}, t;
|
|
2033
|
+
})(p), g = m, b = (function() {
|
|
2034
|
+
function e() {
|
|
2035
|
+
this.reset();
|
|
2036
|
+
}
|
|
2037
|
+
return e.prototype.get = function(t) {
|
|
2038
|
+
return Object.prototype.hasOwnProperty.call(this.members, t) ? {
|
|
2039
|
+
id: t,
|
|
2040
|
+
info: this.members[t]
|
|
2041
|
+
} : null;
|
|
2042
|
+
}, e.prototype.each = function(t) {
|
|
2043
|
+
var n = this;
|
|
2044
|
+
Ft(this.members, function(i, s) {
|
|
2045
|
+
t(n.get(s));
|
|
2046
|
+
});
|
|
2047
|
+
}, e.prototype.setMyID = function(t) {
|
|
2048
|
+
this.myID = t;
|
|
2049
|
+
}, e.prototype.onSubscription = function(t) {
|
|
2050
|
+
this.members = t.presence.hash, this.count = t.presence.count, this.me = this.get(this.myID);
|
|
2051
|
+
}, e.prototype.addMember = function(t) {
|
|
2052
|
+
return this.get(t.user_id) === null && this.count++, this.members[t.user_id] = t.user_info, this.get(t.user_id);
|
|
2053
|
+
}, e.prototype.removeMember = function(t) {
|
|
2054
|
+
var n = this.get(t.user_id);
|
|
2055
|
+
return n && (delete this.members[t.user_id], this.count--), n;
|
|
2056
|
+
}, e.prototype.reset = function() {
|
|
2057
|
+
this.members = {}, this.count = 0, this.myID = null, this.me = null;
|
|
2058
|
+
}, e;
|
|
2059
|
+
})(), w = b, D = /* @__PURE__ */ (function() {
|
|
2060
|
+
var e = function(t, n) {
|
|
2061
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
2062
|
+
i.__proto__ = s;
|
|
2063
|
+
} || function(i, s) {
|
|
2064
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
2065
|
+
}, e(t, n);
|
|
2066
|
+
};
|
|
2067
|
+
return function(t, n) {
|
|
2068
|
+
e(t, n);
|
|
2069
|
+
function i() {
|
|
2070
|
+
this.constructor = t;
|
|
2071
|
+
}
|
|
2072
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
2073
|
+
};
|
|
2074
|
+
})(), V = function(e, t, n, i) {
|
|
2075
|
+
function s(u) {
|
|
2076
|
+
return u instanceof n ? u : new n(function(v) {
|
|
2077
|
+
v(u);
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
return new (n || (n = Promise))(function(u, v) {
|
|
2081
|
+
function P(ct) {
|
|
2082
|
+
try {
|
|
2083
|
+
L(i.next(ct));
|
|
2084
|
+
} catch (Nt) {
|
|
2085
|
+
v(Nt);
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
function z(ct) {
|
|
2089
|
+
try {
|
|
2090
|
+
L(i.throw(ct));
|
|
2091
|
+
} catch (Nt) {
|
|
2092
|
+
v(Nt);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
function L(ct) {
|
|
2096
|
+
ct.done ? u(ct.value) : s(ct.value).then(P, z);
|
|
2097
|
+
}
|
|
2098
|
+
L((i = i.apply(e, t || [])).next());
|
|
2099
|
+
});
|
|
2100
|
+
}, Q = function(e, t) {
|
|
2101
|
+
var n = { label: 0, sent: function() {
|
|
2102
|
+
if (u[0] & 1) throw u[1];
|
|
2103
|
+
return u[1];
|
|
2104
|
+
}, trys: [], ops: [] }, i, s, u, v;
|
|
2105
|
+
return v = { next: P(0), throw: P(1), return: P(2) }, typeof Symbol == "function" && (v[Symbol.iterator] = function() {
|
|
2106
|
+
return this;
|
|
2107
|
+
}), v;
|
|
2108
|
+
function P(L) {
|
|
2109
|
+
return function(ct) {
|
|
2110
|
+
return z([L, ct]);
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
function z(L) {
|
|
2114
|
+
if (i) throw new TypeError("Generator is already executing.");
|
|
2115
|
+
for (; n; ) try {
|
|
2116
|
+
if (i = 1, s && (u = L[0] & 2 ? s.return : L[0] ? s.throw || ((u = s.return) && u.call(s), 0) : s.next) && !(u = u.call(s, L[1])).done) return u;
|
|
2117
|
+
switch (s = 0, u && (L = [L[0] & 2, u.value]), L[0]) {
|
|
2118
|
+
case 0:
|
|
2119
|
+
case 1:
|
|
2120
|
+
u = L;
|
|
2121
|
+
break;
|
|
2122
|
+
case 4:
|
|
2123
|
+
return n.label++, { value: L[1], done: !1 };
|
|
2124
|
+
case 5:
|
|
2125
|
+
n.label++, s = L[1], L = [0];
|
|
2126
|
+
continue;
|
|
2127
|
+
case 7:
|
|
2128
|
+
L = n.ops.pop(), n.trys.pop();
|
|
2129
|
+
continue;
|
|
2130
|
+
default:
|
|
2131
|
+
if (u = n.trys, !(u = u.length > 0 && u[u.length - 1]) && (L[0] === 6 || L[0] === 2)) {
|
|
2132
|
+
n = 0;
|
|
2133
|
+
continue;
|
|
2134
|
+
}
|
|
2135
|
+
if (L[0] === 3 && (!u || L[1] > u[0] && L[1] < u[3])) {
|
|
2136
|
+
n.label = L[1];
|
|
2137
|
+
break;
|
|
2138
|
+
}
|
|
2139
|
+
if (L[0] === 6 && n.label < u[1]) {
|
|
2140
|
+
n.label = u[1], u = L;
|
|
2141
|
+
break;
|
|
2142
|
+
}
|
|
2143
|
+
if (u && n.label < u[2]) {
|
|
2144
|
+
n.label = u[2], n.ops.push(L);
|
|
2145
|
+
break;
|
|
2146
|
+
}
|
|
2147
|
+
u[2] && n.ops.pop(), n.trys.pop();
|
|
2148
|
+
continue;
|
|
2149
|
+
}
|
|
2150
|
+
L = t.call(e, n);
|
|
2151
|
+
} catch (ct) {
|
|
2152
|
+
L = [6, ct], s = 0;
|
|
2153
|
+
} finally {
|
|
2154
|
+
i = u = 0;
|
|
2155
|
+
}
|
|
2156
|
+
if (L[0] & 5) throw L[1];
|
|
2157
|
+
return { value: L[0] ? L[1] : void 0, done: !0 };
|
|
2158
|
+
}
|
|
2159
|
+
}, Z = (function(e) {
|
|
2160
|
+
D(t, e);
|
|
2161
|
+
function t(n, i) {
|
|
2162
|
+
var s = e.call(this, n, i) || this;
|
|
2163
|
+
return s.members = new w(), s;
|
|
2164
|
+
}
|
|
2165
|
+
return t.prototype.authorize = function(n, i) {
|
|
2166
|
+
var s = this;
|
|
2167
|
+
e.prototype.authorize.call(this, n, function(u, v) {
|
|
2168
|
+
return V(s, void 0, void 0, function() {
|
|
2169
|
+
var P, z;
|
|
2170
|
+
return Q(this, function(L) {
|
|
2171
|
+
switch (L.label) {
|
|
2172
|
+
case 0:
|
|
2173
|
+
return u ? [3, 3] : (v = v, v.channel_data == null ? [3, 1] : (P = JSON.parse(v.channel_data), this.members.setMyID(P.user_id), [3, 3]));
|
|
2174
|
+
case 1:
|
|
2175
|
+
return [4, this.pusher.user.signinDonePromise];
|
|
2176
|
+
case 2:
|
|
2177
|
+
if (L.sent(), this.pusher.user.user_data != null)
|
|
2178
|
+
this.members.setMyID(this.pusher.user.user_data.id);
|
|
2179
|
+
else
|
|
2180
|
+
return z = H.buildLogSuffix("authorizationEndpoint"), bt.error("Invalid auth response for channel '" + this.name + "', " + ("expected 'channel_data' field. " + z + ", ") + "or the user should be signed in."), i("Invalid auth response"), [2];
|
|
2181
|
+
L.label = 3;
|
|
2182
|
+
case 3:
|
|
2183
|
+
return i(u, v), [2];
|
|
2184
|
+
}
|
|
2185
|
+
});
|
|
2186
|
+
});
|
|
2187
|
+
});
|
|
2188
|
+
}, t.prototype.handleEvent = function(n) {
|
|
2189
|
+
var i = n.event;
|
|
2190
|
+
if (i.indexOf("pusher_internal:") === 0)
|
|
2191
|
+
this.handleInternalEvent(n);
|
|
2192
|
+
else {
|
|
2193
|
+
var s = n.data, u = {};
|
|
2194
|
+
n.user_id && (u.user_id = n.user_id), this.emit(i, s, u);
|
|
2195
|
+
}
|
|
2196
|
+
}, t.prototype.handleInternalEvent = function(n) {
|
|
2197
|
+
var i = n.event, s = n.data;
|
|
2198
|
+
switch (i) {
|
|
2199
|
+
case "pusher_internal:subscription_succeeded":
|
|
2200
|
+
this.handleSubscriptionSucceededEvent(n);
|
|
2201
|
+
break;
|
|
2202
|
+
case "pusher_internal:subscription_count":
|
|
2203
|
+
this.handleSubscriptionCountEvent(n);
|
|
2204
|
+
break;
|
|
2205
|
+
case "pusher_internal:member_added":
|
|
2206
|
+
var u = this.members.addMember(s);
|
|
2207
|
+
this.emit("pusher:member_added", u);
|
|
2208
|
+
break;
|
|
2209
|
+
case "pusher_internal:member_removed":
|
|
2210
|
+
var v = this.members.removeMember(s);
|
|
2211
|
+
v && this.emit("pusher:member_removed", v);
|
|
2212
|
+
break;
|
|
2213
|
+
}
|
|
2214
|
+
}, t.prototype.handleSubscriptionSucceededEvent = function(n) {
|
|
2215
|
+
this.subscriptionPending = !1, this.subscribed = !0, this.subscriptionCancelled ? this.pusher.unsubscribe(this.name) : (this.members.onSubscription(n.data), this.emit("pusher:subscription_succeeded", this.members));
|
|
2216
|
+
}, t.prototype.disconnect = function() {
|
|
2217
|
+
this.members.reset(), e.prototype.disconnect.call(this);
|
|
2218
|
+
}, t;
|
|
2219
|
+
})(g), h = Z, ot = pt(1), ft = pt(0), dt = /* @__PURE__ */ (function() {
|
|
2220
|
+
var e = function(t, n) {
|
|
2221
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
2222
|
+
i.__proto__ = s;
|
|
2223
|
+
} || function(i, s) {
|
|
2224
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
2225
|
+
}, e(t, n);
|
|
2226
|
+
};
|
|
2227
|
+
return function(t, n) {
|
|
2228
|
+
e(t, n);
|
|
2229
|
+
function i() {
|
|
2230
|
+
this.constructor = t;
|
|
2231
|
+
}
|
|
2232
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
2233
|
+
};
|
|
2234
|
+
})(), nt = (function(e) {
|
|
2235
|
+
dt(t, e);
|
|
2236
|
+
function t(n, i, s) {
|
|
2237
|
+
var u = e.call(this, n, i) || this;
|
|
2238
|
+
return u.key = null, u.nacl = s, u;
|
|
2239
|
+
}
|
|
2240
|
+
return t.prototype.authorize = function(n, i) {
|
|
2241
|
+
var s = this;
|
|
2242
|
+
e.prototype.authorize.call(this, n, function(u, v) {
|
|
2243
|
+
if (u) {
|
|
2244
|
+
i(u, v);
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
var P = v.shared_secret;
|
|
2248
|
+
if (!P) {
|
|
2249
|
+
i(new Error("No shared_secret key in auth payload for encrypted channel: " + s.name), null);
|
|
2250
|
+
return;
|
|
2251
|
+
}
|
|
2252
|
+
s.key = Object(ft.decode)(P), delete v.shared_secret, i(null, v);
|
|
2253
|
+
});
|
|
2254
|
+
}, t.prototype.trigger = function(n, i) {
|
|
2255
|
+
throw new Yt("Client events are not currently supported for encrypted channels");
|
|
2256
|
+
}, t.prototype.handleEvent = function(n) {
|
|
2257
|
+
var i = n.event, s = n.data;
|
|
2258
|
+
if (i.indexOf("pusher_internal:") === 0 || i.indexOf("pusher:") === 0) {
|
|
2259
|
+
e.prototype.handleEvent.call(this, n);
|
|
2260
|
+
return;
|
|
2261
|
+
}
|
|
2262
|
+
this.handleEncryptedEvent(i, s);
|
|
2263
|
+
}, t.prototype.handleEncryptedEvent = function(n, i) {
|
|
2264
|
+
var s = this;
|
|
2265
|
+
if (!this.key) {
|
|
2266
|
+
bt.debug("Received encrypted event before key has been retrieved from the authEndpoint");
|
|
2267
|
+
return;
|
|
2268
|
+
}
|
|
2269
|
+
if (!i.ciphertext || !i.nonce) {
|
|
2270
|
+
bt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + i);
|
|
2271
|
+
return;
|
|
2272
|
+
}
|
|
2273
|
+
var u = Object(ft.decode)(i.ciphertext);
|
|
2274
|
+
if (u.length < this.nacl.secretbox.overheadLength) {
|
|
2275
|
+
bt.error("Expected encrypted event ciphertext length to be " + this.nacl.secretbox.overheadLength + ", got: " + u.length);
|
|
2276
|
+
return;
|
|
2277
|
+
}
|
|
2278
|
+
var v = Object(ft.decode)(i.nonce);
|
|
2279
|
+
if (v.length < this.nacl.secretbox.nonceLength) {
|
|
2280
|
+
bt.error("Expected encrypted event nonce length to be " + this.nacl.secretbox.nonceLength + ", got: " + v.length);
|
|
2281
|
+
return;
|
|
2282
|
+
}
|
|
2283
|
+
var P = this.nacl.secretbox.open(u, v, this.key);
|
|
2284
|
+
if (P === null) {
|
|
2285
|
+
bt.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, function(z, L) {
|
|
2286
|
+
if (z) {
|
|
2287
|
+
bt.error("Failed to make a request to the authEndpoint: " + L + ". Unable to fetch new key, so dropping encrypted event");
|
|
2288
|
+
return;
|
|
2289
|
+
}
|
|
2290
|
+
if (P = s.nacl.secretbox.open(u, v, s.key), P === null) {
|
|
2291
|
+
bt.error("Failed to decrypt event with new key. Dropping encrypted event");
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
s.emit(n, s.getDataToEmit(P));
|
|
2295
|
+
});
|
|
2296
|
+
return;
|
|
2297
|
+
}
|
|
2298
|
+
this.emit(n, this.getDataToEmit(P));
|
|
2299
|
+
}, t.prototype.getDataToEmit = function(n) {
|
|
2300
|
+
var i = Object(ot.decode)(n);
|
|
2301
|
+
try {
|
|
2302
|
+
return JSON.parse(i);
|
|
2303
|
+
} catch {
|
|
2304
|
+
return i;
|
|
2305
|
+
}
|
|
2306
|
+
}, t;
|
|
2307
|
+
})(g), ut = nt, ht = /* @__PURE__ */ (function() {
|
|
2308
|
+
var e = function(t, n) {
|
|
2309
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
2310
|
+
i.__proto__ = s;
|
|
2311
|
+
} || function(i, s) {
|
|
2312
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
2313
|
+
}, e(t, n);
|
|
2314
|
+
};
|
|
2315
|
+
return function(t, n) {
|
|
2316
|
+
e(t, n);
|
|
2317
|
+
function i() {
|
|
2318
|
+
this.constructor = t;
|
|
2319
|
+
}
|
|
2320
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
2321
|
+
};
|
|
2322
|
+
})(), kt = (function(e) {
|
|
2323
|
+
ht(t, e);
|
|
2324
|
+
function t(n, i) {
|
|
2325
|
+
var s = e.call(this) || this;
|
|
2326
|
+
s.state = "initialized", s.connection = null, s.key = n, s.options = i, s.timeline = s.options.timeline, s.usingTLS = s.options.useTLS, s.errorCallbacks = s.buildErrorCallbacks(), s.connectionCallbacks = s.buildConnectionCallbacks(s.errorCallbacks), s.handshakeCallbacks = s.buildHandshakeCallbacks(s.errorCallbacks);
|
|
2327
|
+
var u = rt.getNetwork();
|
|
2328
|
+
return u.bind("online", function() {
|
|
2329
|
+
s.timeline.info({ netinfo: "online" }), (s.state === "connecting" || s.state === "unavailable") && s.retryIn(0);
|
|
2330
|
+
}), u.bind("offline", function() {
|
|
2331
|
+
s.timeline.info({ netinfo: "offline" }), s.connection && s.sendActivityCheck();
|
|
2332
|
+
}), s.updateStrategy(), s;
|
|
2333
|
+
}
|
|
2334
|
+
return t.prototype.connect = function() {
|
|
2335
|
+
if (!(this.connection || this.runner)) {
|
|
2336
|
+
if (!this.strategy.isSupported()) {
|
|
2337
|
+
this.updateState("failed");
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2340
|
+
this.updateState("connecting"), this.startConnecting(), this.setUnavailableTimer();
|
|
2341
|
+
}
|
|
2342
|
+
}, t.prototype.send = function(n) {
|
|
2343
|
+
return this.connection ? this.connection.send(n) : !1;
|
|
2344
|
+
}, t.prototype.send_event = function(n, i, s) {
|
|
2345
|
+
return this.connection ? this.connection.send_event(n, i, s) : !1;
|
|
2346
|
+
}, t.prototype.disconnect = function() {
|
|
2347
|
+
this.disconnectInternally(), this.updateState("disconnected");
|
|
2348
|
+
}, t.prototype.isUsingTLS = function() {
|
|
2349
|
+
return this.usingTLS;
|
|
2350
|
+
}, t.prototype.startConnecting = function() {
|
|
2351
|
+
var n = this, i = function(s, u) {
|
|
2352
|
+
s ? n.runner = n.strategy.connect(0, i) : u.action === "error" ? (n.emit("error", {
|
|
2353
|
+
type: "HandshakeError",
|
|
2354
|
+
error: u.error
|
|
2355
|
+
}), n.timeline.error({ handshakeError: u.error })) : (n.abortConnecting(), n.handshakeCallbacks[u.action](u));
|
|
2356
|
+
};
|
|
2357
|
+
this.runner = this.strategy.connect(0, i);
|
|
2358
|
+
}, t.prototype.abortConnecting = function() {
|
|
2359
|
+
this.runner && (this.runner.abort(), this.runner = null);
|
|
2360
|
+
}, t.prototype.disconnectInternally = function() {
|
|
2361
|
+
if (this.abortConnecting(), this.clearRetryTimer(), this.clearUnavailableTimer(), this.connection) {
|
|
2362
|
+
var n = this.abandonConnection();
|
|
2363
|
+
n.close();
|
|
2364
|
+
}
|
|
2365
|
+
}, t.prototype.updateStrategy = function() {
|
|
2366
|
+
this.strategy = this.options.getStrategy({
|
|
2367
|
+
key: this.key,
|
|
2368
|
+
timeline: this.timeline,
|
|
2369
|
+
useTLS: this.usingTLS
|
|
2370
|
+
});
|
|
2371
|
+
}, t.prototype.retryIn = function(n) {
|
|
2372
|
+
var i = this;
|
|
2373
|
+
this.timeline.info({ action: "retry", delay: n }), n > 0 && this.emit("connecting_in", Math.round(n / 1e3)), this.retryTimer = new $t(n || 0, function() {
|
|
2374
|
+
i.disconnectInternally(), i.connect();
|
|
2375
|
+
});
|
|
2376
|
+
}, t.prototype.clearRetryTimer = function() {
|
|
2377
|
+
this.retryTimer && (this.retryTimer.ensureAborted(), this.retryTimer = null);
|
|
2378
|
+
}, t.prototype.setUnavailableTimer = function() {
|
|
2379
|
+
var n = this;
|
|
2380
|
+
this.unavailableTimer = new $t(this.options.unavailableTimeout, function() {
|
|
2381
|
+
n.updateState("unavailable");
|
|
2382
|
+
});
|
|
2383
|
+
}, t.prototype.clearUnavailableTimer = function() {
|
|
2384
|
+
this.unavailableTimer && this.unavailableTimer.ensureAborted();
|
|
2385
|
+
}, t.prototype.sendActivityCheck = function() {
|
|
2386
|
+
var n = this;
|
|
2387
|
+
this.stopActivityCheck(), this.connection.ping(), this.activityTimer = new $t(this.options.pongTimeout, function() {
|
|
2388
|
+
n.timeline.error({ pong_timed_out: n.options.pongTimeout }), n.retryIn(0);
|
|
2389
|
+
});
|
|
2390
|
+
}, t.prototype.resetActivityCheck = function() {
|
|
2391
|
+
var n = this;
|
|
2392
|
+
this.stopActivityCheck(), this.connection && !this.connection.handlesActivityChecks() && (this.activityTimer = new $t(this.activityTimeout, function() {
|
|
2393
|
+
n.sendActivityCheck();
|
|
2394
|
+
}));
|
|
2395
|
+
}, t.prototype.stopActivityCheck = function() {
|
|
2396
|
+
this.activityTimer && this.activityTimer.ensureAborted();
|
|
2397
|
+
}, t.prototype.buildConnectionCallbacks = function(n) {
|
|
2398
|
+
var i = this;
|
|
2399
|
+
return F({}, n, {
|
|
2400
|
+
message: function(s) {
|
|
2401
|
+
i.resetActivityCheck(), i.emit("message", s);
|
|
2402
|
+
},
|
|
2403
|
+
ping: function() {
|
|
2404
|
+
i.send_event("pusher:pong", {});
|
|
2405
|
+
},
|
|
2406
|
+
activity: function() {
|
|
2407
|
+
i.resetActivityCheck();
|
|
2408
|
+
},
|
|
2409
|
+
error: function(s) {
|
|
2410
|
+
i.emit("error", s);
|
|
2411
|
+
},
|
|
2412
|
+
closed: function() {
|
|
2413
|
+
i.abandonConnection(), i.shouldRetry() && i.retryIn(1e3);
|
|
2414
|
+
}
|
|
2415
|
+
});
|
|
2416
|
+
}, t.prototype.buildHandshakeCallbacks = function(n) {
|
|
2417
|
+
var i = this;
|
|
2418
|
+
return F({}, n, {
|
|
2419
|
+
connected: function(s) {
|
|
2420
|
+
i.activityTimeout = Math.min(i.options.activityTimeout, s.activityTimeout, s.connection.activityTimeout || 1 / 0), i.clearUnavailableTimer(), i.setConnection(s.connection), i.socket_id = i.connection.id, i.updateState("connected", { socket_id: i.socket_id });
|
|
2421
|
+
}
|
|
2422
|
+
});
|
|
2423
|
+
}, t.prototype.buildErrorCallbacks = function() {
|
|
2424
|
+
var n = this, i = function(s) {
|
|
2425
|
+
return function(u) {
|
|
2426
|
+
u.error && n.emit("error", { type: "WebSocketError", error: u.error }), s(u);
|
|
2427
|
+
};
|
|
2428
|
+
};
|
|
2429
|
+
return {
|
|
2430
|
+
tls_only: i(function() {
|
|
2431
|
+
n.usingTLS = !0, n.updateStrategy(), n.retryIn(0);
|
|
2432
|
+
}),
|
|
2433
|
+
refused: i(function() {
|
|
2434
|
+
n.disconnect();
|
|
2435
|
+
}),
|
|
2436
|
+
backoff: i(function() {
|
|
2437
|
+
n.retryIn(1e3);
|
|
2438
|
+
}),
|
|
2439
|
+
retry: i(function() {
|
|
2440
|
+
n.retryIn(0);
|
|
2441
|
+
})
|
|
2442
|
+
};
|
|
2443
|
+
}, t.prototype.setConnection = function(n) {
|
|
2444
|
+
this.connection = n;
|
|
2445
|
+
for (var i in this.connectionCallbacks)
|
|
2446
|
+
this.connection.bind(i, this.connectionCallbacks[i]);
|
|
2447
|
+
this.resetActivityCheck();
|
|
2448
|
+
}, t.prototype.abandonConnection = function() {
|
|
2449
|
+
if (this.connection) {
|
|
2450
|
+
this.stopActivityCheck();
|
|
2451
|
+
for (var n in this.connectionCallbacks)
|
|
2452
|
+
this.connection.unbind(n, this.connectionCallbacks[n]);
|
|
2453
|
+
var i = this.connection;
|
|
2454
|
+
return this.connection = null, i;
|
|
2455
|
+
}
|
|
2456
|
+
}, t.prototype.updateState = function(n, i) {
|
|
2457
|
+
var s = this.state;
|
|
2458
|
+
if (this.state = n, s !== n) {
|
|
2459
|
+
var u = n;
|
|
2460
|
+
u === "connected" && (u += " with new socket ID " + i.socket_id), bt.debug("State changed", s + " -> " + u), this.timeline.info({ state: n, params: i }), this.emit("state_change", { previous: s, current: n }), this.emit(n, i);
|
|
2461
|
+
}
|
|
2462
|
+
}, t.prototype.shouldRetry = function() {
|
|
2463
|
+
return this.state === "connecting" || this.state === "connected";
|
|
2464
|
+
}, t;
|
|
2465
|
+
})(Xt), gt = kt, At = (function() {
|
|
2466
|
+
function e() {
|
|
2467
|
+
this.channels = {};
|
|
2468
|
+
}
|
|
2469
|
+
return e.prototype.add = function(t, n) {
|
|
2470
|
+
return this.channels[t] || (this.channels[t] = Ot(t, n)), this.channels[t];
|
|
2471
|
+
}, e.prototype.all = function() {
|
|
2472
|
+
return ge(this.channels);
|
|
2473
|
+
}, e.prototype.find = function(t) {
|
|
2474
|
+
return this.channels[t];
|
|
2475
|
+
}, e.prototype.remove = function(t) {
|
|
2476
|
+
var n = this.channels[t];
|
|
2477
|
+
return delete this.channels[t], n;
|
|
2478
|
+
}, e.prototype.disconnect = function() {
|
|
2479
|
+
Ft(this.channels, function(t) {
|
|
2480
|
+
t.disconnect();
|
|
2481
|
+
});
|
|
2482
|
+
}, e;
|
|
2483
|
+
})(), Et = At;
|
|
2484
|
+
function Ot(e, t) {
|
|
2485
|
+
if (e.indexOf("private-encrypted-") === 0) {
|
|
2486
|
+
if (t.config.nacl)
|
|
2487
|
+
return Ct.createEncryptedChannel(e, t, t.config.nacl);
|
|
2488
|
+
var n = "Tried to subscribe to a private-encrypted- channel but no nacl implementation available", i = H.buildLogSuffix("encryptedChannelSupport");
|
|
2489
|
+
throw new Yt(n + ". " + i);
|
|
2490
|
+
} else {
|
|
2491
|
+
if (e.indexOf("private-") === 0)
|
|
2492
|
+
return Ct.createPrivateChannel(e, t);
|
|
2493
|
+
if (e.indexOf("presence-") === 0)
|
|
2494
|
+
return Ct.createPresenceChannel(e, t);
|
|
2495
|
+
if (e.indexOf("#") === 0)
|
|
2496
|
+
throw new B('Cannot create a channel with name "' + e + '".');
|
|
2497
|
+
return Ct.createChannel(e, t);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
var Rt = {
|
|
2501
|
+
createChannels: function() {
|
|
2502
|
+
return new Et();
|
|
2503
|
+
},
|
|
2504
|
+
createConnectionManager: function(e, t) {
|
|
2505
|
+
return new gt(e, t);
|
|
2506
|
+
},
|
|
2507
|
+
createChannel: function(e, t) {
|
|
2508
|
+
return new p(e, t);
|
|
2509
|
+
},
|
|
2510
|
+
createPrivateChannel: function(e, t) {
|
|
2511
|
+
return new g(e, t);
|
|
2512
|
+
},
|
|
2513
|
+
createPresenceChannel: function(e, t) {
|
|
2514
|
+
return new h(e, t);
|
|
2515
|
+
},
|
|
2516
|
+
createEncryptedChannel: function(e, t, n) {
|
|
2517
|
+
return new ut(e, t, n);
|
|
2518
|
+
},
|
|
2519
|
+
createTimelineSender: function(e, t) {
|
|
2520
|
+
return new j(e, t);
|
|
2521
|
+
},
|
|
2522
|
+
createHandshake: function(e, t) {
|
|
2523
|
+
return new M(e, t);
|
|
2524
|
+
},
|
|
2525
|
+
createAssistantToTheTransportManager: function(e, t, n) {
|
|
2526
|
+
return new J(e, t, n);
|
|
2527
|
+
}
|
|
2528
|
+
}, Ct = Rt, It = (function() {
|
|
2529
|
+
function e(t) {
|
|
2530
|
+
this.options = t || {}, this.livesLeft = this.options.lives || 1 / 0;
|
|
2531
|
+
}
|
|
2532
|
+
return e.prototype.getAssistant = function(t) {
|
|
2533
|
+
return Ct.createAssistantToTheTransportManager(this, t, {
|
|
2534
|
+
minPingDelay: this.options.minPingDelay,
|
|
2535
|
+
maxPingDelay: this.options.maxPingDelay
|
|
2536
|
+
});
|
|
2537
|
+
}, e.prototype.isAlive = function() {
|
|
2538
|
+
return this.livesLeft > 0;
|
|
2539
|
+
}, e.prototype.reportDeath = function() {
|
|
2540
|
+
this.livesLeft -= 1;
|
|
2541
|
+
}, e;
|
|
2542
|
+
})(), jt = It, Xn = (function() {
|
|
2543
|
+
function e(t, n) {
|
|
2544
|
+
this.strategies = t, this.loop = !!n.loop, this.failFast = !!n.failFast, this.timeout = n.timeout, this.timeoutLimit = n.timeoutLimit;
|
|
2545
|
+
}
|
|
2546
|
+
return e.prototype.isSupported = function() {
|
|
2547
|
+
return Re(this.strategies, mt.method("isSupported"));
|
|
2548
|
+
}, e.prototype.connect = function(t, n) {
|
|
2549
|
+
var i = this, s = this.strategies, u = 0, v = this.timeout, P = null, z = function(L, ct) {
|
|
2550
|
+
ct ? n(null, ct) : (u = u + 1, i.loop && (u = u % s.length), u < s.length ? (v && (v = v * 2, i.timeoutLimit && (v = Math.min(v, i.timeoutLimit))), P = i.tryStrategy(s[u], t, { timeout: v, failFast: i.failFast }, z)) : n(!0));
|
|
2551
|
+
};
|
|
2552
|
+
return P = this.tryStrategy(s[u], t, { timeout: v, failFast: this.failFast }, z), {
|
|
2553
|
+
abort: function() {
|
|
2554
|
+
P.abort();
|
|
2555
|
+
},
|
|
2556
|
+
forceMinPriority: function(L) {
|
|
2557
|
+
t = L, P && P.forceMinPriority(L);
|
|
2558
|
+
}
|
|
2559
|
+
};
|
|
2560
|
+
}, e.prototype.tryStrategy = function(t, n, i, s) {
|
|
2561
|
+
var u = null, v = null;
|
|
2562
|
+
return i.timeout > 0 && (u = new $t(i.timeout, function() {
|
|
2563
|
+
v.abort(), s(!0);
|
|
2564
|
+
})), v = t.connect(n, function(P, z) {
|
|
2565
|
+
P && u && u.isRunning() && !i.failFast || (u && u.ensureAborted(), s(P, z));
|
|
2566
|
+
}), {
|
|
2567
|
+
abort: function() {
|
|
2568
|
+
u && u.ensureAborted(), v.abort();
|
|
2569
|
+
},
|
|
2570
|
+
forceMinPriority: function(P) {
|
|
2571
|
+
v.forceMinPriority(P);
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2574
|
+
}, e;
|
|
2575
|
+
})(), xe = Xn, Wn = (function() {
|
|
2576
|
+
function e(t) {
|
|
2577
|
+
this.strategies = t;
|
|
2578
|
+
}
|
|
2579
|
+
return e.prototype.isSupported = function() {
|
|
2580
|
+
return Re(this.strategies, mt.method("isSupported"));
|
|
2581
|
+
}, e.prototype.connect = function(t, n) {
|
|
2582
|
+
return $n(this.strategies, t, function(i, s) {
|
|
2583
|
+
return function(u, v) {
|
|
2584
|
+
if (s[i].error = u, u) {
|
|
2585
|
+
Gn(s) && n(!0);
|
|
2586
|
+
return;
|
|
2587
|
+
}
|
|
2588
|
+
se(s, function(P) {
|
|
2589
|
+
P.forceMinPriority(v.transport.priority);
|
|
2590
|
+
}), n(null, v);
|
|
2591
|
+
};
|
|
2592
|
+
});
|
|
2593
|
+
}, e;
|
|
2594
|
+
})(), un = Wn;
|
|
2595
|
+
function $n(e, t, n) {
|
|
2596
|
+
var i = he(e, function(s, u, v, P) {
|
|
2597
|
+
return s.connect(t, n(u, P));
|
|
2598
|
+
});
|
|
2599
|
+
return {
|
|
2600
|
+
abort: function() {
|
|
2601
|
+
se(i, Kn);
|
|
2602
|
+
},
|
|
2603
|
+
forceMinPriority: function(s) {
|
|
2604
|
+
se(i, function(u) {
|
|
2605
|
+
u.forceMinPriority(s);
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
};
|
|
2609
|
+
}
|
|
2610
|
+
function Gn(e) {
|
|
2611
|
+
return Qe(e, function(t) {
|
|
2612
|
+
return !!t.error;
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
function Kn(e) {
|
|
2616
|
+
!e.error && !e.aborted && (e.abort(), e.aborted = !0);
|
|
2617
|
+
}
|
|
2618
|
+
var Vn = (function() {
|
|
2619
|
+
function e(t, n, i) {
|
|
2620
|
+
this.strategy = t, this.transports = n, this.ttl = i.ttl || 1800 * 1e3, this.usingTLS = i.useTLS, this.timeline = i.timeline;
|
|
2621
|
+
}
|
|
2622
|
+
return e.prototype.isSupported = function() {
|
|
2623
|
+
return this.strategy.isSupported();
|
|
2624
|
+
}, e.prototype.connect = function(t, n) {
|
|
2625
|
+
var i = this.usingTLS, s = Qn(i), u = [this.strategy];
|
|
2626
|
+
if (s && s.timestamp + this.ttl >= mt.now()) {
|
|
2627
|
+
var v = this.transports[s.transport];
|
|
2628
|
+
v && (this.timeline.info({
|
|
2629
|
+
cached: !0,
|
|
2630
|
+
transport: s.transport,
|
|
2631
|
+
latency: s.latency
|
|
2632
|
+
}), u.push(new xe([v], {
|
|
2633
|
+
timeout: s.latency * 2 + 1e3,
|
|
2634
|
+
failFast: !0
|
|
2635
|
+
})));
|
|
2636
|
+
}
|
|
2637
|
+
var P = mt.now(), z = u.pop().connect(t, function L(ct, Nt) {
|
|
2638
|
+
ct ? (Sn(i), u.length > 0 ? (P = mt.now(), z = u.pop().connect(t, L)) : n(ct)) : (tr(i, Nt.transport.name, mt.now() - P), n(null, Nt));
|
|
2639
|
+
});
|
|
2640
|
+
return {
|
|
2641
|
+
abort: function() {
|
|
2642
|
+
z.abort();
|
|
2643
|
+
},
|
|
2644
|
+
forceMinPriority: function(L) {
|
|
2645
|
+
t = L, z && z.forceMinPriority(L);
|
|
2646
|
+
}
|
|
2647
|
+
};
|
|
2648
|
+
}, e;
|
|
2649
|
+
})(), Zn = Vn;
|
|
2650
|
+
function hn(e) {
|
|
2651
|
+
return "pusherTransport" + (e ? "TLS" : "NonTLS");
|
|
2652
|
+
}
|
|
2653
|
+
function Qn(e) {
|
|
2654
|
+
var t = rt.getLocalStorage();
|
|
2655
|
+
if (t)
|
|
2656
|
+
try {
|
|
2657
|
+
var n = t[hn(e)];
|
|
2658
|
+
if (n)
|
|
2659
|
+
return JSON.parse(n);
|
|
2660
|
+
} catch {
|
|
2661
|
+
Sn(e);
|
|
2662
|
+
}
|
|
2663
|
+
return null;
|
|
2664
|
+
}
|
|
2665
|
+
function tr(e, t, n) {
|
|
2666
|
+
var i = rt.getLocalStorage();
|
|
2667
|
+
if (i)
|
|
2668
|
+
try {
|
|
2669
|
+
i[hn(e)] = ae({
|
|
2670
|
+
timestamp: mt.now(),
|
|
2671
|
+
transport: t,
|
|
2672
|
+
latency: n
|
|
2673
|
+
});
|
|
2674
|
+
} catch {
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
function Sn(e) {
|
|
2678
|
+
var t = rt.getLocalStorage();
|
|
2679
|
+
if (t)
|
|
2680
|
+
try {
|
|
2681
|
+
delete t[hn(e)];
|
|
2682
|
+
} catch {
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
var er = (function() {
|
|
2686
|
+
function e(t, n) {
|
|
2687
|
+
var i = n.delay;
|
|
2688
|
+
this.strategy = t, this.options = { delay: i };
|
|
2689
|
+
}
|
|
2690
|
+
return e.prototype.isSupported = function() {
|
|
2691
|
+
return this.strategy.isSupported();
|
|
2692
|
+
}, e.prototype.connect = function(t, n) {
|
|
2693
|
+
var i = this.strategy, s, u = new $t(this.options.delay, function() {
|
|
2694
|
+
s = i.connect(t, n);
|
|
2695
|
+
});
|
|
2696
|
+
return {
|
|
2697
|
+
abort: function() {
|
|
2698
|
+
u.ensureAborted(), s && s.abort();
|
|
2699
|
+
},
|
|
2700
|
+
forceMinPriority: function(v) {
|
|
2701
|
+
t = v, s && s.forceMinPriority(v);
|
|
2702
|
+
}
|
|
2703
|
+
};
|
|
2704
|
+
}, e;
|
|
2705
|
+
})(), on = er, nr = (function() {
|
|
2706
|
+
function e(t, n, i) {
|
|
2707
|
+
this.test = t, this.trueBranch = n, this.falseBranch = i;
|
|
2708
|
+
}
|
|
2709
|
+
return e.prototype.isSupported = function() {
|
|
2710
|
+
var t = this.test() ? this.trueBranch : this.falseBranch;
|
|
2711
|
+
return t.isSupported();
|
|
2712
|
+
}, e.prototype.connect = function(t, n) {
|
|
2713
|
+
var i = this.test() ? this.trueBranch : this.falseBranch;
|
|
2714
|
+
return i.connect(t, n);
|
|
2715
|
+
}, e;
|
|
2716
|
+
})(), qe = nr, rr = (function() {
|
|
2717
|
+
function e(t) {
|
|
2718
|
+
this.strategy = t;
|
|
2719
|
+
}
|
|
2720
|
+
return e.prototype.isSupported = function() {
|
|
2721
|
+
return this.strategy.isSupported();
|
|
2722
|
+
}, e.prototype.connect = function(t, n) {
|
|
2723
|
+
var i = this.strategy.connect(t, function(s, u) {
|
|
2724
|
+
u && i.abort(), n(s, u);
|
|
2725
|
+
});
|
|
2726
|
+
return i;
|
|
2727
|
+
}, e;
|
|
2728
|
+
})(), ir = rr;
|
|
2729
|
+
function Fe(e) {
|
|
2730
|
+
return function() {
|
|
2731
|
+
return e.isSupported();
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
var or = function(e, t, n) {
|
|
2735
|
+
var i = {};
|
|
2736
|
+
function s(In, xi, vi, yi, gi) {
|
|
2737
|
+
var Mn = n(e, In, xi, vi, yi, gi);
|
|
2738
|
+
return i[In] = Mn, Mn;
|
|
2739
|
+
}
|
|
2740
|
+
var u = Object.assign({}, t, {
|
|
2741
|
+
hostNonTLS: e.wsHost + ":" + e.wsPort,
|
|
2742
|
+
hostTLS: e.wsHost + ":" + e.wssPort,
|
|
2743
|
+
httpPath: e.wsPath
|
|
2744
|
+
}), v = Object.assign({}, u, {
|
|
2745
|
+
useTLS: !0
|
|
2746
|
+
}), P = Object.assign({}, t, {
|
|
2747
|
+
hostNonTLS: e.httpHost + ":" + e.httpPort,
|
|
2748
|
+
hostTLS: e.httpHost + ":" + e.httpsPort,
|
|
2749
|
+
httpPath: e.httpPath
|
|
2750
|
+
}), z = {
|
|
2751
|
+
loop: !0,
|
|
2752
|
+
timeout: 15e3,
|
|
2753
|
+
timeoutLimit: 6e4
|
|
2754
|
+
}, L = new jt({
|
|
2755
|
+
lives: 2,
|
|
2756
|
+
minPingDelay: 1e4,
|
|
2757
|
+
maxPingDelay: e.activityTimeout
|
|
2758
|
+
}), ct = new jt({
|
|
2759
|
+
lives: 2,
|
|
2760
|
+
minPingDelay: 1e4,
|
|
2761
|
+
maxPingDelay: e.activityTimeout
|
|
2762
|
+
}), Nt = s("ws", "ws", 3, u, L), Vt = s("wss", "ws", 3, v, L), ui = s("sockjs", "sockjs", 1, P), kn = s("xhr_streaming", "xhr_streaming", 1, P, ct), hi = s("xdr_streaming", "xdr_streaming", 1, P, ct), Ln = s("xhr_polling", "xhr_polling", 1, P), li = s("xdr_polling", "xdr_polling", 1, P), Rn = new xe([Nt], z), di = new xe([Vt], z), pi = new xe([ui], z), Nn = new xe([
|
|
2763
|
+
new qe(Fe(kn), kn, hi)
|
|
2764
|
+
], z), jn = new xe([
|
|
2765
|
+
new qe(Fe(Ln), Ln, li)
|
|
2766
|
+
], z), Un = new xe([
|
|
2767
|
+
new qe(Fe(Nn), new un([
|
|
2768
|
+
Nn,
|
|
2769
|
+
new on(jn, { delay: 4e3 })
|
|
2770
|
+
]), jn)
|
|
2771
|
+
], z), pn = new qe(Fe(Un), Un, pi), xn;
|
|
2772
|
+
return t.useTLS ? xn = new un([
|
|
2773
|
+
Rn,
|
|
2774
|
+
new on(pn, { delay: 2e3 })
|
|
2775
|
+
]) : xn = new un([
|
|
2776
|
+
Rn,
|
|
2777
|
+
new on(di, { delay: 2e3 }),
|
|
2778
|
+
new on(pn, { delay: 5e3 })
|
|
2779
|
+
]), new Zn(new ir(new qe(Fe(Nt), xn, pn)), i, {
|
|
2780
|
+
ttl: 18e5,
|
|
2781
|
+
timeline: t.timeline,
|
|
2782
|
+
useTLS: t.useTLS
|
|
2783
|
+
});
|
|
2784
|
+
}, sr = or, ar = (function() {
|
|
2785
|
+
var e = this;
|
|
2786
|
+
e.timeline.info(e.buildTimelineMessage({
|
|
2787
|
+
transport: e.name + (e.options.useTLS ? "s" : "")
|
|
2788
|
+
})), e.hooks.isInitialized() ? e.changeState("initialized") : e.hooks.file ? (e.changeState("initializing"), st.load(e.hooks.file, { useTLS: e.options.useTLS }, function(t, n) {
|
|
2789
|
+
e.hooks.isInitialized() ? (e.changeState("initialized"), n(!0)) : (t && e.onError(t), e.onClose(), n(!1));
|
|
2790
|
+
})) : e.onClose();
|
|
2791
|
+
}), fr = {
|
|
2792
|
+
getRequest: function(e) {
|
|
2793
|
+
var t = new window.XDomainRequest();
|
|
2794
|
+
return t.ontimeout = function() {
|
|
2795
|
+
e.emit("error", new St()), e.close();
|
|
2796
|
+
}, t.onerror = function(n) {
|
|
2797
|
+
e.emit("error", n), e.close();
|
|
2798
|
+
}, t.onprogress = function() {
|
|
2799
|
+
t.responseText && t.responseText.length > 0 && e.onChunk(200, t.responseText);
|
|
2800
|
+
}, t.onload = function() {
|
|
2801
|
+
t.responseText && t.responseText.length > 0 && e.onChunk(200, t.responseText), e.emit("finished", 200), e.close();
|
|
2802
|
+
}, t;
|
|
2803
|
+
},
|
|
2804
|
+
abortRequest: function(e) {
|
|
2805
|
+
e.ontimeout = e.onerror = e.onprogress = e.onload = null, e.abort();
|
|
2806
|
+
}
|
|
2807
|
+
}, cr = fr, ur = /* @__PURE__ */ (function() {
|
|
2808
|
+
var e = function(t, n) {
|
|
2809
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
2810
|
+
i.__proto__ = s;
|
|
2811
|
+
} || function(i, s) {
|
|
2812
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
2813
|
+
}, e(t, n);
|
|
2814
|
+
};
|
|
2815
|
+
return function(t, n) {
|
|
2816
|
+
e(t, n);
|
|
2817
|
+
function i() {
|
|
2818
|
+
this.constructor = t;
|
|
2819
|
+
}
|
|
2820
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
2821
|
+
};
|
|
2822
|
+
})(), hr = 256 * 1024, lr = (function(e) {
|
|
2823
|
+
ur(t, e);
|
|
2824
|
+
function t(n, i, s) {
|
|
2825
|
+
var u = e.call(this) || this;
|
|
2826
|
+
return u.hooks = n, u.method = i, u.url = s, u;
|
|
2827
|
+
}
|
|
2828
|
+
return t.prototype.start = function(n) {
|
|
2829
|
+
var i = this;
|
|
2830
|
+
this.position = 0, this.xhr = this.hooks.getRequest(this), this.unloader = function() {
|
|
2831
|
+
i.close();
|
|
2832
|
+
}, rt.addUnloadListener(this.unloader), this.xhr.open(this.method, this.url, !0), this.xhr.setRequestHeader && this.xhr.setRequestHeader("Content-Type", "application/json"), this.xhr.send(n);
|
|
2833
|
+
}, t.prototype.close = function() {
|
|
2834
|
+
this.unloader && (rt.removeUnloadListener(this.unloader), this.unloader = null), this.xhr && (this.hooks.abortRequest(this.xhr), this.xhr = null);
|
|
2835
|
+
}, t.prototype.onChunk = function(n, i) {
|
|
2836
|
+
for (; ; ) {
|
|
2837
|
+
var s = this.advanceBuffer(i);
|
|
2838
|
+
if (s)
|
|
2839
|
+
this.emit("chunk", { status: n, data: s });
|
|
2840
|
+
else
|
|
2841
|
+
break;
|
|
2842
|
+
}
|
|
2843
|
+
this.isBufferTooLong(i) && this.emit("buffer_too_long");
|
|
2844
|
+
}, t.prototype.advanceBuffer = function(n) {
|
|
2845
|
+
var i = n.slice(this.position), s = i.indexOf(`
|
|
2846
|
+
`);
|
|
2847
|
+
return s !== -1 ? (this.position += s + 1, i.slice(0, s)) : null;
|
|
2848
|
+
}, t.prototype.isBufferTooLong = function(n) {
|
|
2849
|
+
return this.position === n.length && n.length > hr;
|
|
2850
|
+
}, t;
|
|
2851
|
+
})(Xt), dr = lr, ln;
|
|
2852
|
+
(function(e) {
|
|
2853
|
+
e[e.CONNECTING = 0] = "CONNECTING", e[e.OPEN = 1] = "OPEN", e[e.CLOSED = 3] = "CLOSED";
|
|
2854
|
+
})(ln || (ln = {}));
|
|
2855
|
+
var ve = ln, pr = 1, xr = (function() {
|
|
2856
|
+
function e(t, n) {
|
|
2857
|
+
this.hooks = t, this.session = Tn(1e3) + "/" + _r(8), this.location = vr(n), this.readyState = ve.CONNECTING, this.openStream();
|
|
2858
|
+
}
|
|
2859
|
+
return e.prototype.send = function(t) {
|
|
2860
|
+
return this.sendRaw(JSON.stringify([t]));
|
|
2861
|
+
}, e.prototype.ping = function() {
|
|
2862
|
+
this.hooks.sendHeartbeat(this);
|
|
2863
|
+
}, e.prototype.close = function(t, n) {
|
|
2864
|
+
this.onClose(t, n, !0);
|
|
2865
|
+
}, e.prototype.sendRaw = function(t) {
|
|
2866
|
+
if (this.readyState === ve.OPEN)
|
|
2867
|
+
try {
|
|
2868
|
+
return rt.createSocketRequest("POST", Cn(yr(this.location, this.session))).start(t), !0;
|
|
2869
|
+
} catch {
|
|
2870
|
+
return !1;
|
|
2871
|
+
}
|
|
2872
|
+
else
|
|
2873
|
+
return !1;
|
|
2874
|
+
}, e.prototype.reconnect = function() {
|
|
2875
|
+
this.closeStream(), this.openStream();
|
|
2876
|
+
}, e.prototype.onClose = function(t, n, i) {
|
|
2877
|
+
this.closeStream(), this.readyState = ve.CLOSED, this.onclose && this.onclose({
|
|
2878
|
+
code: t,
|
|
2879
|
+
reason: n,
|
|
2880
|
+
wasClean: i
|
|
2881
|
+
});
|
|
2882
|
+
}, e.prototype.onChunk = function(t) {
|
|
2883
|
+
if (t.status === 200) {
|
|
2884
|
+
this.readyState === ve.OPEN && this.onActivity();
|
|
2885
|
+
var n, i = t.data.slice(0, 1);
|
|
2886
|
+
switch (i) {
|
|
2887
|
+
case "o":
|
|
2888
|
+
n = JSON.parse(t.data.slice(1) || "{}"), this.onOpen(n);
|
|
2889
|
+
break;
|
|
2890
|
+
case "a":
|
|
2891
|
+
n = JSON.parse(t.data.slice(1) || "[]");
|
|
2892
|
+
for (var s = 0; s < n.length; s++)
|
|
2893
|
+
this.onEvent(n[s]);
|
|
2894
|
+
break;
|
|
2895
|
+
case "m":
|
|
2896
|
+
n = JSON.parse(t.data.slice(1) || "null"), this.onEvent(n);
|
|
2897
|
+
break;
|
|
2898
|
+
case "h":
|
|
2899
|
+
this.hooks.onHeartbeat(this);
|
|
2900
|
+
break;
|
|
2901
|
+
case "c":
|
|
2902
|
+
n = JSON.parse(t.data.slice(1) || "[]"), this.onClose(n[0], n[1], !0);
|
|
2903
|
+
break;
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
}, e.prototype.onOpen = function(t) {
|
|
2907
|
+
this.readyState === ve.CONNECTING ? (t && t.hostname && (this.location.base = gr(this.location.base, t.hostname)), this.readyState = ve.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
|
|
2908
|
+
}, e.prototype.onEvent = function(t) {
|
|
2909
|
+
this.readyState === ve.OPEN && this.onmessage && this.onmessage({ data: t });
|
|
2910
|
+
}, e.prototype.onActivity = function() {
|
|
2911
|
+
this.onactivity && this.onactivity();
|
|
2912
|
+
}, e.prototype.onError = function(t) {
|
|
2913
|
+
this.onerror && this.onerror(t);
|
|
2914
|
+
}, e.prototype.openStream = function() {
|
|
2915
|
+
var t = this;
|
|
2916
|
+
this.stream = rt.createSocketRequest("POST", Cn(this.hooks.getReceiveURL(this.location, this.session))), this.stream.bind("chunk", function(n) {
|
|
2917
|
+
t.onChunk(n);
|
|
2918
|
+
}), this.stream.bind("finished", function(n) {
|
|
2919
|
+
t.hooks.onFinished(t, n);
|
|
2920
|
+
}), this.stream.bind("buffer_too_long", function() {
|
|
2921
|
+
t.reconnect();
|
|
2922
|
+
});
|
|
2923
|
+
try {
|
|
2924
|
+
this.stream.start();
|
|
2925
|
+
} catch (n) {
|
|
2926
|
+
mt.defer(function() {
|
|
2927
|
+
t.onError(n), t.onClose(1006, "Could not start streaming", !1);
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
}, e.prototype.closeStream = function() {
|
|
2931
|
+
this.stream && (this.stream.unbind_all(), this.stream.close(), this.stream = null);
|
|
2932
|
+
}, e;
|
|
2933
|
+
})();
|
|
2934
|
+
function vr(e) {
|
|
2935
|
+
var t = /([^\?]*)\/*(\??.*)/.exec(e);
|
|
2936
|
+
return {
|
|
2937
|
+
base: t[1],
|
|
2938
|
+
queryString: t[2]
|
|
2939
|
+
};
|
|
2940
|
+
}
|
|
2941
|
+
function yr(e, t) {
|
|
2942
|
+
return e.base + "/" + t + "/xhr_send";
|
|
2943
|
+
}
|
|
2944
|
+
function Cn(e) {
|
|
2945
|
+
var t = e.indexOf("?") === -1 ? "?" : "&";
|
|
2946
|
+
return e + t + "t=" + +/* @__PURE__ */ new Date() + "&n=" + pr++;
|
|
2947
|
+
}
|
|
2948
|
+
function gr(e, t) {
|
|
2949
|
+
var n = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e);
|
|
2950
|
+
return n[1] + t + n[3];
|
|
2951
|
+
}
|
|
2952
|
+
function Tn(e) {
|
|
2953
|
+
return rt.randomInt(e);
|
|
2954
|
+
}
|
|
2955
|
+
function _r(e) {
|
|
2956
|
+
for (var t = [], n = 0; n < e; n++)
|
|
2957
|
+
t.push(Tn(32).toString(32));
|
|
2958
|
+
return t.join("");
|
|
2959
|
+
}
|
|
2960
|
+
var br = xr, mr = {
|
|
2961
|
+
getReceiveURL: function(e, t) {
|
|
2962
|
+
return e.base + "/" + t + "/xhr_streaming" + e.queryString;
|
|
2963
|
+
},
|
|
2964
|
+
onHeartbeat: function(e) {
|
|
2965
|
+
e.sendRaw("[]");
|
|
2966
|
+
},
|
|
2967
|
+
sendHeartbeat: function(e) {
|
|
2968
|
+
e.sendRaw("[]");
|
|
2969
|
+
},
|
|
2970
|
+
onFinished: function(e, t) {
|
|
2971
|
+
e.onClose(1006, "Connection interrupted (" + t + ")", !1);
|
|
2972
|
+
}
|
|
2973
|
+
}, wr = mr, Sr = {
|
|
2974
|
+
getReceiveURL: function(e, t) {
|
|
2975
|
+
return e.base + "/" + t + "/xhr" + e.queryString;
|
|
2976
|
+
},
|
|
2977
|
+
onHeartbeat: function() {
|
|
2978
|
+
},
|
|
2979
|
+
sendHeartbeat: function(e) {
|
|
2980
|
+
e.sendRaw("[]");
|
|
2981
|
+
},
|
|
2982
|
+
onFinished: function(e, t) {
|
|
2983
|
+
t === 200 ? e.reconnect() : e.onClose(1006, "Connection interrupted (" + t + ")", !1);
|
|
2984
|
+
}
|
|
2985
|
+
}, Cr = Sr, Tr = {
|
|
2986
|
+
getRequest: function(e) {
|
|
2987
|
+
var t = rt.getXHRAPI(), n = new t();
|
|
2988
|
+
return n.onreadystatechange = n.onprogress = function() {
|
|
2989
|
+
switch (n.readyState) {
|
|
2990
|
+
case 3:
|
|
2991
|
+
n.responseText && n.responseText.length > 0 && e.onChunk(n.status, n.responseText);
|
|
2992
|
+
break;
|
|
2993
|
+
case 4:
|
|
2994
|
+
n.responseText && n.responseText.length > 0 && e.onChunk(n.status, n.responseText), e.emit("finished", n.status), e.close();
|
|
2995
|
+
break;
|
|
2996
|
+
}
|
|
2997
|
+
}, n;
|
|
2998
|
+
},
|
|
2999
|
+
abortRequest: function(e) {
|
|
3000
|
+
e.onreadystatechange = null, e.abort();
|
|
3001
|
+
}
|
|
3002
|
+
}, Pr = Tr, Ar = {
|
|
3003
|
+
createStreamingSocket: function(e) {
|
|
3004
|
+
return this.createSocket(wr, e);
|
|
3005
|
+
},
|
|
3006
|
+
createPollingSocket: function(e) {
|
|
3007
|
+
return this.createSocket(Cr, e);
|
|
3008
|
+
},
|
|
3009
|
+
createSocket: function(e, t) {
|
|
3010
|
+
return new br(e, t);
|
|
3011
|
+
},
|
|
3012
|
+
createXHR: function(e, t) {
|
|
3013
|
+
return this.createRequest(Pr, e, t);
|
|
3014
|
+
},
|
|
3015
|
+
createRequest: function(e, t, n) {
|
|
3016
|
+
return new dr(e, t, n);
|
|
3017
|
+
}
|
|
3018
|
+
}, Pn = Ar;
|
|
3019
|
+
Pn.createXDR = function(e, t) {
|
|
3020
|
+
return this.createRequest(cr, e, t);
|
|
3021
|
+
};
|
|
3022
|
+
var Er = Pn, Or = {
|
|
3023
|
+
nextAuthCallbackID: 1,
|
|
3024
|
+
auth_callbacks: {},
|
|
3025
|
+
ScriptReceivers: y,
|
|
3026
|
+
DependenciesReceivers: vt,
|
|
3027
|
+
getDefaultStrategy: sr,
|
|
3028
|
+
Transports: I,
|
|
3029
|
+
transportConnectionInitializer: ar,
|
|
3030
|
+
HTTPFactory: Er,
|
|
3031
|
+
TimelineTransport: me,
|
|
3032
|
+
getXHRAPI: function() {
|
|
3033
|
+
return window.XMLHttpRequest;
|
|
3034
|
+
},
|
|
3035
|
+
getWebSocketAPI: function() {
|
|
3036
|
+
return window.WebSocket || window.MozWebSocket;
|
|
3037
|
+
},
|
|
3038
|
+
setup: function(e) {
|
|
3039
|
+
var t = this;
|
|
3040
|
+
window.Pusher = e;
|
|
3041
|
+
var n = function() {
|
|
3042
|
+
t.onDocumentBody(e.ready);
|
|
3043
|
+
};
|
|
3044
|
+
window.JSON ? n() : st.load("json2", {}, n);
|
|
3045
|
+
},
|
|
3046
|
+
getDocument: function() {
|
|
3047
|
+
return document;
|
|
3048
|
+
},
|
|
3049
|
+
getProtocol: function() {
|
|
3050
|
+
return this.getDocument().location.protocol;
|
|
3051
|
+
},
|
|
3052
|
+
getAuthorizers: function() {
|
|
3053
|
+
return { ajax: Xe, jsonp: be };
|
|
3054
|
+
},
|
|
3055
|
+
onDocumentBody: function(e) {
|
|
3056
|
+
var t = this;
|
|
3057
|
+
document.body ? e() : setTimeout(function() {
|
|
3058
|
+
t.onDocumentBody(e);
|
|
3059
|
+
}, 0);
|
|
3060
|
+
},
|
|
3061
|
+
createJSONPRequest: function(e, t) {
|
|
3062
|
+
return new fn(e, t);
|
|
3063
|
+
},
|
|
3064
|
+
createScriptRequest: function(e) {
|
|
3065
|
+
return new Ie(e);
|
|
3066
|
+
},
|
|
3067
|
+
getLocalStorage: function() {
|
|
3068
|
+
try {
|
|
3069
|
+
return window.localStorage;
|
|
3070
|
+
} catch {
|
|
3071
|
+
return;
|
|
3072
|
+
}
|
|
3073
|
+
},
|
|
3074
|
+
createXHR: function() {
|
|
3075
|
+
return this.getXHRAPI() ? this.createXMLHttpRequest() : this.createMicrosoftXHR();
|
|
3076
|
+
},
|
|
3077
|
+
createXMLHttpRequest: function() {
|
|
3078
|
+
var e = this.getXHRAPI();
|
|
3079
|
+
return new e();
|
|
3080
|
+
},
|
|
3081
|
+
createMicrosoftXHR: function() {
|
|
3082
|
+
return new ActiveXObject("Microsoft.XMLHTTP");
|
|
3083
|
+
},
|
|
3084
|
+
getNetwork: function() {
|
|
3085
|
+
return R;
|
|
3086
|
+
},
|
|
3087
|
+
createWebSocket: function(e) {
|
|
3088
|
+
var t = this.getWebSocketAPI();
|
|
3089
|
+
return new t(e);
|
|
3090
|
+
},
|
|
3091
|
+
createSocketRequest: function(e, t) {
|
|
3092
|
+
if (this.isXHRSupported())
|
|
3093
|
+
return this.HTTPFactory.createXHR(e, t);
|
|
3094
|
+
if (this.isXDRSupported(t.indexOf("https:") === 0))
|
|
3095
|
+
return this.HTTPFactory.createXDR(e, t);
|
|
3096
|
+
throw "Cross-origin HTTP requests are not supported";
|
|
3097
|
+
},
|
|
3098
|
+
isXHRSupported: function() {
|
|
3099
|
+
var e = this.getXHRAPI();
|
|
3100
|
+
return !!e && new e().withCredentials !== void 0;
|
|
3101
|
+
},
|
|
3102
|
+
isXDRSupported: function(e) {
|
|
3103
|
+
var t = e ? "https:" : "http:", n = this.getProtocol();
|
|
3104
|
+
return !!window.XDomainRequest && n === t;
|
|
3105
|
+
},
|
|
3106
|
+
addUnloadListener: function(e) {
|
|
3107
|
+
window.addEventListener !== void 0 ? window.addEventListener("unload", e, !1) : window.attachEvent !== void 0 && window.attachEvent("onunload", e);
|
|
3108
|
+
},
|
|
3109
|
+
removeUnloadListener: function(e) {
|
|
3110
|
+
window.addEventListener !== void 0 ? window.removeEventListener("unload", e, !1) : window.detachEvent !== void 0 && window.detachEvent("onunload", e);
|
|
3111
|
+
},
|
|
3112
|
+
randomInt: function(e) {
|
|
3113
|
+
var t = function() {
|
|
3114
|
+
var n = window.crypto || window.msCrypto, i = n.getRandomValues(new Uint32Array(1))[0];
|
|
3115
|
+
return i / Math.pow(2, 32);
|
|
3116
|
+
};
|
|
3117
|
+
return Math.floor(t() * e);
|
|
3118
|
+
}
|
|
3119
|
+
}, rt = Or, dn;
|
|
3120
|
+
(function(e) {
|
|
3121
|
+
e[e.ERROR = 3] = "ERROR", e[e.INFO = 6] = "INFO", e[e.DEBUG = 7] = "DEBUG";
|
|
3122
|
+
})(dn || (dn = {}));
|
|
3123
|
+
var sn = dn, kr = (function() {
|
|
3124
|
+
function e(t, n, i) {
|
|
3125
|
+
this.key = t, this.session = n, this.events = [], this.options = i || {}, this.sent = 0, this.uniqueID = 0;
|
|
3126
|
+
}
|
|
3127
|
+
return e.prototype.log = function(t, n) {
|
|
3128
|
+
t <= this.options.level && (this.events.push(F({}, n, { timestamp: mt.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
|
|
3129
|
+
}, e.prototype.error = function(t) {
|
|
3130
|
+
this.log(sn.ERROR, t);
|
|
3131
|
+
}, e.prototype.info = function(t) {
|
|
3132
|
+
this.log(sn.INFO, t);
|
|
3133
|
+
}, e.prototype.debug = function(t) {
|
|
3134
|
+
this.log(sn.DEBUG, t);
|
|
3135
|
+
}, e.prototype.isEmpty = function() {
|
|
3136
|
+
return this.events.length === 0;
|
|
3137
|
+
}, e.prototype.send = function(t, n) {
|
|
3138
|
+
var i = this, s = F({
|
|
3139
|
+
session: this.session,
|
|
3140
|
+
bundle: this.sent + 1,
|
|
3141
|
+
key: this.key,
|
|
3142
|
+
lib: "js",
|
|
3143
|
+
version: this.options.version,
|
|
3144
|
+
cluster: this.options.cluster,
|
|
3145
|
+
features: this.options.features,
|
|
3146
|
+
timeline: this.events
|
|
3147
|
+
}, this.options.params);
|
|
3148
|
+
return this.events = [], t(s, function(u, v) {
|
|
3149
|
+
u || i.sent++, n && n(u, v);
|
|
3150
|
+
}), !0;
|
|
3151
|
+
}, e.prototype.generateUniqueID = function() {
|
|
3152
|
+
return this.uniqueID++, this.uniqueID;
|
|
3153
|
+
}, e;
|
|
3154
|
+
})(), Lr = kr, Rr = (function() {
|
|
3155
|
+
function e(t, n, i, s) {
|
|
3156
|
+
this.name = t, this.priority = n, this.transport = i, this.options = s || {};
|
|
3157
|
+
}
|
|
3158
|
+
return e.prototype.isSupported = function() {
|
|
3159
|
+
return this.transport.isSupported({
|
|
3160
|
+
useTLS: this.options.useTLS
|
|
3161
|
+
});
|
|
3162
|
+
}, e.prototype.connect = function(t, n) {
|
|
3163
|
+
var i = this;
|
|
3164
|
+
if (this.isSupported()) {
|
|
3165
|
+
if (this.priority < t)
|
|
3166
|
+
return An(new it(), n);
|
|
3167
|
+
} else return An(new Mt(), n);
|
|
3168
|
+
var s = !1, u = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), v = null, P = function() {
|
|
3169
|
+
u.unbind("initialized", P), u.connect();
|
|
3170
|
+
}, z = function() {
|
|
3171
|
+
v = Ct.createHandshake(u, function(Vt) {
|
|
3172
|
+
s = !0, Nt(), n(null, Vt);
|
|
3173
|
+
});
|
|
3174
|
+
}, L = function(Vt) {
|
|
3175
|
+
Nt(), n(Vt);
|
|
3176
|
+
}, ct = function() {
|
|
3177
|
+
Nt();
|
|
3178
|
+
var Vt;
|
|
3179
|
+
Vt = ae(u), n(new Ht(Vt));
|
|
3180
|
+
}, Nt = function() {
|
|
3181
|
+
u.unbind("initialized", P), u.unbind("open", z), u.unbind("error", L), u.unbind("closed", ct);
|
|
3182
|
+
};
|
|
3183
|
+
return u.bind("initialized", P), u.bind("open", z), u.bind("error", L), u.bind("closed", ct), u.initialize(), {
|
|
3184
|
+
abort: function() {
|
|
3185
|
+
s || (Nt(), v ? v.close() : u.close());
|
|
3186
|
+
},
|
|
3187
|
+
forceMinPriority: function(Vt) {
|
|
3188
|
+
s || i.priority < Vt && (v ? v.close() : u.close());
|
|
3189
|
+
}
|
|
3190
|
+
};
|
|
3191
|
+
}, e;
|
|
3192
|
+
})(), Nr = Rr;
|
|
3193
|
+
function An(e, t) {
|
|
3194
|
+
return mt.defer(function() {
|
|
3195
|
+
t(e);
|
|
3196
|
+
}), {
|
|
3197
|
+
abort: function() {
|
|
3198
|
+
},
|
|
3199
|
+
forceMinPriority: function() {
|
|
3200
|
+
}
|
|
3201
|
+
};
|
|
3202
|
+
}
|
|
3203
|
+
var jr = rt.Transports, Ur = function(e, t, n, i, s, u) {
|
|
3204
|
+
var v = jr[n];
|
|
3205
|
+
if (!v)
|
|
3206
|
+
throw new Dt(n);
|
|
3207
|
+
var P = (!e.enabledTransports || Le(e.enabledTransports, t) !== -1) && (!e.disabledTransports || Le(e.disabledTransports, t) === -1), z;
|
|
3208
|
+
return P ? (s = Object.assign({ ignoreNullOrigin: e.ignoreNullOrigin }, s), z = new Nr(t, i, u ? u.getAssistant(v) : v, s)) : z = Ir, z;
|
|
3209
|
+
}, Ir = {
|
|
3210
|
+
isSupported: function() {
|
|
3211
|
+
return !1;
|
|
3212
|
+
},
|
|
3213
|
+
connect: function(e, t) {
|
|
3214
|
+
var n = mt.defer(function() {
|
|
3215
|
+
t(new Mt());
|
|
3216
|
+
});
|
|
3217
|
+
return {
|
|
3218
|
+
abort: function() {
|
|
3219
|
+
n.ensureAborted();
|
|
3220
|
+
},
|
|
3221
|
+
forceMinPriority: function() {
|
|
3222
|
+
}
|
|
3223
|
+
};
|
|
3224
|
+
}
|
|
3225
|
+
}, Mr = function(e, t) {
|
|
3226
|
+
var n = "socket_id=" + encodeURIComponent(e.socketId);
|
|
3227
|
+
for (var i in t.params)
|
|
3228
|
+
n += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(t.params[i]);
|
|
3229
|
+
if (t.paramsProvider != null) {
|
|
3230
|
+
var s = t.paramsProvider();
|
|
3231
|
+
for (var i in s)
|
|
3232
|
+
n += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(s[i]);
|
|
3233
|
+
}
|
|
3234
|
+
return n;
|
|
3235
|
+
}, Br = function(e) {
|
|
3236
|
+
if (typeof rt.getAuthorizers()[e.transport] > "u")
|
|
3237
|
+
throw "'" + e.transport + "' is not a recognized auth transport";
|
|
3238
|
+
return function(t, n) {
|
|
3239
|
+
var i = Mr(t, e);
|
|
3240
|
+
rt.getAuthorizers()[e.transport](rt, i, e, T.UserAuthentication, n);
|
|
3241
|
+
};
|
|
3242
|
+
}, Dr = Br, zr = function(e, t) {
|
|
3243
|
+
var n = "socket_id=" + encodeURIComponent(e.socketId);
|
|
3244
|
+
n += "&channel_name=" + encodeURIComponent(e.channelName);
|
|
3245
|
+
for (var i in t.params)
|
|
3246
|
+
n += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(t.params[i]);
|
|
3247
|
+
if (t.paramsProvider != null) {
|
|
3248
|
+
var s = t.paramsProvider();
|
|
3249
|
+
for (var i in s)
|
|
3250
|
+
n += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(s[i]);
|
|
3251
|
+
}
|
|
3252
|
+
return n;
|
|
3253
|
+
}, Hr = function(e) {
|
|
3254
|
+
if (typeof rt.getAuthorizers()[e.transport] > "u")
|
|
3255
|
+
throw "'" + e.transport + "' is not a recognized auth transport";
|
|
3256
|
+
return function(t, n) {
|
|
3257
|
+
var i = zr(t, e);
|
|
3258
|
+
rt.getAuthorizers()[e.transport](rt, i, e, T.ChannelAuthorization, n);
|
|
3259
|
+
};
|
|
3260
|
+
}, qr = Hr, Fr = function(e, t, n) {
|
|
3261
|
+
var i = {
|
|
3262
|
+
authTransport: t.transport,
|
|
3263
|
+
authEndpoint: t.endpoint,
|
|
3264
|
+
auth: {
|
|
3265
|
+
params: t.params,
|
|
3266
|
+
headers: t.headers
|
|
3267
|
+
}
|
|
3268
|
+
};
|
|
3269
|
+
return function(s, u) {
|
|
3270
|
+
var v = e.channel(s.channelName), P = n(v, i);
|
|
3271
|
+
P.authorize(s.socketId, u);
|
|
3272
|
+
};
|
|
3273
|
+
}, Ce = function() {
|
|
3274
|
+
return Ce = Object.assign || function(e) {
|
|
3275
|
+
for (var t, n = 1, i = arguments.length; n < i; n++) {
|
|
3276
|
+
t = arguments[n];
|
|
3277
|
+
for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]);
|
|
3278
|
+
}
|
|
3279
|
+
return e;
|
|
3280
|
+
}, Ce.apply(this, arguments);
|
|
3281
|
+
};
|
|
3282
|
+
function Yr(e, t) {
|
|
3283
|
+
var n = {
|
|
3284
|
+
activityTimeout: e.activityTimeout || tt.activityTimeout,
|
|
3285
|
+
cluster: e.cluster || tt.cluster,
|
|
3286
|
+
httpPath: e.httpPath || tt.httpPath,
|
|
3287
|
+
httpPort: e.httpPort || tt.httpPort,
|
|
3288
|
+
httpsPort: e.httpsPort || tt.httpsPort,
|
|
3289
|
+
pongTimeout: e.pongTimeout || tt.pongTimeout,
|
|
3290
|
+
statsHost: e.statsHost || tt.stats_host,
|
|
3291
|
+
unavailableTimeout: e.unavailableTimeout || tt.unavailableTimeout,
|
|
3292
|
+
wsPath: e.wsPath || tt.wsPath,
|
|
3293
|
+
wsPort: e.wsPort || tt.wsPort,
|
|
3294
|
+
wssPort: e.wssPort || tt.wssPort,
|
|
3295
|
+
enableStats: $r(e),
|
|
3296
|
+
httpHost: Jr(e),
|
|
3297
|
+
useTLS: Wr(e),
|
|
3298
|
+
wsHost: Xr(e),
|
|
3299
|
+
userAuthenticator: Gr(e),
|
|
3300
|
+
channelAuthorizer: Vr(e, t)
|
|
3301
|
+
};
|
|
3302
|
+
return "disabledTransports" in e && (n.disabledTransports = e.disabledTransports), "enabledTransports" in e && (n.enabledTransports = e.enabledTransports), "ignoreNullOrigin" in e && (n.ignoreNullOrigin = e.ignoreNullOrigin), "timelineParams" in e && (n.timelineParams = e.timelineParams), "nacl" in e && (n.nacl = e.nacl), n;
|
|
3303
|
+
}
|
|
3304
|
+
function Jr(e) {
|
|
3305
|
+
return e.httpHost ? e.httpHost : e.cluster ? "sockjs-" + e.cluster + ".pusher.com" : tt.httpHost;
|
|
3306
|
+
}
|
|
3307
|
+
function Xr(e) {
|
|
3308
|
+
return e.wsHost ? e.wsHost : e.cluster ? En(e.cluster) : En(tt.cluster);
|
|
3309
|
+
}
|
|
3310
|
+
function En(e) {
|
|
3311
|
+
return "ws-" + e + ".pusher.com";
|
|
3312
|
+
}
|
|
3313
|
+
function Wr(e) {
|
|
3314
|
+
return rt.getProtocol() === "https:" ? !0 : e.forceTLS !== !1;
|
|
3315
|
+
}
|
|
3316
|
+
function $r(e) {
|
|
3317
|
+
return "enableStats" in e ? e.enableStats : "disableStats" in e ? !e.disableStats : !1;
|
|
3318
|
+
}
|
|
3319
|
+
function Gr(e) {
|
|
3320
|
+
var t = Ce(Ce({}, tt.userAuthentication), e.userAuthentication);
|
|
3321
|
+
return "customHandler" in t && t.customHandler != null ? t.customHandler : Dr(t);
|
|
3322
|
+
}
|
|
3323
|
+
function Kr(e, t) {
|
|
3324
|
+
var n;
|
|
3325
|
+
return "channelAuthorization" in e ? n = Ce(Ce({}, tt.channelAuthorization), e.channelAuthorization) : (n = {
|
|
3326
|
+
transport: e.authTransport || tt.authTransport,
|
|
3327
|
+
endpoint: e.authEndpoint || tt.authEndpoint
|
|
3328
|
+
}, "auth" in e && ("params" in e.auth && (n.params = e.auth.params), "headers" in e.auth && (n.headers = e.auth.headers)), "authorizer" in e && (n.customHandler = Fr(t, n, e.authorizer))), n;
|
|
3329
|
+
}
|
|
3330
|
+
function Vr(e, t) {
|
|
3331
|
+
var n = Kr(e, t);
|
|
3332
|
+
return "customHandler" in n && n.customHandler != null ? n.customHandler : qr(n);
|
|
3333
|
+
}
|
|
3334
|
+
var Zr = /* @__PURE__ */ (function() {
|
|
3335
|
+
var e = function(t, n) {
|
|
3336
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
3337
|
+
i.__proto__ = s;
|
|
3338
|
+
} || function(i, s) {
|
|
3339
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
3340
|
+
}, e(t, n);
|
|
3341
|
+
};
|
|
3342
|
+
return function(t, n) {
|
|
3343
|
+
e(t, n);
|
|
3344
|
+
function i() {
|
|
3345
|
+
this.constructor = t;
|
|
3346
|
+
}
|
|
3347
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
3348
|
+
};
|
|
3349
|
+
})(), Qr = (function(e) {
|
|
3350
|
+
Zr(t, e);
|
|
3351
|
+
function t(n) {
|
|
3352
|
+
var i = e.call(this, function(s, u) {
|
|
3353
|
+
bt.debug("No callbacks on watchlist events for " + s);
|
|
3354
|
+
}) || this;
|
|
3355
|
+
return i.pusher = n, i.bindWatchlistInternalEvent(), i;
|
|
3356
|
+
}
|
|
3357
|
+
return t.prototype.handleEvent = function(n) {
|
|
3358
|
+
var i = this;
|
|
3359
|
+
n.data.events.forEach(function(s) {
|
|
3360
|
+
i.emit(s.name, s);
|
|
3361
|
+
});
|
|
3362
|
+
}, t.prototype.bindWatchlistInternalEvent = function() {
|
|
3363
|
+
var n = this;
|
|
3364
|
+
this.pusher.connection.bind("message", function(i) {
|
|
3365
|
+
var s = i.event;
|
|
3366
|
+
s === "pusher_internal:watchlist_events" && n.handleEvent(i);
|
|
3367
|
+
});
|
|
3368
|
+
}, t;
|
|
3369
|
+
})(Xt), ti = Qr;
|
|
3370
|
+
function ei() {
|
|
3371
|
+
var e, t, n = new Promise(function(i, s) {
|
|
3372
|
+
e = i, t = s;
|
|
3373
|
+
});
|
|
3374
|
+
return { promise: n, resolve: e, reject: t };
|
|
3375
|
+
}
|
|
3376
|
+
var ni = ei, ri = /* @__PURE__ */ (function() {
|
|
3377
|
+
var e = function(t, n) {
|
|
3378
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
3379
|
+
i.__proto__ = s;
|
|
3380
|
+
} || function(i, s) {
|
|
3381
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
3382
|
+
}, e(t, n);
|
|
3383
|
+
};
|
|
3384
|
+
return function(t, n) {
|
|
3385
|
+
e(t, n);
|
|
3386
|
+
function i() {
|
|
3387
|
+
this.constructor = t;
|
|
3388
|
+
}
|
|
3389
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
3390
|
+
};
|
|
3391
|
+
})(), ii = (function(e) {
|
|
3392
|
+
ri(t, e);
|
|
3393
|
+
function t(n) {
|
|
3394
|
+
var i = e.call(this, function(s, u) {
|
|
3395
|
+
bt.debug("No callbacks on user for " + s);
|
|
3396
|
+
}) || this;
|
|
3397
|
+
return i.signin_requested = !1, i.user_data = null, i.serverToUserChannel = null, i.signinDonePromise = null, i._signinDoneResolve = null, i._onAuthorize = function(s, u) {
|
|
3398
|
+
if (s) {
|
|
3399
|
+
bt.warn("Error during signin: " + s), i._cleanup();
|
|
3400
|
+
return;
|
|
3401
|
+
}
|
|
3402
|
+
i.pusher.send_event("pusher:signin", {
|
|
3403
|
+
auth: u.auth,
|
|
3404
|
+
user_data: u.user_data
|
|
3405
|
+
});
|
|
3406
|
+
}, i.pusher = n, i.pusher.connection.bind("state_change", function(s) {
|
|
3407
|
+
var u = s.previous, v = s.current;
|
|
3408
|
+
u !== "connected" && v === "connected" && i._signin(), u === "connected" && v !== "connected" && (i._cleanup(), i._newSigninPromiseIfNeeded());
|
|
3409
|
+
}), i.watchlist = new ti(n), i.pusher.connection.bind("message", function(s) {
|
|
3410
|
+
var u = s.event;
|
|
3411
|
+
u === "pusher:signin_success" && i._onSigninSuccess(s.data), i.serverToUserChannel && i.serverToUserChannel.name === s.channel && i.serverToUserChannel.handleEvent(s);
|
|
3412
|
+
}), i;
|
|
3413
|
+
}
|
|
3414
|
+
return t.prototype.signin = function() {
|
|
3415
|
+
this.signin_requested || (this.signin_requested = !0, this._signin());
|
|
3416
|
+
}, t.prototype._signin = function() {
|
|
3417
|
+
this.signin_requested && (this._newSigninPromiseIfNeeded(), this.pusher.connection.state === "connected" && this.pusher.config.userAuthenticator({
|
|
3418
|
+
socketId: this.pusher.connection.socket_id
|
|
3419
|
+
}, this._onAuthorize));
|
|
3420
|
+
}, t.prototype._onSigninSuccess = function(n) {
|
|
3421
|
+
try {
|
|
3422
|
+
this.user_data = JSON.parse(n.user_data);
|
|
3423
|
+
} catch {
|
|
3424
|
+
bt.error("Failed parsing user data after signin: " + n.user_data), this._cleanup();
|
|
3425
|
+
return;
|
|
3426
|
+
}
|
|
3427
|
+
if (typeof this.user_data.id != "string" || this.user_data.id === "") {
|
|
3428
|
+
bt.error("user_data doesn't contain an id. user_data: " + this.user_data), this._cleanup();
|
|
3429
|
+
return;
|
|
3430
|
+
}
|
|
3431
|
+
this._signinDoneResolve(), this._subscribeChannels();
|
|
3432
|
+
}, t.prototype._subscribeChannels = function() {
|
|
3433
|
+
var n = this, i = function(s) {
|
|
3434
|
+
s.subscriptionPending && s.subscriptionCancelled ? s.reinstateSubscription() : !s.subscriptionPending && n.pusher.connection.state === "connected" && s.subscribe();
|
|
3435
|
+
};
|
|
3436
|
+
this.serverToUserChannel = new p("#server-to-user-" + this.user_data.id, this.pusher), this.serverToUserChannel.bind_global(function(s, u) {
|
|
3437
|
+
s.indexOf("pusher_internal:") === 0 || s.indexOf("pusher:") === 0 || n.emit(s, u);
|
|
3438
|
+
}), i(this.serverToUserChannel);
|
|
3439
|
+
}, t.prototype._cleanup = function() {
|
|
3440
|
+
this.user_data = null, this.serverToUserChannel && (this.serverToUserChannel.unbind_all(), this.serverToUserChannel.disconnect(), this.serverToUserChannel = null), this.signin_requested && this._signinDoneResolve();
|
|
3441
|
+
}, t.prototype._newSigninPromiseIfNeeded = function() {
|
|
3442
|
+
if (this.signin_requested && !(this.signinDonePromise && !this.signinDonePromise.done)) {
|
|
3443
|
+
var n = ni(), i = n.promise, s = n.resolve;
|
|
3444
|
+
i.done = !1;
|
|
3445
|
+
var u = function() {
|
|
3446
|
+
i.done = !0;
|
|
3447
|
+
};
|
|
3448
|
+
i.then(u).catch(u), this.signinDonePromise = i, this._signinDoneResolve = s;
|
|
3449
|
+
}
|
|
3450
|
+
}, t;
|
|
3451
|
+
})(Xt), oi = ii, On = (function() {
|
|
3452
|
+
function e(t, n) {
|
|
3453
|
+
var i = this;
|
|
3454
|
+
if (si(t), n = n || {}, !n.cluster && !(n.wsHost || n.httpHost)) {
|
|
3455
|
+
var s = H.buildLogSuffix("javascriptQuickStart");
|
|
3456
|
+
bt.warn("You should always specify a cluster when connecting. " + s);
|
|
3457
|
+
}
|
|
3458
|
+
"disableStats" in n && bt.warn("The disableStats option is deprecated in favor of enableStats"), this.key = t, this.config = Yr(n, this), this.channels = Ct.createChannels(), this.global_emitter = new Xt(), this.sessionID = rt.randomInt(1e9), this.timeline = new Lr(this.key, this.sessionID, {
|
|
3459
|
+
cluster: this.config.cluster,
|
|
3460
|
+
features: e.getClientFeatures(),
|
|
3461
|
+
params: this.config.timelineParams || {},
|
|
3462
|
+
limit: 50,
|
|
3463
|
+
level: sn.INFO,
|
|
3464
|
+
version: tt.VERSION
|
|
3465
|
+
}), this.config.enableStats && (this.timelineSender = Ct.createTimelineSender(this.timeline, {
|
|
3466
|
+
host: this.config.statsHost,
|
|
3467
|
+
path: "/timeline/v2/" + rt.TimelineTransport.name
|
|
3468
|
+
}));
|
|
3469
|
+
var u = function(v) {
|
|
3470
|
+
return rt.getDefaultStrategy(i.config, v, Ur);
|
|
3471
|
+
};
|
|
3472
|
+
this.connection = Ct.createConnectionManager(this.key, {
|
|
3473
|
+
getStrategy: u,
|
|
3474
|
+
timeline: this.timeline,
|
|
3475
|
+
activityTimeout: this.config.activityTimeout,
|
|
3476
|
+
pongTimeout: this.config.pongTimeout,
|
|
3477
|
+
unavailableTimeout: this.config.unavailableTimeout,
|
|
3478
|
+
useTLS: !!this.config.useTLS
|
|
3479
|
+
}), this.connection.bind("connected", function() {
|
|
3480
|
+
i.subscribeAll(), i.timelineSender && i.timelineSender.send(i.connection.isUsingTLS());
|
|
3481
|
+
}), this.connection.bind("message", function(v) {
|
|
3482
|
+
var P = v.event, z = P.indexOf("pusher_internal:") === 0;
|
|
3483
|
+
if (v.channel) {
|
|
3484
|
+
var L = i.channel(v.channel);
|
|
3485
|
+
L && L.handleEvent(v);
|
|
3486
|
+
}
|
|
3487
|
+
z || i.global_emitter.emit(v.event, v.data);
|
|
3488
|
+
}), this.connection.bind("connecting", function() {
|
|
3489
|
+
i.channels.disconnect();
|
|
3490
|
+
}), this.connection.bind("disconnected", function() {
|
|
3491
|
+
i.channels.disconnect();
|
|
3492
|
+
}), this.connection.bind("error", function(v) {
|
|
3493
|
+
bt.warn(v);
|
|
3494
|
+
}), e.instances.push(this), this.timeline.info({ instances: e.instances.length }), this.user = new oi(this), e.isReady && this.connect();
|
|
3495
|
+
}
|
|
3496
|
+
return e.ready = function() {
|
|
3497
|
+
e.isReady = !0;
|
|
3498
|
+
for (var t = 0, n = e.instances.length; t < n; t++)
|
|
3499
|
+
e.instances[t].connect();
|
|
3500
|
+
}, e.getClientFeatures = function() {
|
|
3501
|
+
return ue(Ze({ ws: rt.Transports.ws }, function(t) {
|
|
3502
|
+
return t.isSupported({});
|
|
3503
|
+
}));
|
|
3504
|
+
}, e.prototype.channel = function(t) {
|
|
3505
|
+
return this.channels.find(t);
|
|
3506
|
+
}, e.prototype.allChannels = function() {
|
|
3507
|
+
return this.channels.all();
|
|
3508
|
+
}, e.prototype.connect = function() {
|
|
3509
|
+
if (this.connection.connect(), this.timelineSender && !this.timelineSenderTimer) {
|
|
3510
|
+
var t = this.connection.isUsingTLS(), n = this.timelineSender;
|
|
3511
|
+
this.timelineSenderTimer = new ke(6e4, function() {
|
|
3512
|
+
n.send(t);
|
|
3513
|
+
});
|
|
3514
|
+
}
|
|
3515
|
+
}, e.prototype.disconnect = function() {
|
|
3516
|
+
this.connection.disconnect(), this.timelineSenderTimer && (this.timelineSenderTimer.ensureAborted(), this.timelineSenderTimer = null);
|
|
3517
|
+
}, e.prototype.bind = function(t, n, i) {
|
|
3518
|
+
return this.global_emitter.bind(t, n, i), this;
|
|
3519
|
+
}, e.prototype.unbind = function(t, n, i) {
|
|
3520
|
+
return this.global_emitter.unbind(t, n, i), this;
|
|
3521
|
+
}, e.prototype.bind_global = function(t) {
|
|
3522
|
+
return this.global_emitter.bind_global(t), this;
|
|
3523
|
+
}, e.prototype.unbind_global = function(t) {
|
|
3524
|
+
return this.global_emitter.unbind_global(t), this;
|
|
3525
|
+
}, e.prototype.unbind_all = function(t) {
|
|
3526
|
+
return this.global_emitter.unbind_all(), this;
|
|
3527
|
+
}, e.prototype.subscribeAll = function() {
|
|
3528
|
+
var t;
|
|
3529
|
+
for (t in this.channels.channels)
|
|
3530
|
+
this.channels.channels.hasOwnProperty(t) && this.subscribe(t);
|
|
3531
|
+
}, e.prototype.subscribe = function(t) {
|
|
3532
|
+
var n = this.channels.add(t, this);
|
|
3533
|
+
return n.subscriptionPending && n.subscriptionCancelled ? n.reinstateSubscription() : !n.subscriptionPending && this.connection.state === "connected" && n.subscribe(), n;
|
|
3534
|
+
}, e.prototype.unsubscribe = function(t) {
|
|
3535
|
+
var n = this.channels.find(t);
|
|
3536
|
+
n && n.subscriptionPending ? n.cancelSubscription() : (n = this.channels.remove(t), n && n.subscribed && n.unsubscribe());
|
|
3537
|
+
}, e.prototype.send_event = function(t, n, i) {
|
|
3538
|
+
return this.connection.send_event(t, n, i);
|
|
3539
|
+
}, e.prototype.shouldUseTLS = function() {
|
|
3540
|
+
return this.config.useTLS;
|
|
3541
|
+
}, e.prototype.signin = function() {
|
|
3542
|
+
this.user.signin();
|
|
3543
|
+
}, e.instances = [], e.isReady = !1, e.logToConsole = !1, e.Runtime = rt, e.ScriptReceivers = rt.ScriptReceivers, e.DependenciesReceivers = rt.DependenciesReceivers, e.auth_callbacks = rt.auth_callbacks, e;
|
|
3544
|
+
})(), Te = On;
|
|
3545
|
+
function si(e) {
|
|
3546
|
+
if (e == null)
|
|
3547
|
+
throw "You must pass your app key when you instantiate Pusher.";
|
|
3548
|
+
}
|
|
3549
|
+
rt.setup(On);
|
|
3550
|
+
var ai = pt(2), fi = /* @__PURE__ */ (function() {
|
|
3551
|
+
var e = function(t, n) {
|
|
3552
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) {
|
|
3553
|
+
i.__proto__ = s;
|
|
3554
|
+
} || function(i, s) {
|
|
3555
|
+
for (var u in s) s.hasOwnProperty(u) && (i[u] = s[u]);
|
|
3556
|
+
}, e(t, n);
|
|
3557
|
+
};
|
|
3558
|
+
return function(t, n) {
|
|
3559
|
+
e(t, n);
|
|
3560
|
+
function i() {
|
|
3561
|
+
this.constructor = t;
|
|
3562
|
+
}
|
|
3563
|
+
t.prototype = n === null ? Object.create(n) : (i.prototype = n.prototype, new i());
|
|
3564
|
+
};
|
|
3565
|
+
})(), ci = (function(e) {
|
|
3566
|
+
fi(t, e);
|
|
3567
|
+
function t(n, i) {
|
|
3568
|
+
var s = this;
|
|
3569
|
+
return Te.logToConsole = t.logToConsole, Te.log = t.log, i = i || {}, i.nacl = ai, s = e.call(this, n, i) || this, s;
|
|
3570
|
+
}
|
|
3571
|
+
return t;
|
|
3572
|
+
})(Te);
|
|
3573
|
+
at.default = ci;
|
|
3574
|
+
})
|
|
3575
|
+
/******/
|
|
3576
|
+
])
|
|
3577
|
+
);
|
|
3578
|
+
});
|
|
3579
|
+
})(_n)), _n.exports;
|
|
3580
|
+
}
|
|
3581
|
+
var bn, Yn;
|
|
3582
|
+
function Bi() {
|
|
3583
|
+
return Yn || (Yn = 1, bn = Mi()), bn;
|
|
3584
|
+
}
|
|
3585
|
+
var Di = Bi();
|
|
3586
|
+
const zi = /* @__PURE__ */ Ii(Di), wn = `${wi}/api/notification`, Hi = (wt) => mn.get(wn, { params: { ...wt } }), qi = (wt) => mn.put(`${wn}/${wt}`), Fi = () => mn.put(`${wn}/updateAllStatus`), Yi = {
|
|
3587
|
+
currentPage: 1,
|
|
3588
|
+
pageSize: 30,
|
|
3589
|
+
searchString: "",
|
|
3590
|
+
isRead: !1
|
|
3591
|
+
}, Ji = "Notification list", Jn = "NOTIFICATION_CHANNEL", Xi = "NEW_NOTIFICATION", Wi = () => {
|
|
3592
|
+
const wt = ki(), { roles: ie } = Li(), Lt = Pe((B) => B.common.user), at = Lt?.id, pt = Lt?.studentId, S = Pe(
|
|
3593
|
+
(B) => B.notification.notificationList
|
|
3594
|
+
), y = Pe((B) => B.common.user.pusherKey), Tt = Pe(
|
|
3595
|
+
(B) => B.common.user.pusherCluster
|
|
3596
|
+
), tt = Pe(
|
|
3597
|
+
(B) => B.notification.totalItems
|
|
3598
|
+
), yt = Pe(
|
|
3599
|
+
(B) => B.notification.unReadNotification
|
|
3600
|
+
), [xt, vt] = Hn(Yi), [st, et] = Hn(!1), _t = (B) => vt({
|
|
3601
|
+
...xt,
|
|
3602
|
+
...B
|
|
3603
|
+
}), H = (B) => {
|
|
3604
|
+
const { source: St, extraData: it } = B;
|
|
3605
|
+
switch (St) {
|
|
3606
|
+
case "AssessmentAssignment":
|
|
3607
|
+
window.open(`/player/diagnosticsurvey/${Number(it)}`);
|
|
3608
|
+
break;
|
|
3609
|
+
case "NewConferenceCreated":
|
|
3610
|
+
window.open(
|
|
3611
|
+
`/start-conference/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}/conferenceRubric`
|
|
3612
|
+
);
|
|
3613
|
+
break;
|
|
3614
|
+
case "Class Reflection":
|
|
3615
|
+
window.open(
|
|
3616
|
+
`/start-reflection/${it?.replace(/[\[\]]/g, "")?.split(",")?.[1]}`
|
|
3617
|
+
);
|
|
3618
|
+
break;
|
|
3619
|
+
case "Class Reflection Completed":
|
|
3620
|
+
window.open(
|
|
3621
|
+
`/result-reflection/${it?.replace(/[\[\]]/g, "")?.split(",")?.[1]}`
|
|
3622
|
+
);
|
|
3623
|
+
break;
|
|
3624
|
+
case "External Reflection Completed":
|
|
3625
|
+
window.open(
|
|
3626
|
+
`/result-reflection/${JSON.parse(it)?.[0]}/external`
|
|
3627
|
+
);
|
|
3628
|
+
break;
|
|
3629
|
+
case "NewSessionCreated":
|
|
3630
|
+
window.open(
|
|
3631
|
+
`/start-question/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`
|
|
3632
|
+
);
|
|
3633
|
+
break;
|
|
3634
|
+
case "NewSessionComplete":
|
|
3635
|
+
window.open(
|
|
3636
|
+
`/start-question/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`
|
|
3637
|
+
);
|
|
3638
|
+
break;
|
|
3639
|
+
case "ActionPointReminder":
|
|
3640
|
+
window.open(
|
|
3641
|
+
"/action-point/to-do"
|
|
3642
|
+
);
|
|
3643
|
+
break;
|
|
3644
|
+
case "SendNotiPLP":
|
|
3645
|
+
window.open(
|
|
3646
|
+
"/personal-learning-plan"
|
|
3647
|
+
);
|
|
3648
|
+
break;
|
|
3649
|
+
case "SendNotiGOAL":
|
|
3650
|
+
window.open(
|
|
3651
|
+
`/my-goals/${JSON.parse(it)}`
|
|
3652
|
+
);
|
|
3653
|
+
break;
|
|
3654
|
+
case "CertificateApproved":
|
|
3655
|
+
window.open("/dashboard/certification/2");
|
|
3656
|
+
break;
|
|
3657
|
+
case "RequestCheckIn":
|
|
3658
|
+
window.open(
|
|
3659
|
+
`/start-question/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`
|
|
3660
|
+
);
|
|
3661
|
+
case "NewSurveyCreated":
|
|
3662
|
+
pt && window.open(
|
|
3663
|
+
`/start-survey/${JSON.parse(it)?.[0]}/${pt}`
|
|
3664
|
+
);
|
|
3665
|
+
break;
|
|
3666
|
+
case "StudentCompletedSurvey":
|
|
3667
|
+
window.open(
|
|
3668
|
+
`/start-survey/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`
|
|
3669
|
+
);
|
|
3670
|
+
break;
|
|
3671
|
+
}
|
|
3672
|
+
}, T = gn(async () => {
|
|
3673
|
+
wt(Dn(!0));
|
|
3674
|
+
try {
|
|
3675
|
+
const B = await Hi({ ...xt, roles: ie?.trim() ? [ie] : Lt?.roles }), { items: St, totalItems: it } = B.data;
|
|
3676
|
+
wt(
|
|
3677
|
+
Si({
|
|
3678
|
+
notificationList: St,
|
|
3679
|
+
totalItems: it
|
|
3680
|
+
})
|
|
3681
|
+
);
|
|
3682
|
+
} catch (B) {
|
|
3683
|
+
wt(
|
|
3684
|
+
yn({
|
|
3685
|
+
type: "danger",
|
|
3686
|
+
message: B.response?.data?.title || B.message
|
|
3687
|
+
})
|
|
3688
|
+
);
|
|
3689
|
+
}
|
|
3690
|
+
wt(Dn(!1));
|
|
3691
|
+
}, [xt]);
|
|
3692
|
+
qn(() => {
|
|
3693
|
+
document.title = Ji;
|
|
3694
|
+
}, []), qn(() => {
|
|
3695
|
+
T();
|
|
3696
|
+
const B = new zi(y, { cluster: Tt });
|
|
3697
|
+
return B.subscribe(`${Jn}-${at}`).bind(Xi, T), () => B.unsubscribe(`${Jn}-${at}`);
|
|
3698
|
+
}, [xt, at]);
|
|
3699
|
+
const A = gn(
|
|
3700
|
+
(B, St) => {
|
|
3701
|
+
try {
|
|
3702
|
+
wt(
|
|
3703
|
+
zn({
|
|
3704
|
+
isOpen: !0,
|
|
3705
|
+
type: "warning",
|
|
3706
|
+
message: `Do you want to mark this notification ${St ? "read" : "unread"}?`,
|
|
3707
|
+
onConfirm: async () => {
|
|
3708
|
+
await qi(B), T();
|
|
3709
|
+
}
|
|
3710
|
+
})
|
|
3711
|
+
);
|
|
3712
|
+
} catch (it) {
|
|
3713
|
+
wt(
|
|
3714
|
+
yn({
|
|
3715
|
+
type: "danger",
|
|
3716
|
+
message: it.response?.data?.title || it.message
|
|
3717
|
+
})
|
|
3718
|
+
);
|
|
3719
|
+
}
|
|
3720
|
+
},
|
|
3721
|
+
[S, yt]
|
|
3722
|
+
), G = gn(async () => {
|
|
3723
|
+
try {
|
|
3724
|
+
if (S.length === 0) throw new Error("There are no unread messages");
|
|
3725
|
+
wt(
|
|
3726
|
+
zn({
|
|
3727
|
+
isOpen: !0,
|
|
3728
|
+
type: "warning",
|
|
3729
|
+
message: "Do you want to mark all notification ?",
|
|
3730
|
+
onConfirm: async () => {
|
|
3731
|
+
et(!0), await Fi(), T(), et(!1);
|
|
3732
|
+
}
|
|
3733
|
+
})
|
|
3734
|
+
);
|
|
3735
|
+
} catch (B) {
|
|
3736
|
+
wt(
|
|
3737
|
+
yn({
|
|
3738
|
+
type: "danger",
|
|
3739
|
+
message: B.response?.data?.title || B.message
|
|
3740
|
+
})
|
|
3741
|
+
);
|
|
3742
|
+
}
|
|
3743
|
+
}, [S]);
|
|
3744
|
+
return {
|
|
3745
|
+
notificationList: S,
|
|
3746
|
+
totalItems: tt,
|
|
3747
|
+
unReadNotification: yt,
|
|
3748
|
+
filters: xt,
|
|
3749
|
+
changeFilters: _t,
|
|
3750
|
+
updateNotification: A,
|
|
3751
|
+
viewNotification: H,
|
|
3752
|
+
updateAll: G,
|
|
3753
|
+
toggleUpdateAllStatus: st
|
|
3754
|
+
};
|
|
3755
|
+
}, $i = "Notification list", Gi = 20, io = () => {
|
|
3756
|
+
const {
|
|
3757
|
+
notificationList: wt,
|
|
3758
|
+
totalItems: ie,
|
|
3759
|
+
filters: Lt,
|
|
3760
|
+
changeFilters: at,
|
|
3761
|
+
updateNotification: pt,
|
|
3762
|
+
viewNotification: S,
|
|
3763
|
+
updateAll: y,
|
|
3764
|
+
toggleUpdateAllStatus: Tt
|
|
3765
|
+
} = Wi(), { t: tt } = Ri();
|
|
3766
|
+
return /* @__PURE__ */ ce("div", { className: "animated fadeIn", style: { padding: "56px" }, children: [
|
|
3767
|
+
/* @__PURE__ */ Pt("h5", { className: "mb-2", children: $i }),
|
|
3768
|
+
/* @__PURE__ */ ce(vn, { className: "my-2", children: [
|
|
3769
|
+
/* @__PURE__ */ Pt(Ye, { md: 8, children: /* @__PURE__ */ Pt(
|
|
3770
|
+
Ci,
|
|
3771
|
+
{
|
|
3772
|
+
initValue: Lt.searchString,
|
|
3773
|
+
onSearch: (yt) => at({
|
|
3774
|
+
searchString: yt
|
|
3775
|
+
}),
|
|
3776
|
+
placeholder: "Type something to search"
|
|
3777
|
+
}
|
|
3778
|
+
) }),
|
|
3779
|
+
/* @__PURE__ */ Pt(Ye, { md: 4, children: /* @__PURE__ */ Pt(
|
|
3780
|
+
Ui,
|
|
3781
|
+
{
|
|
3782
|
+
value: Lt.isRead,
|
|
3783
|
+
onChange: (yt) => at({ isRead: yt.value })
|
|
3784
|
+
}
|
|
3785
|
+
) })
|
|
3786
|
+
] }),
|
|
3787
|
+
/* @__PURE__ */ Pt(vn, { className: "my-2 d-flex justify-content-center", children: /* @__PURE__ */ ce(Ye, { md: 12, className: "d-flex justify-content-end align-items-center", children: [
|
|
3788
|
+
Lt.isRead === !1 && /* @__PURE__ */ ce("div", { className: "d-flex align-items-center justify-content-end mx-2", children: [
|
|
3789
|
+
"Mark all as read",
|
|
3790
|
+
/* @__PURE__ */ Pt(
|
|
3791
|
+
Bn,
|
|
3792
|
+
{
|
|
3793
|
+
checked: Tt,
|
|
3794
|
+
className: "mx-2",
|
|
3795
|
+
type: "checkbox",
|
|
3796
|
+
id: "status-checkbox",
|
|
3797
|
+
onChange: () => y()
|
|
3798
|
+
}
|
|
3799
|
+
)
|
|
3800
|
+
] }),
|
|
3801
|
+
"Total of notifications: ",
|
|
3802
|
+
ie
|
|
3803
|
+
] }) }),
|
|
3804
|
+
/* @__PURE__ */ ce(vn, { className: "mb-2", children: [
|
|
3805
|
+
/* @__PURE__ */ Pt(Ye, { md: 12, children: wt && wt.length > 0 ? /* @__PURE__ */ Pt("div", { children: /* @__PURE__ */ ce(_i, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
|
|
3806
|
+
/* @__PURE__ */ Pt("thead", { children: /* @__PURE__ */ ce("tr", { children: [
|
|
3807
|
+
/* @__PURE__ */ Pt("th", { className: "align-top", children: "Text" }),
|
|
3808
|
+
/* @__PURE__ */ Pt("th", { className: "align-top", children: "Time" }),
|
|
3809
|
+
/* @__PURE__ */ Pt("th", { className: "text-center", children: "Is read" }),
|
|
3810
|
+
/* @__PURE__ */ Pt("th", { className: "text-center", children: "Action" })
|
|
3811
|
+
] }) }),
|
|
3812
|
+
/* @__PURE__ */ Pt("tbody", { children: wt.map((yt) => /* @__PURE__ */ ce("tr", { children: [
|
|
3813
|
+
/* @__PURE__ */ Pt("td", { className: "align-middle", children: yt.text }),
|
|
3814
|
+
/* @__PURE__ */ Pt("td", { className: "align-middle", children: Ti(
|
|
3815
|
+
yt.time,
|
|
3816
|
+
"yyyy-MM-DD HH:mm"
|
|
3817
|
+
) }),
|
|
3818
|
+
/* @__PURE__ */ Pt(
|
|
3819
|
+
"td",
|
|
3820
|
+
{
|
|
3821
|
+
className: `${Pi["control-input"]} text-center align-middle`,
|
|
3822
|
+
children: /* @__PURE__ */ Pt(
|
|
3823
|
+
Bn,
|
|
3824
|
+
{
|
|
3825
|
+
type: "checkbox",
|
|
3826
|
+
id: `status-checkbox-${yt.id}`,
|
|
3827
|
+
checked: yt.isRead,
|
|
3828
|
+
onChange: () => pt(
|
|
3829
|
+
yt.id,
|
|
3830
|
+
!yt.isRead
|
|
3831
|
+
)
|
|
3832
|
+
}
|
|
3833
|
+
)
|
|
3834
|
+
}
|
|
3835
|
+
),
|
|
3836
|
+
/* @__PURE__ */ Pt("td", { className: "text-center align-middle", children: [
|
|
3837
|
+
"AssessmentAssignment",
|
|
3838
|
+
"NewConferenceCreated",
|
|
3839
|
+
"NewSessionCreated",
|
|
3840
|
+
"CertificateApproved",
|
|
3841
|
+
"Class Reflection",
|
|
3842
|
+
"NewSessionComplete",
|
|
3843
|
+
"ActionPointReminder",
|
|
3844
|
+
"SendNotiPLP",
|
|
3845
|
+
"SendNotiGOAL",
|
|
3846
|
+
"Class Reflection Completed",
|
|
3847
|
+
"External Reflection Completed",
|
|
3848
|
+
"RequestCheckIn",
|
|
3849
|
+
"NewSurveyCreated",
|
|
3850
|
+
"StudentCompletedSurvey"
|
|
3851
|
+
].includes(yt.source) && /* @__PURE__ */ Pt(
|
|
3852
|
+
bi,
|
|
3853
|
+
{
|
|
3854
|
+
className: "cursor-pointer",
|
|
3855
|
+
size: Gi,
|
|
3856
|
+
title: "Detail",
|
|
3857
|
+
onClick: () => S(
|
|
3858
|
+
yt
|
|
3859
|
+
)
|
|
3860
|
+
}
|
|
3861
|
+
) })
|
|
3862
|
+
] }, yt.id)) })
|
|
3863
|
+
] }) }) : /* @__PURE__ */ Pt(Ai, { label: tt("notification") }) }),
|
|
3864
|
+
/* @__PURE__ */ Pt(Ye, { md: 12, children: /* @__PURE__ */ Pt(
|
|
3865
|
+
Ei,
|
|
3866
|
+
{
|
|
3867
|
+
filters: Lt,
|
|
3868
|
+
totalRecordCount: ie,
|
|
3869
|
+
changePageSize: (yt) => at({ pageSize: yt }),
|
|
3870
|
+
changePage: (yt) => at({ currentPage: yt })
|
|
3871
|
+
}
|
|
3872
|
+
) })
|
|
3873
|
+
] })
|
|
3874
|
+
] });
|
|
3875
|
+
};
|
|
3876
|
+
export {
|
|
3877
|
+
io as default
|
|
3878
|
+
};
|