@clickview/lite 0.104.0-rc.0 → 0.104.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/.vite/manifest.json +686 -686
  2. package/dist/bundles.json +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{BYC-9gzd.chunk.js → 6BvA1WyF.chunk.js} +2 -2
  5. package/dist/scripts/{BYC-9gzd.chunk.js.map → 6BvA1WyF.chunk.js.map} +1 -1
  6. package/dist/scripts/B1hsuVfV2.chunk.js +2 -0
  7. package/dist/scripts/{BwBWuxjr2.chunk.js.map → B1hsuVfV2.chunk.js.map} +1 -1
  8. package/dist/scripts/{CFxoQ45v.chunk.js → B4GpjPP-.chunk.js} +2 -2
  9. package/dist/scripts/{CFxoQ45v.chunk.js.map → B4GpjPP-.chunk.js.map} +1 -1
  10. package/dist/scripts/{HyBCRhmv2.chunk.js → BAYtWmRb2.chunk.js} +3 -3
  11. package/dist/scripts/{HyBCRhmv2.chunk.js.map → BAYtWmRb2.chunk.js.map} +1 -1
  12. package/dist/scripts/{CVEuWE2q2.chunk.js → BBAIRd3r2.chunk.js} +2 -2
  13. package/dist/scripts/{CVEuWE2q2.chunk.js.map → BBAIRd3r2.chunk.js.map} +1 -1
  14. package/dist/scripts/{C2Hgija5.chunk.js → BGH3t983.chunk.js} +2 -2
  15. package/dist/scripts/{C2Hgija5.chunk.js.map → BGH3t983.chunk.js.map} +1 -1
  16. package/dist/scripts/{DsSd-eh2.chunk.js → BIjzNf4b.chunk.js} +2 -2
  17. package/dist/scripts/{DsSd-eh2.chunk.js.map → BIjzNf4b.chunk.js.map} +1 -1
  18. package/dist/scripts/{D20SeFH5.chunk.js → BLad2z5b.chunk.js} +2 -2
  19. package/dist/scripts/{D20SeFH5.chunk.js.map → BLad2z5b.chunk.js.map} +1 -1
  20. package/dist/scripts/{BklRyGO0.chunk.js → BMZNQKEe.chunk.js} +2 -2
  21. package/dist/scripts/{BklRyGO0.chunk.js.map → BMZNQKEe.chunk.js.map} +1 -1
  22. package/dist/scripts/{BOuzZEkK2.chunk.js → BPjqerK42.chunk.js} +2 -2
  23. package/dist/scripts/BPjqerK42.chunk.js.map +1 -0
  24. package/dist/scripts/{fjQ026Rz2.chunk.js → BQS6kDvJ2.chunk.js} +2 -2
  25. package/dist/scripts/{fjQ026Rz2.chunk.js.map → BQS6kDvJ2.chunk.js.map} +1 -1
  26. package/dist/scripts/{CnfcodVE2.chunk.js → BeOS0_E02.chunk.js} +2 -2
  27. package/dist/scripts/{CnfcodVE2.chunk.js.map → BeOS0_E02.chunk.js.map} +1 -1
  28. package/dist/scripts/{kz-JIHlB2.chunk.js → Bnyn-It62.chunk.js} +2 -2
  29. package/dist/scripts/{kz-JIHlB2.chunk.js.map → Bnyn-It62.chunk.js.map} +1 -1
  30. package/dist/scripts/{BbKY_Dwq.chunk.js → CJCh1Gq6.chunk.js} +2 -2
  31. package/dist/scripts/{BbKY_Dwq.chunk.js.map → CJCh1Gq6.chunk.js.map} +1 -1
  32. package/dist/scripts/{CoUj6M-_.chunk.js → CKGiikBV.chunk.js} +2 -2
  33. package/dist/scripts/{CoUj6M-_.chunk.js.map → CKGiikBV.chunk.js.map} +1 -1
  34. package/dist/scripts/{B8t1n8_x2.chunk.js → CL5P1KMy2.chunk.js} +2 -2
  35. package/dist/scripts/{B8t1n8_x2.chunk.js.map → CL5P1KMy2.chunk.js.map} +1 -1
  36. package/dist/scripts/{Bz-3cXSL.chunk.js → CMKTpGri.chunk.js} +2 -2
  37. package/dist/scripts/{Bz-3cXSL.chunk.js.map → CMKTpGri.chunk.js.map} +1 -1
  38. package/dist/scripts/{ByMZucv2.chunk.js → CgL1gDuH.chunk.js} +2 -2
  39. package/dist/scripts/{ByMZucv2.chunk.js.map → CgL1gDuH.chunk.js.map} +1 -1
  40. package/dist/scripts/{VDqAyMTi2.chunk.js → ClMXRZea2.chunk.js} +2 -2
  41. package/dist/scripts/{VDqAyMTi2.chunk.js.map → ClMXRZea2.chunk.js.map} +1 -1
  42. package/dist/scripts/{Bw2cauzs2.chunk.js → Cm6SLr7W2.chunk.js} +3 -3
  43. package/dist/scripts/{Bw2cauzs2.chunk.js.map → Cm6SLr7W2.chunk.js.map} +1 -1
  44. package/dist/scripts/{gF9PGTMC.chunk.js → Cmjtel65.chunk.js} +2 -2
  45. package/dist/scripts/{gF9PGTMC.chunk.js.map → Cmjtel65.chunk.js.map} +1 -1
  46. package/dist/scripts/{DwLSTi6C.chunk.js → CnYpIR5V.chunk.js} +2 -2
  47. package/dist/scripts/{DwLSTi6C.chunk.js.map → CnYpIR5V.chunk.js.map} +1 -1
  48. package/dist/scripts/{BpFyfI-52.chunk.js → D2vAOC7r2.chunk.js} +2 -2
  49. package/dist/scripts/{BpFyfI-52.chunk.js.map → D2vAOC7r2.chunk.js.map} +1 -1
  50. package/dist/scripts/{29-YRbOp.chunk.js → D4uneRs9.chunk.js} +2 -2
  51. package/dist/scripts/{29-YRbOp.chunk.js.map → D4uneRs9.chunk.js.map} +1 -1
  52. package/dist/scripts/{DbQFpTve.chunk.js → DIeIfhGe.chunk.js} +2 -2
  53. package/dist/scripts/{DbQFpTve.chunk.js.map → DIeIfhGe.chunk.js.map} +1 -1
  54. package/dist/scripts/{CrGWZr2R2.chunk.js → DRHbASmP2.chunk.js} +2 -2
  55. package/dist/scripts/{CrGWZr2R2.chunk.js.map → DRHbASmP2.chunk.js.map} +1 -1
  56. package/dist/scripts/{n4utAY5E2.chunk.js → DTnfO2MH2.chunk.js} +2 -2
  57. package/dist/scripts/{n4utAY5E2.chunk.js.map → DTnfO2MH2.chunk.js.map} +1 -1
  58. package/dist/scripts/{BcMb1XKL.chunk.js → DUJvtd00.chunk.js} +2 -2
  59. package/dist/scripts/{BcMb1XKL.chunk.js.map → DUJvtd00.chunk.js.map} +1 -1
  60. package/dist/scripts/{B0DGioRk.chunk.js → DWz2oR7C.chunk.js} +2 -2
  61. package/dist/scripts/{B0DGioRk.chunk.js.map → DWz2oR7C.chunk.js.map} +1 -1
  62. package/dist/scripts/{CTUTwtJp.chunk.js → DZD8iLCw.chunk.js} +2 -2
  63. package/dist/scripts/{CTUTwtJp.chunk.js.map → DZD8iLCw.chunk.js.map} +1 -1
  64. package/dist/scripts/{C-gsezmj.chunk.js → D_foXB2p.chunk.js} +2 -2
  65. package/dist/scripts/{C-gsezmj.chunk.js.map → D_foXB2p.chunk.js.map} +1 -1
  66. package/dist/scripts/{Br8WvETm.chunk.js → Dhv7zSEB.chunk.js} +2 -2
  67. package/dist/scripts/{Br8WvETm.chunk.js.map → Dhv7zSEB.chunk.js.map} +1 -1
  68. package/dist/scripts/{B6p7xJj9.chunk.js → DpHKtTzO.chunk.js} +2 -2
  69. package/dist/scripts/{B6p7xJj9.chunk.js.map → DpHKtTzO.chunk.js.map} +1 -1
  70. package/dist/scripts/{DynqFaq92.chunk.js → GcexF25w2.chunk.js} +2 -2
  71. package/dist/scripts/{DynqFaq92.chunk.js.map → GcexF25w2.chunk.js.map} +1 -1
  72. package/dist/scripts/{DYN56vJ6.chunk.js → _XhYAc8v.chunk.js} +2 -2
  73. package/dist/scripts/{DYN56vJ6.chunk.js.map → _XhYAc8v.chunk.js.map} +1 -1
  74. package/dist/scripts/{app-4vEzpLow.js → app-DamRTcio.js} +4 -4
  75. package/dist/scripts/{app-4vEzpLow.js.map → app-DamRTcio.js.map} +1 -1
  76. package/dist/scripts/{B2PLlkVH.chunk.js → dZhIkfV6.chunk.js} +3 -3
  77. package/dist/scripts/{B2PLlkVH.chunk.js.map → dZhIkfV6.chunk.js.map} +1 -1
  78. package/dist/scripts/{DZQhE4mm.chunk.js → eSX6I2aK.chunk.js} +2 -2
  79. package/dist/scripts/{DZQhE4mm.chunk.js.map → eSX6I2aK.chunk.js.map} +1 -1
  80. package/dist/scripts/{DnogtDGY2.chunk.js → gTfMMiRw2.chunk.js} +2 -2
  81. package/dist/scripts/{DnogtDGY2.chunk.js.map → gTfMMiRw2.chunk.js.map} +1 -1
  82. package/dist/scripts/{DYW8v4_j2.chunk.js → xUmhnDE42.chunk.js} +2 -2
  83. package/dist/scripts/{DYW8v4_j2.chunk.js.map → xUmhnDE42.chunk.js.map} +1 -1
  84. package/package.json +1 -1
  85. package/dist/scripts/BOuzZEkK2.chunk.js.map +0 -1
  86. package/dist/scripts/BwBWuxjr2.chunk.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"BcMb1XKL.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/user-manager/components/bulk-actions-wizard/action-details/reset-password-action-details/bulk-user-actions-reset-password-action-details.module.scss","../../../../libs/shared/src/apps/user-manager/components/bulk-actions-wizard/action-details/reset-password-action-details/BulkUserActionsResetPasswordActionDetails.tsx","../../src/apps/user-manager/views/wizard/action-details/reset-password/BulkUserActionsResetPasswordActionDetailsView.tsx"],"sourcesContent":[":local {\n .passWordInput {\n min-width: 25rem; //400px\n }\n}","import React from 'react';\nimport { useFormikContext } from 'formik';\n\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { ChangePasswordFormV2 } from 'libs/shared/apps/user-manager/components/change-password-form-v2/ChangePasswordFormV2';\nimport { ChangePasswordRequest, UserManagerAppLinks } from 'libs/shared/apps/user-manager/interfaces';\nimport { BulkUserActionsResetPasswordViewModel } from 'libs/shared/apps/user-manager/interfaces/viewmodels/BulkUserActionsViewModel';\nimport { getChangePasswordValidationSchema } from 'libs/shared/apps/user-manager/validation/ChangePasswordValidationSchema';\nimport { FormWrapper } from 'libs/shared/components/forms/form-wrapper/FormWrapper';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { SharedViewModelKeys } from 'libs/shared/constants/SharedViewModelKeys';\nimport { WizardLayoutContext } from 'libs/shared/context/WizardLayoutContext';\n\nimport styles from './bulk-user-actions-reset-password-action-details.module.scss';\n\nconst namespace = 'userManager.bulkUserActionsResetPasswordActionDetails';\n\nconst initialValues: ChangePasswordRequest = {\n newPassword: '',\n confirmPassword: '',\n changeOnNextLogin: true\n};\n\ninterface ChangePasswordProps {\n onUpdate: (val: string, changeOnNextLogin: boolean, isValid: boolean) => void;\n minLength: number;\n}\n\nfunction ChangePassword(props: ChangePasswordProps): JSX.Element {\n const formikContext = useFormikContext<ChangePasswordRequest>();\n\n React.useEffect(() => {\n props.onUpdate(\n formikContext.values?.newPassword,\n formikContext.values?.changeOnNextLogin,\n formikContext.isValid && formikContext.dirty\n );\n }, [ formikContext.isValid, formikContext.values ]);\n\n return (\n <ChangePasswordFormV2\n inputWidthClass={`${styles.passWordInput} w-50`}\n hideButtons\n hideCurrentPassword\n showChangeOnNextLogin\n minLength={props.minLength}\n passwordStrengthClassName='w-50'\n />\n );\n}\n\ninterface BulkUserActionsResetPasswordActionDetailsProps {\n appLinks: UserManagerAppLinks;\n minPasswordLength: number;\n totalUsers: number;\n}\n\nexport function BulkUserActionsResetPasswordActionDetails(\n props: BulkUserActionsResetPasswordActionDetailsProps\n): JSX.Element {\n const [ , setViewModel ] = useViewModel<BulkUserActionsResetPasswordViewModel>(\n SharedViewModelKeys.BULK_USER_ACTIONS\n );\n\n const { disableNext, setDisableNext } = React.useContext(WizardLayoutContext);\n\n React.useEffect(() => {\n setDisableNext(true);\n }, []);\n\n React.useEffect(() => {\n setViewModel('subAction', 'resetPassword');\n }, []);\n\n function onUpdateForm(newPassword: string, changeOnNextLogin: boolean, isValid: boolean) {\n if (isValid && disableNext)\n setDisableNext(false);\n\n if (!isValid && !disableNext)\n setDisableNext(true);\n\n setViewModel('password', newPassword);\n setViewModel('changeOnNextLogin', changeOnNextLogin);\n }\n\n return (\n <>\n <h2 className='h4 mb-3'>\n <Text namespace={namespace} phrase='heading' />\n </h2>\n\n <p>\n <Text namespace={namespace} phrase='info' options={{ smartCount: props.totalUsers }} />\n </p>\n\n <div className='px-2 pt-2 border rounded mb-2 pb-0'>\n <ul className='mt-2 ps-3 ms-1'>\n <li>\n <Text namespace={namespace} phrase='ssoWarning' />\n </li>\n </ul>\n <FormWrapper<ChangePasswordRequest>\n initialValues={initialValues}\n onSubmit={() => {}}\n validationSchema={getChangePasswordValidationSchema(props.minPasswordLength)}\n >\n <ChangePassword onUpdate={onUpdateForm} minLength={props.minPasswordLength}/>\n </FormWrapper>\n </div>\n </>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\n\nimport { BulkUserActionsResetPasswordActionDetails } from 'libs/shared/apps/user-manager/components/bulk-actions-wizard/action-details/reset-password-action-details/BulkUserActionsResetPasswordActionDetails';\nimport { BulkUserActionsWizardLayout } from 'libs/shared/apps/user-manager/components/bulk-actions-wizard/layout/BulkUserActionsWizardLayout';\nimport { UserWizardParams } from 'libs/shared/apps/user-manager/interfaces/query-params/UserWizardParams';\nimport { SecuritySettingsResponse } from 'libs/shared/apps/user-manager/interfaces/SecuritySettingsResponse';\nimport { UserManagerHelper } from 'libs/shared/apps/user-manager/utils/UserManagerHelper';\nimport { UserRole } from 'libs/shared/enums/UserRole';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { CurrentUser } from 'libs/shared/interfaces';\n\nimport { SecuritySettingsRequests } from 'apps/settings/flight-requests/SecuritySettingsRequests';\nimport { useBulkActionsUsersWrapper } from 'apps/user-manager/hooks/useBulkActionsUsersWrapper';\nimport { getUserManagerAppLinks } from 'apps/user-manager/utils/LiteUserManagerAppLinks';\n\nconst namespace = 'userManager.bulkResetPasswordDetails';\n\nexport function BulkUserActionsResetPasswordActionDetailsView(props: UserWizardParams): JSX.Element {\n const { users, count } = useBulkActionsUsersWrapper(props.userType);\n const appLinks = getUserManagerAppLinks(props.userType);\n useSetPageMetadata({ title: LanguageService.getPhrase(namespace, 'pageTitle') });\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const passwordPolicy = Flight.useBasicFetch<SecuritySettingsResponse>(currentUser.data &&\n SecuritySettingsRequests.getCustomerSecuritySettings(currentUser.data.customerId));\n\n const minPasswordLen = UserManagerHelper.getMinimumPasswordLength(passwordPolicy.data, props.userType, UserRole.User);\n\n return (\n <BulkUserActionsWizardLayout\n appLinks={appLinks}\n userType={props.userType}\n users={users}\n currentStep='action-details'\n userCount={count}\n loaded\n >\n <BulkUserActionsResetPasswordActionDetails\n minPasswordLength={minPasswordLen}\n totalUsers={count}\n appLinks={appLinks}\n />\n </BulkUserActionsWizardLayout>\n );\n}\n"],"mappings":"s2BCgBM,EAAY,wDAEZ,EAAuC,CAC3C,YAAa,GACb,gBAAiB,GACjB,kBAAmB,EACrB,EAOA,SAAS,EAAe,EAAyC,CAC/D,IAAM,EAAgB,EAAwC,EAU9D,OARA,EAAM,cAAgB,CACpB,EAAM,SACJ,EAAc,QAAQ,YACtB,EAAc,QAAQ,kBACtB,EAAc,SAAW,EAAc,KACzC,CACF,EAAG,CAAE,EAAc,QAAS,EAAc,MAAO,CAAC,GAGhD,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,gBAAiB,GAAG,EAAO,cAAc,OACzC,YAAA,GACA,oBAAA,GACA,sBAAA,GACA,UAAW,EAAM,UACjB,0BAA0B,MAC3B,CAAA,CAEL,CAQA,SAAgB,EACd,EACa,CACb,GAAM,EAAI,GAAiB,EACzB,EAAoB,iBACtB,EAEM,CAAE,cAAa,kBAAA,EAAyB,WAAW,CAAmB,EAE5E,EAAM,cAAgB,CACpB,EAAe,EAAI,CACrB,EAAG,CAAC,CAAC,EAEL,EAAM,cAAgB,CACpB,EAAa,YAAa,eAAe,CAC3C,EAAG,CAAC,CAAC,EAEL,SAAS,EAAa,EAAqB,EAA4B,EAAkB,CACnF,GAAW,GACb,EAAe,EAAK,EAElB,CAAC,GAAW,CAAC,GACf,EAAe,EAAI,EAErB,EAAa,WAAY,CAAW,EACpC,EAAa,oBAAqB,CAAiB,CACrD,CAEA,OACE,EAAA,EAAA,KAAA,CAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,oBACZ,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,SAAW,CAAA,CAC5C,CAAA,GAEJ,EAAA,EAAA,IAAA,CAAC,IAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,OAAO,QAAS,CAAE,WAAY,EAAM,UAAW,CAAI,CAAA,CACrF,CAAA,GAEH,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,8CAAf,EACE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,2BACZ,EAAA,EAAA,IAAA,CAAC,KAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,YAAc,CAAA,CAC/C,CAAA,CACF,CAAA,GACJ,EAAA,EAAA,IAAA,CAAC,EAAD,CACiB,gBACf,aAAgB,CAAC,EACjB,iBAAkB,EAAkC,EAAM,iBAAiB,YAE3E,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,SAAU,EAAc,UAAW,EAAM,iBAAmB,CAAA,CACjE,CAAA,CACV,GACL,CAAA,CAAA,CAEN,CC7FA,IAAM,EAAY,uCAElB,SAAgB,EAA8C,EAAsC,CAClG,GAAM,CAAE,QAAO,SAAU,EAA2B,EAAM,QAAQ,EAC5D,EAAW,EAAuB,EAAM,QAAQ,EACtD,EAAmB,CAAE,MAAO,EAAgB,UAAU,EAAW,WAAW,CAAE,CAAC,EAE/E,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAiB,EAA+C,EAAY,MAChF,EAAyB,4BAA4B,EAAY,KAAK,UAAU,CAAC,EAE7E,EAAiB,EAAkB,yBAAyB,EAAe,KAAM,EAAM,SAAU,EAAS,IAAI,EAEpH,OACE,EAAA,EAAA,IAAA,CAAC,EAAD,CACY,WACV,SAAU,EAAM,SACT,QACP,YAAY,iBACZ,UAAW,EACX,OAAA,aAEA,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,kBAAmB,EACnB,WAAY,EACF,UACX,CAAA,CAC0B,CAAA,CAEjC"}
1
+ {"version":3,"file":"DUJvtd00.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/user-manager/components/bulk-actions-wizard/action-details/reset-password-action-details/bulk-user-actions-reset-password-action-details.module.scss","../../../../libs/shared/src/apps/user-manager/components/bulk-actions-wizard/action-details/reset-password-action-details/BulkUserActionsResetPasswordActionDetails.tsx","../../src/apps/user-manager/views/wizard/action-details/reset-password/BulkUserActionsResetPasswordActionDetailsView.tsx"],"sourcesContent":[":local {\n .passWordInput {\n min-width: 25rem; //400px\n }\n}","import React from 'react';\nimport { useFormikContext } from 'formik';\n\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { ChangePasswordFormV2 } from 'libs/shared/apps/user-manager/components/change-password-form-v2/ChangePasswordFormV2';\nimport { ChangePasswordRequest, UserManagerAppLinks } from 'libs/shared/apps/user-manager/interfaces';\nimport { BulkUserActionsResetPasswordViewModel } from 'libs/shared/apps/user-manager/interfaces/viewmodels/BulkUserActionsViewModel';\nimport { getChangePasswordValidationSchema } from 'libs/shared/apps/user-manager/validation/ChangePasswordValidationSchema';\nimport { FormWrapper } from 'libs/shared/components/forms/form-wrapper/FormWrapper';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { SharedViewModelKeys } from 'libs/shared/constants/SharedViewModelKeys';\nimport { WizardLayoutContext } from 'libs/shared/context/WizardLayoutContext';\n\nimport styles from './bulk-user-actions-reset-password-action-details.module.scss';\n\nconst namespace = 'userManager.bulkUserActionsResetPasswordActionDetails';\n\nconst initialValues: ChangePasswordRequest = {\n newPassword: '',\n confirmPassword: '',\n changeOnNextLogin: true\n};\n\ninterface ChangePasswordProps {\n onUpdate: (val: string, changeOnNextLogin: boolean, isValid: boolean) => void;\n minLength: number;\n}\n\nfunction ChangePassword(props: ChangePasswordProps): JSX.Element {\n const formikContext = useFormikContext<ChangePasswordRequest>();\n\n React.useEffect(() => {\n props.onUpdate(\n formikContext.values?.newPassword,\n formikContext.values?.changeOnNextLogin,\n formikContext.isValid && formikContext.dirty\n );\n }, [ formikContext.isValid, formikContext.values ]);\n\n return (\n <ChangePasswordFormV2\n inputWidthClass={`${styles.passWordInput} w-50`}\n hideButtons\n hideCurrentPassword\n showChangeOnNextLogin\n minLength={props.minLength}\n passwordStrengthClassName='w-50'\n />\n );\n}\n\ninterface BulkUserActionsResetPasswordActionDetailsProps {\n appLinks: UserManagerAppLinks;\n minPasswordLength: number;\n totalUsers: number;\n}\n\nexport function BulkUserActionsResetPasswordActionDetails(\n props: BulkUserActionsResetPasswordActionDetailsProps\n): JSX.Element {\n const [ , setViewModel ] = useViewModel<BulkUserActionsResetPasswordViewModel>(\n SharedViewModelKeys.BULK_USER_ACTIONS\n );\n\n const { disableNext, setDisableNext } = React.useContext(WizardLayoutContext);\n\n React.useEffect(() => {\n setDisableNext(true);\n }, []);\n\n React.useEffect(() => {\n setViewModel('subAction', 'resetPassword');\n }, []);\n\n function onUpdateForm(newPassword: string, changeOnNextLogin: boolean, isValid: boolean) {\n if (isValid && disableNext)\n setDisableNext(false);\n\n if (!isValid && !disableNext)\n setDisableNext(true);\n\n setViewModel('password', newPassword);\n setViewModel('changeOnNextLogin', changeOnNextLogin);\n }\n\n return (\n <>\n <h2 className='h4 mb-3'>\n <Text namespace={namespace} phrase='heading' />\n </h2>\n\n <p>\n <Text namespace={namespace} phrase='info' options={{ smartCount: props.totalUsers }} />\n </p>\n\n <div className='px-2 pt-2 border rounded mb-2 pb-0'>\n <ul className='mt-2 ps-3 ms-1'>\n <li>\n <Text namespace={namespace} phrase='ssoWarning' />\n </li>\n </ul>\n <FormWrapper<ChangePasswordRequest>\n initialValues={initialValues}\n onSubmit={() => {}}\n validationSchema={getChangePasswordValidationSchema(props.minPasswordLength)}\n >\n <ChangePassword onUpdate={onUpdateForm} minLength={props.minPasswordLength}/>\n </FormWrapper>\n </div>\n </>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\n\nimport { BulkUserActionsResetPasswordActionDetails } from 'libs/shared/apps/user-manager/components/bulk-actions-wizard/action-details/reset-password-action-details/BulkUserActionsResetPasswordActionDetails';\nimport { BulkUserActionsWizardLayout } from 'libs/shared/apps/user-manager/components/bulk-actions-wizard/layout/BulkUserActionsWizardLayout';\nimport { UserWizardParams } from 'libs/shared/apps/user-manager/interfaces/query-params/UserWizardParams';\nimport { SecuritySettingsResponse } from 'libs/shared/apps/user-manager/interfaces/SecuritySettingsResponse';\nimport { UserManagerHelper } from 'libs/shared/apps/user-manager/utils/UserManagerHelper';\nimport { UserRole } from 'libs/shared/enums/UserRole';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { CurrentUser } from 'libs/shared/interfaces';\n\nimport { SecuritySettingsRequests } from 'apps/settings/flight-requests/SecuritySettingsRequests';\nimport { useBulkActionsUsersWrapper } from 'apps/user-manager/hooks/useBulkActionsUsersWrapper';\nimport { getUserManagerAppLinks } from 'apps/user-manager/utils/LiteUserManagerAppLinks';\n\nconst namespace = 'userManager.bulkResetPasswordDetails';\n\nexport function BulkUserActionsResetPasswordActionDetailsView(props: UserWizardParams): JSX.Element {\n const { users, count } = useBulkActionsUsersWrapper(props.userType);\n const appLinks = getUserManagerAppLinks(props.userType);\n useSetPageMetadata({ title: LanguageService.getPhrase(namespace, 'pageTitle') });\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const passwordPolicy = Flight.useBasicFetch<SecuritySettingsResponse>(currentUser.data &&\n SecuritySettingsRequests.getCustomerSecuritySettings(currentUser.data.customerId));\n\n const minPasswordLen = UserManagerHelper.getMinimumPasswordLength(passwordPolicy.data, props.userType, UserRole.User);\n\n return (\n <BulkUserActionsWizardLayout\n appLinks={appLinks}\n userType={props.userType}\n users={users}\n currentStep='action-details'\n userCount={count}\n loaded\n >\n <BulkUserActionsResetPasswordActionDetails\n minPasswordLength={minPasswordLen}\n totalUsers={count}\n appLinks={appLinks}\n />\n </BulkUserActionsWizardLayout>\n );\n}\n"],"mappings":"s2BCgBM,EAAY,wDAEZ,EAAuC,CAC3C,YAAa,GACb,gBAAiB,GACjB,kBAAmB,EACrB,EAOA,SAAS,EAAe,EAAyC,CAC/D,IAAM,EAAgB,EAAwC,EAU9D,OARA,EAAM,cAAgB,CACpB,EAAM,SACJ,EAAc,QAAQ,YACtB,EAAc,QAAQ,kBACtB,EAAc,SAAW,EAAc,KACzC,CACF,EAAG,CAAE,EAAc,QAAS,EAAc,MAAO,CAAC,GAGhD,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,gBAAiB,GAAG,EAAO,cAAc,OACzC,YAAA,GACA,oBAAA,GACA,sBAAA,GACA,UAAW,EAAM,UACjB,0BAA0B,MAC3B,CAAA,CAEL,CAQA,SAAgB,EACd,EACa,CACb,GAAM,EAAI,GAAiB,EACzB,EAAoB,iBACtB,EAEM,CAAE,cAAa,kBAAA,EAAyB,WAAW,CAAmB,EAE5E,EAAM,cAAgB,CACpB,EAAe,EAAI,CACrB,EAAG,CAAC,CAAC,EAEL,EAAM,cAAgB,CACpB,EAAa,YAAa,eAAe,CAC3C,EAAG,CAAC,CAAC,EAEL,SAAS,EAAa,EAAqB,EAA4B,EAAkB,CACnF,GAAW,GACb,EAAe,EAAK,EAElB,CAAC,GAAW,CAAC,GACf,EAAe,EAAI,EAErB,EAAa,WAAY,CAAW,EACpC,EAAa,oBAAqB,CAAiB,CACrD,CAEA,OACE,EAAA,EAAA,KAAA,CAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,oBACZ,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,SAAW,CAAA,CAC5C,CAAA,GAEJ,EAAA,EAAA,IAAA,CAAC,IAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,OAAO,QAAS,CAAE,WAAY,EAAM,UAAW,CAAI,CAAA,CACrF,CAAA,GAEH,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,8CAAf,EACE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,2BACZ,EAAA,EAAA,IAAA,CAAC,KAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,YAAc,CAAA,CAC/C,CAAA,CACF,CAAA,GACJ,EAAA,EAAA,IAAA,CAAC,EAAD,CACiB,gBACf,aAAgB,CAAC,EACjB,iBAAkB,EAAkC,EAAM,iBAAiB,YAE3E,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,SAAU,EAAc,UAAW,EAAM,iBAAmB,CAAA,CACjE,CAAA,CACV,GACL,CAAA,CAAA,CAEN,CC7FA,IAAM,EAAY,uCAElB,SAAgB,EAA8C,EAAsC,CAClG,GAAM,CAAE,QAAO,SAAU,EAA2B,EAAM,QAAQ,EAC5D,EAAW,EAAuB,EAAM,QAAQ,EACtD,EAAmB,CAAE,MAAO,EAAgB,UAAU,EAAW,WAAW,CAAE,CAAC,EAE/E,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAiB,EAA+C,EAAY,MAChF,EAAyB,4BAA4B,EAAY,KAAK,UAAU,CAAC,EAE7E,EAAiB,EAAkB,yBAAyB,EAAe,KAAM,EAAM,SAAU,EAAS,IAAI,EAEpH,OACE,EAAA,EAAA,IAAA,CAAC,EAAD,CACY,WACV,SAAU,EAAM,SACT,QACP,YAAY,iBACZ,UAAW,EACX,OAAA,aAEA,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,kBAAmB,EACnB,WAAY,EACF,UACX,CAAA,CAC0B,CAAA,CAEjC"}
@@ -1,2 +1,2 @@
1
- import"./DAXXjFlN.chunk.js";import{t as e}from"./CQyJ7YGa.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{p as r,u as i}from"./BX0wDJmp.chunk.js";import{t as a}from"./C5j5LRut2.chunk.js";import{t as o}from"./C1PTqhPY2.chunk.js";import{t as s}from"./CqrjHjAN.chunk.js";import{n as c}from"./CpFtf-tI2.chunk.js";import{t as l}from"./CXnhm0VS2.chunk.js";import{t as u}from"./DS3e-Ht4.chunk.js";import{t as d}from"./DaT2nTfp.chunk.js";import{t as f}from"./D5WAilZl.chunk.js";import{t as p}from"./D1aO6GEr.chunk.js";import{t as m}from"./BOuzZEkK2.chunk.js";import{t as h}from"./Bh0cxa0U2.chunk.js";import{t as g}from"./BxWf68MX.chunk.js";t();var _=n(),v=`userManager.changePasswordSsoWarning`;function y(){return(0,_.jsx)(`div`,{className:`alert alert-warning`,children:(0,_.jsx)(c,{namespace:v,phrase:`ssoWarning`})})}var b=e.encloseNamespace(`userManager.changePassword`),x={newPassword:``,confirmPassword:``,changeOnNextLogin:!0};function S(e){let t=i(s.currentUser()),n=i(p.getUser(e.userId)),c=i(t.data&&h.getCustomerSecuritySettings(t.data.customerId)),v=n.data?.userType,S=n.data?.userProfile?.role,C=r(),w=l();function T(t){let n=p.changeUserPassword(e.userId,v,t.newPassword,t.changeOnNextLogin);C(n).then(()=>w.success(b(`success`))).catch(()=>w.error(b(`error`))).finally(e.closePopup)}let E=u.getMinimumPasswordLength(c.data,v,S),D=!!c.data&&!!n.data;return(0,_.jsxs)(d,{title:b(`title`),closePopup:e.closePopup,showLoadingSpinner:!D,children:[!!D&&a.hasSso(n.data)&&(0,_.jsx)(y,{}),(0,_.jsx)(f,{initialValues:x,onSubmit:T,validationSchema:g(E),children:D&&(0,_.jsx)(m,{onClickCancel:e.closePopup,submitVariant:`dark`,buttonContainerClass:`border-top d-flex justify-content-end align-items-center pt-3 px-3 mx-n3`,showChangeOnNextLogin:v===o.Learner,hideCurrentPassword:!0,minLength:E,passwordStrengthClassName:`w-75`})})]})}export{S as ChangePasswordView};
2
- //# sourceMappingURL=B0DGioRk.chunk.js.map
1
+ import"./DAXXjFlN.chunk.js";import{t as e}from"./CQyJ7YGa.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{p as r,u as i}from"./BX0wDJmp.chunk.js";import{t as a}from"./C5j5LRut2.chunk.js";import{t as o}from"./C1PTqhPY2.chunk.js";import{t as s}from"./CqrjHjAN.chunk.js";import{n as c}from"./CpFtf-tI2.chunk.js";import{t as l}from"./CXnhm0VS2.chunk.js";import{t as u}from"./DS3e-Ht4.chunk.js";import{t as d}from"./DaT2nTfp.chunk.js";import{t as f}from"./D5WAilZl.chunk.js";import{t as p}from"./D1aO6GEr.chunk.js";import{t as m}from"./BPjqerK42.chunk.js";import{t as h}from"./Bh0cxa0U2.chunk.js";import{t as g}from"./BxWf68MX.chunk.js";t();var _=n(),v=`userManager.changePasswordSsoWarning`;function y(){return(0,_.jsx)(`div`,{className:`alert alert-warning`,children:(0,_.jsx)(c,{namespace:v,phrase:`ssoWarning`})})}var b=e.encloseNamespace(`userManager.changePassword`),x={newPassword:``,confirmPassword:``,changeOnNextLogin:!0};function S(e){let t=i(s.currentUser()),n=i(p.getUser(e.userId)),c=i(t.data&&h.getCustomerSecuritySettings(t.data.customerId)),v=n.data?.userType,S=n.data?.userProfile?.role,C=r(),w=l();function T(t){let n=p.changeUserPassword(e.userId,v,t.newPassword,t.changeOnNextLogin);C(n).then(()=>w.success(b(`success`))).catch(()=>w.error(b(`error`))).finally(e.closePopup)}let E=u.getMinimumPasswordLength(c.data,v,S),D=!!c.data&&!!n.data;return(0,_.jsxs)(d,{title:b(`title`),closePopup:e.closePopup,showLoadingSpinner:!D,children:[!!D&&a.hasSso(n.data)&&(0,_.jsx)(y,{}),(0,_.jsx)(f,{initialValues:x,onSubmit:T,validationSchema:g(E),children:D&&(0,_.jsx)(m,{onClickCancel:e.closePopup,submitVariant:`dark`,buttonContainerClass:`border-top d-flex justify-content-end align-items-center pt-3 px-3 mx-n3`,showChangeOnNextLogin:v===o.Learner,hideCurrentPassword:!0,minLength:E,passwordStrengthClassName:`w-75`})})]})}export{S as ChangePasswordView};
2
+ //# sourceMappingURL=DWz2oR7C.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"B0DGioRk.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/user-manager/components/change-password-sso-warning/ChangePasswordSsoWarning.tsx","../../src/apps/user-manager/views/change-password/ChangePasswordView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'userManager.changePasswordSsoWarning';\n\nexport function ChangePasswordSsoWarning(): JSX.Element {\n return (\n <div className='alert alert-warning'>\n <Text namespace={namespace} phrase='ssoWarning' />\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\n\nimport { ChangePasswordFormV2 } from 'libs/shared/apps/user-manager/components/change-password-form-v2/ChangePasswordFormV2';\nimport { ChangePasswordSsoWarning } from 'libs/shared/apps/user-manager/components/change-password-sso-warning/ChangePasswordSsoWarning';\nimport { ChangePasswordRequest } from 'libs/shared/apps/user-manager/interfaces';\nimport { SecuritySettingsResponse } from 'libs/shared/apps/user-manager/interfaces/SecuritySettingsResponse';\nimport { UserManagerHelper } from 'libs/shared/apps/user-manager/utils/UserManagerHelper';\nimport { getChangePasswordValidationSchema } from 'libs/shared/apps/user-manager/validation/ChangePasswordValidationSchema';\nimport { FormWrapper } from 'libs/shared/components/forms/form-wrapper/FormWrapper';\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { UserGroup } from 'libs/shared/enums/UserGroup';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { CurrentUser, PropsWithPopupViewProps, User } from 'libs/shared/interfaces';\nimport { UserHelper } from 'libs/shared/utils/UserHelper';\n\nimport { SecuritySettingsRequests } from 'apps/settings/flight-requests/SecuritySettingsRequests';\nimport { UserManagerRequests } from 'apps/user-manager/flight-requests/UserManagerRequests';\n\nconst namespace = 'userManager.changePassword';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst initialValues = {\n newPassword: '',\n confirmPassword: '',\n changeOnNextLogin: true\n};\n\ntype ChangePasswordViewProps = PropsWithPopupViewProps<{\n userId: string\n}>;\n\nexport function ChangePasswordView(props: ChangePasswordViewProps): JSX.Element {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const user = Flight.useBasicFetch<User>(UserManagerRequests.getUser(props.userId));\n const passwordPolicy = Flight.useBasicFetch<SecuritySettingsResponse>(currentUser.data &&\n SecuritySettingsRequests.getCustomerSecuritySettings(currentUser.data.customerId));\n\n const userType = user.data?.userType;\n const userRole = user.data?.userProfile?.role;\n\n const fetch = Flight.useGetFetchAsync();\n const alerts = useAlerts();\n\n function onClickUpdate(data: ChangePasswordRequest): void {\n const request = UserManagerRequests.changeUserPassword(\n props.userId,\n userType,\n data.newPassword,\n data.changeOnNextLogin\n );\n\n fetch(request)\n .then(() => alerts.success(getPhrase('success')))\n .catch(() => alerts.error(getPhrase('error')))\n .finally(props.closePopup);\n }\n\n const minLength = UserManagerHelper.getMinimumPasswordLength(\n passwordPolicy.data,\n userType,\n userRole\n );\n\n const dataLoaded = !!passwordPolicy.data && !!user.data;\n\n return (\n <Popup title={getPhrase('title')} closePopup={props.closePopup} showLoadingSpinner={!dataLoaded}>\n {!!dataLoaded && UserHelper.hasSso(user.data) && (\n <ChangePasswordSsoWarning />\n )}\n\n <FormWrapper<ChangePasswordRequest>\n initialValues={initialValues}\n onSubmit={onClickUpdate}\n validationSchema={getChangePasswordValidationSchema(minLength)}\n >\n {dataLoaded && (\n <ChangePasswordFormV2\n onClickCancel={props.closePopup}\n submitVariant='dark'\n buttonContainerClass='border-top d-flex justify-content-end align-items-center pt-3 px-3 mx-n3'\n showChangeOnNextLogin={userType === UserGroup.Learner}\n hideCurrentPassword\n minLength={minLength}\n passwordStrengthClassName='w-75'\n />\n )}\n </FormWrapper>\n </Popup>\n );\n}\n"],"mappings":"krBAIM,EAAY,uCAElB,SAAgB,GAAwC,CACtD,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,gCACb,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,YAAc,CAAA,CAC9C,CAAA,CAET,CCWA,IAAM,EAAY,EAAgB,iBAAiB,4BAAS,EAEtD,EAAgB,CACpB,YAAa,GACb,gBAAiB,GACjB,kBAAmB,EACrB,EAMA,SAAgB,EAAmB,EAA6C,CAC9E,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAO,EAA2B,EAAoB,QAAQ,EAAM,MAAM,CAAC,EAC3E,EAAiB,EAA+C,EAAY,MAChF,EAAyB,4BAA4B,EAAY,KAAK,UAAU,CAAC,EAE7E,EAAW,EAAK,MAAM,SACtB,EAAW,EAAK,MAAM,aAAa,KAEnC,EAAQ,EAAwB,EAChC,EAAS,EAAU,EAEzB,SAAS,EAAc,EAAmC,CACxD,IAAM,EAAU,EAAoB,mBAClC,EAAM,OACN,EACA,EAAK,YACL,EAAK,iBACP,EAEA,EAAM,CAAO,CAAC,CACX,SAAW,EAAO,QAAQ,EAAU,SAAS,CAAC,CAAC,CAAC,CAChD,UAAY,EAAO,MAAM,EAAU,OAAO,CAAC,CAAC,CAAC,CAC7C,QAAQ,EAAM,UAAU,CAC7B,CAEA,IAAM,EAAY,EAAkB,yBAClC,EAAe,KACf,EACA,CACF,EAEM,EAAa,CAAC,CAAC,EAAe,MAAQ,CAAC,CAAC,EAAK,KAEnD,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAO,MAAO,EAAU,OAAO,EAAG,WAAY,EAAM,WAAY,mBAAoB,CAAC,WAArF,CACG,CAAC,CAAC,GAAc,EAAW,OAAO,EAAK,IAAI,IAC1C,EAAA,EAAA,IAAA,CAAC,EAAD,CAA2B,CAAA,GAG7B,EAAA,EAAA,IAAA,CAAC,EAAD,CACiB,gBACf,SAAU,EACV,iBAAkB,EAAkC,CAAS,WAE5D,IACC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,cAAe,EAAM,WACrB,cAAc,OACd,qBAAqB,2EACrB,sBAAuB,IAAa,EAAU,QAC9C,oBAAA,GACW,YACX,0BAA0B,MAC3B,CAAA,CAEQ,CAAA,CACR,GAEX"}
1
+ {"version":3,"file":"DWz2oR7C.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/user-manager/components/change-password-sso-warning/ChangePasswordSsoWarning.tsx","../../src/apps/user-manager/views/change-password/ChangePasswordView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'userManager.changePasswordSsoWarning';\n\nexport function ChangePasswordSsoWarning(): JSX.Element {\n return (\n <div className='alert alert-warning'>\n <Text namespace={namespace} phrase='ssoWarning' />\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\n\nimport { ChangePasswordFormV2 } from 'libs/shared/apps/user-manager/components/change-password-form-v2/ChangePasswordFormV2';\nimport { ChangePasswordSsoWarning } from 'libs/shared/apps/user-manager/components/change-password-sso-warning/ChangePasswordSsoWarning';\nimport { ChangePasswordRequest } from 'libs/shared/apps/user-manager/interfaces';\nimport { SecuritySettingsResponse } from 'libs/shared/apps/user-manager/interfaces/SecuritySettingsResponse';\nimport { UserManagerHelper } from 'libs/shared/apps/user-manager/utils/UserManagerHelper';\nimport { getChangePasswordValidationSchema } from 'libs/shared/apps/user-manager/validation/ChangePasswordValidationSchema';\nimport { FormWrapper } from 'libs/shared/components/forms/form-wrapper/FormWrapper';\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { UserGroup } from 'libs/shared/enums/UserGroup';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { CurrentUser, PropsWithPopupViewProps, User } from 'libs/shared/interfaces';\nimport { UserHelper } from 'libs/shared/utils/UserHelper';\n\nimport { SecuritySettingsRequests } from 'apps/settings/flight-requests/SecuritySettingsRequests';\nimport { UserManagerRequests } from 'apps/user-manager/flight-requests/UserManagerRequests';\n\nconst namespace = 'userManager.changePassword';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst initialValues = {\n newPassword: '',\n confirmPassword: '',\n changeOnNextLogin: true\n};\n\ntype ChangePasswordViewProps = PropsWithPopupViewProps<{\n userId: string\n}>;\n\nexport function ChangePasswordView(props: ChangePasswordViewProps): JSX.Element {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const user = Flight.useBasicFetch<User>(UserManagerRequests.getUser(props.userId));\n const passwordPolicy = Flight.useBasicFetch<SecuritySettingsResponse>(currentUser.data &&\n SecuritySettingsRequests.getCustomerSecuritySettings(currentUser.data.customerId));\n\n const userType = user.data?.userType;\n const userRole = user.data?.userProfile?.role;\n\n const fetch = Flight.useGetFetchAsync();\n const alerts = useAlerts();\n\n function onClickUpdate(data: ChangePasswordRequest): void {\n const request = UserManagerRequests.changeUserPassword(\n props.userId,\n userType,\n data.newPassword,\n data.changeOnNextLogin\n );\n\n fetch(request)\n .then(() => alerts.success(getPhrase('success')))\n .catch(() => alerts.error(getPhrase('error')))\n .finally(props.closePopup);\n }\n\n const minLength = UserManagerHelper.getMinimumPasswordLength(\n passwordPolicy.data,\n userType,\n userRole\n );\n\n const dataLoaded = !!passwordPolicy.data && !!user.data;\n\n return (\n <Popup title={getPhrase('title')} closePopup={props.closePopup} showLoadingSpinner={!dataLoaded}>\n {!!dataLoaded && UserHelper.hasSso(user.data) && (\n <ChangePasswordSsoWarning />\n )}\n\n <FormWrapper<ChangePasswordRequest>\n initialValues={initialValues}\n onSubmit={onClickUpdate}\n validationSchema={getChangePasswordValidationSchema(minLength)}\n >\n {dataLoaded && (\n <ChangePasswordFormV2\n onClickCancel={props.closePopup}\n submitVariant='dark'\n buttonContainerClass='border-top d-flex justify-content-end align-items-center pt-3 px-3 mx-n3'\n showChangeOnNextLogin={userType === UserGroup.Learner}\n hideCurrentPassword\n minLength={minLength}\n passwordStrengthClassName='w-75'\n />\n )}\n </FormWrapper>\n </Popup>\n );\n}\n"],"mappings":"krBAIM,EAAY,uCAElB,SAAgB,GAAwC,CACtD,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,gCACb,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,YAAc,CAAA,CAC9C,CAAA,CAET,CCWA,IAAM,EAAY,EAAgB,iBAAiB,4BAAS,EAEtD,EAAgB,CACpB,YAAa,GACb,gBAAiB,GACjB,kBAAmB,EACrB,EAMA,SAAgB,EAAmB,EAA6C,CAC9E,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAO,EAA2B,EAAoB,QAAQ,EAAM,MAAM,CAAC,EAC3E,EAAiB,EAA+C,EAAY,MAChF,EAAyB,4BAA4B,EAAY,KAAK,UAAU,CAAC,EAE7E,EAAW,EAAK,MAAM,SACtB,EAAW,EAAK,MAAM,aAAa,KAEnC,EAAQ,EAAwB,EAChC,EAAS,EAAU,EAEzB,SAAS,EAAc,EAAmC,CACxD,IAAM,EAAU,EAAoB,mBAClC,EAAM,OACN,EACA,EAAK,YACL,EAAK,iBACP,EAEA,EAAM,CAAO,CAAC,CACX,SAAW,EAAO,QAAQ,EAAU,SAAS,CAAC,CAAC,CAAC,CAChD,UAAY,EAAO,MAAM,EAAU,OAAO,CAAC,CAAC,CAAC,CAC7C,QAAQ,EAAM,UAAU,CAC7B,CAEA,IAAM,EAAY,EAAkB,yBAClC,EAAe,KACf,EACA,CACF,EAEM,EAAa,CAAC,CAAC,EAAe,MAAQ,CAAC,CAAC,EAAK,KAEnD,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAO,MAAO,EAAU,OAAO,EAAG,WAAY,EAAM,WAAY,mBAAoB,CAAC,WAArF,CACG,CAAC,CAAC,GAAc,EAAW,OAAO,EAAK,IAAI,IAC1C,EAAA,EAAA,IAAA,CAAC,EAAD,CAA2B,CAAA,GAG7B,EAAA,EAAA,IAAA,CAAC,EAAD,CACiB,gBACf,SAAU,EACV,iBAAkB,EAAkC,CAAS,WAE5D,IACC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,cAAe,EAAM,WACrB,cAAc,OACd,qBAAqB,2EACrB,sBAAuB,IAAa,EAAU,QAC9C,oBAAA,GACW,YACX,0BAA0B,MAC3B,CAAA,CAEQ,CAAA,CACR,GAEX"}
@@ -1,2 +1,2 @@
1
- import"./DAXXjFlN.chunk.js";import{y as e}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{t as r}from"./BXTI9cmX.chunk.js";import{u as i}from"./BX0wDJmp.chunk.js";import{t as a}from"./LoQS6GjP.chunk.js";import{t as o}from"./CqrjHjAN.chunk.js";import{t as s}from"./eoAypzU3.chunk.js";import{t as c}from"./D_gWf2lC.chunk.js";import{n as l,t as u}from"./C6-aC3vu.chunk.js";import{n as d,t as f}from"./BGhJ8TEx.chunk.js";import{t as p}from"./7LGxCHGV.chunk.js";import{c as m,l as h,t as g}from"./Bw2cauzs2.chunk.js";import{t as _}from"./B_-pJtOI2.chunk.js";import{t as v}from"./DbyH1eEj.chunk.js";import{t as y}from"./C9XBZFiR.chunk.js";import{t as b}from"./Tp0DOKOR.chunk.js";t();var x=n();function S(t){let n=i(o.currentUser()),S=i(n.data?.isAuthenticated&&a.video(t.id)),C=i(c.config()),w=i(f.createViewKey(t.id,d.MasterObject)),T=h(n.data?.isAuthenticated&&t.id),E=m(t.id);return u(l.getVideoMetadata({content:S.data,canonicalLink:_.getCanonicalLink(),allowIndexing:!1})),p(S,{private:v}),y(S,b),n.hasCompleted&&!n.data.isAuthenticated?(e.trigger({application:r.EMBED,action:s.Embed.LCS_LOGIN,args:[t.id],params:t.queryParams}),(0,x.jsx)(x.Fragment,{})):S.data&&n.hasCompleted&&C.hasCompleted&&w.hasCompleted&&T.hasCompleted&&E.hasCompleted?(0,x.jsx)(g,{config:C.data,video:S.data,currentUser:n.data,viewKey:w.data,pointsOfInterest:T.items,presentationSlug:null,embed:!0,showResources:!0,autoplay:t.queryParams.a===`true`,startTime:t.queryParams.t??t.queryParams.startTime,endTime:t.queryParams.endTime,playerIntegrations:E.data}):(0,x.jsx)(x.Fragment,{})}export{S as EmbeddedLcsVideoView};
2
- //# sourceMappingURL=CTUTwtJp.chunk.js.map
1
+ import"./DAXXjFlN.chunk.js";import{y as e}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{t as r}from"./BXTI9cmX.chunk.js";import{u as i}from"./BX0wDJmp.chunk.js";import{t as a}from"./LoQS6GjP.chunk.js";import{t as o}from"./CqrjHjAN.chunk.js";import{t as s}from"./eoAypzU3.chunk.js";import{t as c}from"./D_gWf2lC.chunk.js";import{n as l,t as u}from"./C6-aC3vu.chunk.js";import{n as d,t as f}from"./BGhJ8TEx.chunk.js";import{t as p}from"./7LGxCHGV.chunk.js";import{c as m,l as h,t as g}from"./Cm6SLr7W2.chunk.js";import{t as _}from"./B_-pJtOI2.chunk.js";import{t as v}from"./DbyH1eEj.chunk.js";import{t as y}from"./C9XBZFiR.chunk.js";import{t as b}from"./Tp0DOKOR.chunk.js";t();var x=n();function S(t){let n=i(o.currentUser()),S=i(n.data?.isAuthenticated&&a.video(t.id)),C=i(c.config()),w=i(f.createViewKey(t.id,d.MasterObject)),T=h(n.data?.isAuthenticated&&t.id),E=m(t.id);return u(l.getVideoMetadata({content:S.data,canonicalLink:_.getCanonicalLink(),allowIndexing:!1})),p(S,{private:v}),y(S,b),n.hasCompleted&&!n.data.isAuthenticated?(e.trigger({application:r.EMBED,action:s.Embed.LCS_LOGIN,args:[t.id],params:t.queryParams}),(0,x.jsx)(x.Fragment,{})):S.data&&n.hasCompleted&&C.hasCompleted&&w.hasCompleted&&T.hasCompleted&&E.hasCompleted?(0,x.jsx)(g,{config:C.data,video:S.data,currentUser:n.data,viewKey:w.data,pointsOfInterest:T.items,presentationSlug:null,embed:!0,showResources:!0,autoplay:t.queryParams.a===`true`,startTime:t.queryParams.t??t.queryParams.startTime,endTime:t.queryParams.endTime,playerIntegrations:E.data}):(0,x.jsx)(x.Fragment,{})}export{S as EmbeddedLcsVideoView};
2
+ //# sourceMappingURL=DZD8iLCw.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CTUTwtJp.chunk.js","names":[],"sources":["../../src/apps/embed/views/embedded-lcs-video/EmbeddedLcsVideoView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Config, CurrentUser, PlayerViewKey, Video } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useFetchPointsOfInterest } from 'shared/hooks/useFetchPointsOfInterest';\nimport { usePlayerIntegrations } from 'shared/hooks/usePlayerIntegrations';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { LitePlayerView } from 'shared/views/lite-player/LitePlayerView';\n\nimport { PrivateEmbedError } from 'apps/embed/errors/forbidden/PrivateEmbedError';\nimport { EmbeddedDefaultErrors } from 'apps/embed/utils/EmbedDefaultErrors';\n\ninterface EmbeddedLcsVideoViewProps {\n id: string;\n queryParams?: HashObject;\n}\n\n/**\n * This view has been introduced soley for the purpose of supporting RSS and Marc21 links\n * for LCSs (Library Cataloging Systems). If you're thinking about using it for anything else\n * please talk to me first - Sha\n */\nexport function EmbeddedLcsVideoView(props: EmbeddedLcsVideoViewProps): JSX.Element {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const video = Flight.useBasicFetch<Video>(currentUser.data?.isAuthenticated && VideoRequests.video(props.id));\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(PlayerRequests.createViewKey(props.id, MediaIdType.MasterObject));\n const pointsOfInterest = useFetchPointsOfInterest(currentUser.data?.isAuthenticated && props.id);\n const playerIntegrations = usePlayerIntegrations(props.id);\n\n useSetPageMetadata(PageMetadataHelper.getVideoMetadata({\n content: video.data,\n canonicalLink: SeoHelper.getCanonicalLink(),\n allowIndexing: false\n }));\n useCannotConsumeError(video, { private: PrivateEmbedError });\n useHandleObjectError(video, EmbeddedDefaultErrors);\n\n if (currentUser.hasCompleted && !currentUser.data.isAuthenticated) {\n Core.AppLinkHelper.trigger({\n application: AppChannels.EMBED,\n action: Actions.Embed.LCS_LOGIN,\n args: [props.id],\n params: props.queryParams\n });\n return <></>;\n }\n\n const hasLoaded = (\n video.data &&\n currentUser.hasCompleted &&\n config.hasCompleted &&\n viewKey.hasCompleted &&\n pointsOfInterest.hasCompleted &&\n playerIntegrations.hasCompleted\n );\n\n if (!hasLoaded) {\n return <></>;\n }\n\n return (\n <LitePlayerView\n config={config.data}\n video={video.data}\n currentUser={currentUser.data}\n viewKey={viewKey.data}\n pointsOfInterest={pointsOfInterest.items}\n presentationSlug={null}\n embed\n showResources\n autoplay={props.queryParams.a === 'true'}\n startTime={props.queryParams.t ?? props.queryParams.startTime}\n endTime={props.queryParams.endTime}\n playerIntegrations={playerIntegrations.data}\n />\n );\n}\n"],"mappings":"uwBAqCA,SAAgB,EAAqB,EAA+C,CAClF,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAQ,EAA4B,EAAY,MAAM,iBAAmB,EAAc,MAAM,EAAM,EAAE,CAAC,EACtG,EAAS,EAA6B,EAAe,OAAO,CAAC,EAC7D,EAAU,EAAoC,EAAe,cAAc,EAAM,GAAI,EAAY,YAAY,CAAC,EAC9G,EAAmB,EAAyB,EAAY,MAAM,iBAAmB,EAAM,EAAE,EACzF,EAAqB,EAAsB,EAAM,EAAE,EAiCzD,OA/BA,EAAmB,EAAmB,iBAAiB,CACrD,QAAS,EAAM,KACf,cAAe,EAAU,iBAAiB,EAC1C,cAAe,EACjB,CAAC,CAAC,EACF,EAAsB,EAAO,CAAE,QAAS,CAAkB,CAAC,EAC3D,EAAqB,EAAO,CAAqB,EAE7C,EAAY,cAAgB,CAAC,EAAY,KAAK,iBAChD,EAAmB,QAAQ,CACzB,YAAa,EAAY,MACzB,OAAQ,EAAQ,MAAM,UACtB,KAAM,CAAC,EAAM,EAAE,EACf,OAAQ,EAAM,WAChB,CAAC,GACM,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,GAIX,EAAM,MACN,EAAY,cACZ,EAAO,cACP,EAAQ,cACR,EAAiB,cACjB,EAAmB,cAQnB,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,OAAQ,EAAO,KACf,MAAO,EAAM,KACb,YAAa,EAAY,KACzB,QAAS,EAAQ,KACjB,iBAAkB,EAAiB,MACnC,iBAAkB,KAClB,MAAA,GACA,cAAA,GACA,SAAU,EAAM,YAAY,IAAM,OAClC,UAAW,EAAM,YAAY,GAAK,EAAM,YAAY,UACpD,QAAS,EAAM,YAAY,QAC3B,mBAAoB,EAAmB,IACxC,CAAA,GAjBM,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CAmBf"}
1
+ {"version":3,"file":"DZD8iLCw.chunk.js","names":[],"sources":["../../src/apps/embed/views/embedded-lcs-video/EmbeddedLcsVideoView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Config, CurrentUser, PlayerViewKey, Video } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useFetchPointsOfInterest } from 'shared/hooks/useFetchPointsOfInterest';\nimport { usePlayerIntegrations } from 'shared/hooks/usePlayerIntegrations';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { LitePlayerView } from 'shared/views/lite-player/LitePlayerView';\n\nimport { PrivateEmbedError } from 'apps/embed/errors/forbidden/PrivateEmbedError';\nimport { EmbeddedDefaultErrors } from 'apps/embed/utils/EmbedDefaultErrors';\n\ninterface EmbeddedLcsVideoViewProps {\n id: string;\n queryParams?: HashObject;\n}\n\n/**\n * This view has been introduced soley for the purpose of supporting RSS and Marc21 links\n * for LCSs (Library Cataloging Systems). If you're thinking about using it for anything else\n * please talk to me first - Sha\n */\nexport function EmbeddedLcsVideoView(props: EmbeddedLcsVideoViewProps): JSX.Element {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const video = Flight.useBasicFetch<Video>(currentUser.data?.isAuthenticated && VideoRequests.video(props.id));\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(PlayerRequests.createViewKey(props.id, MediaIdType.MasterObject));\n const pointsOfInterest = useFetchPointsOfInterest(currentUser.data?.isAuthenticated && props.id);\n const playerIntegrations = usePlayerIntegrations(props.id);\n\n useSetPageMetadata(PageMetadataHelper.getVideoMetadata({\n content: video.data,\n canonicalLink: SeoHelper.getCanonicalLink(),\n allowIndexing: false\n }));\n useCannotConsumeError(video, { private: PrivateEmbedError });\n useHandleObjectError(video, EmbeddedDefaultErrors);\n\n if (currentUser.hasCompleted && !currentUser.data.isAuthenticated) {\n Core.AppLinkHelper.trigger({\n application: AppChannels.EMBED,\n action: Actions.Embed.LCS_LOGIN,\n args: [props.id],\n params: props.queryParams\n });\n return <></>;\n }\n\n const hasLoaded = (\n video.data &&\n currentUser.hasCompleted &&\n config.hasCompleted &&\n viewKey.hasCompleted &&\n pointsOfInterest.hasCompleted &&\n playerIntegrations.hasCompleted\n );\n\n if (!hasLoaded) {\n return <></>;\n }\n\n return (\n <LitePlayerView\n config={config.data}\n video={video.data}\n currentUser={currentUser.data}\n viewKey={viewKey.data}\n pointsOfInterest={pointsOfInterest.items}\n presentationSlug={null}\n embed\n showResources\n autoplay={props.queryParams.a === 'true'}\n startTime={props.queryParams.t ?? props.queryParams.startTime}\n endTime={props.queryParams.endTime}\n playerIntegrations={playerIntegrations.data}\n />\n );\n}\n"],"mappings":"uwBAqCA,SAAgB,EAAqB,EAA+C,CAClF,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAQ,EAA4B,EAAY,MAAM,iBAAmB,EAAc,MAAM,EAAM,EAAE,CAAC,EACtG,EAAS,EAA6B,EAAe,OAAO,CAAC,EAC7D,EAAU,EAAoC,EAAe,cAAc,EAAM,GAAI,EAAY,YAAY,CAAC,EAC9G,EAAmB,EAAyB,EAAY,MAAM,iBAAmB,EAAM,EAAE,EACzF,EAAqB,EAAsB,EAAM,EAAE,EAiCzD,OA/BA,EAAmB,EAAmB,iBAAiB,CACrD,QAAS,EAAM,KACf,cAAe,EAAU,iBAAiB,EAC1C,cAAe,EACjB,CAAC,CAAC,EACF,EAAsB,EAAO,CAAE,QAAS,CAAkB,CAAC,EAC3D,EAAqB,EAAO,CAAqB,EAE7C,EAAY,cAAgB,CAAC,EAAY,KAAK,iBAChD,EAAmB,QAAQ,CACzB,YAAa,EAAY,MACzB,OAAQ,EAAQ,MAAM,UACtB,KAAM,CAAC,EAAM,EAAE,EACf,OAAQ,EAAM,WAChB,CAAC,GACM,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,GAIX,EAAM,MACN,EAAY,cACZ,EAAO,cACP,EAAQ,cACR,EAAiB,cACjB,EAAmB,cAQnB,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,OAAQ,EAAO,KACf,MAAO,EAAM,KACb,YAAa,EAAY,KACzB,QAAS,EAAQ,KACjB,iBAAkB,EAAiB,MACnC,iBAAkB,KAClB,MAAA,GACA,cAAA,GACA,SAAU,EAAM,YAAY,IAAM,OAClC,UAAW,EAAM,YAAY,GAAK,EAAM,YAAY,UACpD,QAAS,EAAM,YAAY,QAC3B,mBAAoB,EAAmB,IACxC,CAAA,GAjBM,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CAmBf"}
@@ -1,2 +1,2 @@
1
- import"./DAXXjFlN.chunk.js";import{y as e}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t}from"./CQyJ7YGa.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{u as i}from"./BX0wDJmp.chunk.js";import{t as a}from"./DIqO2TFN.chunk.js";import{t as o}from"./DTGfiG8Y.chunk.js";import{t as s}from"./LoQS6GjP.chunk.js";import{t as c}from"./CqrjHjAN.chunk.js";import{t as l}from"./D_gWf2lC.chunk.js";import{t as u}from"./DruDe9vI.chunk.js";import{t as d}from"./C4TNMYS42.chunk.js";import{n as f,t as p}from"./BGhJ8TEx.chunk.js";import{t as m}from"./Bw2cauzs2.chunk.js";import{t as h}from"./CpoRsMKu.chunk.js";import{t as g}from"./DaT2nTfp.chunk.js";import{t as _}from"./C-k6FY-f.chunk.js";n();var v=r(),y=t.encloseNamespace(`views.upsellProductInfoView`);function b(t){let n=i(c.currentUser()),r=n.data?.instanceRegion,b=i(l.config()),x=d(),{applink:S}=h(),C=x.upsellPresentationType===o.Subject?`welcomeToClickView`:`welcomeToClickViewLive`,w=(b.data?.liteUrl.includes(`staging`)?a.TutorialVideoHighlight[C].staging:a.TutorialVideoHighlight[C].production)?.[r],T=i(w&&s.sharedVideo(w.VIDEO,w.SHARE)),E=i(w&&p.createViewKey(w.SHARE,f.Share)),D=i(w.SHARE&&u.getShareObject(w.SHARE)),O=()=>{t.closePopup(),e.trigger(S)},k=n.hasCompleted&&b.hasCompleted,A=!w||T.hasCompleted&&E.hasCompleted,j=k&&A,M=!!T.data&&!!E.data,N=y(x.upsellPresentationType===o.Subject?`cv`:`cvlive`);return(0,v.jsxs)(g,{size:`lg`,closePopup:t.closePopup,showLoadingSpinner:!j,title:y(`header`,{productName:N}),children:[j&&M&&(0,v.jsx)(m,{config:b.data,currentUser:n.data,video:T?.data,viewKey:E.data,presentationSlug:null,shareLink:D.data,autoplay:!0}),(0,v.jsx)(`p`,{className:`mt-3`,children:y(`infoText`,{productName:N})}),(0,v.jsxs)(_,{children:[(0,v.jsx)(_.Cancel,{onClick:t.closePopup}),(0,v.jsx)(_.Submit,{onClick:O,text:y(`submitText`),variant:`dark`})]})]})}export{b as UpsellProductInfoView};
2
- //# sourceMappingURL=C-gsezmj.chunk.js.map
1
+ import"./DAXXjFlN.chunk.js";import{y as e}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t}from"./CQyJ7YGa.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{u as i}from"./BX0wDJmp.chunk.js";import{t as a}from"./DIqO2TFN.chunk.js";import{t as o}from"./DTGfiG8Y.chunk.js";import{t as s}from"./LoQS6GjP.chunk.js";import{t as c}from"./CqrjHjAN.chunk.js";import{t as l}from"./D_gWf2lC.chunk.js";import{t as u}from"./DruDe9vI.chunk.js";import{t as d}from"./C4TNMYS42.chunk.js";import{n as f,t as p}from"./BGhJ8TEx.chunk.js";import{t as m}from"./Cm6SLr7W2.chunk.js";import{t as h}from"./CpoRsMKu.chunk.js";import{t as g}from"./DaT2nTfp.chunk.js";import{t as _}from"./C-k6FY-f.chunk.js";n();var v=r(),y=t.encloseNamespace(`views.upsellProductInfoView`);function b(t){let n=i(c.currentUser()),r=n.data?.instanceRegion,b=i(l.config()),x=d(),{applink:S}=h(),C=x.upsellPresentationType===o.Subject?`welcomeToClickView`:`welcomeToClickViewLive`,w=(b.data?.liteUrl.includes(`staging`)?a.TutorialVideoHighlight[C].staging:a.TutorialVideoHighlight[C].production)?.[r],T=i(w&&s.sharedVideo(w.VIDEO,w.SHARE)),E=i(w&&p.createViewKey(w.SHARE,f.Share)),D=i(w.SHARE&&u.getShareObject(w.SHARE)),O=()=>{t.closePopup(),e.trigger(S)},k=n.hasCompleted&&b.hasCompleted,A=!w||T.hasCompleted&&E.hasCompleted,j=k&&A,M=!!T.data&&!!E.data,N=y(x.upsellPresentationType===o.Subject?`cv`:`cvlive`);return(0,v.jsxs)(g,{size:`lg`,closePopup:t.closePopup,showLoadingSpinner:!j,title:y(`header`,{productName:N}),children:[j&&M&&(0,v.jsx)(m,{config:b.data,currentUser:n.data,video:T?.data,viewKey:E.data,presentationSlug:null,shareLink:D.data,autoplay:!0}),(0,v.jsx)(`p`,{className:`mt-3`,children:y(`infoText`,{productName:N})}),(0,v.jsxs)(_,{children:[(0,v.jsx)(_.Cancel,{onClick:t.closePopup}),(0,v.jsx)(_.Submit,{onClick:O,text:y(`submitText`),variant:`dark`})]})]})}export{b as UpsellProductInfoView};
2
+ //# sourceMappingURL=D_foXB2p.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"C-gsezmj.chunk.js","names":[],"sources":["../../src/shared/views/upsell-product-info/UpsellProductInfoView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/react/index';\n\nimport { ShareRequests } from 'libs/shared/apps/share/flight-requests/ShareRequests';\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { HardCoded } from 'libs/shared/constants/HardCoded';\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { Config, CurrentUser, PlayerViewKey, ShareLink, VideoTypes } from 'libs/shared/interfaces';\n\nimport { useRequestAccessApplink } from 'shared/hooks/useRequestAccessApplink';\nimport { useUpsellContext } from 'shared/hooks/useUpsellContext';\n\nimport { LitePlayerView } from '../lite-player/LitePlayerView';\n\nconst namespace = 'views.upsellProductInfoView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface UpsellProductInfoViewProps {\n presentationPreview: PresentationType;\n closePopup: () => void;\n}\n\nexport function UpsellProductInfoView(props: UpsellProductInfoViewProps) {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const instanceRegion = currentUser.data?.instanceRegion;\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const context = useUpsellContext();\n\n const { applink: requestAccessApplink } = useRequestAccessApplink();\n\n const type = context.upsellPresentationType === PresentationType.Subject ? 'welcomeToClickView' : 'welcomeToClickViewLive';\n\n const ids = config.data?.liteUrl.includes('staging') ?\n HardCoded.TutorialVideoHighlight[type].staging :\n HardCoded.TutorialVideoHighlight[type].production;\n\n const videoIds = ids?.[instanceRegion as keyof typeof ids];\n\n const video = Flight.useBasicFetch<VideoTypes>(\n videoIds && VideoRequests.sharedVideo(videoIds.VIDEO, videoIds.SHARE)\n );\n\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(\n videoIds && PlayerRequests.createViewKey(videoIds.SHARE, MediaIdType.Share)\n );\n\n const shareLink = Flight.useBasicFetch<ShareLink>(\n videoIds.SHARE && ShareRequests.getShareObject(videoIds.SHARE)\n );\n\n const onAccessRequest = () => {\n props.closePopup();\n Core.AppLinkHelper.trigger(requestAccessApplink);\n };\n\n const inputsLoaded = currentUser.hasCompleted && config.hasCompleted;\n const videoLoaded = !videoIds || (video.hasCompleted && viewKey.hasCompleted);\n const loaded = inputsLoaded && videoLoaded;\n const hasVideo = !!video.data && !!viewKey.data;\n \n const productName = getPhrase(context.upsellPresentationType === PresentationType.Subject ? 'cv' : 'cvlive');\n\n return (\n <Popup\n size='lg'\n closePopup={props.closePopup}\n showLoadingSpinner={!loaded}\n title={getPhrase('header', { productName })}\n >\n {\n loaded && hasVideo &&\n <LitePlayerView\n config={config.data}\n currentUser={currentUser.data}\n video={video?.data}\n viewKey={viewKey.data}\n presentationSlug={null}\n shareLink={shareLink.data}\n autoplay\n />\n }\n\n <p className='mt-3'>{getPhrase('infoText', { productName })}</p>\n \n <PopupButtons>\n <PopupButtons.Cancel onClick={props.closePopup} />\n <PopupButtons.Submit onClick={onAccessRequest} text={getPhrase('submitText')} variant='dark' />\n </PopupButtons>\n </Popup>\n );\n}\n"],"mappings":"kvBAwBM,EAAY,EAAgB,iBAAiB,6BAAS,EAO5D,SAAgB,EAAsB,EAAmC,CACvE,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAiB,EAAY,MAAM,eACnC,EAAS,EAA6B,EAAe,OAAO,CAAC,EAC7D,EAAU,EAAiB,EAE3B,CAAE,QAAS,GAAyB,EAAwB,EAE5D,EAAO,EAAQ,yBAA2B,EAAiB,QAAU,qBAAuB,yBAM5F,GAJM,EAAO,MAAM,QAAQ,SAAS,SAAS,EACjD,EAAU,uBAAuB,EAAK,CAAC,QACvC,EAAU,uBAAuB,EAAK,CAAC,WAAA,GAElB,GAEjB,EAAQ,EACZ,GAAY,EAAc,YAAY,EAAS,MAAO,EAAS,KAAK,CACtE,EAEM,EAAU,EACd,GAAY,EAAe,cAAc,EAAS,MAAO,EAAY,KAAK,CAC5E,EAEM,EAAY,EAChB,EAAS,OAAS,EAAc,eAAe,EAAS,KAAK,CAC/D,EAEM,MAAwB,CAC5B,EAAM,WAAW,EACjB,EAAmB,QAAQ,CAAoB,CACjD,EAEM,EAAe,EAAY,cAAgB,EAAO,aAClD,EAAc,CAAC,GAAa,EAAM,cAAgB,EAAQ,aAC1D,EAAS,GAAgB,EACzB,EAAW,CAAC,CAAC,EAAM,MAAQ,CAAC,CAAC,EAAQ,KAErC,EAAc,EAAU,EAAQ,yBAA2B,EAAiB,QAAU,KAAO,QAAQ,EAE3G,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CACE,KAAK,KACL,WAAY,EAAM,WAClB,mBAAoB,CAAC,EACrB,MAAO,EAAU,SAAU,CAAE,aAAY,CAAC,WAJ5C,CAOI,GAAU,IACV,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,OAAQ,EAAO,KACf,YAAa,EAAY,KACzB,MAAO,GAAO,KACd,QAAS,EAAQ,KACjB,iBAAkB,KAClB,UAAW,EAAU,KACrB,SAAA,EACD,CAAA,GAGH,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,gBAAQ,EAAU,WAAY,CAAE,aAAY,CAAC,CAAK,CAAA,GAE/D,EAAA,EAAA,KAAA,CAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAa,OAAd,CAAqB,QAAS,EAAM,UAAa,CAAA,GACjD,EAAA,EAAA,IAAA,CAAC,EAAa,OAAd,CAAqB,QAAS,EAAiB,KAAM,EAAU,YAAY,EAAG,QAAQ,MAAQ,CAAA,CAClF,CAAA,CAAA,CACT,GAEX"}
1
+ {"version":3,"file":"D_foXB2p.chunk.js","names":[],"sources":["../../src/shared/views/upsell-product-info/UpsellProductInfoView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/react/index';\n\nimport { ShareRequests } from 'libs/shared/apps/share/flight-requests/ShareRequests';\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { HardCoded } from 'libs/shared/constants/HardCoded';\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { Config, CurrentUser, PlayerViewKey, ShareLink, VideoTypes } from 'libs/shared/interfaces';\n\nimport { useRequestAccessApplink } from 'shared/hooks/useRequestAccessApplink';\nimport { useUpsellContext } from 'shared/hooks/useUpsellContext';\n\nimport { LitePlayerView } from '../lite-player/LitePlayerView';\n\nconst namespace = 'views.upsellProductInfoView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface UpsellProductInfoViewProps {\n presentationPreview: PresentationType;\n closePopup: () => void;\n}\n\nexport function UpsellProductInfoView(props: UpsellProductInfoViewProps) {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const instanceRegion = currentUser.data?.instanceRegion;\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const context = useUpsellContext();\n\n const { applink: requestAccessApplink } = useRequestAccessApplink();\n\n const type = context.upsellPresentationType === PresentationType.Subject ? 'welcomeToClickView' : 'welcomeToClickViewLive';\n\n const ids = config.data?.liteUrl.includes('staging') ?\n HardCoded.TutorialVideoHighlight[type].staging :\n HardCoded.TutorialVideoHighlight[type].production;\n\n const videoIds = ids?.[instanceRegion as keyof typeof ids];\n\n const video = Flight.useBasicFetch<VideoTypes>(\n videoIds && VideoRequests.sharedVideo(videoIds.VIDEO, videoIds.SHARE)\n );\n\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(\n videoIds && PlayerRequests.createViewKey(videoIds.SHARE, MediaIdType.Share)\n );\n\n const shareLink = Flight.useBasicFetch<ShareLink>(\n videoIds.SHARE && ShareRequests.getShareObject(videoIds.SHARE)\n );\n\n const onAccessRequest = () => {\n props.closePopup();\n Core.AppLinkHelper.trigger(requestAccessApplink);\n };\n\n const inputsLoaded = currentUser.hasCompleted && config.hasCompleted;\n const videoLoaded = !videoIds || (video.hasCompleted && viewKey.hasCompleted);\n const loaded = inputsLoaded && videoLoaded;\n const hasVideo = !!video.data && !!viewKey.data;\n \n const productName = getPhrase(context.upsellPresentationType === PresentationType.Subject ? 'cv' : 'cvlive');\n\n return (\n <Popup\n size='lg'\n closePopup={props.closePopup}\n showLoadingSpinner={!loaded}\n title={getPhrase('header', { productName })}\n >\n {\n loaded && hasVideo &&\n <LitePlayerView\n config={config.data}\n currentUser={currentUser.data}\n video={video?.data}\n viewKey={viewKey.data}\n presentationSlug={null}\n shareLink={shareLink.data}\n autoplay\n />\n }\n\n <p className='mt-3'>{getPhrase('infoText', { productName })}</p>\n \n <PopupButtons>\n <PopupButtons.Cancel onClick={props.closePopup} />\n <PopupButtons.Submit onClick={onAccessRequest} text={getPhrase('submitText')} variant='dark' />\n </PopupButtons>\n </Popup>\n );\n}\n"],"mappings":"kvBAwBM,EAAY,EAAgB,iBAAiB,6BAAS,EAO5D,SAAgB,EAAsB,EAAmC,CACvE,IAAM,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAiB,EAAY,MAAM,eACnC,EAAS,EAA6B,EAAe,OAAO,CAAC,EAC7D,EAAU,EAAiB,EAE3B,CAAE,QAAS,GAAyB,EAAwB,EAE5D,EAAO,EAAQ,yBAA2B,EAAiB,QAAU,qBAAuB,yBAM5F,GAJM,EAAO,MAAM,QAAQ,SAAS,SAAS,EACjD,EAAU,uBAAuB,EAAK,CAAC,QACvC,EAAU,uBAAuB,EAAK,CAAC,WAAA,GAElB,GAEjB,EAAQ,EACZ,GAAY,EAAc,YAAY,EAAS,MAAO,EAAS,KAAK,CACtE,EAEM,EAAU,EACd,GAAY,EAAe,cAAc,EAAS,MAAO,EAAY,KAAK,CAC5E,EAEM,EAAY,EAChB,EAAS,OAAS,EAAc,eAAe,EAAS,KAAK,CAC/D,EAEM,MAAwB,CAC5B,EAAM,WAAW,EACjB,EAAmB,QAAQ,CAAoB,CACjD,EAEM,EAAe,EAAY,cAAgB,EAAO,aAClD,EAAc,CAAC,GAAa,EAAM,cAAgB,EAAQ,aAC1D,EAAS,GAAgB,EACzB,EAAW,CAAC,CAAC,EAAM,MAAQ,CAAC,CAAC,EAAQ,KAErC,EAAc,EAAU,EAAQ,yBAA2B,EAAiB,QAAU,KAAO,QAAQ,EAE3G,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CACE,KAAK,KACL,WAAY,EAAM,WAClB,mBAAoB,CAAC,EACrB,MAAO,EAAU,SAAU,CAAE,aAAY,CAAC,WAJ5C,CAOI,GAAU,IACV,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,OAAQ,EAAO,KACf,YAAa,EAAY,KACzB,MAAO,GAAO,KACd,QAAS,EAAQ,KACjB,iBAAkB,KAClB,UAAW,EAAU,KACrB,SAAA,EACD,CAAA,GAGH,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,gBAAQ,EAAU,WAAY,CAAE,aAAY,CAAC,CAAK,CAAA,GAE/D,EAAA,EAAA,KAAA,CAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAa,OAAd,CAAqB,QAAS,EAAM,UAAa,CAAA,GACjD,EAAA,EAAA,IAAA,CAAC,EAAa,OAAd,CAAqB,QAAS,EAAiB,KAAM,EAAU,YAAY,EAAG,QAAQ,MAAQ,CAAA,CAClF,CAAA,CAAA,CACT,GAEX"}
@@ -1,4 +1,4 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{x as t}from"./BftnFbcr.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{C as i,U as a,d as o,l as s,z as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./Dyy-PWHO.chunk.js";import{a as u,c as d,d as f,f as p,m,n as h,o as g,p as _,s as v,t as ee,u as te}from"./CoUj6M-_.chunk.js";import{t as y}from"./CnnDkGmK.chunk.js";import{n as b}from"./B5XaBzZh.chunk.js";import"./DbQFpTve.chunk.js";import"./DYN56vJ6.chunk.js";import{t as x}from"./BiKac8UT2.chunk.js";import"./29-YRbOp.chunk.js";import{a as S,i as C,n as w,o as T,r as E,s as D,t as O}from"./_jJAx6fU.chunk.js";import{t as ne}from"./CLjADRa42.chunk.js";var k=e(n()),re=m.getComponent(`Button`),A=class extends re{constructor(...e){super(...e),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildCSSClass(){return`cv-create-clip-button`}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return``}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}};A.prototype.controlText_=`Create clip`,m.registerComponent(`CreateClipButton`,A);var ie=m.getPlugin(`plugin`),ae=class extends ie{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){let e=this.player.getChild(`collapserator`);e&&e.addChild(`CreateClipButton`,{clickHandler:this.options.onClick})}};m.registerPlugin(`createClipButtonPlugin`,ae);var oe=m.getComponent(`PictureInPictureToggle`),se=class extends oe{handlePictureInPictureEnabledChange(){this.enable()}};m.registerComponent(`PictureInPictureToggle`,se);var ce=m.getComponent(`PlayToggle`),le=m.getPlugin(`plugin`),ue=800,de=class extends le{constructor(e,t){super(e,t),this.options=t,this.bindFunctions(),e.ready(()=>this.initialize())}bindFunctions(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}initialize(){let e=this.player.getChild(`collapserator`);this.toggle=e.addChild(`pictureInPictureToggle`,{}),this.toggle.enable(),this.player.on(`playerresize`,this.onPlayerResize),this.player.on(`dispose`,()=>{this.player?.off(`playerresize`,this.onPlayerResize)})}togglePictureInPicture(e){if(e===this.player.isInPictureInPicture())return;let t=e?`enterpictureinpicture`:`leavepictureinpicture`;this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}onPlayerResize(){if(this.player.isInPictureInPicture())return;let e=this.player.el().getBoundingClientRect();e.width!==0&&(e.width<ue?this.toggle?.hide():this.toggle?.show())}addPipStyles(){this.player.addClass(`cv-picture-in-picture`),this.playToggle=new ce(this.player),this.playToggle.addClass(`cv-pip-play-toggle`),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}removePipStyles(){this.player.removeClass(`cv-picture-in-picture`),this.player.removeChild(this.playToggle),delete this.playToggle}requestPictureInPicture(){this.togglePictureInPicture(!0),typeof this.options?.onRequestPictureInPicture==`function`&&this.options.onRequestPictureInPicture(!0)}async exitPictureInPicture(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}dispose(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,super.dispose()}};m.registerPlugin(`pictureInPicture`,de);var fe=m.getComponent(`Component`),pe=class extends fe{constructor(e,t){super(e,t),this.hasBuffered=!1,this.hasPlayed=!1,this.eventsService=ne,this.pointOfInterest=t.pointOfInterest,this.onMouseOver=this.onMouseOver.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onGlancePointOfInterestMouseEnter=this.onGlancePointOfInterestMouseEnter.bind(this),this.onGlancePointOfInterestMouseLeave=this.onGlancePointOfInterestMouseLeave.bind(this),this.initialize()}initialize(){this.setPosition(),this.bindListeners()}buildCSSClass(){return`cv-point-of-interest-indicator ${super.buildCSSClass()}`}createEl(e,t,n){return super.createEl(e,{...t,className:this.buildCSSClass()},n)}bindListeners(){this.on(`mouseover`,this.onMouseOver),this.on(`mouseleave`,this.onMouseLeave),this.eventsService.subscribe(`glance:poi:mouseover`,this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe(`glance:poi:mouseleave`,this.onGlancePointOfInterestMouseLeave)}dispose(){this.eventsService.unsubscribe(`glance:poi:mouseover`,this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe(`glance:poi:mouseleave`,this.onGlancePointOfInterestMouseLeave)}getPointOfInterestTime(){return this.pointOfInterest.startTime}setPosition(){let e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+`%`}updateBuffered(e){let t=this.getPointOfInterestTime()<=e;if(t===this.hasBuffered)return;this.hasBuffered=t;let n=`cv-point-of-interest-indicator-buffered`;this.hasBuffered?this.addClass(n):this.removeClass(n)}updatePlaybackProgress(e){let t=this.getPointOfInterestTime()<=e;if(t===this.hasPlayed)return;this.hasPlayed=t;let n=`cv-point-of-interest-indicator-played`;t?this.addClass(n):this.removeClass(n)}toggleVisibility(e){let t=`cv-point-of-interest-indicator-hidden`;e?this.removeClass(t):this.addClass(t)}onMouseOver(){this.setTimeTooltipText(),this.eventsService.trigger(`player:poi:mouseover`,this.pointOfInterest)}onMouseLeave(){this.clearTimeTooltipText(),this.eventsService.trigger(`player:poi:mouseleave`)}onGlancePointOfInterestMouseEnter(e){e.id===this.pointOfInterest.id&&(this.addClass(`cv-point-of-interest-indicator-highlight`),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}onGlancePointOfInterestMouseLeave(){this.removeClass(`cv-point-of-interest-indicator-highlight`),this.hideMouseTimeDisplay()}setTimeTooltipText(){this.getTimeTooltip()?.setCustomChapterText(this.pointOfInterest.description)}clearTimeTooltipText(){this.getTimeTooltip()?.setCustomChapterText()}setTimeTooltipTime(){this.getTimeTooltip()?.updateTime(this.getPointOfInterestTime())}positionMouseTimeDisplay(){let e=this.getSeekBar()?.el();if(!e)return;let t=m.dom.findPosition(e),n=this.getPointOfInterestTime()/this.player().duration();this.getMouseTimeDisplay()?.update(t,n)}showMouseTimeDisplay(){this.getMouseTimeDisplay()?.forceShow()}hideMouseTimeDisplay(){this.getMouseTimeDisplay()?.removeForceShow()}getSeekBar(){return this.player().controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`)}getMouseTimeDisplay(){return this.getSeekBar()?.getChild(`MouseTimeDisplay`)}getTimeTooltip(){return this.getMouseTimeDisplay()?.getChild(`TimeTooltip`)}},me=m.getComponent(`MenuItem`),j=class extends me{constructor(e,t){super(e,t),this.pointsOfInterestVisible=t.pointsOfInterestVisible,this.toggle(this.pointsOfInterestVisible)}handleToggle(){this.toggle(!this.pointsOfInterestVisible)}toggle(e){e?this.toggleOn():this.toggleOff()}toggleOn(){m.dom.addClass(this.toggleEl,`on`),m.dom.setAttribute(this.toggleEl,`aria-checked`,`true`),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}toggleOff(){m.dom.removeClass(this.toggleEl,`on`),m.dom.setAttribute(this.toggleEl,`aria-checked`,`false`),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,n){this.handlerBound||=(this.handleToggle=this.handleToggle.bind(this),!0),this.toggleEl&&this.toggleEl.removeEventListener(`click`,this.handleToggle),this.toggleEl=m.dom.createEl(`div`,{className:`custom-toggle custom-toggle-info toggle-option float-end`,innerHTML:`<span class="handle"></span></div>`}),m.dom.setAttribute(this.toggleEl,`id`,`poi-toggle`),m.dom.setAttribute(this.toggleEl,`role`,`switch`),this.toggleEl.addEventListener(`click`,this.handleToggle);let r=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item cv-poi-toggle`,innerHTML:`
1
+ import{o as e}from"./DAXXjFlN.chunk.js";import{x as t}from"./BftnFbcr.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{C as i,U as a,d as o,l as s,z as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./Dyy-PWHO.chunk.js";import{a as u,c as d,d as f,f as p,m,n as h,o as g,p as _,s as v,t as ee,u as te}from"./CKGiikBV.chunk.js";import{t as y}from"./CnnDkGmK.chunk.js";import{n as b}from"./B5XaBzZh.chunk.js";import"./DIeIfhGe.chunk.js";import"./_XhYAc8v.chunk.js";import{t as x}from"./BiKac8UT2.chunk.js";import"./D4uneRs9.chunk.js";import{a as S,i as C,n as w,o as T,r as E,s as D,t as O}from"./_jJAx6fU.chunk.js";import{t as ne}from"./CLjADRa42.chunk.js";var k=e(n()),re=m.getComponent(`Button`),A=class extends re{constructor(...e){super(...e),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildCSSClass(){return`cv-create-clip-button`}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return``}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}};A.prototype.controlText_=`Create clip`,m.registerComponent(`CreateClipButton`,A);var ie=m.getPlugin(`plugin`),ae=class extends ie{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){let e=this.player.getChild(`collapserator`);e&&e.addChild(`CreateClipButton`,{clickHandler:this.options.onClick})}};m.registerPlugin(`createClipButtonPlugin`,ae);var oe=m.getComponent(`PictureInPictureToggle`),se=class extends oe{handlePictureInPictureEnabledChange(){this.enable()}};m.registerComponent(`PictureInPictureToggle`,se);var ce=m.getComponent(`PlayToggle`),le=m.getPlugin(`plugin`),ue=800,de=class extends le{constructor(e,t){super(e,t),this.options=t,this.bindFunctions(),e.ready(()=>this.initialize())}bindFunctions(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}initialize(){let e=this.player.getChild(`collapserator`);this.toggle=e.addChild(`pictureInPictureToggle`,{}),this.toggle.enable(),this.player.on(`playerresize`,this.onPlayerResize),this.player.on(`dispose`,()=>{this.player?.off(`playerresize`,this.onPlayerResize)})}togglePictureInPicture(e){if(e===this.player.isInPictureInPicture())return;let t=e?`enterpictureinpicture`:`leavepictureinpicture`;this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}onPlayerResize(){if(this.player.isInPictureInPicture())return;let e=this.player.el().getBoundingClientRect();e.width!==0&&(e.width<ue?this.toggle?.hide():this.toggle?.show())}addPipStyles(){this.player.addClass(`cv-picture-in-picture`),this.playToggle=new ce(this.player),this.playToggle.addClass(`cv-pip-play-toggle`),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}removePipStyles(){this.player.removeClass(`cv-picture-in-picture`),this.player.removeChild(this.playToggle),delete this.playToggle}requestPictureInPicture(){this.togglePictureInPicture(!0),typeof this.options?.onRequestPictureInPicture==`function`&&this.options.onRequestPictureInPicture(!0)}async exitPictureInPicture(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}dispose(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,super.dispose()}};m.registerPlugin(`pictureInPicture`,de);var fe=m.getComponent(`Component`),pe=class extends fe{constructor(e,t){super(e,t),this.hasBuffered=!1,this.hasPlayed=!1,this.eventsService=ne,this.pointOfInterest=t.pointOfInterest,this.onMouseOver=this.onMouseOver.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onGlancePointOfInterestMouseEnter=this.onGlancePointOfInterestMouseEnter.bind(this),this.onGlancePointOfInterestMouseLeave=this.onGlancePointOfInterestMouseLeave.bind(this),this.initialize()}initialize(){this.setPosition(),this.bindListeners()}buildCSSClass(){return`cv-point-of-interest-indicator ${super.buildCSSClass()}`}createEl(e,t,n){return super.createEl(e,{...t,className:this.buildCSSClass()},n)}bindListeners(){this.on(`mouseover`,this.onMouseOver),this.on(`mouseleave`,this.onMouseLeave),this.eventsService.subscribe(`glance:poi:mouseover`,this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe(`glance:poi:mouseleave`,this.onGlancePointOfInterestMouseLeave)}dispose(){this.eventsService.unsubscribe(`glance:poi:mouseover`,this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe(`glance:poi:mouseleave`,this.onGlancePointOfInterestMouseLeave)}getPointOfInterestTime(){return this.pointOfInterest.startTime}setPosition(){let e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+`%`}updateBuffered(e){let t=this.getPointOfInterestTime()<=e;if(t===this.hasBuffered)return;this.hasBuffered=t;let n=`cv-point-of-interest-indicator-buffered`;this.hasBuffered?this.addClass(n):this.removeClass(n)}updatePlaybackProgress(e){let t=this.getPointOfInterestTime()<=e;if(t===this.hasPlayed)return;this.hasPlayed=t;let n=`cv-point-of-interest-indicator-played`;t?this.addClass(n):this.removeClass(n)}toggleVisibility(e){let t=`cv-point-of-interest-indicator-hidden`;e?this.removeClass(t):this.addClass(t)}onMouseOver(){this.setTimeTooltipText(),this.eventsService.trigger(`player:poi:mouseover`,this.pointOfInterest)}onMouseLeave(){this.clearTimeTooltipText(),this.eventsService.trigger(`player:poi:mouseleave`)}onGlancePointOfInterestMouseEnter(e){e.id===this.pointOfInterest.id&&(this.addClass(`cv-point-of-interest-indicator-highlight`),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}onGlancePointOfInterestMouseLeave(){this.removeClass(`cv-point-of-interest-indicator-highlight`),this.hideMouseTimeDisplay()}setTimeTooltipText(){this.getTimeTooltip()?.setCustomChapterText(this.pointOfInterest.description)}clearTimeTooltipText(){this.getTimeTooltip()?.setCustomChapterText()}setTimeTooltipTime(){this.getTimeTooltip()?.updateTime(this.getPointOfInterestTime())}positionMouseTimeDisplay(){let e=this.getSeekBar()?.el();if(!e)return;let t=m.dom.findPosition(e),n=this.getPointOfInterestTime()/this.player().duration();this.getMouseTimeDisplay()?.update(t,n)}showMouseTimeDisplay(){this.getMouseTimeDisplay()?.forceShow()}hideMouseTimeDisplay(){this.getMouseTimeDisplay()?.removeForceShow()}getSeekBar(){return this.player().controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`)}getMouseTimeDisplay(){return this.getSeekBar()?.getChild(`MouseTimeDisplay`)}getTimeTooltip(){return this.getMouseTimeDisplay()?.getChild(`TimeTooltip`)}},me=m.getComponent(`MenuItem`),j=class extends me{constructor(e,t){super(e,t),this.pointsOfInterestVisible=t.pointsOfInterestVisible,this.toggle(this.pointsOfInterestVisible)}handleToggle(){this.toggle(!this.pointsOfInterestVisible)}toggle(e){e?this.toggleOn():this.toggleOff()}toggleOn(){m.dom.addClass(this.toggleEl,`on`),m.dom.setAttribute(this.toggleEl,`aria-checked`,`true`),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}toggleOff(){m.dom.removeClass(this.toggleEl,`on`),m.dom.setAttribute(this.toggleEl,`aria-checked`,`false`),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,n){this.handlerBound||=(this.handleToggle=this.handleToggle.bind(this),!0),this.toggleEl&&this.toggleEl.removeEventListener(`click`,this.handleToggle),this.toggleEl=m.dom.createEl(`div`,{className:`custom-toggle custom-toggle-info toggle-option float-end`,innerHTML:`<span class="handle"></span></div>`}),m.dom.setAttribute(this.toggleEl,`id`,`poi-toggle`),m.dom.setAttribute(this.toggleEl,`role`,`switch`),this.toggleEl.addEventListener(`click`,this.handleToggle);let r=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item cv-poi-toggle`,innerHTML:`
2
2
  <span for="poi-toggle" class="vjs-menu-item-text">Points of Interest</span>
3
3
  <span class="cv-toggle-container"></span>`},n);return r.children[1].appendChild(this.toggleEl),r}};m.registerComponent(`PointsOfInterestMenuItem`,j);var M=m.getPlugin(`plugin`),N=`cvplayer-points-of-interest`,P=class extends M{constructor(e,t){super(e),this.pointOfInterestIndicators=[],this.enabled=!0,this.pointsOfInterest=t?.pointsOfInterest,this.initialize=this.initialize.bind(this),this.updateBuffered=this.updateBuffered.bind(this),this.updatePlaybackProgress=this.updatePlaybackProgress.bind(this),this.player.one(`loadedmetadata`,()=>this.player.ready(this.initialize))}initialize(){this.pointsOfInterest&&(b.hasLocalStorage()&&b.get(N)===`false`&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}bindListeners(){this.player.on(`progress`,this.updateBuffered),this.player.on(`timeupdate`,this.updatePlaybackProgress),this.player.on(`dispose`,()=>{this.player?.off(`progress`,this.updateBuffered),this.player?.off(`timeupdate`,this.updatePlaybackProgress)})}togglePointsOfInterest(e){b.set(N,e.toString()),this.pointOfInterestIndicators.forEach(t=>t.toggleVisibility(e))}setupTrack(){let e=this.player.addTextTrack(`metadata`,`pointsofinterest`);this.pointsOfInterest.forEach(t=>{e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})}),e.trigger({type:`loadeddata`,target:e})}createPointOfInterestIndicators(){let e=this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`);this.pointsOfInterest.forEach(t=>{let n=new pe(this.player,{pointOfInterest:t});this.pointOfInterestIndicators.push(n),e.addChild(n)})}addMenuItem(){(this.player.getChild(`collapserator`)?.getChild(`cogButton`)).addItem({ctor:j,name:`PointsOfInterestMenuItem`,options:{pointsOfInterestVisible:this.enabled}})}updateBuffered(){this.pointOfInterestIndicators.forEach(e=>e.updateBuffered(u(this.player)))}updatePlaybackProgress(){this.pointOfInterestIndicators.forEach(e=>e.updatePlaybackProgress(this.player.currentTime()))}};m.registerPlugin(`pointsOfInterestPlugin`,P);var F=m.getComponent(`Component`),I=class extends F{constructor(e,t){super(e,t),this.initialize()}initialize(){this.setPosition()}buildCSSClass(){return`cv-range-indicator ${super.buildCSSClass()}`}createEl(e,t,n){return super.createEl(e,{...t,className:this.buildCSSClass()},n)}setPosition(){let e=this.player().duration();this.el_.style.left=this.options_.time/e*100+`%`}},L=m.getComponent(`ClickableComponent`),R=class extends L{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view-button ${super.buildCSSClass()}`}createEl(e,t,n){return super.createEl(e,{...t,innerHTML:`<span class="${this.options_.iconClassName}"></span><span>${this.options_.label}</span>`,className:this.buildCSSClass()},n)}handleClick(){this.options_.onPress()}},z=m.getComponent(`Component`),he=class extends z{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view ${super.buildCSSClass()}`}createEl(e,t,n){let r=super.createEl(e,{...t,className:this.buildCSSClass()},n),i=m.dom.createEl(`h5`,{innerHTML:this.localize(`This clip has finished`),className:`cv-replay-heading`}),a=m.dom.createEl(`div`,{className:`cv-button-container`}),o=new R(this.player_,{label:this.localize(`Replay clip`),iconClassName:`cv-replay-icon`,onPress:this.options_.onReplayPress}),s=new R(this.player_,{label:this.localize(`Continue watching`),iconClassName:`cv-continue-icon`,onPress:this.options_.onContinuePress});return r.appendChild(i),r.appendChild(a),a.appendChild(o.el()),a.appendChild(s.el()),r}},ge=m.getPlugin(`plugin`),_e=class extends ge{constructor(e,t){if(super(e,t),this.startTime=parseFloat(t.startTime.toPrecision(4)),this.endTime=parseFloat(t.endTime.toPrecision(4)),this.dismissed=!1,this.startTime>this.endTime)throw Error(`Range start cannot be greater than range end`);this.bindFunctions(),this.initialize()}bindFunctions(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}initialize(){this.player.one(`loadedmetadata`,()=>this.player.ready(this.onReady)),this.player.on(`timeupdate`,this.onTimeUpdateOrSeeked),this.player.on(`seeked`,this.onTimeUpdateOrSeeked)}onReady(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}onTimeUpdateOrSeeked(){if(this.dismissed)return;let e=this.player.currentTime();if(e<this.startTime){this.player.currentTime(this.startTime);return}if(e>this.endTime){this.showReplayView(),this.disablePlayToggle(),this.player.pause(),this.player.currentTime(this.endTime);return}}onReplayPress(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}onContinuePress(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}showRangeIndicators(){let e=this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`);this.startTimeIndicator||(this.startTimeIndicator=new I(this.player,{time:this.startTime}),e?.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new I(this.player,{time:this.endTime}),e?.addChild(this.endTimeIndicator))}hideRangeIndicators(){this.startTimeIndicator?.hide(),this.endTimeIndicator?.hide()}addMaskToProgressBar(){let e=(this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`))?.el().getElementsByClassName(`cv-chapter-bar-items`);if(e&&e.length){let t=e[0],n=this.player.duration(),r=this.startTime/n*100,i=100-this.endTime/n*100;t.style.clipPath=`inset(-5em ${i}% -5em ${r}%)`}}removeMaskFromProgressBar(){let e=(this.player.controlBar.getChild(`ProgressControl`)?.getChild(`SeekBar`))?.el().getElementsByClassName(`cv-chapter-bar-items`);if(e&&e.length){let t=e[0];t.style.clipPath=``}}showReplayView(){this.replayView||(this.replayView=new he(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}hideReplayView(){this.replayView?.hide()}getPlayToggle(){return this.player.getChild(`collapserator`)?.getChild(`PlayToggle`)}enablePlayToggle(){let e=this.getPlayToggle();e&&e.enable()}disablePlayToggle(){let e=this.getPlayToggle();e&&e.disable()}addCssClasses(){this.player.addClass(`cv-range-indicator-plugin`)}removeCssClasses(){this.player.removeClass(`cv-range-indicator-plugin`)}dispose(){this.removeCssClasses(),this.player.off(`timeupdate`,this.onTimeUpdateOrSeeked),this.player.off(`seeked`,this.onTimeUpdateOrSeeked),this.startTimeIndicator?.dispose(),this.endTimeIndicator?.dispose(),this.replayView?.dispose(),super.dispose()}};m.registerPlugin(`rangeIndicatorPlugin`,_e);var B={generateRandomId:()=>window.crypto?.randomUUID?.()??Math.random().toString()},ve=class extends ee{constructor(e,t){super(e,t)}getPlayerOptions(){let e=super.getPlayerOptions();return this.options.allowTranscript&&(e.allowTranscript=!0),e.devicesConfig?.canUserCastToDevices?{...e,techOrder:[`devices`,...e.techOrder],devices:{instanceId:B.generateRandomId()}}:e}configurePlugins(){try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),this.options.pointsOfInterest?.length&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest}),this.player.loopVideoPlugin({allowLoop:this.options.allowLoop})}catch(e){console.log(`failed to register plugins`,e)}}setNextVideo(e,t,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(e,t,n)}togglePictureInPicture(e){let t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}toggleTheatreMode(e){let t=this.player.theatreModePlugin();t&&t.toggleTheatreMode(e,{shouldLog:!0})}toggleTranscript(e){if(!this.player.viewTranscriptPlugin)return;let t=this.player.viewTranscriptPlugin();t&&t.toggleTranscript(e)}hasStarted(){return this.player.hasStarted()}async additionalSetup(e){if(this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode,playbackObject:e}),super.additionalSetup(e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),e.mediaType===`MasterClip`){let t=e.additionalData;if(t===null)throw Error(`Invalid clip data`);this.player.clipPlugin({startTime:t.startTime,endTime:t.endTime})}e.mediaType===`MasterVideo`&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime})}setupAnalyticsDependentPlugins(e){super.setupAnalyticsDependentPlugins(e),this.options.allowTranscript&&this.player.viewTranscriptPlugin().registerAnalytics(this.analyticsService,e),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin().registerAnalytics(this.analyticsService),this.options.devicesConfig?.canUserCastToDevices&&this.player.devicesPlugin&&this.player.devicesPlugin({...this.options.devicesConfig,userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService})}setActivityStatus(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}useCurrentTranscript(e,t){p.useMetadataTracks(this.player,`transcript`,e,t)}useChapters(e){p.useChapters(this.player,e)}},V={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:``},ye=class{constructor(e,t=V){this.bindFunctions(),this.url=e,this.options={...V,...t},this.webSocket=this.connect(),this.heartbeat=new E().schedule(()=>this.send(this.options.heartbeatMessage)).every(this.options.heartbeatIntervalInMillseconds)}bindFunctions(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}cleanup(){this.heartbeat.stop(),this.webSocket.removeEventListener(`error`,this.handleError),this.webSocket.removeEventListener(`message`,this.handleMessage),this.webSocket.removeEventListener(`open`,this.handleOpen),this.webSocket.removeEventListener(`close`,this.handleClose)}handleOpen(e){this.onOpen?.(e),this.options.heartbeatEnabled&&this.heartbeat.start()}handleMessage(e){this.onMessage?.(e)}handleClose(e){this.onClose?.(e),this.cleanup(),setTimeout(()=>{this.webSocket=this.connect()},this.options.reconnectIntervalInMilliseconds)}handleError(e){this.onError?.(e),this.handleClose()}connect(){let e=new WebSocket(this.url);return e.addEventListener(`open`,this.handleOpen),e.addEventListener(`message`,this.handleMessage),e.addEventListener(`close`,this.handleClose),e.addEventListener(`error`,this.handleError),e}send(e){this.webSocket.send(e)}dipose(){this.cleanup(),this.webSocket.close()}},be=2e3,xe=class{constructor(e,t){return this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource=``,this.subtitleSource=``,this.subtitles=!1,this.volume=0,this.title=e,this.device=t,this.ready=!1,this.playbackFinished=!1,this.debounced=w.withDebouncedSetters(this,be),w.withTimestampedSetters(this)}get position(){return this._position+this.getTimerDurationInSeconds()}set position(e){this._position=e,this.restartTimer()}get playing(){return this._playing}set playing(e){this._playing=e,e?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}restartTimer(){this._timerStartedAt=Date.now()}stopTimer(){this._timerStartedAt=0}getTimerDurationInSeconds(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}},H=function(e){return e.Update=`update`,e.Volume=`volume`,e.Playing=`playing`,e.Paused=`paused`,e.NewChapter=`new_chapter`,e.Stopped=`stopped`,e.Ready=`ready`,e.Mute=`mute`,e.Finished=`finished`,e.Subtitles=`subtitles`,e}({}),Se=class extends S{constructor(e,t){super(),this.client=e,this.localState=new xe(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}initialize(){this.client.on(`dispose`,this.dispose),this.client.on(`connected`,this.handleClientConnected),this.client.on(`message`,this.handleDisconnectMessage).filter(e=>e.source===this.getDevice().id&&e.message.type===`disconnect`),this.client.on(`message`,this.handleAllVideoMessages).filter(e=>e.source===this.getDevice().id&&e.message.type===`video_event`)}dispose(){this.client.off(`dispose`,this.dispose),this.client.off(`connected`,this.handleClientConnected),this.client.off(`message`,this.handleDisconnectMessage),this.client.off(`message`,this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(e=>console.error(e)),super.dispose()}async handleClientConnected(){try{await this.client.joinRoom(this.getDevice().id)}catch(e){this.trigger(`error`,e)}}handleDisconnectMessage(){this.dispose()}handleAllVideoMessages(e){let t=this.localState.debounced,n=e.message.payload.params||{};switch(e.message.payload.event){case H.Update:this.handleUpdateMessage(t,n);break;case H.NewChapter:this.handleNewChapterMessage(t,n);break;case H.Volume:this.handleVolumeMessage(t,n);break;case H.Playing:this.handlePlayingMessage(t);break;case H.Paused:this.handlePausedMessage(t);break;case H.Finished:this.handleFinishedMessage(t);break;case H.Stopped:this.handleStoppedMessage();break}}handleUpdateMessage(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger(`durationchange`,C.void)),e.position!==t.position&&(e.position=t.position,this.trigger(`positionchange`,C.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger(`subtitleschange`,C.void))}handleVolumeMessage(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=t.level===0,this.trigger(`volumechange`,C.void))}handlePlayingMessage(e){e.playing!==!0&&(e.playing=!0,e.playbackFinished=!1,this.trigger(`playingchange`,C.void))}handlePausedMessage(e){e.playing!==!1&&(e.playing=!1,this.trigger(`playingchange`,C.void))}handleFinishedMessage(e){e.playbackFinished!==!0&&(e.playing=!1,e.playbackFinished=!0,this.trigger(`playingchange`,C.void))}handleNewChapterMessage(e,t){let n=(t.queue??[]).find(t=>t.url===e.videoSource);if(!n){console.info(`The device is no longer playing the source we loaded - disposing the session`),this.dispose();return}e.subtitleSource!==n.suburl&&(e.subtitleSource=n.suburl,this.trigger(`subtitleschange`,C.void))}handleStoppedMessage(){this.dispose()}async loadSource(e,t){if(!(this.localState.videoSource===e&&this.localState.subtitleSource===t))try{let n=this.getDevice().id,r=this.getPosition();this.localState.videoSource=e,this.localState.subtitleSource=t,this.localState.ready=!1,await this.client.joinRoom(n),await this.client.loadQueue({title:this.getTitle(),roomId:n,videoSource:e,subtitleSource:t}),this.localState.ready=!0,this.trigger(`sourceloaded`,C.void),r>0&&this.seek(r),t&&this.setSubtitles(t)}catch(e){console.error(e),this.trigger(`error`,Error(`Could not load video on Vivi device`))}}play(){this.localState.ready&&this.localState.playing!==!0&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger(`playingchange`,C.void))}pause(){this.localState.ready&&this.localState.playing!==!1&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger(`playingchange`,C.void))}seek(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger(`positionchange`,C.void))}setVolume(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger(`volumechange`,C.void))}setMuted(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger(`volumechange`,C.void))}async setSubtitles(e){if(!this.localState.ready)return;e&&await this.loadSource(this.localState.videoSource,e);let t=!!e;this.localState.subtitles!==t&&(this.localState.subtitles=t,this.client.setSubtitles(this.getDevice().id,t),this.trigger(`subtitleschange`,C.void))}isPlaying(){return this.localState.playing}isPlaybackFinished(){return this.localState.playbackFinished}getPosition(){return this.localState.position}getDuration(){return this.localState.duration}getVolume(){return this.localState.volume}getMuted(){return this.localState.mute}getSubtitles(){if(this.localState.subtitles)return this.localState.subtitleSource}getDevice(){return this.localState.device}getTitle(){return this.localState.title}},U=1e4,Ce=500,we=1e4,W=class e extends S{constructor(e){super(),this.options=e,this.accessToken=``,this.devices=[],this.devicesFingerprint=``,this.deviceDiscovery=new E,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=y(this.sendMessage,Ce,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}initialize(){this.webSocket=new ye(this.options.url),this.webSocket.onMessage=e=>this.trigger(`message`,JSON.parse(e.data)),this.webSocket.onOpen=async()=>{try{this.accessToken=await this.options.fetchAccessToken(),await this.authenticateWithVivi(),this.beginDeviceDiscovery(),this.trigger(`connected`,C.void)}catch(e){console.error(e),this.trigger(`error`,Error(`Could not connect to Vivi`))}}}sendMessage(e){this.webSocket?.send(JSON.stringify(e))}beginDeviceDiscovery(){this.deviceDiscovery.every(we).schedule(async()=>{try{let t=await this.getRoomList(),n=e.calculateFingerprint(t);if(n===this.devicesFingerprint)return;let r=new Set(t.map(e=>e.organisation??``)).size,i=new Set(t.map(e=>e.location??``)).size;this.devices=t.map(e=>({id:e.id,name:e.name,schoolName:r>1?e.organisation:``,description:i>1?e.location:``,type:D.Vivi,status:T.Available})),this.devicesFingerprint=n,this.trigger(`deviceschange`,C.void)}catch(e){console.warn(e)}}).trigger().start()}dispose(){this.deviceDiscovery.stop(),this.webSocket?.dipose(),super.dispose()}canCastToDevice(e){return e===D.Vivi}getDevices(){return this.devices}startCastSession(e){return new Se(this,e)}async authenticateWithVivi(){this.sendMessage({destination:`relay`,message:{token:this.accessToken,type:`identify_video_api`}}),await this.one(`message`,e=>e.message.type===`video_api_identified`).timeout(U).catch(()=>{throw Error(`Failed to authenticate with Vivi`)})}async getRoomList(){return this.sendMessage({destination:`relay`,message:{type:`video_api_rooms`}}),(await this.one(`message`,e=>e.message.type===`video_api_rooms`).timeout(U).catch(()=>{throw Error(`Failed to fetch rooms`)})).message.rooms||[]}async joinRoom(e){this.sendMessage({destination:`relay`,message:{destination_type:`box`,new_destination:e,token:this.accessToken,type:`connect`}}),await this.one(`message`,t=>{if(t.source===e&&t.message.type===`connect`||t.message.type===`error`&&t.message.error_type===`already_connected`)return!0}).timeout(U).catch(()=>{throw Error(`Failed to join room`)})}async query(t){let n=e.createAckId();return this.sendMessage({destination:t,message:{type:`message_with_ack`,ack_id:n,name:`query`}}),await this.one(`message`,e=>e.message.ack_id===n).timeout(U).catch(()=>{throw Error(`Failed to fetch query`)})}async loadQueue({roomId:t,title:n,videoSource:r,subtitleSource:i}){this.sendMessage({destination:t,message:{type:`message_with_ack`,ack_id:e.createAckId(),name:`queue_load`,payload:{urls:[{title:n,url:r,suburl:i}]}}}),await this.one(`message`,e=>e.source===t&&e.message.payload?.event===`ready`).timeout(U).catch(()=>{throw Error(`Failed to load media`)})}async play(e){this.sendMessage({destination:e,message:{type:`message`,name:`video_play`,payload:{}}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`playing`).timeout(U).catch(()=>{throw Error(`Failed to play video`)})}async pause(e){this.sendMessage({destination:e,message:{type:`message`,name:`video_pause`}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`paused`).timeout(U).catch(()=>{throw Error(`Failed to pause video`)})}async stop(e){this.sendMessage({destination:e,message:{type:`message`,name:`video_stop`}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`stopped`).timeout(U).catch(()=>{throw Error(`Failed to stop video`)})}async seek(e,t){this.sendMessageDebounced({destination:e,message:{type:`message`,name:`video_seek`,payload:{position:t}}})&&await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`playing`).timeout(U).catch(()=>{throw Error(`Failed to seek video`)})}async setVolume(e,t){this.sendMessageDebounced({destination:e,message:{type:`message`,name:`set_volume`,payload:{volume:t}}})&&await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`volume`).timeout(U).catch(()=>{throw Error(`Failed to set volume`)})}async setMuted(e,t){this.sendMessage({destination:e,message:{type:`message`,name:`set_mute`,payload:{mute:t}}}),await this.one(`message`,t=>t.source===e&&t.message.payload?.event===`mute`).timeout(U).catch(()=>{throw Error(`Failed to set mute`)})}async setSubtitles(t,n){let r=e.createAckId();this.sendMessage({destination:t,message:{type:`message_with_ack`,ack_id:r,name:`set_subtitles`,payload:{subtitles:n}}}),await this.one(`message`,e=>e.source===t&&e.message.payload?.event===`subtitles`).timeout(U).catch(()=>{throw Error(`Failed to set subtitles`)})}static createAckId(){return B.generateRandomId()}static calculateFingerprint(e){return e.map(e=>e.id).sort().join(`,`)}},G=class e extends S{constructor(e){super(),this.instanceId=e,this.clients=[],this.bindFunctions()}bindFunctions(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}addClient(e){e.on(`deviceschange`,this.gatherAndPublishDevices),e.on(`error`,e=>this.trigger(`error`,e)),this.clients.push(e)}hasInstanceOfClient(e){return this.clients.some(t=>t instanceof e)}startCastSession(e){if(this.castSession)if(this.castSession.getDevice().id!==e.device.id)this.castSession.dispose();else{console.info(`A session with device ${e.device.id} already exists - this is a no-op`);return}let t=this.clients.find(t=>t.canCastToDevice(e.device.type));t&&(this.castSession=t.startCastSession(e),this.castSession.on(`error`,e=>{this.castSession.dispose(),this.trigger(`error`,e)}),this.castSession.on(`dispose`,()=>{this.castSession=void 0,this.trigger(`castsessionchange`,void 0)}),this.trigger(`castsessionchange`,this.castSession))}getCastSession(){return this.castSession}gatherAndPublishDevices(){let e=this.clients.map(e=>e.getDevices()).reduce((e,t)=>[...e,...t],[]);this.trigger(`deviceschange`,e)}dispose(){this.castSession?.dispose(),this.clients.forEach(e=>e.dispose()),this.castSession=void 0,this.clients=[],super.dispose()}static{this.instances={}}static getOrCreateInstance(t){if(!t)throw Error(`instanceId is required`);return this.instances[t]||(this.instances[t]=new e(t)),this.instances[t]}static disposeAndRemoveInstance(e){e.dispose(),delete this.instances[e.instanceId]}static isActive(){return Object.keys(this.instances).length>0}},Te=m.getComponent(`MenuItem`),K=class extends Te{constructor(e,t){super(e,t),this.isVisible=this.isVisible.bind(this)}createEl(){let e={vivi:`cv-vivi-icon`,"apple-tv":`cv-apple-icon`},t=super.createEl(`li`,{className:`vjs-menu-item cv-device-menu-item`}),n=m.dom.createEl(`div`,{className:`cv-device-menu-item-body`,innerHTML:`
4
4
  <span class="cv-device-icon ${e[this.options_.type]}"></span>
@@ -14,4 +14,4 @@ import{o as e}from"./DAXXjFlN.chunk.js";import{x as t}from"./BftnFbcr.chunk.js";
14
14
  </div>
15
15
  <div class="cv-devices-background" style="background-image: url(${this.poster})"></div>
16
16
  `;let t=document.createElement(`button`),n=e=>{e.stopPropagation(),this.options_.onStopCasting()};t.onclick=n,t.ontouchstart=n,t.className=`stop-casting-button`,t.innerHTML=this.localize(`Stop casting`),this.el_.querySelector(`.cv-devices-content`).appendChild(t)}play(){}},Fe=m.getComponent(`Tech`),Ie=class extends Fe{constructor(e,t){super(e,t),this.featuresVolumeControl=!0,this.featuresPlaybackRate=!1,this.movingMediaElementInDOM=!1,this.featuresFullscreenResize=!0,this.featuresTimeupdateEvents=!0,this.featuresProgressEvents=!1,this.featuresNativeTextTracks=!1,this.featuresNativeAudioTracks=!1,this.featuresNativeVideoTracks=!1,this.featuresMuteControl=!0,this.featuresSourceset=!1,this.videojsPlayer=m(this.options_.playerId),this.bindFunctions(),this.bindEventListeners(),this.ready(()=>{this.setSource(this.options_.source)}),this.triggerReady()}bindFunctions(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}bindEventListeners(){let e=this.getCastSession();e&&(this.textTracks().on(`change`,this.onTextTrackChanged),this.videojsPlayer.one(`ended`,()=>{e.dispose()}),e.on(`durationchange`,()=>{this.trigger(`durationchange`)}),e.on(`dispose`,()=>{this.trigger(`ended`),this.hideUI()}),e.on(`playingchange`,()=>{e.isPlaying()?(this.trigger(`play`),this.trigger(`playing`)):this.trigger(`pause`)}),e.on(`volumechange`,()=>{this.trigger(`volumechange`)}),e.on(`sourceloaded`,()=>{this.trigger(`loadeddata`)}),e.on(`subtitleschange`,()=>{this.setSelectedTextTrack(e.getSubtitles())}))}onTextTrackChanged(){let e=this.getSelectedTextTrack();this.getCastSession()?.setSubtitles(e?.src)}getSelectedTextTrack(){return p.findTrackByPredicate(this.videojsPlayer.player_,e=>e.mode===`showing`&&!!e.src)}setSelectedTextTrack(e){p.forEachTrack(this.videojsPlayer.player_,t=>{t.kind===`subtitles`&&(t.src===e?t.mode=`showing`:t.mode=`disabled`)})}showUI(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}hideUI(){this.ui?.hide()}dispose(){this.textTracks().off(`change`,this.onTextTrackChanged);let e=this.getCastSession();e&&e.dispose(),super.cleanupAutoTextTracks(),super.dispose()}createEl(){return this.ui=this.ui||new Pe({onStopCasting:()=>{this.getCastSession()?.dispose()}}),this.ui.el()}setSource(e){let t=this.getCastSession();if(!t)return;this.showUI(t.getDevice()),this.trigger(`loadstart`);let n=this.getSelectedTextTrack();t.loadSource(d.getOriginalUrl(e.src),n?.src)}addRemoteTextTrack(e){return super.addRemoteTextTrack(e,!0)}getCastSession(){return G.getOrCreateInstance(this.options_.instanceId??``).getCastSession()}play(){this.getCastSession()?.play()}pause(){this.getCastSession()?.pause()}paused(){return this.getCastSession()?.isPlaying()===!1}ended(){return this.getCastSession()?.isPlaybackFinished()??!1}setCurrentTime(e){this.getCastSession()?.seek(e??0)}currentTime(){return this.getCastSession()?.getPosition()??0}duration(){return this.getCastSession()?.getDuration()??this.videojsPlayer.duration()}volume(){return this.getCastSession()?.getVolume()??1}setVolume(e){this.getCastSession()?.setVolume(e)}muted(){return this.getCastSession()?.getMuted()??!1}setMuted(e){this.getCastSession()?.setMuted(e)}buffered(){}seekable(){return m.createTimeRanges(0,this.duration())}playbackRate(){return 1}readyState(){return 4}controls(){return!1}playsinline(){return!0}supportsFullScreen(){return!0}setAutoplay(){}preload(){}load(){}setPlaybackRate(){}static canPlayType(){return``}static canPlaySource(e,t){return e.type!==`application/dash+xml`&&!!G.getOrCreateInstance(t?.instanceId??``).getCastSession()}static isSupported(){return G.isActive()}};m.registerTech(`devices`,Ie);var Z=m.getPlugin(`plugin`),Le=class extends Z{constructor(e,t){super(e,t),this.options=t,this.instanceId=this.player.options_.devices?.instanceId??``,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}initialize(){this.player.ready(this.onReady)}onReady(){let e=this.player.getChild(`collapserator`),t=this.getSessionManager();if(!e||!t)return;t.on(`deviceschange`,this.onDevicesChanged),t.on(`castsessionchange`,this.onCastSessionChanged),t.on(`error`,this.onDevicesError);let n=()=>{this.addViviClient(t),this.addAppleTvClient(t)},r=(e,n)=>{t.startCastSession({device:n,title:this.options.title}),this.options.analyticsService?.logUserAction(n,{actionType:c.Select,workflowPhase:a.Complete,descriptor:i.ChangeDevice,entity:s.Device,eventVersion:o.V3})},l=this.options.ctaOptions,u=this.options.vivi,d=this.options.appleTv,f=[];d.enabled||f.push(D.AppleTv),(!u.enabled||!u.accountConnected)&&f.push(D.Vivi);let p={onClick:n,onDeviceMenuItemClick:r,ctaOptions:{...l,inactiveIntegrations:f}};this.devicesButton=e.addChild(`DevicesButton`,p)}onDevicesChanged(e){this.devicesButton?.setDevices(e)}onCastSessionChanged(e){this.devicesButton?.setCastSession(e),this.reloadTech(),e?(this.player.addClass(`cv-device-casting`),this.player.addClass(`cv-device-${e.getDevice().type}`),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass(`cv-device-casting`),this.player.removeClass(`cv-device-${D.AppleTv}`),this.player.removeClass(`cv-device-${D.Vivi}`))}onDevicesError(e){this.player.error(e.message),this.player.pause()}addViviClient(e){if(!this.options.vivi.enabled||!this.options.vivi.accountConnected||!this.options.vivi.apiUrl||e.hasInstanceOfClient(W))return;let t=new W({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});e.addClient(t)}addAppleTvClient(e){if(!this.options.appleTv.enabled||!this.options.trackingCode||!this.options.userId||e.hasInstanceOfClient(O))return;let t=new O({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}reloadTech(){let e=this.player,t=e.currentSources(),n=e.volume(),r=e.muted(),i=e.currentTime(),a=e.paused();e.src(t),e.one(`playing`,()=>{e.volume(n),e.muted(r),e.currentTime(i),a?e.pause():e.play()})}getSessionManager(){if(this.instanceId)return G.getOrCreateInstance(this.instanceId)}dispose(){let e=this.getSessionManager();e&&(e.off(`deviceschange`,this.onDevicesChanged),e.off(`castsessionchange`,this.onCastSessionChanged),e.off(`error`,this.onDevicesError),G.disposeAndRemoveInstance(e),super.dispose())}};m.registerPlugin(`devicesPlugin`,Le);function Re(e){return(0,J.jsx)(`div`,{className:`cv-resource-item`,children:(0,J.jsx)(l,{data:e.resource,imageCdnUrl:e.imageCdnUrl,titlePosition:`above`,hideTypeBadge:!0})})}var ze=h((e,t)=>(0,J.jsx)(Re,{...t})),Be=m.getComponent(`MenuItem`),Ve=class extends Be{constructor(e,t){super(e,t);let n=new ze(e,{resource:t.resource,imageCdnUrl:t.imageCdnUrl});this.addChild(n)}createEl(e,t={},n){return super.createEl(e,{...t,className:`${t.className} cv-resource-menu-item`},n)}handleClick(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}},He=m.getComponent(`MenuButton`),Q=class extends He{constructor(...e){super(...e),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildWrapperCSSClass(){return`cv-menu-small cv-resources-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-resources-button ${super.buildCSSClass()}`}update(){super.update()}createItems(){let e=[];return e.push(new _(this.player_,{label:`Resources`})),this.options_.resources.forEach(t=>{let n=new Ve(this.player(),{resource:t,imageCdnUrl:this.options_.imageCdnUrl,downloadResource:e=>this.downloadResource(e),label:t.name});e.push(n)}),e}downloadResource(e){if(e.type===`link`){t.PageLoad(e.url,!0);return}this.getDownloadIframe().src=e.url}getDownloadIframe(){return this.downloadIframe?this.downloadIframe:(this.downloadIframe=m.dom.createEl(`iframe`),this.downloadIframe.style.display=`none`,m.dom.appendContent(m.dom.$(`body`),this.downloadIframe),this.downloadIframe)}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return``}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}};Q.prototype.controlText_=`Resources`,m.registerComponent(`ResourcesButton`,Q);var Ue=m.getPlugin(`plugin`),We=class extends Ue{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){this.options.resources.length&&this.player.getChild(`collapserator`).addChild(`ResourcesButton`,{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl})}};m.registerPlugin(`resourcesPlugin`,We);function $(e){let{className:t=``,playerApi:n,onReady:r,onDispose:i,...a}=e,o=k.useRef(null);return k.useEffect(()=>{if(!o)return;let e=new ve(o.current,{...a,playerApi:n});return r&&e.ready(()=>{r(x(e))}),i&&e.one(`dispose`,i),()=>{e?.dispose()}},[e.viewKey]),(0,J.jsx)(`div`,{ref:o,className:t})}export{$ as ClickViewPlayer,$ as default};
17
- //# sourceMappingURL=Br8WvETm.chunk.js.map
17
+ //# sourceMappingURL=Dhv7zSEB.chunk.js.map