@clickview/streamable-learning 0.48.0-rc.0 → 0.48.0

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 (116) hide show
  1. package/dist/.vite/manifest.json +650 -650
  2. package/dist/bundles.json +1 -1
  3. package/dist/css/DU3tPCD_.chunk.css +12 -0
  4. package/dist/en.json +1 -1
  5. package/dist/scripts/{CeWjJPIz.chunk.js → BIisq8ZO.chunk.js} +2 -2
  6. package/dist/scripts/{CeWjJPIz.chunk.js.map → BIisq8ZO.chunk.js.map} +1 -1
  7. package/dist/scripts/{DxsW8K0n2.chunk.js → BWU6_pPN2.chunk.js} +2 -2
  8. package/dist/scripts/{DxsW8K0n2.chunk.js.map → BWU6_pPN2.chunk.js.map} +1 -1
  9. package/dist/scripts/{BMjES83N2.chunk.js → BcZFo9Vw2.chunk.js} +2 -2
  10. package/dist/scripts/{BMjES83N2.chunk.js.map → BcZFo9Vw2.chunk.js.map} +1 -1
  11. package/dist/scripts/Bd2bbHru.chunk.js +1 -0
  12. package/dist/scripts/{0xQRFMBY.chunk.js → BfNy0Hvk.chunk.js} +2 -2
  13. package/dist/scripts/{0xQRFMBY.chunk.js.map → BfNy0Hvk.chunk.js.map} +1 -1
  14. package/dist/scripts/{C9UjF0q6.chunk.js → BivP7X20.chunk.js} +2 -2
  15. package/dist/scripts/{C9UjF0q6.chunk.js.map → BivP7X20.chunk.js.map} +1 -1
  16. package/dist/scripts/{DrDQfaFN2.chunk.js → BjbY4Fbp2.chunk.js} +3 -3
  17. package/dist/scripts/{DrDQfaFN2.chunk.js.map → BjbY4Fbp2.chunk.js.map} +1 -1
  18. package/dist/scripts/{awemA_vU2.chunk.js → BmxcE73n2.chunk.js} +2 -2
  19. package/dist/scripts/{awemA_vU2.chunk.js.map → BmxcE73n2.chunk.js.map} +1 -1
  20. package/dist/scripts/{BMl02f_62.chunk.js → BnEMhkEE2.chunk.js} +2 -2
  21. package/dist/scripts/{BMl02f_62.chunk.js.map → BnEMhkEE2.chunk.js.map} +1 -1
  22. package/dist/scripts/{DmfbtOlu.chunk.js → Buc8GegC.chunk.js} +2 -2
  23. package/dist/scripts/{DmfbtOlu.chunk.js.map → Buc8GegC.chunk.js.map} +1 -1
  24. package/dist/scripts/{DvL3J2BU.chunk.js → Byczy1lS.chunk.js} +2 -2
  25. package/dist/scripts/{DvL3J2BU.chunk.js.map → Byczy1lS.chunk.js.map} +1 -1
  26. package/dist/scripts/{BV74ZRR22.chunk.js → C2itEpvc2.chunk.js} +2 -2
  27. package/dist/scripts/{BV74ZRR22.chunk.js.map → C2itEpvc2.chunk.js.map} +1 -1
  28. package/dist/scripts/{UAcFqQzZ.chunk.js → CEFKXxac.chunk.js} +2 -2
  29. package/dist/scripts/{UAcFqQzZ.chunk.js.map → CEFKXxac.chunk.js.map} +1 -1
  30. package/dist/scripts/{B7if0Lk52.chunk.js → CEYjJAp52.chunk.js} +2 -2
  31. package/dist/scripts/{B7if0Lk52.chunk.js.map → CEYjJAp52.chunk.js.map} +1 -1
  32. package/dist/scripts/{B1jitqYS2.chunk.js → CJSc4YDq2.chunk.js} +2 -2
  33. package/dist/scripts/{B1jitqYS2.chunk.js.map → CJSc4YDq2.chunk.js.map} +1 -1
  34. package/dist/scripts/{JtFbyaXc.chunk.js → CKUA5J3R.chunk.js} +2 -2
  35. package/dist/scripts/{JtFbyaXc.chunk.js.map → CKUA5J3R.chunk.js.map} +1 -1
  36. package/dist/scripts/{DNO0KpY72.chunk.js → CYrzupmS2.chunk.js} +2 -2
  37. package/dist/scripts/{DNO0KpY72.chunk.js.map → CYrzupmS2.chunk.js.map} +1 -1
  38. package/dist/scripts/{E9tNds1l.chunk.js → CcGYZb9f.chunk.js} +2 -2
  39. package/dist/scripts/{E9tNds1l.chunk.js.map → CcGYZb9f.chunk.js.map} +1 -1
  40. package/dist/scripts/{CibcLNJP2.chunk.js → CeQGaFi-2.chunk.js} +2 -2
  41. package/dist/scripts/{CibcLNJP2.chunk.js.map → CeQGaFi-2.chunk.js.map} +1 -1
  42. package/dist/scripts/{BqO6i89w2.chunk.js → Cr3Blj6H2.chunk.js} +2 -2
  43. package/dist/scripts/{BqO6i89w2.chunk.js.map → Cr3Blj6H2.chunk.js.map} +1 -1
  44. package/dist/scripts/{D0vsmyva.chunk.js → CxCkwLio.chunk.js} +2 -2
  45. package/dist/scripts/{D0vsmyva.chunk.js.map → CxCkwLio.chunk.js.map} +1 -1
  46. package/dist/scripts/{CvqqZmNo2.chunk.js → Cxj75Dqe2.chunk.js} +2 -2
  47. package/dist/scripts/{CvqqZmNo2.chunk.js.map → Cxj75Dqe2.chunk.js.map} +1 -1
  48. package/dist/scripts/{CcDgbmw52.chunk.js → D-VNmhoM2.chunk.js} +2 -2
  49. package/dist/scripts/{CcDgbmw52.chunk.js.map → D-VNmhoM2.chunk.js.map} +1 -1
  50. package/dist/scripts/{DAvXFgC62.chunk.js → D2FqnK9m2.chunk.js} +2 -2
  51. package/dist/scripts/{DAvXFgC62.chunk.js.map → D2FqnK9m2.chunk.js.map} +1 -1
  52. package/dist/scripts/{lokG7Sha2.chunk.js → D3sdyN2Q2.chunk.js} +2 -2
  53. package/dist/scripts/{lokG7Sha2.chunk.js.map → D3sdyN2Q2.chunk.js.map} +1 -1
  54. package/dist/scripts/{KCdpQ8qv2.chunk.js → D6IzS-bj2.chunk.js} +2 -2
  55. package/dist/scripts/{KCdpQ8qv2.chunk.js.map → D6IzS-bj2.chunk.js.map} +1 -1
  56. package/dist/scripts/{CPkKuTSK2.chunk.js → D8g6nOG92.chunk.js} +2 -2
  57. package/dist/scripts/{CPkKuTSK2.chunk.js.map → D8g6nOG92.chunk.js.map} +1 -1
  58. package/dist/scripts/{Bkv1Tbyu.chunk.js → DCKKwz9L.chunk.js} +2 -2
  59. package/dist/scripts/{Bkv1Tbyu.chunk.js.map → DCKKwz9L.chunk.js.map} +1 -1
  60. package/dist/scripts/{CeI-LCE-.chunk.js → DL4UFxRK.chunk.js} +2 -2
  61. package/dist/scripts/{CeI-LCE-.chunk.js.map → DL4UFxRK.chunk.js.map} +1 -1
  62. package/dist/scripts/{DLp7yHzT2.chunk.js → DLofRa642.chunk.js} +2 -2
  63. package/dist/scripts/{DLp7yHzT2.chunk.js.map → DLofRa642.chunk.js.map} +1 -1
  64. package/dist/scripts/{BSjm_rCE.chunk.js → DMZ--ok1.chunk.js} +2 -2
  65. package/dist/scripts/{BSjm_rCE.chunk.js.map → DMZ--ok1.chunk.js.map} +1 -1
  66. package/dist/scripts/{CikSQKH-.chunk.js → DQFcbMMk.chunk.js} +2 -2
  67. package/dist/scripts/{CikSQKH-.chunk.js.map → DQFcbMMk.chunk.js.map} +1 -1
  68. package/dist/scripts/{XnBhLH-02.chunk.js → DVeqPzBe2.chunk.js} +2 -2
  69. package/dist/scripts/{XnBhLH-02.chunk.js.map → DVeqPzBe2.chunk.js.map} +1 -1
  70. package/dist/scripts/{Clh6wBrg.chunk.js → DWerltCT.chunk.js} +2 -2
  71. package/dist/scripts/{Clh6wBrg.chunk.js.map → DWerltCT.chunk.js.map} +1 -1
  72. package/dist/scripts/{i2-k6ULv2.chunk.js → DatscYpA2.chunk.js} +2 -2
  73. package/dist/scripts/{i2-k6ULv2.chunk.js.map → DatscYpA2.chunk.js.map} +1 -1
  74. package/dist/scripts/{BXT8nHry2.chunk.js → DkaGC5IU2.chunk.js} +2 -2
  75. package/dist/scripts/{BXT8nHry2.chunk.js.map → DkaGC5IU2.chunk.js.map} +1 -1
  76. package/dist/scripts/{BoxedFO8.chunk.js → DqZWSPDJ.chunk.js} +2 -2
  77. package/dist/scripts/{BoxedFO8.chunk.js.map → DqZWSPDJ.chunk.js.map} +1 -1
  78. package/dist/scripts/{CoYNU7We2.chunk.js → Dql-1E6g2.chunk.js} +2 -2
  79. package/dist/scripts/{CoYNU7We2.chunk.js.map → Dql-1E6g2.chunk.js.map} +1 -1
  80. package/dist/scripts/{DNNNPLMp.chunk.js → DuBHin02.chunk.js} +2 -2
  81. package/dist/scripts/{DNNNPLMp.chunk.js.map → DuBHin02.chunk.js.map} +1 -1
  82. package/dist/scripts/{CK6c6uHp2.chunk.js → QMuFwiiF2.chunk.js} +2 -2
  83. package/dist/scripts/{CK6c6uHp2.chunk.js.map → QMuFwiiF2.chunk.js.map} +1 -1
  84. package/dist/scripts/{NV4_mMU8.chunk.js → U_sIlzAD.chunk.js} +2 -2
  85. package/dist/scripts/{NV4_mMU8.chunk.js.map → U_sIlzAD.chunk.js.map} +1 -1
  86. package/dist/scripts/{m9QbGES0.chunk.js → WLyOm9Lj.chunk.js} +2 -2
  87. package/dist/scripts/{m9QbGES0.chunk.js.map → WLyOm9Lj.chunk.js.map} +1 -1
  88. package/dist/scripts/{DlQrdOls.chunk.js → Ymq7JLkU.chunk.js} +2 -2
  89. package/dist/scripts/{DlQrdOls.chunk.js.map → Ymq7JLkU.chunk.js.map} +1 -1
  90. package/dist/scripts/{app-B1XBsz23.js → app-gjHxcZG3.js} +4 -4
  91. package/dist/scripts/app-gjHxcZG3.js.map +1 -0
  92. package/dist/scripts/{DIHDe4Sg.chunk.js → djRnI462.chunk.js} +2 -2
  93. package/dist/scripts/{DIHDe4Sg.chunk.js.map → djRnI462.chunk.js.map} +1 -1
  94. package/dist/scripts/{BDliRFoa.chunk.js → e2K2YU7z.chunk.js} +2 -2
  95. package/dist/scripts/{BDliRFoa.chunk.js.map → e2K2YU7z.chunk.js.map} +1 -1
  96. package/dist/scripts/{CpFOQcL7.chunk.js → fnfhCa1P.chunk.js} +2 -2
  97. package/dist/scripts/{CpFOQcL7.chunk.js.map → fnfhCa1P.chunk.js.map} +1 -1
  98. package/dist/scripts/{Dd8r1SE32.chunk.js → iyIL3kim2.chunk.js} +2 -2
  99. package/dist/scripts/{Dd8r1SE32.chunk.js.map → iyIL3kim2.chunk.js.map} +1 -1
  100. package/dist/scripts/{BKbKu9Rp.chunk.js → kfFYr9dc.chunk.js} +2 -2
  101. package/dist/scripts/{BKbKu9Rp.chunk.js.map → kfFYr9dc.chunk.js.map} +1 -1
  102. package/dist/scripts/{CwI-7tep2.chunk.js → kts5xiiM2.chunk.js} +2 -2
  103. package/dist/scripts/{CwI-7tep2.chunk.js.map → kts5xiiM2.chunk.js.map} +1 -1
  104. package/dist/scripts/{D8_5yfHY2.chunk.js → lLAYbgAy2.chunk.js} +2 -2
  105. package/dist/scripts/{D8_5yfHY2.chunk.js.map → lLAYbgAy2.chunk.js.map} +1 -1
  106. package/dist/scripts/{CXNve4Wq2.chunk.js → p9ukva5a2.chunk.js} +2 -2
  107. package/dist/scripts/{CXNve4Wq2.chunk.js.map → p9ukva5a2.chunk.js.map} +1 -1
  108. package/dist/scripts/{BCdnm1Nn.chunk.js → wOeN2ls0.chunk.js} +2 -2
  109. package/dist/scripts/{BCdnm1Nn.chunk.js.map → wOeN2ls0.chunk.js.map} +1 -1
  110. package/dist/scripts/{DMq5Gp-U2.chunk.js → zp2BHOp82.chunk.js} +2 -2
  111. package/dist/scripts/{DMq5Gp-U2.chunk.js.map → zp2BHOp82.chunk.js.map} +1 -1
  112. package/dist/scripts/{CmrPRojb.chunk.js → zyVwH8JF.chunk.js} +2 -2
  113. package/dist/scripts/{CmrPRojb.chunk.js.map → zyVwH8JF.chunk.js.map} +1 -1
  114. package/package.json +1 -1
  115. package/dist/scripts/D5Jnyjf8.chunk.js +0 -1
  116. package/dist/scripts/app-B1XBsz23.js.map +0 -1
@@ -0,0 +1 @@
1
+ import{g as e}from"./app-gjHxcZG3.js";export{e as ErrorView};
@@ -1,2 +1,2 @@
1
- import"./Dp9qJj1C.chunk.js";import{v as e}from"./BJvPfCvt.chunk.js";import{dt as t,lt as n,ut as r}from"./Dun43GrB.chunk.js";import{t as i}from"./B7tm2CBz.chunk.js";import{z as a}from"./app-B1XBsz23.js";r();var o=n();function s(n){let r=n.buttons.map(t=>({buttonText:t.text,className:t.className,onClick:()=>{t.success?e.isFunction(n.onDone)&&n.onDone():e.isFunction(n.onFail)&&n.onFail(),n.closePopup()},type:t.type,close:t.close}));return r=i.sortBy(r,`close`),(0,o.jsxs)(a,{title:n.title,closePopup:n.closePopup,children:[(0,o.jsx)(`p`,{dangerouslySetInnerHTML:{__html:t.sanitize(n.text)}}),(0,o.jsx)(`div`,{className:`d-flex justify-content-end border-top pt-3 px-3 mx-n3`,children:r.map((e,t)=>(0,o.jsx)(`button`,{className:e.className,onClick:e.onClick,type:e.type,children:e.buttonText},t))})]})}export{s as DialogView};
2
- //# sourceMappingURL=0xQRFMBY.chunk.js.map
1
+ import"./Dp9qJj1C.chunk.js";import{v as e}from"./BJvPfCvt.chunk.js";import{dt as t,lt as n,ut as r}from"./Dun43GrB.chunk.js";import{t as i}from"./B7tm2CBz.chunk.js";import{z as a}from"./app-gjHxcZG3.js";r();var o=n();function s(n){let r=n.buttons.map(t=>({buttonText:t.text,className:t.className,onClick:()=>{t.success?e.isFunction(n.onDone)&&n.onDone():e.isFunction(n.onFail)&&n.onFail(),n.closePopup()},type:t.type,close:t.close}));return r=i.sortBy(r,`close`),(0,o.jsxs)(a,{title:n.title,closePopup:n.closePopup,children:[(0,o.jsx)(`p`,{dangerouslySetInnerHTML:{__html:t.sanitize(n.text)}}),(0,o.jsx)(`div`,{className:`d-flex justify-content-end border-top pt-3 px-3 mx-n3`,children:r.map((e,t)=>(0,o.jsx)(`button`,{className:e.className,onClick:e.onClick,type:e.type,children:e.buttonText},t))})]})}export{s as DialogView};
2
+ //# sourceMappingURL=BfNy0Hvk.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"0xQRFMBY.chunk.js","names":[],"sources":["../../../../libs/shared/src/views/dialog/DialogView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { FunctionHelper } from 'libs/common/backbone/utils/FunctionHelper';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { DialogOptions, PopupViewProps } from 'libs/shared/interfaces';\n\ninterface DialogViewProps extends DialogOptions {\n onDone?: () => void;\n onFail?: () => void;\n}\n\ntype PropTypes = React.PropsWithChildren<DialogViewProps & PopupViewProps>;\n\nexport function DialogView(props: PropTypes): React.ReactElement {\n let buttons = props.buttons.map(b => {\n const onClick = () => {\n if (b.success)\n FunctionHelper.isFunction(props.onDone) && props.onDone();\n else\n FunctionHelper.isFunction(props.onFail) && props.onFail();\n\n props.closePopup();\n };\n\n return {\n buttonText: b.text,\n className: b.className,\n onClick,\n type: b.type,\n close: b.close\n };\n });\n\n /**\n * The dismiss action should always be on the left side of the popup\n */\n buttons = ArrayHelper.sortBy(buttons, 'close');\n\n return (\n <Popup title={props.title} closePopup={props.closePopup}>\n <p dangerouslySetInnerHTML={{ __html: TextHelper.sanitize(props.text) }} />\n <div className='d-flex justify-content-end border-top pt-3 px-3 mx-n3'>\n {buttons.map((b, idx) => (\n <button key={idx} className={b.className} onClick={b.onClick} type={b.type}>\n {b.buttonText}\n </button>\n ))}\n </div>\n </Popup>\n );\n}\n"],"mappings":"yNAgBA,SAAgB,EAAW,EAAsC,CAC/D,IAAI,EAAU,EAAM,QAAQ,IAAI,IAUvB,CACL,WAAY,EAAE,KACd,UAAW,EAAE,UACb,YAZoB,CAChB,EAAE,QACJ,EAAe,WAAW,EAAM,OAAO,EAAI,EAAM,QAAQ,CAEzD,EAAe,WAAW,EAAM,OAAO,EAAI,EAAM,QAAQ,CAE3D,EAAM,YAAY,EAOlB,KAAM,EAAE,KACR,MAAO,EAAE,MACV,EACD,CAOF,MAFA,GAAU,EAAY,OAAO,EAAS,QAAQ,EAG5C,EAAA,EAAA,MAAC,EAAD,CAAO,MAAO,EAAM,MAAO,WAAY,EAAM,oBAA7C,EACE,EAAA,EAAA,KAAC,IAAD,CAAG,wBAAyB,CAAE,OAAQ,EAAW,SAAS,EAAM,KAAK,CAAE,CAAI,CAAA,EAC3E,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,iEACZ,EAAQ,KAAK,EAAG,KACf,EAAA,EAAA,KAAC,SAAD,CAAkB,UAAW,EAAE,UAAW,QAAS,EAAE,QAAS,KAAM,EAAE,cACnE,EAAE,WACI,CAFI,EAEJ,CACT,CACE,CAAA,CACA"}
1
+ {"version":3,"file":"BfNy0Hvk.chunk.js","names":[],"sources":["../../../../libs/shared/src/views/dialog/DialogView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { FunctionHelper } from 'libs/common/backbone/utils/FunctionHelper';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { DialogOptions, PopupViewProps } from 'libs/shared/interfaces';\n\ninterface DialogViewProps extends DialogOptions {\n onDone?: () => void;\n onFail?: () => void;\n}\n\ntype PropTypes = React.PropsWithChildren<DialogViewProps & PopupViewProps>;\n\nexport function DialogView(props: PropTypes): React.ReactElement {\n let buttons = props.buttons.map(b => {\n const onClick = () => {\n if (b.success)\n FunctionHelper.isFunction(props.onDone) && props.onDone();\n else\n FunctionHelper.isFunction(props.onFail) && props.onFail();\n\n props.closePopup();\n };\n\n return {\n buttonText: b.text,\n className: b.className,\n onClick,\n type: b.type,\n close: b.close\n };\n });\n\n /**\n * The dismiss action should always be on the left side of the popup\n */\n buttons = ArrayHelper.sortBy(buttons, 'close');\n\n return (\n <Popup title={props.title} closePopup={props.closePopup}>\n <p dangerouslySetInnerHTML={{ __html: TextHelper.sanitize(props.text) }} />\n <div className='d-flex justify-content-end border-top pt-3 px-3 mx-n3'>\n {buttons.map((b, idx) => (\n <button key={idx} className={b.className} onClick={b.onClick} type={b.type}>\n {b.buttonText}\n </button>\n ))}\n </div>\n </Popup>\n );\n}\n"],"mappings":"yNAgBA,SAAgB,EAAW,EAAsC,CAC/D,IAAI,EAAU,EAAM,QAAQ,IAAI,IAUvB,CACL,WAAY,EAAE,KACd,UAAW,EAAE,UACb,YAZoB,CAChB,EAAE,QACJ,EAAe,WAAW,EAAM,OAAO,EAAI,EAAM,QAAQ,CAEzD,EAAe,WAAW,EAAM,OAAO,EAAI,EAAM,QAAQ,CAE3D,EAAM,YAAY,EAOlB,KAAM,EAAE,KACR,MAAO,EAAE,MACV,EACD,CAOF,MAFA,GAAU,EAAY,OAAO,EAAS,QAAQ,EAG5C,EAAA,EAAA,MAAC,EAAD,CAAO,MAAO,EAAM,MAAO,WAAY,EAAM,oBAA7C,EACE,EAAA,EAAA,KAAC,IAAD,CAAG,wBAAyB,CAAE,OAAQ,EAAW,SAAS,EAAM,KAAK,CAAE,CAAI,CAAA,EAC3E,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,iEACZ,EAAQ,KAAK,EAAG,KACf,EAAA,EAAA,KAAC,SAAD,CAAkB,UAAW,EAAE,UAAW,QAAS,EAAE,QAAS,KAAM,EAAE,cACnE,EAAE,WACI,CAFI,EAEJ,CACT,CACE,CAAA,CACA"}
@@ -1,2 +1,2 @@
1
- import"./Dp9qJj1C.chunk.js";import{M as e,lt as t,ut as n}from"./Dun43GrB.chunk.js";import{y as r}from"./BQ5XMoHG.chunk.js";import{t as i}from"./B7tm2CBz.chunk.js";import{n as a}from"./CAEQvGr_.chunk.js";import{t as o}from"./D86qrFLE.chunk.js";import{n as s}from"./Da5tDmIW2.chunk.js";import{a as c}from"./CK6c6uHp2.chunk.js";import{a as l,t as u}from"./B8R4YVaF2.chunk.js";import{N as d}from"./app-B1XBsz23.js";import{t as f}from"./Bg4Ri2TO.chunk.js";import{t as p}from"./CnDOpuFK.chunk.js";import{n as m}from"./C9tPKnK22.chunk.js";var h={partialOptions:`_partialOptions_157xw_1`,partialName:`_partialName_157xw_4`,partialDescription:`_partialDescription_157xw_8`,partialThumbnail:`_partialThumbnail_157xw_12`,partialDragHandle:`_partialDragHandle_157xw_15`};n();var g=t();_.defaultProps={numVideos:15};function _(e){return(0,g.jsx)(g.Fragment,{children:Array(e.numVideos).fill(null).map((t,n)=>(0,g.jsxs)(`div`,{className:`d-flex`,children:[e.allowBulkActions&&(0,g.jsx)(`div`,{className:`form-check pe-3 pe-sm-2 mx-0 mx-md-2`}),(0,g.jsx)(v,{...e})]},n))})}function v(e){let t=d(),n=c.getSize(t,`md`)===`sm`,r=e.withReordering&&!t.xs;return(0,g.jsxs)(s,{className:`${n?``:`py-2`} flex-grow-1`,children:[(0,g.jsx)(o,{...c.getThumbnailColumns(),className:`flex-column align-items-flex-start ${n?`pb-2 pe-1`:`mb-1 pe-3 pe-md-2`}`,children:(0,g.jsxs)(s,{children:[!!r&&(0,g.jsx)(`div`,{className:`d-flex align-items-center justify-content-center col-2`,children:(0,g.jsx)(`div`,{className:`partial-loading-background ${h.partialDragHandle}`})}),(0,g.jsx)(o,{xs:c.getThumbnailColSize(r),children:(0,g.jsx)(`div`,{className:`partial-loading-background ${n?`rounded`:`rounded-3`} ${h.partialThumbnail}`})})]})}),(0,g.jsxs)(o,{...c.getDetailsColumns(),className:n?`pb-2`:`px-2`,children:[(0,g.jsx)(`div`,{className:`partial-loading-background mb-1 ${h.partialName}`}),(0,g.jsx)(`div`,{className:`partial-loading-background ${h.partialDescription}`})]})]})}var y=new Set([...Object.values(m.Classifications.Twig.EnglandSecondary),...Object.values(m.Classifications.Twig.InternationalSecondary),...Object.values(m.Classifications.Twig.ScotlandSecondary),...Object.values(m.Classifications.Twig.NewZealandSecondary),...Object.values(m.Classifications.Twig.CanadaMiddle),...Object.values(m.Classifications.Twig.CanadaHigh)]),b=new Set([...Object.values(m.Classifications.Tigtag.EnglandPrimary),...Object.values(m.Classifications.Tigtag.InternationalPrimary),...Object.values(m.Classifications.Tigtag.ScotlandPrimary),...Object.values(m.Classifications.Tigtag.NewZealandPrimary),...Object.values(m.Classifications.Tigtag.CanadaElementary),...Object.values(m.Classifications.Tigtag.CanadaMiddle)]);function x(e){return Object.keys(e).map(t=>e[t]).join(`:`)}function S(t,n){return n.cursor?`${x(e.pick(t,[`audienceId`,`letterPrefix`,`sort`]))}:${n.cursor}`:x(e.pick(t,[`audienceId`,`letterPrefix`,`sort`]))}function C(e){return e!==l.EditableCoverFixedPillListSmall}var w={classificationDashboard(e,t,n,r){let o={target:`classification:${e}`,status:n,userType:t};return{url:a.urlBuilder(`{gateway}/v1/discover/dashboards`,o),publicUrl:a.urlBuilder(`/api/discover/dashboards`,o),key:`classification:dashboard:${e}:${t}:${r}:${n?.join(`:`)}`,formatData:e=>r?e.data?.find(e=>e.id.toString()===r.toString()):i.first(e.data)}},dashboardWidgetContent(e,t={},n,r,i={}){let o={...t,cursor:i.cursor};return{url:a.urlBuilder(`{gateway}/v1/discover/widgets/${e}`,o),publicUrl:a.urlBuilder(`/api/discover/widgets/${e}`,o),key:`widget:${e}:${x(o)}`,formatData:e=>{let t=u.formatResponseData(e,r);return Array.isArray(t.content)&&(t.content=t.content.map(e=>p.isClassification(e)?f.applyThemeToClassification(e):e)),!i.hideTigTag&&!i.hideTwig||Array.isArray(t.content)&&(t.content=t.content.filter(e=>p.isClassification(e)?b.has(e.id)?!i.hideTigTag:y.has(e.id)?!i.hideTwig:!0:!0)),t},normalizeOptions:{namespace:S(t,i)},normalize:C(n)}},getDashboard(e,t,n,r,o,s,c){let l={target:n,status:t,userType:e};r?.length&&(l[`widgets.curriculum`]=r),s&&(l.contentRegion=s);let u=`dashboard:${n}:${e}:${o}:${t.join(`:`)}:${s??``}`;return{url:a.urlBuilder(`{gateway}/v1/discover/dashboards`,l),publicUrl:a.urlBuilder(`/api/discover/dashboards`,l),key:u,formatData:e=>o?e.data?.find(e=>e.id.toString()===o.toString()):i.first(e.data),success:c}},updateWidgetPreferences(e,t,n){return{url:`{gateway}/v1/discover/widgets/${e}/preferences`,key:`update:widget:preferences`,invalidationKeys:[`widget:${e}`],type:r.PUT,data:{userId:n.id,customerId:n.customerId,metadata:t}}}};export{_ as n,w as t};
2
- //# sourceMappingURL=C9UjF0q6.chunk.js.map
1
+ import"./Dp9qJj1C.chunk.js";import{M as e,lt as t,ut as n}from"./Dun43GrB.chunk.js";import{y as r}from"./BQ5XMoHG.chunk.js";import{t as i}from"./B7tm2CBz.chunk.js";import{n as a}from"./CAEQvGr_.chunk.js";import{t as o}from"./D86qrFLE.chunk.js";import{n as s}from"./Da5tDmIW2.chunk.js";import{a as c}from"./QMuFwiiF2.chunk.js";import{a as l,t as u}from"./B8R4YVaF2.chunk.js";import{N as d}from"./app-gjHxcZG3.js";import{t as f}from"./Bg4Ri2TO.chunk.js";import{t as p}from"./CnDOpuFK.chunk.js";import{n as m}from"./C9tPKnK22.chunk.js";var h={partialOptions:`_partialOptions_157xw_1`,partialName:`_partialName_157xw_4`,partialDescription:`_partialDescription_157xw_8`,partialThumbnail:`_partialThumbnail_157xw_12`,partialDragHandle:`_partialDragHandle_157xw_15`};n();var g=t();_.defaultProps={numVideos:15};function _(e){return(0,g.jsx)(g.Fragment,{children:Array(e.numVideos).fill(null).map((t,n)=>(0,g.jsxs)(`div`,{className:`d-flex`,children:[e.allowBulkActions&&(0,g.jsx)(`div`,{className:`form-check pe-3 pe-sm-2 mx-0 mx-md-2`}),(0,g.jsx)(v,{...e})]},n))})}function v(e){let t=d(),n=c.getSize(t,`md`)===`sm`,r=e.withReordering&&!t.xs;return(0,g.jsxs)(s,{className:`${n?``:`py-2`} flex-grow-1`,children:[(0,g.jsx)(o,{...c.getThumbnailColumns(),className:`flex-column align-items-flex-start ${n?`pb-2 pe-1`:`mb-1 pe-3 pe-md-2`}`,children:(0,g.jsxs)(s,{children:[!!r&&(0,g.jsx)(`div`,{className:`d-flex align-items-center justify-content-center col-2`,children:(0,g.jsx)(`div`,{className:`partial-loading-background ${h.partialDragHandle}`})}),(0,g.jsx)(o,{xs:c.getThumbnailColSize(r),children:(0,g.jsx)(`div`,{className:`partial-loading-background ${n?`rounded`:`rounded-3`} ${h.partialThumbnail}`})})]})}),(0,g.jsxs)(o,{...c.getDetailsColumns(),className:n?`pb-2`:`px-2`,children:[(0,g.jsx)(`div`,{className:`partial-loading-background mb-1 ${h.partialName}`}),(0,g.jsx)(`div`,{className:`partial-loading-background ${h.partialDescription}`})]})]})}var y=new Set([...Object.values(m.Classifications.Twig.EnglandSecondary),...Object.values(m.Classifications.Twig.InternationalSecondary),...Object.values(m.Classifications.Twig.ScotlandSecondary),...Object.values(m.Classifications.Twig.NewZealandSecondary),...Object.values(m.Classifications.Twig.CanadaMiddle),...Object.values(m.Classifications.Twig.CanadaHigh)]),b=new Set([...Object.values(m.Classifications.Tigtag.EnglandPrimary),...Object.values(m.Classifications.Tigtag.InternationalPrimary),...Object.values(m.Classifications.Tigtag.ScotlandPrimary),...Object.values(m.Classifications.Tigtag.NewZealandPrimary),...Object.values(m.Classifications.Tigtag.CanadaElementary),...Object.values(m.Classifications.Tigtag.CanadaMiddle)]);function x(e){return Object.keys(e).map(t=>e[t]).join(`:`)}function S(t,n){return n.cursor?`${x(e.pick(t,[`audienceId`,`letterPrefix`,`sort`]))}:${n.cursor}`:x(e.pick(t,[`audienceId`,`letterPrefix`,`sort`]))}function C(e){return e!==l.EditableCoverFixedPillListSmall}var w={classificationDashboard(e,t,n,r){let o={target:`classification:${e}`,status:n,userType:t};return{url:a.urlBuilder(`{gateway}/v1/discover/dashboards`,o),publicUrl:a.urlBuilder(`/api/discover/dashboards`,o),key:`classification:dashboard:${e}:${t}:${r}:${n?.join(`:`)}`,formatData:e=>r?e.data?.find(e=>e.id.toString()===r.toString()):i.first(e.data)}},dashboardWidgetContent(e,t={},n,r,i={}){let o={...t,cursor:i.cursor};return{url:a.urlBuilder(`{gateway}/v1/discover/widgets/${e}`,o),publicUrl:a.urlBuilder(`/api/discover/widgets/${e}`,o),key:`widget:${e}:${x(o)}`,formatData:e=>{let t=u.formatResponseData(e,r);return Array.isArray(t.content)&&(t.content=t.content.map(e=>p.isClassification(e)?f.applyThemeToClassification(e):e)),!i.hideTigTag&&!i.hideTwig||Array.isArray(t.content)&&(t.content=t.content.filter(e=>p.isClassification(e)?b.has(e.id)?!i.hideTigTag:y.has(e.id)?!i.hideTwig:!0:!0)),t},normalizeOptions:{namespace:S(t,i)},normalize:C(n)}},getDashboard(e,t,n,r,o,s,c){let l={target:n,status:t,userType:e};r?.length&&(l[`widgets.curriculum`]=r),s&&(l.contentRegion=s);let u=`dashboard:${n}:${e}:${o}:${t.join(`:`)}:${s??``}`;return{url:a.urlBuilder(`{gateway}/v1/discover/dashboards`,l),publicUrl:a.urlBuilder(`/api/discover/dashboards`,l),key:u,formatData:e=>o?e.data?.find(e=>e.id.toString()===o.toString()):i.first(e.data),success:c}},updateWidgetPreferences(e,t,n){return{url:`{gateway}/v1/discover/widgets/${e}/preferences`,key:`update:widget:preferences`,invalidationKeys:[`widget:${e}`],type:r.PUT,data:{userId:n.id,customerId:n.customerId,metadata:t}}}};export{_ as n,w as t};
2
+ //# sourceMappingURL=BivP7X20.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"C9UjF0q6.chunk.js","names":[],"sources":["../../../../libs/shared/src/components/video-list/partial-loading/partial-video-list.module.scss","../../../../libs/shared/src/components/video-list/partial-loading/PartialVideoList.tsx","../../../../libs/shared/src/flight-requests/DashboardRequests.ts"],"sourcesContent":[":local {\n .partialOptions {\n width: 5.375rem;\n }\n\n .partialName {\n width: 18.75rem;\n height: 1.3125rem;\n }\n\n .partialDescription {\n width: 12.5rem;\n height: 1.3125rem;\n }\n\n .partialThumbnail {\n padding-bottom: 56.25%;\n }\n\n .partialDragHandle {\n width: 1.25rem;\n height: 1.25rem;\n }\n}","import React from 'react';\nimport { Col, Row } from 'react-bootstrap';\n\nimport { VideoListHelper } from 'libs/shared/components/video-list/VideoListHelper';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\n\nimport styles from './partial-video-list.module.scss';\n\ninterface PartialVideoListProps {\n withReordering?: boolean;\n numVideos?: number;\n allowBulkActions?: boolean;\n}\n\nPartialVideoList.defaultProps = {\n numVideos: 15\n};\n\nexport function PartialVideoList(props: PartialVideoListProps): JSX.Element {\n return (\n <>\n {Array(props.numVideos).fill(null).map((_, i) => (\n <div className='d-flex' key={i}>\n {props.allowBulkActions && <div className='form-check pe-3 pe-sm-2 mx-0 mx-md-2' />}\n <PartialVideoItem {...props} />\n </div>\n ))}\n </>\n );\n}\n\nexport function PartialVideoItem(props: PartialVideoListProps): JSX.Element {\n const breakpoints = useBreakpoints();\n\n const size = VideoListHelper.getSize(breakpoints, 'md');\n const isSmall = size === 'sm';\n\n const withDragHandle = props.withReordering && !breakpoints.xs;\n\n return (\n <Row className={`${isSmall ? '' : 'py-2'} flex-grow-1`}>\n <Col {...VideoListHelper.getThumbnailColumns()} className={`flex-column align-items-flex-start ${isSmall ? `pb-2 pe-1` : 'mb-1 pe-3 pe-md-2'}`}>\n <Row>\n {!!withDragHandle && (\n <div className='d-flex align-items-center justify-content-center col-2'>\n <div className={`partial-loading-background ${styles.partialDragHandle}`} />\n </div>\n )}\n <Col xs={VideoListHelper.getThumbnailColSize(withDragHandle)}>\n <div className={`partial-loading-background ${isSmall ? 'rounded' : 'rounded-3'} ${styles.partialThumbnail}`} />\n </Col>\n </Row>\n </Col>\n <Col {...VideoListHelper.getDetailsColumns()} className={isSmall ? 'pb-2' : 'px-2'}>\n <div className={`partial-loading-background mb-1 ${styles.partialName}`} />\n <div className={`partial-loading-background ${styles.partialDescription}`} />\n </Col>\n </Row>\n );\n}\n\n","import { HttpVerbs } from 'libs/common/backbone/enums/HttpVerbs';\nimport { UrlHelper } from 'libs/common/backbone/utils/UrlHelper';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { CuratedDashboard, CuratedDashboardCollection, CuratedWidget, CuratedWidgetContent, CuratedWidgetQueryParams, CurrentUser, DashboardStatus, DashboardUserType, Presentation, WidgetPreference } from 'libs/shared/interfaces';\nimport { WidgetHelper } from 'libs/shared/utils/WidgetHelper';\n\nimport { HardCoded } from '../constants/HardCoded';\nimport { ContentRegion } from '../enums/ContentRegion';\nimport { WidgetTemplate } from '../enums/WidgetTemplate';\nimport { MasterTypeHelper } from '../utils/MasterTypeHelper';\nimport { ThemeAssetHelper } from '../utils/ThemeAssetHelper';\n\ninterface GetDashboardWidgetContentOptions {\n hideTigTag?: boolean;\n hideTwig?: boolean;\n cursor?: string;\n}\n\nconst TWIG_TOPIC_IDS = new Set([\n ...Object.values(HardCoded.Classifications.Twig.EnglandSecondary),\n ...Object.values(HardCoded.Classifications.Twig.InternationalSecondary),\n ...Object.values(HardCoded.Classifications.Twig.ScotlandSecondary),\n ...Object.values(HardCoded.Classifications.Twig.NewZealandSecondary),\n ...Object.values(HardCoded.Classifications.Twig.CanadaMiddle),\n ...Object.values(HardCoded.Classifications.Twig.CanadaHigh)\n]);\n\nconst TIG_TAG_TOPIC_IDS = new Set([\n ...Object.values(HardCoded.Classifications.Tigtag.EnglandPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.InternationalPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.ScotlandPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.NewZealandPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.CanadaElementary),\n ...Object.values(HardCoded.Classifications.Tigtag.CanadaMiddle)\n]);\n\nfunction getQueryParamsKey(queryParams: CuratedWidgetQueryParams): string {\n return Object.keys(queryParams)\n .map((key: keyof CuratedWidgetQueryParams) => queryParams[key])\n .join(':');\n}\n\nfunction getNamespaceKey(queryParams: CuratedWidgetQueryParams, options: GetDashboardWidgetContentOptions): string {\n if (!options.cursor)\n return getQueryParamsKey(ObjectHelper.pick(queryParams, [ 'audienceId', 'letterPrefix', 'sort' ]));\n\n return `${getQueryParamsKey(ObjectHelper.pick(queryParams, [ 'audienceId', 'letterPrefix', 'sort' ]))}:${options.cursor}`;\n}\n\nfunction shouldNormalizeWidgetRequest(\n template: WidgetTemplate\n): boolean {\n if (template === WidgetTemplate.EditableCoverFixedPillListSmall)\n return false;\n\n return true;\n}\n\nexport const DashboardRequests = {\n classificationDashboard(\n classificationId: string,\n userType: DashboardUserType,\n statuses: DashboardStatus[],\n dashboardId?: string | null\n ): Flight.PublicRequest {\n const queryParamOpts = {\n target: `classification:${classificationId}`,\n status: statuses,\n userType\n };\n\n return {\n url: UrlHelper.urlBuilder(`{gateway}/v1/discover/dashboards`, queryParamOpts),\n publicUrl: UrlHelper.urlBuilder(`/api/discover/dashboards`, queryParamOpts),\n key: `classification:dashboard:${classificationId}:${userType}:${dashboardId}:${statuses?.join(':')}`,\n formatData: (data: CuratedDashboardCollection) => {\n if (dashboardId)\n return data.data?.find(d => d.id.toString() === dashboardId.toString());\n\n // only the first one of available dashboard will be displayed for the user\n return ArrayHelper.first(data.data);\n }\n };\n },\n\n dashboardWidgetContent(\n id: string,\n queryParams: CuratedWidgetQueryParams = {},\n template?: WidgetTemplate,\n presentation?: Presentation,\n options: GetDashboardWidgetContentOptions = {}\n ): Flight.PublicRequest {\n const queryParamsWithCursor = { ...queryParams, cursor: options.cursor };\n\n return {\n url: UrlHelper.urlBuilder(`{gateway}/v1/discover/widgets/${id}`, queryParamsWithCursor),\n publicUrl: UrlHelper.urlBuilder(`/api/discover/widgets/${id}`, queryParamsWithCursor),\n key: `widget:${id}:${getQueryParamsKey(queryParamsWithCursor)}`,\n formatData: (widget: CuratedWidget) => {\n const formatted = WidgetHelper.formatResponseData(widget, presentation);\n\n if (Array.isArray(formatted.content)) {\n formatted.content = formatted.content.map(\n entity => MasterTypeHelper.isClassification(entity) ?\n ThemeAssetHelper.applyThemeToClassification(entity) :\n entity\n ) as CuratedWidgetContent;\n }\n\n if (!options.hideTigTag && !options.hideTwig)\n return formatted;\n\n // Filter out the Twig topics for users who don't have access to the Twig library\n if (Array.isArray(formatted.content)) {\n const newContent = formatted.content.filter(entity => {\n if (MasterTypeHelper.isClassification(entity)) {\n if (TIG_TAG_TOPIC_IDS.has(entity.id))\n return !options.hideTigTag;\n\n if (TWIG_TOPIC_IDS.has(entity.id))\n return !options.hideTwig;\n\n return true;\n }\n \n return true;\n }) as CuratedWidgetContent;\n \n formatted.content = newContent;\n }\n \n return formatted;\n },\n normalizeOptions: {\n namespace: getNamespaceKey(queryParams, options)\n },\n normalize: shouldNormalizeWidgetRequest(template)\n };\n },\n\n getDashboard(\n userType: DashboardUserType,\n statuses: DashboardStatus[],\n target: string,\n curriculumIds?: string[],\n dashboardId?: string,\n contentRegion?: ContentRegion,\n success?: (data: CuratedDashboard) => void\n ): Flight.PublicRequest {\n const queryParamOpts: HashObject = {\n target,\n status: statuses,\n userType\n };\n\n if (curriculumIds?.length)\n queryParamOpts['widgets.curriculum'] = curriculumIds;\n\n if (contentRegion)\n queryParamOpts.contentRegion = contentRegion;\n\n const key = `dashboard:${target}:${userType}:${dashboardId}:${statuses.join(':')}:${contentRegion ?? ''}`;\n\n return {\n url: UrlHelper.urlBuilder(`{gateway}/v1/discover/dashboards`, queryParamOpts),\n publicUrl: UrlHelper.urlBuilder(`/api/discover/dashboards`, queryParamOpts),\n key,\n formatData: (data: CuratedDashboardCollection) => {\n if (dashboardId)\n return data.data?.find(d => d.id.toString() === dashboardId.toString());\n\n // only the first one of available dashboard will be displayed for the user\n return ArrayHelper.first(data.data);\n },\n success\n };\n },\n\n updateWidgetPreferences(widgetId: string, preferences: WidgetPreference[], currentUser: CurrentUser): Flight.Request {\n return {\n url: `{gateway}/v1/discover/widgets/${widgetId}/preferences`,\n key: 'update:widget:preferences',\n invalidationKeys: [`widget:${widgetId}`],\n type: HttpVerbs.PUT,\n data: {\n userId: currentUser.id,\n customerId: currentUser.customerId,\n metadata: preferences\n }\n };\n }\n};\n"],"mappings":"swBCcA,EAAiB,aAAe,CAC9B,UAAW,GACZ,CAED,SAAgB,EAAiB,EAA2C,CAC1E,OACE,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,MAAM,EAAM,UAAU,CAAC,KAAK,KAAK,CAAC,KAAK,EAAG,KACzC,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,kBAAf,CACG,EAAM,mBAAoB,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,uCAAyC,CAAA,EACnF,EAAA,EAAA,KAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAAA,EAFJ,EAGvB,CACN,CACD,CAAA,CAIP,SAAgB,EAAiB,EAA2C,CAC1E,IAAM,EAAc,GAAgB,CAG9B,EADO,EAAgB,QAAQ,EAAa,KAAK,GAC9B,KAEnB,EAAiB,EAAM,gBAAkB,CAAC,EAAY,GAE5D,OACE,EAAA,EAAA,MAAC,EAAD,CAAK,UAAW,GAAG,EAAU,GAAK,OAAO,uBAAzC,EACE,EAAA,EAAA,KAAC,EAAD,CAAK,GAAI,EAAgB,qBAAqB,CAAE,UAAW,sCAAsC,EAAU,YAAc,gCACvH,EAAA,EAAA,MAAC,EAAD,CAAA,SAAA,CACG,CAAC,CAAC,IACD,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mEACb,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,8BAA8B,EAAO,oBAAuB,CAAA,CACxE,CAAA,EAER,EAAA,EAAA,KAAC,EAAD,CAAK,GAAI,EAAgB,oBAAoB,EAAe,WAC1D,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,8BAA8B,EAAU,UAAY,YAAY,GAAG,EAAO,mBAAsB,CAAA,CAC5G,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EACN,EAAA,EAAA,MAAC,EAAD,CAAK,GAAI,EAAgB,mBAAmB,CAAE,UAAW,EAAU,OAAS,gBAA5E,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,mCAAmC,EAAO,cAAiB,CAAA,EAC3E,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,8BAA8B,EAAO,qBAAwB,CAAA,CAAA,MCjCrF,IAAM,EAAiB,IAAI,IAAI,CAC7B,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,iBAAiB,CACjE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,uBAAuB,CACvE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,kBAAkB,CAClE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,oBAAoB,CACpE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,aAAa,CAC7D,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,WAAA,CACjD,CAAC,CAEI,EAAoB,IAAI,IAAI,CAChC,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,eAAe,CACjE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,qBAAqB,CACvE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,gBAAgB,CAClE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,kBAAkB,CACpE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,iBAAiB,CACnE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,aAAA,CACnD,CAAC,CAEF,SAAS,EAAkB,EAA+C,CACxE,OAAO,OAAO,KAAK,EAAY,CAC5B,IAAK,GAAwC,EAAY,GAAK,CAC9D,KAAK,IAAI,CAGd,SAAS,EAAgB,EAAuC,EAAmD,CAIjH,OAHK,EAAQ,OAGN,GAAG,EAAkB,EAAa,KAAK,EAAa,CAAE,aAAc,eAAgB,OAAQ,CAAC,CAAC,CAAC,GAAG,EAAQ,SAFxG,EAAkB,EAAa,KAAK,EAAa,CAAE,aAAc,eAAgB,OAAQ,CAAC,CAAC,CAKtG,SAAS,EACP,EACS,CAIT,OAHI,IAAa,EAAe,gCAMlC,IAAa,EAAoB,CAC/B,wBACE,EACA,EACA,EACA,EACsB,CACtB,IAAM,EAAiB,CACrB,OAAQ,kBAAkB,IAC1B,OAAQ,EACR,WACD,CAED,MAAO,CACL,IAAK,EAAU,WAAW,mCAAoC,EAAe,CAC7E,UAAW,EAAU,WAAW,2BAA4B,EAAe,CAC3E,IAAK,4BAA4B,EAAiB,GAAG,EAAS,GAAG,EAAY,GAAG,GAAU,KAAK,IAAI,GACnG,WAAa,GACP,EACK,EAAK,MAAM,KAAK,GAAK,EAAE,GAAG,UAAU,GAAK,EAAY,UAAU,CAAC,CAGlE,EAAY,MAAM,EAAK,KAAK,CAEtC,EAGH,uBACE,EACA,EAAwC,EAAE,CAC1C,EACA,EACA,EAA4C,EAAE,CACxB,CACtB,IAAM,EAAwB,CAAE,GAAG,EAAa,OAAQ,EAAQ,OAAQ,CAExE,MAAO,CACL,IAAK,EAAU,WAAW,iCAAiC,IAAM,EAAsB,CACvF,UAAW,EAAU,WAAW,yBAAyB,IAAM,EAAsB,CACrF,IAAK,UAAU,EAAG,GAAG,EAAkB,EAAsB,GAC7D,WAAa,GAA0B,CACrC,IAAM,EAAY,EAAa,mBAAmB,EAAQ,EAAa,CAgCvE,OA9BI,MAAM,QAAQ,EAAU,QAAQ,GAClC,EAAU,QAAU,EAAU,QAAQ,IACpC,GAAU,EAAiB,iBAAiB,EAAO,CACjD,EAAiB,2BAA2B,EAAO,CACnD,EACH,EAGC,CAAC,EAAQ,YAAc,CAAC,EAAQ,UAIhC,MAAM,QAAQ,EAAU,QAAQ,GAelC,EAAU,QAdS,EAAU,QAAQ,OAAO,GACtC,EAAiB,iBAAiB,EAAO,CACvC,EAAkB,IAAI,EAAO,GAAG,CAC3B,CAAC,EAAQ,WAEd,EAAe,IAAI,EAAO,GAAG,CACxB,CAAC,EAAQ,SAEX,GAGF,GACP,EAhBK,GAuBX,iBAAkB,CAChB,UAAW,EAAgB,EAAa,EAAQ,CACjD,CACD,UAAW,EAA6B,EAAA,CACzC,EAGH,aACE,EACA,EACA,EACA,EACA,EACA,EACA,EACsB,CACtB,IAAM,EAA6B,CACjC,SACA,OAAQ,EACR,WACD,CAEG,GAAe,SACjB,EAAe,sBAAwB,GAErC,IACF,EAAe,cAAgB,GAEjC,IAAM,EAAM,aAAa,EAAO,GAAG,EAAS,GAAG,EAAY,GAAG,EAAS,KAAK,IAAI,CAAC,GAAG,GAAiB,KAErG,MAAO,CACL,IAAK,EAAU,WAAW,mCAAoC,EAAe,CAC7E,UAAW,EAAU,WAAW,2BAA4B,EAAe,CAC3E,MACA,WAAa,GACP,EACK,EAAK,MAAM,KAAK,GAAK,EAAE,GAAG,UAAU,GAAK,EAAY,UAAU,CAAC,CAGlE,EAAY,MAAM,EAAK,KAAK,CAErC,UACD,EAGH,wBAAwB,EAAkB,EAAiC,EAA0C,CACnH,MAAO,CACL,IAAK,iCAAiC,EAAS,cAC/C,IAAK,4BACL,iBAAkB,CAAC,UAAU,IAAW,CACxC,KAAM,EAAU,IAChB,KAAM,CACJ,OAAQ,EAAY,GACpB,WAAY,EAAY,WACxB,SAAU,GAEb,EAEJ"}
1
+ {"version":3,"file":"BivP7X20.chunk.js","names":[],"sources":["../../../../libs/shared/src/components/video-list/partial-loading/partial-video-list.module.scss","../../../../libs/shared/src/components/video-list/partial-loading/PartialVideoList.tsx","../../../../libs/shared/src/flight-requests/DashboardRequests.ts"],"sourcesContent":[":local {\n .partialOptions {\n width: 5.375rem;\n }\n\n .partialName {\n width: 18.75rem;\n height: 1.3125rem;\n }\n\n .partialDescription {\n width: 12.5rem;\n height: 1.3125rem;\n }\n\n .partialThumbnail {\n padding-bottom: 56.25%;\n }\n\n .partialDragHandle {\n width: 1.25rem;\n height: 1.25rem;\n }\n}","import React from 'react';\nimport { Col, Row } from 'react-bootstrap';\n\nimport { VideoListHelper } from 'libs/shared/components/video-list/VideoListHelper';\nimport { useBreakpoints } from 'libs/shared/hooks/useBreakpoints';\n\nimport styles from './partial-video-list.module.scss';\n\ninterface PartialVideoListProps {\n withReordering?: boolean;\n numVideos?: number;\n allowBulkActions?: boolean;\n}\n\nPartialVideoList.defaultProps = {\n numVideos: 15\n};\n\nexport function PartialVideoList(props: PartialVideoListProps): JSX.Element {\n return (\n <>\n {Array(props.numVideos).fill(null).map((_, i) => (\n <div className='d-flex' key={i}>\n {props.allowBulkActions && <div className='form-check pe-3 pe-sm-2 mx-0 mx-md-2' />}\n <PartialVideoItem {...props} />\n </div>\n ))}\n </>\n );\n}\n\nexport function PartialVideoItem(props: PartialVideoListProps): JSX.Element {\n const breakpoints = useBreakpoints();\n\n const size = VideoListHelper.getSize(breakpoints, 'md');\n const isSmall = size === 'sm';\n\n const withDragHandle = props.withReordering && !breakpoints.xs;\n\n return (\n <Row className={`${isSmall ? '' : 'py-2'} flex-grow-1`}>\n <Col {...VideoListHelper.getThumbnailColumns()} className={`flex-column align-items-flex-start ${isSmall ? `pb-2 pe-1` : 'mb-1 pe-3 pe-md-2'}`}>\n <Row>\n {!!withDragHandle && (\n <div className='d-flex align-items-center justify-content-center col-2'>\n <div className={`partial-loading-background ${styles.partialDragHandle}`} />\n </div>\n )}\n <Col xs={VideoListHelper.getThumbnailColSize(withDragHandle)}>\n <div className={`partial-loading-background ${isSmall ? 'rounded' : 'rounded-3'} ${styles.partialThumbnail}`} />\n </Col>\n </Row>\n </Col>\n <Col {...VideoListHelper.getDetailsColumns()} className={isSmall ? 'pb-2' : 'px-2'}>\n <div className={`partial-loading-background mb-1 ${styles.partialName}`} />\n <div className={`partial-loading-background ${styles.partialDescription}`} />\n </Col>\n </Row>\n );\n}\n\n","import { HttpVerbs } from 'libs/common/backbone/enums/HttpVerbs';\nimport { UrlHelper } from 'libs/common/backbone/utils/UrlHelper';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { CuratedDashboard, CuratedDashboardCollection, CuratedWidget, CuratedWidgetContent, CuratedWidgetQueryParams, CurrentUser, DashboardStatus, DashboardUserType, Presentation, WidgetPreference } from 'libs/shared/interfaces';\nimport { WidgetHelper } from 'libs/shared/utils/WidgetHelper';\n\nimport { HardCoded } from '../constants/HardCoded';\nimport { ContentRegion } from '../enums/ContentRegion';\nimport { WidgetTemplate } from '../enums/WidgetTemplate';\nimport { MasterTypeHelper } from '../utils/MasterTypeHelper';\nimport { ThemeAssetHelper } from '../utils/ThemeAssetHelper';\n\ninterface GetDashboardWidgetContentOptions {\n hideTigTag?: boolean;\n hideTwig?: boolean;\n cursor?: string;\n}\n\nconst TWIG_TOPIC_IDS = new Set([\n ...Object.values(HardCoded.Classifications.Twig.EnglandSecondary),\n ...Object.values(HardCoded.Classifications.Twig.InternationalSecondary),\n ...Object.values(HardCoded.Classifications.Twig.ScotlandSecondary),\n ...Object.values(HardCoded.Classifications.Twig.NewZealandSecondary),\n ...Object.values(HardCoded.Classifications.Twig.CanadaMiddle),\n ...Object.values(HardCoded.Classifications.Twig.CanadaHigh)\n]);\n\nconst TIG_TAG_TOPIC_IDS = new Set([\n ...Object.values(HardCoded.Classifications.Tigtag.EnglandPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.InternationalPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.ScotlandPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.NewZealandPrimary),\n ...Object.values(HardCoded.Classifications.Tigtag.CanadaElementary),\n ...Object.values(HardCoded.Classifications.Tigtag.CanadaMiddle)\n]);\n\nfunction getQueryParamsKey(queryParams: CuratedWidgetQueryParams): string {\n return Object.keys(queryParams)\n .map((key: keyof CuratedWidgetQueryParams) => queryParams[key])\n .join(':');\n}\n\nfunction getNamespaceKey(queryParams: CuratedWidgetQueryParams, options: GetDashboardWidgetContentOptions): string {\n if (!options.cursor)\n return getQueryParamsKey(ObjectHelper.pick(queryParams, [ 'audienceId', 'letterPrefix', 'sort' ]));\n\n return `${getQueryParamsKey(ObjectHelper.pick(queryParams, [ 'audienceId', 'letterPrefix', 'sort' ]))}:${options.cursor}`;\n}\n\nfunction shouldNormalizeWidgetRequest(\n template: WidgetTemplate\n): boolean {\n if (template === WidgetTemplate.EditableCoverFixedPillListSmall)\n return false;\n\n return true;\n}\n\nexport const DashboardRequests = {\n classificationDashboard(\n classificationId: string,\n userType: DashboardUserType,\n statuses: DashboardStatus[],\n dashboardId?: string | null\n ): Flight.PublicRequest {\n const queryParamOpts = {\n target: `classification:${classificationId}`,\n status: statuses,\n userType\n };\n\n return {\n url: UrlHelper.urlBuilder(`{gateway}/v1/discover/dashboards`, queryParamOpts),\n publicUrl: UrlHelper.urlBuilder(`/api/discover/dashboards`, queryParamOpts),\n key: `classification:dashboard:${classificationId}:${userType}:${dashboardId}:${statuses?.join(':')}`,\n formatData: (data: CuratedDashboardCollection) => {\n if (dashboardId)\n return data.data?.find(d => d.id.toString() === dashboardId.toString());\n\n // only the first one of available dashboard will be displayed for the user\n return ArrayHelper.first(data.data);\n }\n };\n },\n\n dashboardWidgetContent(\n id: string,\n queryParams: CuratedWidgetQueryParams = {},\n template?: WidgetTemplate,\n presentation?: Presentation,\n options: GetDashboardWidgetContentOptions = {}\n ): Flight.PublicRequest {\n const queryParamsWithCursor = { ...queryParams, cursor: options.cursor };\n\n return {\n url: UrlHelper.urlBuilder(`{gateway}/v1/discover/widgets/${id}`, queryParamsWithCursor),\n publicUrl: UrlHelper.urlBuilder(`/api/discover/widgets/${id}`, queryParamsWithCursor),\n key: `widget:${id}:${getQueryParamsKey(queryParamsWithCursor)}`,\n formatData: (widget: CuratedWidget) => {\n const formatted = WidgetHelper.formatResponseData(widget, presentation);\n\n if (Array.isArray(formatted.content)) {\n formatted.content = formatted.content.map(\n entity => MasterTypeHelper.isClassification(entity) ?\n ThemeAssetHelper.applyThemeToClassification(entity) :\n entity\n ) as CuratedWidgetContent;\n }\n\n if (!options.hideTigTag && !options.hideTwig)\n return formatted;\n\n // Filter out the Twig topics for users who don't have access to the Twig library\n if (Array.isArray(formatted.content)) {\n const newContent = formatted.content.filter(entity => {\n if (MasterTypeHelper.isClassification(entity)) {\n if (TIG_TAG_TOPIC_IDS.has(entity.id))\n return !options.hideTigTag;\n\n if (TWIG_TOPIC_IDS.has(entity.id))\n return !options.hideTwig;\n\n return true;\n }\n \n return true;\n }) as CuratedWidgetContent;\n \n formatted.content = newContent;\n }\n \n return formatted;\n },\n normalizeOptions: {\n namespace: getNamespaceKey(queryParams, options)\n },\n normalize: shouldNormalizeWidgetRequest(template)\n };\n },\n\n getDashboard(\n userType: DashboardUserType,\n statuses: DashboardStatus[],\n target: string,\n curriculumIds?: string[],\n dashboardId?: string,\n contentRegion?: ContentRegion,\n success?: (data: CuratedDashboard) => void\n ): Flight.PublicRequest {\n const queryParamOpts: HashObject = {\n target,\n status: statuses,\n userType\n };\n\n if (curriculumIds?.length)\n queryParamOpts['widgets.curriculum'] = curriculumIds;\n\n if (contentRegion)\n queryParamOpts.contentRegion = contentRegion;\n\n const key = `dashboard:${target}:${userType}:${dashboardId}:${statuses.join(':')}:${contentRegion ?? ''}`;\n\n return {\n url: UrlHelper.urlBuilder(`{gateway}/v1/discover/dashboards`, queryParamOpts),\n publicUrl: UrlHelper.urlBuilder(`/api/discover/dashboards`, queryParamOpts),\n key,\n formatData: (data: CuratedDashboardCollection) => {\n if (dashboardId)\n return data.data?.find(d => d.id.toString() === dashboardId.toString());\n\n // only the first one of available dashboard will be displayed for the user\n return ArrayHelper.first(data.data);\n },\n success\n };\n },\n\n updateWidgetPreferences(widgetId: string, preferences: WidgetPreference[], currentUser: CurrentUser): Flight.Request {\n return {\n url: `{gateway}/v1/discover/widgets/${widgetId}/preferences`,\n key: 'update:widget:preferences',\n invalidationKeys: [`widget:${widgetId}`],\n type: HttpVerbs.PUT,\n data: {\n userId: currentUser.id,\n customerId: currentUser.customerId,\n metadata: preferences\n }\n };\n }\n};\n"],"mappings":"swBCcA,EAAiB,aAAe,CAC9B,UAAW,GACZ,CAED,SAAgB,EAAiB,EAA2C,CAC1E,OACE,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,MAAM,EAAM,UAAU,CAAC,KAAK,KAAK,CAAC,KAAK,EAAG,KACzC,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,kBAAf,CACG,EAAM,mBAAoB,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,uCAAyC,CAAA,EACnF,EAAA,EAAA,KAAC,EAAD,CAAkB,GAAI,EAAS,CAAA,CAAA,EAFJ,EAGvB,CACN,CACD,CAAA,CAIP,SAAgB,EAAiB,EAA2C,CAC1E,IAAM,EAAc,GAAgB,CAG9B,EADO,EAAgB,QAAQ,EAAa,KAAK,GAC9B,KAEnB,EAAiB,EAAM,gBAAkB,CAAC,EAAY,GAE5D,OACE,EAAA,EAAA,MAAC,EAAD,CAAK,UAAW,GAAG,EAAU,GAAK,OAAO,uBAAzC,EACE,EAAA,EAAA,KAAC,EAAD,CAAK,GAAI,EAAgB,qBAAqB,CAAE,UAAW,sCAAsC,EAAU,YAAc,gCACvH,EAAA,EAAA,MAAC,EAAD,CAAA,SAAA,CACG,CAAC,CAAC,IACD,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mEACb,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,8BAA8B,EAAO,oBAAuB,CAAA,CACxE,CAAA,EAER,EAAA,EAAA,KAAC,EAAD,CAAK,GAAI,EAAgB,oBAAoB,EAAe,WAC1D,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,8BAA8B,EAAU,UAAY,YAAY,GAAG,EAAO,mBAAsB,CAAA,CAC5G,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EACN,EAAA,EAAA,MAAC,EAAD,CAAK,GAAI,EAAgB,mBAAmB,CAAE,UAAW,EAAU,OAAS,gBAA5E,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,mCAAmC,EAAO,cAAiB,CAAA,EAC3E,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,8BAA8B,EAAO,qBAAwB,CAAA,CAAA,MCjCrF,IAAM,EAAiB,IAAI,IAAI,CAC7B,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,iBAAiB,CACjE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,uBAAuB,CACvE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,kBAAkB,CAClE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,oBAAoB,CACpE,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,aAAa,CAC7D,GAAG,OAAO,OAAO,EAAU,gBAAgB,KAAK,WAAA,CACjD,CAAC,CAEI,EAAoB,IAAI,IAAI,CAChC,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,eAAe,CACjE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,qBAAqB,CACvE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,gBAAgB,CAClE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,kBAAkB,CACpE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,iBAAiB,CACnE,GAAG,OAAO,OAAO,EAAU,gBAAgB,OAAO,aAAA,CACnD,CAAC,CAEF,SAAS,EAAkB,EAA+C,CACxE,OAAO,OAAO,KAAK,EAAY,CAC5B,IAAK,GAAwC,EAAY,GAAK,CAC9D,KAAK,IAAI,CAGd,SAAS,EAAgB,EAAuC,EAAmD,CAIjH,OAHK,EAAQ,OAGN,GAAG,EAAkB,EAAa,KAAK,EAAa,CAAE,aAAc,eAAgB,OAAQ,CAAC,CAAC,CAAC,GAAG,EAAQ,SAFxG,EAAkB,EAAa,KAAK,EAAa,CAAE,aAAc,eAAgB,OAAQ,CAAC,CAAC,CAKtG,SAAS,EACP,EACS,CAIT,OAHI,IAAa,EAAe,gCAMlC,IAAa,EAAoB,CAC/B,wBACE,EACA,EACA,EACA,EACsB,CACtB,IAAM,EAAiB,CACrB,OAAQ,kBAAkB,IAC1B,OAAQ,EACR,WACD,CAED,MAAO,CACL,IAAK,EAAU,WAAW,mCAAoC,EAAe,CAC7E,UAAW,EAAU,WAAW,2BAA4B,EAAe,CAC3E,IAAK,4BAA4B,EAAiB,GAAG,EAAS,GAAG,EAAY,GAAG,GAAU,KAAK,IAAI,GACnG,WAAa,GACP,EACK,EAAK,MAAM,KAAK,GAAK,EAAE,GAAG,UAAU,GAAK,EAAY,UAAU,CAAC,CAGlE,EAAY,MAAM,EAAK,KAAK,CAEtC,EAGH,uBACE,EACA,EAAwC,EAAE,CAC1C,EACA,EACA,EAA4C,EAAE,CACxB,CACtB,IAAM,EAAwB,CAAE,GAAG,EAAa,OAAQ,EAAQ,OAAQ,CAExE,MAAO,CACL,IAAK,EAAU,WAAW,iCAAiC,IAAM,EAAsB,CACvF,UAAW,EAAU,WAAW,yBAAyB,IAAM,EAAsB,CACrF,IAAK,UAAU,EAAG,GAAG,EAAkB,EAAsB,GAC7D,WAAa,GAA0B,CACrC,IAAM,EAAY,EAAa,mBAAmB,EAAQ,EAAa,CAgCvE,OA9BI,MAAM,QAAQ,EAAU,QAAQ,GAClC,EAAU,QAAU,EAAU,QAAQ,IACpC,GAAU,EAAiB,iBAAiB,EAAO,CACjD,EAAiB,2BAA2B,EAAO,CACnD,EACH,EAGC,CAAC,EAAQ,YAAc,CAAC,EAAQ,UAIhC,MAAM,QAAQ,EAAU,QAAQ,GAelC,EAAU,QAdS,EAAU,QAAQ,OAAO,GACtC,EAAiB,iBAAiB,EAAO,CACvC,EAAkB,IAAI,EAAO,GAAG,CAC3B,CAAC,EAAQ,WAEd,EAAe,IAAI,EAAO,GAAG,CACxB,CAAC,EAAQ,SAEX,GAGF,GACP,EAhBK,GAuBX,iBAAkB,CAChB,UAAW,EAAgB,EAAa,EAAQ,CACjD,CACD,UAAW,EAA6B,EAAA,CACzC,EAGH,aACE,EACA,EACA,EACA,EACA,EACA,EACA,EACsB,CACtB,IAAM,EAA6B,CACjC,SACA,OAAQ,EACR,WACD,CAEG,GAAe,SACjB,EAAe,sBAAwB,GAErC,IACF,EAAe,cAAgB,GAEjC,IAAM,EAAM,aAAa,EAAO,GAAG,EAAS,GAAG,EAAY,GAAG,EAAS,KAAK,IAAI,CAAC,GAAG,GAAiB,KAErG,MAAO,CACL,IAAK,EAAU,WAAW,mCAAoC,EAAe,CAC7E,UAAW,EAAU,WAAW,2BAA4B,EAAe,CAC3E,MACA,WAAa,GACP,EACK,EAAK,MAAM,KAAK,GAAK,EAAE,GAAG,UAAU,GAAK,EAAY,UAAU,CAAC,CAGlE,EAAY,MAAM,EAAK,KAAK,CAErC,UACD,EAGH,wBAAwB,EAAkB,EAAiC,EAA0C,CACnH,MAAO,CACL,IAAK,iCAAiC,EAAS,cAC/C,IAAK,4BACL,iBAAkB,CAAC,UAAU,IAAW,CACxC,KAAM,EAAU,IAChB,KAAM,CACJ,OAAQ,EAAY,GACpB,WAAY,EAAY,WACxB,SAAU,GAEb,EAEJ"}
@@ -1,4 +1,4 @@
1
- import{b as e,gt as t,h as n,m as r,mt as i,p as a,v as o}from"./Dp9qJj1C.chunk.js";import{_ as s,a as c,n as l,r as u,t as d,v as f}from"./BJvPfCvt.chunk.js";import{t as p}from"./ImQRQGZr.chunk.js";import{A as m,C as h,E as g,M as _,S as v,_ as y,b,c as x,d as S,dt as C,ft as w,g as T,j as E,l as D,lt as O,m as ee,n as te,ut as k,w as ne,x as re}from"./Dun43GrB.chunk.js";import{n as ie,t as ae}from"./Xo0rk19-.chunk.js";import{t as oe}from"./CFXUbsBS.chunk.js";import{t as se}from"./B-OL6Vs7.chunk.js";import{l as ce,u as le,v as A,y as ue}from"./BQ5XMoHG.chunk.js";import{t as de}from"./B7tm2CBz.chunk.js";import{n as fe}from"./CAEQvGr_.chunk.js";import{t as pe}from"./ibuOpDkQ.chunk.js";import{t as me}from"./DeldjYRc.chunk.js";import{t as he}from"./CEsevkum.chunk.js";import{t as ge}from"./BYYiNmLB.chunk.js";import{t as _e}from"./H6wjCesG.chunk.js";import{M as j,N as M}from"./B3l7OlNe.chunk.js";import{t as N}from"./CMND6rmE.chunk.js";import{n as ve,t as ye}from"./Ca1QPe-q2.chunk.js";import{t as be}from"./Cz6swPXe2.chunk.js";import{n as xe,t as Se}from"./D7d5XFW82.chunk.js";import{i as Ce,n as we,t as P}from"./DjIdG9LL2.chunk.js";import{t as Te}from"./iuoIcGAm2.chunk.js";import{r as Ee,t as De}from"./D2om474U2.chunk.js";import{n as Oe,o as ke,r as Ae,t as je}from"./E9tNds1l.chunk.js";import{t as Me}from"./CoualKDX.chunk.js";import{t as Ne}from"./DrjwL4ct.chunk.js";import{C as Pe,E as Fe,I as Ie,L as Le,O as Re,T as ze,X as Be,Y as Ve,a as He,at as F,ct as Ue,dt as We,et as Ge,ft as Ke,ht as qe,it as Je,j as Ye,k as Xe,lt as Ze,mt as Qe,nt as $e,ot as et,p as I,pt as tt,q as nt,r as rt,rt as it,s as at,st as ot,tt as st,ut as ct}from"./app-B1XBsz23.js";import{t as lt}from"./BRiYVLuz.chunk.js";import{t as ut}from"./DhknOwAy.chunk.js";import{t as dt}from"./fs-4GtPf.chunk.js";import{t as L}from"./DDKwae_D2.chunk.js";import{t as ft}from"./Ct5auYPr2.chunk.js";import{t as pt}from"./BK011l4Q2.chunk.js";import{t as mt}from"./DkuROpKb2.chunk.js";import{t as ht}from"./DpDQnXqh2.chunk.js";import{n as gt,r as _t,t as vt}from"./DnwEQ4qU2.chunk.js";import"./BKbKu9Rp.chunk.js";import{t as yt}from"./A9b1YA0E.chunk.js";import{t as bt}from"./BF6BdGN-.chunk.js";import{t as xt}from"./BlBCp_pE.chunk.js";import{i as St,l as Ct,n as wt,r as Tt,s as Et,t as Dt}from"./CeI-LCE-.chunk.js";import{n as Ot}from"./gbgcwRX-.chunk.js";import{t as kt}from"./BgJGBaQ7.chunk.js";import{t as At}from"./Cdw1vkxV.chunk.js";import{n as jt}from"./DmfbtOlu.chunk.js";import{t as Mt}from"./xtnkiLCr.chunk.js";import{t as Nt}from"./CoYNU7We2.chunk.js";import{t as Pt}from"./BqO6i89w2.chunk.js";import{t as Ft}from"./BfT-O7-i2.chunk.js";var R=t(k()),It=function(e){return e.Share=`share`,e.MasterObject=`masterobject`,e}({}),Lt=`shared.videoNotFoundError`,Rt=class extends ie{constructor(){super(p.getPhrase(Lt,`title`))}get name(){return`VideoNotFoundError`}get heading(){return p.getPhrase(Lt,`heading`)}get description(){return p.getPhrase(Lt,`description`)}},zt=p.encloseNamespace(`shared.videoPrivateError`);function Bt(e){return L.isClip(e)?zt(`clipTitle`):L.isInteractive(e)?zt(`interactiveTitle`):zt(`videoTitle`)}function Vt(e){return L.isClip(e)?zt(`clipDescription`):L.isInteractive(e)?zt(`interactiveDescription`):zt(`videoDescription`)}var Ht=class extends ie{constructor(e){super(Bt(e)),this.video=e}get name(){return`VideoPrivateError`}get heading(){return Bt(this.video)}get description(){return Vt(this.video)}},Ut={createViewKey(e,t,n,r,i){let a={mediaId:e.toString(),mediaIdType:t};return n&&(a.shareContextId=n),{url:`/api/player/create-view-key`,key:`view:key:${e}:${t}:${n}`,type:ue.POST,data:a,cacheDuration:28800,success:r,error:i}}},Wt={theme(e){return{url:`/api/domain/v1/themes/${e}`,key:`themes:${e}`}},themeImages(e,t){return{url:fe.urlBuilder(`/api/domain/v1/themes`,{name:e,type:t}),key:`themes:${e}:${t}`}},themes(e){let t=`/api/domain/v1/themes`,n=`themes`;return e&&(t+=`?type=${e}`,n+=`:type:${e}`),{url:t,key:n,formatData:e=>e.sort((e,t)=>e.name.localeCompare(t.name))}},createTheme(e,t,n,r){return{url:`/api/domain/v1/themes`,key:`theme`,data:e,type:ue.POST,invalidationKeys:`themes`,success:t,error:n,always:r}},updateTheme(e,t,n,r,i){return{url:`/api/domain/v1/themes/${e}`,key:`update:theme:${e}`,data:t,type:ue.PUT,success:n,error:r,always:i}},deleteTheme(e,t,n,r){return{url:`/api/domain/v1/themes/${e}`,key:`delete:theme:${e}`,type:ue.DELETE,invalidationKeys:`themes`,success:t,error:n,always:r}}},Gt=`shared.restrictedLibraryError`,Kt=class extends ie{constructor(){super(p.getPhrase(Gt,`title`))}get name(){return`RestrictedLibraryError`}get heading(){return p.getPhrase(Gt,`heading`)}get description(){return p.getPhrase(Gt,`description`)}get cta(){return{text:p.getPhrase(Gt,`cta`),url:Re.getLiteArticle(Xe.StudentSharingGuide),openInNewTab:!0}}},qt=p.encloseNamespace(`shared.loginRequired`);function Jt(e){return L.isClip(e)?qt(`clipDescription`):L.isInteractive(e)?qt(`interactiveDescription`):qt(`videoDescription`)}var Yt=class extends r{constructor(e){super(qt(`title`)),this.video=e}get name(){return`LoginRequiredError`}get heading(){return qt(`title`)}get description(){return Jt(this.video)}},Xt=p.encloseNamespace(`shared.videoNotInSubscriptionError`),Zt=class extends ie{constructor(e){super(`VideoNotInSubscriptionError`),this.video=e}get name(){return`VideoNotInSubscriptionError`}get heading(){return Xt(`title`)}get description(){return Xt(`description`)}},Qt=p.encloseNamespace(`shared.parentVideoDeletedError`);function $t(e){return L.isClip(e)?Qt(`clipTitle`):L.isInteractive(e)?Qt(`interactiveTitle`):Qt(`videoTitle`)}function en(e){return L.isClip(e)?Qt(`clipDescription`):L.isInteractive(e)?Qt(`interactiveDescription`):Qt(`videoDescription`)}var tn=class extends ie{constructor(e){super($t(e)),this.video=e}get name(){return`ParentVideoDeletedError`}get heading(){return $t(this.video)}get description(){return en(this.video)}},nn=p.encloseNamespace(`shared.videoRatingAccess`);function rn(e){return L.isClip(e)?nn(`clipTitle`):L.isInteractive(e)?nn(`interactiveTitle`):nn(`videoTitle`)}function an(e){return L.isClip(e)?nn(`clipDescription`):L.isInteractive(e)?nn(`interactiveDescription`):nn(`videoDescription`)}var on=class extends ie{constructor(e){super(rn(e)),this.video=e}get name(){return`VideoRatingAccessError`}get heading(){return rn(this.video)}get description(){return an(this.video)}},sn=p.encloseNamespace(`shared.videoRestrictedError`);function cn(e){return L.isClip(e)?sn(`clipTitle`):L.isInteractive(e)?sn(`interactiveTitle`):sn(`videoTitle`)}function ln(e){return L.isClip(e)?sn(`clipDescription`):L.isInteractive(e)?sn(`interactiveDescription`):sn(`videoDescription`)}var un=class extends ie{constructor(e){super(cn(e)),this.video=e}get name(){return`VideoRestrictedError`}get heading(){return cn(this.video)}get description(){return ln(this.video)}},dn={"rating-not-allowed":on,"video-deleted":tn,private:Ht,"clickview-private":Zt,"login-required":Yt,"restricted-access":un,"content-region-violated":jt,"restricted-library":Kt},fn={...dn,private:Yt,"clickview-private":Yt},pn=(e,t={})=>{let n=ce(pe.currentUser());R.useEffect(()=>{if(!e.hasCompleted||!n.hasCompleted)return;let r=e.data;if(!r)return;let{canConsume:i,reason:o}=L.getCanBeConsumed(r);if(i)return;let s={...n.data.isAuthenticated?dn:fn,...t}[o??`private`]??Ge;a.throw(new s(r))},[e.hasCompleted,n.hasCompleted])},mn={getTagActionProps:(e,t,n)=>n?{onClick:n=>{t&&t();let r=e?e(n):null;if(r)return o.trigger(r)}}:{getAppLink:t=>e?e(t):null,onClick:t}},z=O();function hn(e){switch(e.tagType?.toLowerCase()){case gt.Pedagogy:return 0;case gt.Skill:return 1;default:return 2}}function gn(e){if(!e.tags)return(0,z.jsx)(z.Fragment,{});let t=[...e.tags].sort((e,t)=>hn(e)-hn(t));return(0,z.jsx)(`div`,{className:`${_t.tagList} ${e.className}`,children:t.map(t=>{let n=typeof e.getAppLink==`function`?e.getAppLink(t):null,r=typeof e.onRemove==`function`?()=>e.onRemove(t):null,i=typeof e.onClick==`function`?()=>e.onClick(t):null;return(0,z.jsx)(vt,{tag:t,appLink:n,themeColours:e.themeColours,onRemove:r,onClick:i},t.id||t.name)})})}var _n=new class{constructor(){this.listeners={}}subscribe(e,t){this.registerListener(e,t)}subscribeOnce(e,t){this.registerListener(e,t,1)}unsubscribe(e,t){this.deregisterListener(e,t)}trigger(e,...t){this.triggerCallbacks(e,t)}registerListener(e,t,n){if(typeof e!=`string`)throw Error(`Event name must be a string`);if(typeof t!=`function`)throw Error(`Event callback must be a function`);if(n&&typeof n!=`number`)throw Error(`Execution limit must be a number or undefined`);this.listeners[e]=this.listeners[e]??[],this.listeners[e].push({callback:t,executionLimit:n})}deregisterListener(e,t){if(typeof e!=`string`)throw Error(`Event name must be a string`);if(t&&typeof t!=`function`)throw Error(`Event callback must be a function`);if(!t){this.listeners[e]=[];return}let n=this.listeners[e]?.findIndex(e=>e.callback===t);typeof n!=`number`||n===-1||(this.listeners[e].splice(n,1),this.listeners[e].length===0&&delete this.listeners[e])}triggerCallbacks(e,...t){if(!this.listeners[e])return;let n=[];this.listeners[e].forEach(e=>{typeof e.executionLimit==`number`&&(e.executionCount=e.executionCount??0,e.executionCount++,e.executionCount===e.executionLimit&&n.push(e.callback)),e.callback.apply(null,...t)}),n.length&&n.forEach(t=>this.deregisterListener(e,t))}};function vn(e,t,n,r){let i=()=>{_n.unsubscribe(e,t)};return(0,R.useEffect)(()=>{if(r)return n?_n.subscribeOnce(e,t):_n.subscribe(e,t),()=>{i()}},[]),i}var yn={container:`_container_an6o0_1`,background:`_background_an6o0_4`,topLeft:`_topLeft_an6o0_13`,bottomLeft:`_bottomLeft_an6o0_16`,topRight:`_topRight_an6o0_19`,bottomRight:`_bottomRight_an6o0_22`,detailsBtn:`_detailsBtn_an6o0_25`,content:`_content_an6o0_29`,highlightPoi:`_highlightPoi_an6o0_37`},bn=/(\[.*\]\(cv:\/\/poi\?id=[0-9]+\))/g,xn=/[0-9]+/,Sn=/\[.*\]/,Cn=/[\[\]]/g;function wn(e,t,n){return t?.length?e.content.replace(bn,e=>{let r=e.match(xn);if(!r?.length)return e;let i=t.find(e=>e.id.toString()===r[0]),a=e.match(Sn);if(!i||!a?.length)return e;let o=`<span class="me-2">${yt.ToDisplayDuration(i.startTime*1e3)}</span>`,s=a[0];return s=s.replace(Cn,``),s||=i.description,s=`${o} ${s}`,n?`<span class="d-flex">${s}</span>`:e.replace(Sn,`[${s}]`)}):e.content}function Tn(e,t,n){return Ce(wn(e,t,n),{async:!1}).split(`a href="cv://poi`).join(`a class="d-flex" href="cv://poi`)}function En(e,t,n){e.preventDefault();let r=e.target.getAttribute(`href`);if(!r?.includes(`cv://poi`)||!t?.length)return;let i=r.split(`cv://poi?id=`)[1],a=t.find(e=>e.id.toString()===i);n&&a&&n(a.startTime)}function Dn(e,t,n,r){let[i,a]=(0,R.useState)(``);return(0,R.useEffect)(()=>{n&&a(Tn(e.glance,t,r))},[e.glance?.content,t?.length,n]),i}function On(e,t){let n=(0,R.useRef)(null);vn(`player:poi:mouseover`,r,null,t),vn(`player:poi:mouseleave`,i,null,t),(0,R.useEffect)(()=>{if(!n.current||!t)return;let e=c();return e.forEach(e=>e.addEventListener(`mouseover`,a)),e.forEach(e=>e.addEventListener(`mouseleave`,o)),()=>{e.forEach(e=>e.removeEventListener(`mouseover`,a)),e.forEach(e=>e.removeEventListener(`mouseleave`,o))}},[n.current]);function r(e){let t=e?.id;t&&s(t)?.classList.add(yn.highlightPoi)}function i(){c()?.forEach(e=>e.classList.remove(yn.highlightPoi))}function a(){let t=this.getAttribute(`href`);if(!t?.includes(`cv://poi`)||!e?.length)return;let n=t.split(`cv://poi?id=`)[1];if(!n)return;let r=e.find(e=>e.id.toString()===n);r&&_n.trigger(`glance:poi:mouseover`,r)}function o(){_n.trigger(`glance:poi:mouseleave`)}function s(e){return n.current?.querySelector(`[href="cv://poi?id=${e}"]`)}function c(){return n.current?.querySelectorAll(`[href*="cv://poi"]`)}return n}function kn(e,t){return t&&e.glance?.content&&e.glance?.format===`text/markdown`}var An=`shared.videoAtAGlance`;function jn(e){return e?.data?.colours?.primary&&e?.data?.colours?.secondary?e.data.colours:{primary:`#F5F4FF`,secondary:`#9294FF`}}function Mn(e){let t=kn(e.video,e.theme),n=Dn(e.video,e.pointsOfInterest,t,e.suppressInteractivity),r=On(e.pointsOfInterest,t);if(!t)return(0,z.jsx)(z.Fragment,{});let i=jn(e.theme),a=typeof e.onClickShowDescription==`function`,o=typeof e.onClickShowCurriculumLinks==`function`;return(0,z.jsxs)(`div`,{className:`rounded border px-3 px-sm-5 py-3 mb-3 position-relative d-flex justify-content-center ${yn.container}`,style:{backgroundColor:i.primary},children:[(0,z.jsx)(`div`,{className:`${yn.content} d-flex align-items-center pt-4 pt-sm-0`,children:(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`h4`,children:(0,z.jsx)(xe,{namespace:An,phrase:`videoAtAGlance`})}),a&&(0,z.jsx)(ve,{onClick:e.onClickShowDescription,className:`${yn.detailsBtn} position-absolute cursor-pointer me-4 fw-semibold text-info`,children:(0,z.jsx)(xe,{namespace:An,phrase:`readFullDescription`})}),(0,z.jsx)(`div`,{ref:r,onClick:t=>En(t,e.pointsOfInterest,e.setStartTime),dangerouslySetInnerHTML:{__html:n}}),e.video.tags?.data?.length?(0,z.jsx)(`div`,{className:`py-1`,children:(0,z.jsx)(gn,{tags:e.video?.tags?.data,themeColours:i,...mn.getTagActionProps(e.getTagAppLink,null,e.suppressInteractivity)})}):(0,z.jsx)(z.Fragment,{}),(0,z.jsx)(`div`,{className:`mt-2`,children:o&&(0,z.jsx)(ve,{onClick:e.onClickShowCurriculumLinks,className:`cursor-pointer d-inline-block fw-semibold text-info`,children:(0,z.jsx)(xe,{namespace:An,phrase:`seeCurriculumLinks`})})})]})}),(()=>{let t=e.theme?.data?.images??{};return _.keys(t).filter(e=>!_.isEmpty(t[e])).map(e=>{let n=De.createUrl(t[e]?.url,{size:Ee.Medium});return(0,z.jsx)(`div`,{className:`${yn[e]} ${yn.background} d-none d-lg-block`,style:{backgroundImage:`url('${n}')`}},t[e]?.fileId)})})()]})}var Nn=t(i(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.ImmersiveReader=r():n.ImmersiveReader=r()})(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,`default`,{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=1)}([function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),function(e){e[e.Disable=0]=`Disable`,e[e.Enable=1]=`Enable`}(t.CookiePolicy||={})},function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(2);t.renderButtons=r.renderButtons;var i=n(3);t.close=i.close,t.launchAsync=i.launchAsync,t.CookiePolicy=n(0).CookiePolicy,window.addEventListener(`load`,(function(){var e,t;window.hasOwnProperty(`Promise`)||(e=`https://contentstorage.onenote.office.net/onenoteltir/permanent-static-resources/promise-polyfill.min.js`,(t=document.createElement(`script`)).src=e,document.head.appendChild(t)),r.renderButtons()}))},function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r={af:`Indompelende leser`,am:`በህያው ስሜት ፈጣሪ ዕይታ አንባቢ`,ar:`القارئ الشامل`,as:`ইমাৰচিভ ৰিডাৰ`,az:`İmmersiv Oxuyucu`,be:`Імерсіўны чытальнік`,bg:`Концентриран четец`,bn:`মনোগ্রাহী পাঠক`,"bn-bd":`ইমার্সিভ পাঠক`,bs:`Koncentrirani čitalac`,ca:`Lector immersiu`,cs:`Asistivní čtečka`,"cy-gb":`Darllenydd Ymdrwythol`,da:`Forenklet læser`,de:`Plastischer Reader`,el:`Προηγμένο πρόγραμμα ανάγνωσης`,en:`Immersive Reader`,es:`Lector inmersivo`,et:`Süvaluger`,eu:`Irakurgailu murgiltzailea`,fa:`خواننده همه‌جانبه`,fi:`Syventävä lukuohjelma`,fil:`Immersive Reader`,fr:`Lecteur immersif`,"ga-ie":`Léitheoir tumthach`,gd:`An leughadair ùr-nòsach`,gl:`Lector avanzado`,gu:`ઇમર્સિવ રીડર`,ha:`Mai karatu Mai barbazawa`,he:`תצוגת קריאה מודרנית`,hi:`इमर्सिव रीडर`,hr:`Stopljeni čitač`,hu:`Modern olvasó`,hy:`Խորասուզված ընթերցիչ`,id:`Pembaca Imersif`,ig:`Ọgụụ Kenzipụtara`,is:`Aðgengilegt lestrarumhverfi`,it:`Strumento di lettura immersiva`,ja:`イマーシブ リーダー`,ka:`იმერსიული წამკითხველი`,kk:`Иммерсивті оқу құралы`,km:`កម្មវិធីអានពណ៌រំលេចនៅលើអេក្រង់`,kn:`ಇಮ್ಮರ್ಸಿವ್ ಓದುಗ`,ko:`몰입형 리더`,kok:`तंद्री लागिल्लो वाचक`,"ku-arab":`خوێنەری پڕ`,ky:`Курчаган Окугуч`,lb:`Immersive Reader`,lo:`ຕົວອ່ານອິມເມີສີບ`,lt:`Įtraukianti skaitytuvė`,lv:`Tīrskata lasītājs`,mi:`Pūpānui Rumaki`,mk:`Сеопфатен читач`,ml:`ഇമ്മേഴ്‌സീവ് റീഡർ`,mn:`Идэвхтэй уншигч`,mr:`इमर्सिव्ह वाचक`,ms:`Pembaca Imersif`,mt:`Qarrej Immersiv`,ne:`इमेर्सिभ रिडर`,nl:`Insluitende lezer`,"nn-no":`Engasjerande lesar`,no:`Engasjerende leser`,nso:`Go Bala ka Mongwalo o Mokoto`,or:`ଇମରସିଭ୍ ରିଡର୍`,pa:`ਇਮਰਸਿਵ ਰੀਡਰ`,"pa-arab":`گھیرن آلا مطالعہ کار`,pl:`Czytnik immersyjny`,prs:`خواننده نمایش`,pt:`Leitura Avançada`,quc:`Nim ucholajil sik'inel uwach`,quz:`Wankisqa Ñawiq`,ro:`Immersive Reader`,ru:`Иммерсивное средство чтения`,rw:`Insakazasoma`,sd:`امرسو ريڊر`,si:`ගිලෙන සුළු කියවනය`,sk:`Imerzná čítačka`,sl:`Potopni bralnik`,sq:`Lexuesi kredhës`,"sr-cyrl-ba":`Концентрисани читалац`,"sr-cyrl-rs":`Концентрисани читалац`,"sr-latn-rs":`Koncentrisani čitalac`,sv:`Avancerad läsare`,sw:`Kisomaji cha Kuzamisha`,ta:`அற்புதமான ரீடர்`,te:`మంత్రముగ్ధులను చేసే పఠన సాధనం`,"tg-cyrl-tj":`Хонандаи фарогир`,th:`โปรแกรมช่วยอ่าน`,ti:`ኣንባቢ ሕሉው ስምዒት ፈጣሪ`,tk:`Giňişleýin okaýjy`,tn:`Sebadi sa Imesife`,tr:`Tam Ekran Okuyucu`,tt:`Чолгап алучы уку чарасы`,"ug-cn":`چۆكمە ئوقۇغۇچ`,uk:`Занурення в текст`,ur:`امرسیو مطالعہ کار`,uz:`Immersiv mutolaa vositasi`,vi:`Trình đọc Chân thực`,wo:`Jàngukaay bu Rafet`,xh:`Isifundi Esikhulu`,yo:`Ìwò Alámùtán`,zh:`沉浸式阅读器`,"zh-hant":`沈浸式閱讀程式`,zu:`Isifundi Sokuzizwisa`};function i(e){var t=document.createElement(`img`);t.src=`https://contentstorage.onenote.office.net/onenoteltir/permanent-static-resources/immersive-reader-icon.svg`;var n=e.getAttribute(`data-icon-px-size`)||`20`;t.style.height=t.style.width=n+`px`,t.style.verticalAlign=`middle`,t.style.marginTop=`-2px`,t.alt=s(e.getAttribute(`data-locale`)||`en`),e.appendChild(t)}function a(e){var t=document.createElement(`span`);t.style.marginLeft=`8px`,e.appendChild(t)}function o(e){var t=document.createElement(`span`);t.textContent=s(e.getAttribute(`data-locale`)||`en`),e.appendChild(t)}function s(e){return e=e.toLowerCase(),r[e]?r[e]:e===`zh-hk`||e===`zh-mo`||e===`zh-tw`?r[`zh-hant`]:(e=e.substring(0,e.lastIndexOf(`-`)),r[e]?r[e]:(e=e.substring(0,e.lastIndexOf(`-`)),r[e]?r[e]:r.en))}t.renderButtons=function(e){var t=document.createElement(`style`);t.innerHTML=`.immersive-reader-button{cursor:pointer;display:inline-block;padding:5px;} .immersive-reader-button:hover{background:rgba(0,0,0,.05);border-radius:2px`,document.head.appendChild(t);var n=[].slice.call(document.getElementsByClassName(`immersive-reader-button`));e&&e.elements&&(n=e.elements);for(var r=0,c=n;r<c.length;r++){var l=c[r];l.setAttribute(`role`,`button`);var u=l.getAttribute(`data-locale`)||`en`;switch(l.setAttribute(`aria-label`,s(u)),l.getAttribute(`data-button-style`)||`icon`){case`icon`:i(l);break;case`text`:o(l);break;case`iconAndText`:i(l),a(l),o(l)}}}},function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,`__esModule`,{value:!0});var i=n(0),a=n(4),o={};function s(e){return e?RegExp(`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])$`).test(e):!1}o[a.ErrorCode.TokenExpired]=`The access token supplied is expired.`,o[a.ErrorCode.Throttled]=`You have exceeded your quota.`,o[a.ErrorCode.ServerError]=`An error occurred when calling the server to process the text.`,o[a.ErrorCode.InvalidSubdomain]=`The subdomain supplied is invalid.`,t.launchAsync=function(e,t,n,c){return new Promise((function(l,u){if(e)if(n)if(n.chunks)if(n.chunks.length)if(s(t)||c&&c.customDomain){var d=Date.now();(c=r({uiZIndex:1e3,timeout:15e3,useWebview:!1,allowFullscreen:!0,hideExitButton:!1,cookiePolicy:i.CookiePolicy.Disable},c)).uiZIndex&&typeof c.uiZIndex==`number`||(c.uiZIndex=1e3);var f=null,p=document.createElement(`div`),m=c.useWebview?document.createElement(`webview`):document.createElement(`iframe`),h=document.createElement(`style`);h.innerHTML=`body{height:100%;overflow:hidden;}`;var g=function(){f&&=(window.clearTimeout(f),null)},_=function(){document.body.contains(p)&&document.body.removeChild(p),window.removeEventListener(`message`,y),g(),h.parentNode&&h.parentNode.removeChild(h)},v=function(){_(),c.onExit&&c.onExit()};_();var y=function(r){if(r&&r.data){if(r.data===`ImmersiveReader-ReadyForContent`){g();var i={cogSvcsAccessToken:e,cogSvcsSubdomain:t,request:n,launchToPostMessageSentDurationInMs:Date.now()-d};m.contentWindow.postMessage(JSON.stringify({messageType:`Content`,messageValue:i}),`*`)}else if(r.data===`ImmersiveReader-Exit`)v();else if(r.data.startsWith(`ImmersiveReader-LaunchResponse:`)){var s=null,c=null,f=null;try{f=JSON.parse(r.data.substring(31))}catch{}f&&f.success?s={container:p,sessionId:f.sessionId}:c=f&&!f.success?{code:f.errorCode,message:o[f.errorCode],sessionId:f.sessionId}:{code:a.ErrorCode.ServerError,message:o[a.ErrorCode.ServerError]},s?(g(),l(s)):c&&(v(),u(c))}}};window.addEventListener(`message`,y),f=window.setTimeout((function(){_(),u({code:a.ErrorCode.Timeout,message:`Page failed to load after timeout (`+c.timeout+` ms)`})}),c.timeout),c.allowFullscreen&&m.setAttribute(`allowfullscreen`,``),m.style.cssText=`position: static; width: 100vw; height: 100vh; left: 0; top: 0; border-width: 0`,c.useWebview&&m.addEventListener(`loadstop`,(function(){m.contentWindow.postMessage(JSON.stringify({messageType:`WebviewHost`}),`*`)}));var b=(c.customDomain?c.customDomain:`https://`+t+`.cognitiveservices.azure.com/immersivereader/webapp/v1.0/`)+`reader?exitCallback=ImmersiveReader-Exit&sdkPlatform=js&sdkVersion=1.0.0`;b+=`&cookiePolicy=`+(c.cookiePolicy===i.CookiePolicy.Enable?`enable`:`disable`),c.hideExitButton&&(b+=`&hideExitButton=true`),c.uiLang&&(b+=`&omkt=`+c.uiLang),m.src=b,p.style.cssText=`position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; border-width: 0; -webkit-perspective: 1px; z-index: `+c.uiZIndex+`; background: white; overflow: hidden`,p.appendChild(m),document.body.appendChild(p),document.head.appendChild(h)}else u({code:a.ErrorCode.InvalidSubdomain,message:o[a.ErrorCode.InvalidSubdomain]});else u({code:a.ErrorCode.BadArgument,message:`Chunks must not be empty`});else u({code:a.ErrorCode.BadArgument,message:`Chunks must not be null`});else u({code:a.ErrorCode.BadArgument,message:`Content must not be null`});else u({code:a.ErrorCode.BadArgument,message:`Token must not be null`})}))},t.close=function(){window.postMessage(`ImmersiveReader-Exit`,`*`)},t.isValidSubdomain=s},function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),function(e){e.BadArgument=`BadArgument`,e.Timeout=`Timeout`,e.TokenExpired=`TokenExpired`,e.Throttled=`Throttled`,e.ServerError=`ServerError`,e.InvalidSubdomain=`InvalidSubdomain`}(t.ErrorCode||={})}])}))}))()),Pn=Fe(),Fn={button:`_button_6xsqi_1`},In={reader:null,fetched:!1},Ln=`shared.immersiveReader`;function Rn(e){let[t,n]=R.useState(In.reader);!In.reader&&!In.fetched&&(In.fetched=!0,A({resource:`/api/integrations/token/immersive-reader`,type:ue.GET,success:r,error:()=>{}}));function r(e){In.reader=e,n(e),window.setTimeout(()=>{In.reader=null,In.fetched=!1},9e5)}if(!t)return(0,z.jsx)(z.Fragment,{});e.title||=p.getPhrase(Ln,`titleFallback`);function i(){f.isFunction(e.onLaunch)&&e.onLaunch(),te.logUserAction(e.analyticsData,e.analyticsOptions);let n={title:e.title,chunks:[{content:e.text,mimeType:e.html?`text/html`:`text/plain`}]},{subdomain:r,token:i}=t;Nn.launchAsync(i,r,n,{uiZIndex:5e3,onExit:()=>{f.isFunction(e.onExit)&&e.onExit()}})}return(0,z.jsx)(`span`,{className:`${Fn.button} ${e.className||``}`,onClick:i,children:(0,z.jsxs)(`svg`,{viewBox:`0 0 40 37`,children:[(0,z.jsx)(`path`,{d:`M37.4,0.9 L37.4,9.6 L35.4,9.6 L35.4,2.9 L24.4,2.9 C22.9,3.3 20,4.5 20,6 L20,17.2 L18,17.2 L18,6 C18,5 15.6,3.6 13.8,2.9 L2,2.9 L2,29 L12.4,29 L12.4,31 L0,31 L0,0.9 L14.1,0.9 L14.3,1 C15,1.2 17.5,2.2 18.9,3.7 C20.5,1.9 23.5,1.1 23.9,1 L24.1,1 L37.4,1 L37.4,0.9 Z`,fill:`#000000`}),(0,z.jsx)(`path`,{d:`M27.4,37 L25.8,37 L18.4,29.4 L14,29.4 L14,21 L18.4,20.9 L26.1,13 L27.4,13 L27.4,37 Z M16,27.4 L19.2,27.4 L25.3,33.7 L25.3,16.6 L19.2,22.9 L15.9,22.9 L15.9,27.4 L16,27.4 Z`,fill:`#0197F2`}),(0,z.jsx)(`path`,{d:`M31.3,32.7 L29.6,31.7 C29.6,31.7 31.7,28.3 31.7,25.2 C31.7,21.9 29.6,18.5 29.6,18.4 L31.3,17.4 C31.4,17.6 33.7,21.3 33.7,25.2 C33.7,28.8 31.4,32.6 31.3,32.7 Z`,fill:`#0197F2`}),(0,z.jsx)(`path`,{d:`M36.4,36.2 L34.8,35 C34.8,35 38,30.8 38,25.2 C38,19.6 34.8,15.4 34.8,15.4 L36.4,14.2 C36.5,14.4 40,19 40,25.3 C40,31.5 36.5,36 36.4,36.2 Z`,fill:`#0197F2`})]})})}function zn(e){let{page:t,totalPages:n}=e,r=Pe.isNumber(t)&&t>0&&t<n&&t+1,i=Pe.isNumber(t)&&t>1&&t-1,a={};if(r&&r<=n&&(a.next=r.toString()),i&&(a.previous=i.toString()),!_.isEmpty(a))return a}var Bn={isEmpty(e){return e&&!(e.data&&e.data.length)},length(e){return e&&e.data&&e.data.length},at(e,t){if(!(!e||!e.data||!e.data.length||t>e.data.length))return e.data[t]},get(e,t){if(!(!e||!e.data||!e.data.length))return e.data.find(e=>e.id&&e.id.toString()===t)},flattenCollections(e){if(!e||!e.length)return;let t=[];return e.forEach(e=>{t=[...t,...e.data]}),t},getNextCursor(e){return e.pagination&&e.pagination.cursors&&e.pagination.cursors.next},convertLegacyPaginatedCollection(e){if(e)return{data:e.data,pagination:{cursors:zn(e.pagination),limit:e.pagination.pageSize}}},hasData(e){return!Bn.isEmpty(e)}};function Vn(e){return L.isVideo(e)?e:L.isClip(e)?e._parentVideo:null}function Hn(e){let t=Bn.hasData,n=Vn(e);return n?t(n.productionCompanies)||t(n.producers)||t(n.distributors)||t(n.directors):!1}var Un={closeButton:`_closeButton_1bg8h_1`,descriptionBorder:`_descriptionBorder_1bg8h_7`},Wn=`shared.videoDetails`,Gn=p.encloseNamespace(Wn);function Kn(e){let{label:t,items:n,className:r}=e;return n&&n.data&&n.data.length?(0,z.jsxs)(`div`,{className:r,children:[t,`: `,n.data.map(e=>e.name).join(`, `)]}):(0,z.jsx)(z.Fragment,{})}function qn(e){let{video:t}=e;if(!L.isVideo(t)&&!L.isClip(t))return(0,z.jsx)(z.Fragment,{});let n=L.getParentVideo(t);return(0,z.jsxs)(`div`,{className:t.description?`col-md-5 ps-md-3 pt-3 pt-md-0`:`col-12`,children:[(0,z.jsx)(`h2`,{className:`h6 mb-1`,children:(0,z.jsx)(xe,{phrase:`details`})}),!!n.productionYear&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`productionYear`,options:{year:n.productionYear}})}),(0,z.jsx)(Kn,{label:Gn(`productionCompanies`,{smartCount:n.productionCompanies?.data?.length}),items:n.productionCompanies,className:`mb-1`}),(0,z.jsx)(Kn,{label:Gn(`distributors`,{smartCount:n.distributors?.data?.length}),items:n.distributors,className:`mb-1`}),(0,z.jsx)(Kn,{label:Gn(`producers`,{smartCount:n.producers?.data?.length}),items:n.producers,className:`mb-1`}),(0,z.jsx)(Kn,{label:Gn(`directors`,{smartCount:n.directors?.data?.length}),items:n.directors,className:`mb-1`}),!!n.dateBroadcast&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`dateBroadcast`,options:{date:oe.format(n.dateBroadcast,`DD/MM/YYYY`)}})}),!!n.channel&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`channel`,options:{channel:n.channel.name}})}),L.canViewUploadDate(e.video)&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`dateUploaded`,options:{date:oe.format(t.dateCreated,`DD/MM/YYYY`)}})})]})}function Jn(e){let{video:t,maxHeight:n=368}=e,r=L.getParentVideo(t),i=!!e.video.description,a=Hn(e.video)||!!r.productionYear||!!r.dateBroadcast||!!r.channel||L.canViewUploadDate(e.video),o=typeof e.onClickClose==`function`,s=typeof e.onClickShowCurriculumLinks==`function`;function c(){return e.hideTags||L.isInteractive(e.video)||!e.video.tags?.data?.length?null:e.video.tags.data}return!i&&!a?(0,z.jsx)(z.Fragment,{}):(0,z.jsx)(Se.Provider,{value:Wn,children:(0,z.jsxs)(`div`,{className:`rounded border p-3 mb-3 position-relative`,children:[(0,z.jsx)(Pn.Scrollbars,{autoHeight:!0,autoHeightMax:n,children:(0,z.jsxs)(`div`,{className:`row g-0`,children:[i&&(0,z.jsxs)(`div`,{className:a?`${Un.descriptionBorder} pe-3 col-md-7`:`col-12`,children:[(0,z.jsxs)(`div`,{className:`d-flex align-items-center`,children:[(0,z.jsx)(`h2`,{className:`h6 mb-1`,children:(0,z.jsx)(xe,{phrase:`description`})}),(0,z.jsx)(Rn,{text:t.description,title:t.name,className:`ps-2`,onLaunch:e.onLaunchImmersiveReader,onExit:e.onExitImmersiveReader,analyticsOptions:{location:ee.PlayPage,entity:D.Video,actionType:h.Click,descriptor:x.LaunchImmersiveReader},analyticsData:{id:t.id,type:`description`}})]}),(0,z.jsx)(`p`,{className:`mb-0`,dangerouslySetInnerHTML:{__html:ht.linkifyText(e.video.description,{nl2br:!0})}}),(0,z.jsx)(gn,{tags:c(),...mn.getTagActionProps(e.getTagAppLink,null,e.suppressInteractivity),className:`mt-1`}),s&&(0,z.jsx)(ve,{onClick:e.onClickShowCurriculumLinks,className:`cursor-pointer d-inline-block fw-semibold text-info mt-2 mb-1`,children:(0,z.jsx)(xe,{namespace:Wn,phrase:`seeCurriculumLinks`})})]}),a&&(0,z.jsx)(qn,{...e})]})}),o&&(0,z.jsx)(`button`,{type:`button`,className:`btn-close ${Un.closeButton}`,"aria-label":`Close`,onClick:e.onClickClose})]})})}function Yn(){return(0,z.jsx)(`div`,{className:`p-3 mb-3 border rounded`,children:(0,z.jsxs)(`div`,{className:`row`,children:[(0,z.jsxs)(`div`,{className:`pe-3 col-md-7 border-right`,children:[(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`12rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`4.5rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background`,style:{height:`1.5rem`,width:`15rem`}})]}),(0,z.jsxs)(`div`,{className:`col-md-5 ps-md-3 pt-3 pt-md-0`,children:[(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`7rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`10rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`12rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`3rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`4rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`3.5rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`4.5rem`}})]})]})})}var Xn=`shared.playPage`;function Zn(){let e=p.encloseNamespace(Xn);return(0,z.jsxs)(`div`,{className:`alert bg-light-blue p-3 rounded-3 d-flex justify-content-between align-items-center`,children:[(0,z.jsx)(d,{svg:kt,size:l.Standard,className:`me-2 svg-container`}),(0,z.jsxs)(`div`,{className:`w-100`,children:[(0,z.jsx)(`p`,{className:`fw-semibold mb-0`,children:e(`archivedInfoTitle`)}),(0,z.jsx)(`p`,{className:`mb-1`,children:e(`archivedInfo`)})]})]})}var Qn={series:`_series_1xytj_1`};function $n(e){let t=wt(e.video.subjectPresentationAudiences?.data,e.audiences);return(0,z.jsxs)(`section`,{className:`position-relative`,children:[(0,z.jsxs)(`div`,{className:`d-inline-block`,children:[(0,z.jsx)(Et,{type:`productionCompany`,video:e.video,appLink:e.getSubTextAppLink(e.video),className:`${Qn.series} text-truncate mw-100`,analyticsOptions:{location:ee.PlayPage}}),(0,z.jsx)(`h1`,{className:`h4 d-inline-flex align-items-center mb-2 mt-n1 mw-100 mb-0 pt-2`,children:(0,z.jsx)(`span`,{className:`align-self-center`,children:e.video.name})})]}),t&&(0,z.jsx)(Ct,{className:`mb-3`,children:(0,z.jsx)(Tt,{audience:t,className:`bg-white text-dark`,border:`dark`})})]})}var er={mask:`_mask_vq9tb_1`,centeredIcon:`_centeredIcon_vq9tb_10`,bgImage:`_bgImage_vq9tb_21`,centeredOverlay:`_centeredOverlay_vq9tb_24`};function tr(e){let t=De.createUrl(L.getThumbnail(e.video)?.url??``,{size:Ee.Large});return(0,z.jsx)(`div`,{className:`position-relative responsive-img ${er.bgImage}`,style:{backgroundImage:`url('${t}')`},children:(0,z.jsxs)(ye,{appLink:e.appLink,analyticsOptions:{actionType:h.Click,location:ee.PlayPage,entity:D.AppLink,workflowPhase:g.Start,descriptor:re.SignUp},analyticsData:{},children:[(0,z.jsx)(d,{svg:St,className:er.centeredIcon}),(0,z.jsx)(`div`,{className:er.mask})]})})}var nr=()=>{let[,e]=R.useState(Date.now());return()=>{e(Date.now())}},rr=3,ir=300,ar=class{constructor(e){this.hasLogged=!1,this.options=e,this.player=e.player,this.analyticsLocation=e.analyticsLocation,this.onTimeUpdate=this.onTimeUpdate.bind(this),this.initialize()}initialize(){this.bindListeners()}bindListeners(){this.player.on(`timeupdate`,this.onTimeUpdate),this.player.one(`dispose`,()=>{this.player.off(`timeupdate`,this.onTimeUpdate)})}unbindListeners(){this.player.off(`timeupdate`,this.onTimeUpdate)}setAnalyticsLocation(e){this.analyticsLocation=e}onTimeUpdate(){if(!(this.player.currentTime()<rr||this.hasLogged)&&this.player.getPlayerMode()!==`hover`)try{let e=`m:${this.options.video.id}`;if(this.hasCoolDownTime()&&he.cacheExists(e))return;te.logUserAction(this.getAnalyticsData(),{actionType:h.Stream,entity:L.getAnalyticsEntity(this.options.video),location:this.analyticsLocation}),this.hasCoolDownTime()&&he.cacheSet(e,null,ir)}finally{this.hasLogged=!0,this.unbindListeners()}}hasCoolDownTime(){return L.isVideo(this.options.video)}getAnalyticsData(){let e={name:this.options.video.name};return this.options.shareId&&(e.shareId=this.options.shareId),L.isVideo(this.options.video)&&(e.id=this.options.video.id),L.isClip(this.options.video)&&(e.id=this.options.video._parentVideo?.id,e.clip={id:this.options.video.id}),L.isInteractive(this.options.video)&&(e.id=this.options.video._parentVideo?.id,e.interactive={id:this.options.video.id}),e}},or=i(((e,t)=>{t.exports=typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{}})),sr=i(((e,t)=>{t.exports={}})),cr=i(((e,t)=>{var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},r=sr(),i;typeof document<`u`?i=document:(i=n[`__GLOBAL_DOCUMENT_CACHE@4`],i||=n[`__GLOBAL_DOCUMENT_CACHE@4`]=r),t.exports=i})),lr=i(((e,t)=>{t.exports=r;var n=Object.prototype.toString;function r(e){if(!e)return!1;var t=n.call(e);return t===`[object Function]`||typeof e==`function`&&t!==`[object RegExp]`||typeof window<`u`&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}})),ur=i(((e,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ import{b as e,gt as t,h as n,m as r,mt as i,p as a,v as o}from"./Dp9qJj1C.chunk.js";import{_ as s,a as c,n as l,r as u,t as d,v as f}from"./BJvPfCvt.chunk.js";import{t as p}from"./ImQRQGZr.chunk.js";import{A as m,C as h,E as g,M as _,S as v,_ as y,b,c as x,d as S,dt as C,ft as w,g as T,j as E,l as D,lt as O,m as ee,n as te,ut as k,w as ne,x as re}from"./Dun43GrB.chunk.js";import{n as ie,t as ae}from"./Xo0rk19-.chunk.js";import{t as oe}from"./CFXUbsBS.chunk.js";import{t as se}from"./B-OL6Vs7.chunk.js";import{l as ce,u as le,v as A,y as ue}from"./BQ5XMoHG.chunk.js";import{t as de}from"./B7tm2CBz.chunk.js";import{n as fe}from"./CAEQvGr_.chunk.js";import{t as pe}from"./ibuOpDkQ.chunk.js";import{t as me}from"./DeldjYRc.chunk.js";import{t as he}from"./CEsevkum.chunk.js";import{t as ge}from"./BYYiNmLB.chunk.js";import{t as _e}from"./H6wjCesG.chunk.js";import{M as j,N as M}from"./B3l7OlNe.chunk.js";import{t as N}from"./CMND6rmE.chunk.js";import{n as ve,t as ye}from"./Ca1QPe-q2.chunk.js";import{t as be}from"./Cz6swPXe2.chunk.js";import{n as xe,t as Se}from"./D7d5XFW82.chunk.js";import{i as Ce,n as we,t as P}from"./DjIdG9LL2.chunk.js";import{t as Te}from"./iuoIcGAm2.chunk.js";import{r as Ee,t as De}from"./D2om474U2.chunk.js";import{n as Oe,o as ke,r as Ae,t as je}from"./CcGYZb9f.chunk.js";import{t as Me}from"./CoualKDX.chunk.js";import{t as Ne}from"./DrjwL4ct.chunk.js";import{C as Pe,E as Fe,I as Ie,L as Le,O as Re,T as ze,X as Be,Y as Ve,a as He,at as F,ct as Ue,dt as We,et as Ge,ft as Ke,ht as qe,it as Je,j as Ye,k as Xe,lt as Ze,mt as Qe,nt as $e,ot as et,p as I,pt as tt,q as nt,r as rt,rt as it,s as at,st as ot,tt as st,ut as ct}from"./app-gjHxcZG3.js";import{t as lt}from"./BRiYVLuz.chunk.js";import{t as ut}from"./DhknOwAy.chunk.js";import{t as dt}from"./fs-4GtPf.chunk.js";import{t as L}from"./DDKwae_D2.chunk.js";import{t as ft}from"./Ct5auYPr2.chunk.js";import{t as pt}from"./BK011l4Q2.chunk.js";import{t as mt}from"./DkuROpKb2.chunk.js";import{t as ht}from"./DpDQnXqh2.chunk.js";import{n as gt,r as _t,t as vt}from"./DnwEQ4qU2.chunk.js";import"./kfFYr9dc.chunk.js";import{t as yt}from"./A9b1YA0E.chunk.js";import{t as bt}from"./BF6BdGN-.chunk.js";import{t as xt}from"./BlBCp_pE.chunk.js";import{i as St,l as Ct,n as wt,r as Tt,s as Et,t as Dt}from"./DL4UFxRK.chunk.js";import{n as Ot}from"./gbgcwRX-.chunk.js";import{t as kt}from"./BgJGBaQ7.chunk.js";import{t as At}from"./Cdw1vkxV.chunk.js";import{n as jt}from"./Buc8GegC.chunk.js";import{t as Mt}from"./xtnkiLCr.chunk.js";import{t as Nt}from"./Dql-1E6g2.chunk.js";import{t as Pt}from"./Cr3Blj6H2.chunk.js";import{t as Ft}from"./BfT-O7-i2.chunk.js";var R=t(k()),It=function(e){return e.Share=`share`,e.MasterObject=`masterobject`,e}({}),Lt=`shared.videoNotFoundError`,Rt=class extends ie{constructor(){super(p.getPhrase(Lt,`title`))}get name(){return`VideoNotFoundError`}get heading(){return p.getPhrase(Lt,`heading`)}get description(){return p.getPhrase(Lt,`description`)}},zt=p.encloseNamespace(`shared.videoPrivateError`);function Bt(e){return L.isClip(e)?zt(`clipTitle`):L.isInteractive(e)?zt(`interactiveTitle`):zt(`videoTitle`)}function Vt(e){return L.isClip(e)?zt(`clipDescription`):L.isInteractive(e)?zt(`interactiveDescription`):zt(`videoDescription`)}var Ht=class extends ie{constructor(e){super(Bt(e)),this.video=e}get name(){return`VideoPrivateError`}get heading(){return Bt(this.video)}get description(){return Vt(this.video)}},Ut={createViewKey(e,t,n,r,i){let a={mediaId:e.toString(),mediaIdType:t};return n&&(a.shareContextId=n),{url:`/api/player/create-view-key`,key:`view:key:${e}:${t}:${n}`,type:ue.POST,data:a,cacheDuration:28800,success:r,error:i}}},Wt={theme(e){return{url:`/api/domain/v1/themes/${e}`,key:`themes:${e}`}},themeImages(e,t){return{url:fe.urlBuilder(`/api/domain/v1/themes`,{name:e,type:t}),key:`themes:${e}:${t}`}},themes(e){let t=`/api/domain/v1/themes`,n=`themes`;return e&&(t+=`?type=${e}`,n+=`:type:${e}`),{url:t,key:n,formatData:e=>e.sort((e,t)=>e.name.localeCompare(t.name))}},createTheme(e,t,n,r){return{url:`/api/domain/v1/themes`,key:`theme`,data:e,type:ue.POST,invalidationKeys:`themes`,success:t,error:n,always:r}},updateTheme(e,t,n,r,i){return{url:`/api/domain/v1/themes/${e}`,key:`update:theme:${e}`,data:t,type:ue.PUT,success:n,error:r,always:i}},deleteTheme(e,t,n,r){return{url:`/api/domain/v1/themes/${e}`,key:`delete:theme:${e}`,type:ue.DELETE,invalidationKeys:`themes`,success:t,error:n,always:r}}},Gt=`shared.restrictedLibraryError`,Kt=class extends ie{constructor(){super(p.getPhrase(Gt,`title`))}get name(){return`RestrictedLibraryError`}get heading(){return p.getPhrase(Gt,`heading`)}get description(){return p.getPhrase(Gt,`description`)}get cta(){return{text:p.getPhrase(Gt,`cta`),url:Re.getLiteArticle(Xe.StudentSharingGuide),openInNewTab:!0}}},qt=p.encloseNamespace(`shared.loginRequired`);function Jt(e){return L.isClip(e)?qt(`clipDescription`):L.isInteractive(e)?qt(`interactiveDescription`):qt(`videoDescription`)}var Yt=class extends r{constructor(e){super(qt(`title`)),this.video=e}get name(){return`LoginRequiredError`}get heading(){return qt(`title`)}get description(){return Jt(this.video)}},Xt=p.encloseNamespace(`shared.videoNotInSubscriptionError`),Zt=class extends ie{constructor(e){super(`VideoNotInSubscriptionError`),this.video=e}get name(){return`VideoNotInSubscriptionError`}get heading(){return Xt(`title`)}get description(){return Xt(`description`)}},Qt=p.encloseNamespace(`shared.parentVideoDeletedError`);function $t(e){return L.isClip(e)?Qt(`clipTitle`):L.isInteractive(e)?Qt(`interactiveTitle`):Qt(`videoTitle`)}function en(e){return L.isClip(e)?Qt(`clipDescription`):L.isInteractive(e)?Qt(`interactiveDescription`):Qt(`videoDescription`)}var tn=class extends ie{constructor(e){super($t(e)),this.video=e}get name(){return`ParentVideoDeletedError`}get heading(){return $t(this.video)}get description(){return en(this.video)}},nn=p.encloseNamespace(`shared.videoRatingAccess`);function rn(e){return L.isClip(e)?nn(`clipTitle`):L.isInteractive(e)?nn(`interactiveTitle`):nn(`videoTitle`)}function an(e){return L.isClip(e)?nn(`clipDescription`):L.isInteractive(e)?nn(`interactiveDescription`):nn(`videoDescription`)}var on=class extends ie{constructor(e){super(rn(e)),this.video=e}get name(){return`VideoRatingAccessError`}get heading(){return rn(this.video)}get description(){return an(this.video)}},sn=p.encloseNamespace(`shared.videoRestrictedError`);function cn(e){return L.isClip(e)?sn(`clipTitle`):L.isInteractive(e)?sn(`interactiveTitle`):sn(`videoTitle`)}function ln(e){return L.isClip(e)?sn(`clipDescription`):L.isInteractive(e)?sn(`interactiveDescription`):sn(`videoDescription`)}var un=class extends ie{constructor(e){super(cn(e)),this.video=e}get name(){return`VideoRestrictedError`}get heading(){return cn(this.video)}get description(){return ln(this.video)}},dn={"rating-not-allowed":on,"video-deleted":tn,private:Ht,"clickview-private":Zt,"login-required":Yt,"restricted-access":un,"content-region-violated":jt,"restricted-library":Kt},fn={...dn,private:Yt,"clickview-private":Yt},pn=(e,t={})=>{let n=ce(pe.currentUser());R.useEffect(()=>{if(!e.hasCompleted||!n.hasCompleted)return;let r=e.data;if(!r)return;let{canConsume:i,reason:o}=L.getCanBeConsumed(r);if(i)return;let s={...n.data.isAuthenticated?dn:fn,...t}[o??`private`]??Ge;a.throw(new s(r))},[e.hasCompleted,n.hasCompleted])},mn={getTagActionProps:(e,t,n)=>n?{onClick:n=>{t&&t();let r=e?e(n):null;if(r)return o.trigger(r)}}:{getAppLink:t=>e?e(t):null,onClick:t}},z=O();function hn(e){switch(e.tagType?.toLowerCase()){case gt.Pedagogy:return 0;case gt.Skill:return 1;default:return 2}}function gn(e){if(!e.tags)return(0,z.jsx)(z.Fragment,{});let t=[...e.tags].sort((e,t)=>hn(e)-hn(t));return(0,z.jsx)(`div`,{className:`${_t.tagList} ${e.className}`,children:t.map(t=>{let n=typeof e.getAppLink==`function`?e.getAppLink(t):null,r=typeof e.onRemove==`function`?()=>e.onRemove(t):null,i=typeof e.onClick==`function`?()=>e.onClick(t):null;return(0,z.jsx)(vt,{tag:t,appLink:n,themeColours:e.themeColours,onRemove:r,onClick:i},t.id||t.name)})})}var _n=new class{constructor(){this.listeners={}}subscribe(e,t){this.registerListener(e,t)}subscribeOnce(e,t){this.registerListener(e,t,1)}unsubscribe(e,t){this.deregisterListener(e,t)}trigger(e,...t){this.triggerCallbacks(e,t)}registerListener(e,t,n){if(typeof e!=`string`)throw Error(`Event name must be a string`);if(typeof t!=`function`)throw Error(`Event callback must be a function`);if(n&&typeof n!=`number`)throw Error(`Execution limit must be a number or undefined`);this.listeners[e]=this.listeners[e]??[],this.listeners[e].push({callback:t,executionLimit:n})}deregisterListener(e,t){if(typeof e!=`string`)throw Error(`Event name must be a string`);if(t&&typeof t!=`function`)throw Error(`Event callback must be a function`);if(!t){this.listeners[e]=[];return}let n=this.listeners[e]?.findIndex(e=>e.callback===t);typeof n!=`number`||n===-1||(this.listeners[e].splice(n,1),this.listeners[e].length===0&&delete this.listeners[e])}triggerCallbacks(e,...t){if(!this.listeners[e])return;let n=[];this.listeners[e].forEach(e=>{typeof e.executionLimit==`number`&&(e.executionCount=e.executionCount??0,e.executionCount++,e.executionCount===e.executionLimit&&n.push(e.callback)),e.callback.apply(null,...t)}),n.length&&n.forEach(t=>this.deregisterListener(e,t))}};function vn(e,t,n,r){let i=()=>{_n.unsubscribe(e,t)};return(0,R.useEffect)(()=>{if(r)return n?_n.subscribeOnce(e,t):_n.subscribe(e,t),()=>{i()}},[]),i}var yn={container:`_container_an6o0_1`,background:`_background_an6o0_4`,topLeft:`_topLeft_an6o0_13`,bottomLeft:`_bottomLeft_an6o0_16`,topRight:`_topRight_an6o0_19`,bottomRight:`_bottomRight_an6o0_22`,detailsBtn:`_detailsBtn_an6o0_25`,content:`_content_an6o0_29`,highlightPoi:`_highlightPoi_an6o0_37`},bn=/(\[.*\]\(cv:\/\/poi\?id=[0-9]+\))/g,xn=/[0-9]+/,Sn=/\[.*\]/,Cn=/[\[\]]/g;function wn(e,t,n){return t?.length?e.content.replace(bn,e=>{let r=e.match(xn);if(!r?.length)return e;let i=t.find(e=>e.id.toString()===r[0]),a=e.match(Sn);if(!i||!a?.length)return e;let o=`<span class="me-2">${yt.ToDisplayDuration(i.startTime*1e3)}</span>`,s=a[0];return s=s.replace(Cn,``),s||=i.description,s=`${o} ${s}`,n?`<span class="d-flex">${s}</span>`:e.replace(Sn,`[${s}]`)}):e.content}function Tn(e,t,n){return Ce(wn(e,t,n),{async:!1}).split(`a href="cv://poi`).join(`a class="d-flex" href="cv://poi`)}function En(e,t,n){e.preventDefault();let r=e.target.getAttribute(`href`);if(!r?.includes(`cv://poi`)||!t?.length)return;let i=r.split(`cv://poi?id=`)[1],a=t.find(e=>e.id.toString()===i);n&&a&&n(a.startTime)}function Dn(e,t,n,r){let[i,a]=(0,R.useState)(``);return(0,R.useEffect)(()=>{n&&a(Tn(e.glance,t,r))},[e.glance?.content,t?.length,n]),i}function On(e,t){let n=(0,R.useRef)(null);vn(`player:poi:mouseover`,r,null,t),vn(`player:poi:mouseleave`,i,null,t),(0,R.useEffect)(()=>{if(!n.current||!t)return;let e=c();return e.forEach(e=>e.addEventListener(`mouseover`,a)),e.forEach(e=>e.addEventListener(`mouseleave`,o)),()=>{e.forEach(e=>e.removeEventListener(`mouseover`,a)),e.forEach(e=>e.removeEventListener(`mouseleave`,o))}},[n.current]);function r(e){let t=e?.id;t&&s(t)?.classList.add(yn.highlightPoi)}function i(){c()?.forEach(e=>e.classList.remove(yn.highlightPoi))}function a(){let t=this.getAttribute(`href`);if(!t?.includes(`cv://poi`)||!e?.length)return;let n=t.split(`cv://poi?id=`)[1];if(!n)return;let r=e.find(e=>e.id.toString()===n);r&&_n.trigger(`glance:poi:mouseover`,r)}function o(){_n.trigger(`glance:poi:mouseleave`)}function s(e){return n.current?.querySelector(`[href="cv://poi?id=${e}"]`)}function c(){return n.current?.querySelectorAll(`[href*="cv://poi"]`)}return n}function kn(e,t){return t&&e.glance?.content&&e.glance?.format===`text/markdown`}var An=`shared.videoAtAGlance`;function jn(e){return e?.data?.colours?.primary&&e?.data?.colours?.secondary?e.data.colours:{primary:`#F5F4FF`,secondary:`#9294FF`}}function Mn(e){let t=kn(e.video,e.theme),n=Dn(e.video,e.pointsOfInterest,t,e.suppressInteractivity),r=On(e.pointsOfInterest,t);if(!t)return(0,z.jsx)(z.Fragment,{});let i=jn(e.theme),a=typeof e.onClickShowDescription==`function`,o=typeof e.onClickShowCurriculumLinks==`function`;return(0,z.jsxs)(`div`,{className:`rounded border px-3 px-sm-5 py-3 mb-3 position-relative d-flex justify-content-center ${yn.container}`,style:{backgroundColor:i.primary},children:[(0,z.jsx)(`div`,{className:`${yn.content} d-flex align-items-center pt-4 pt-sm-0`,children:(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`h4`,children:(0,z.jsx)(xe,{namespace:An,phrase:`videoAtAGlance`})}),a&&(0,z.jsx)(ve,{onClick:e.onClickShowDescription,className:`${yn.detailsBtn} position-absolute cursor-pointer me-4 fw-semibold text-info`,children:(0,z.jsx)(xe,{namespace:An,phrase:`readFullDescription`})}),(0,z.jsx)(`div`,{ref:r,onClick:t=>En(t,e.pointsOfInterest,e.setStartTime),dangerouslySetInnerHTML:{__html:n}}),e.video.tags?.data?.length?(0,z.jsx)(`div`,{className:`py-1`,children:(0,z.jsx)(gn,{tags:e.video?.tags?.data,themeColours:i,...mn.getTagActionProps(e.getTagAppLink,null,e.suppressInteractivity)})}):(0,z.jsx)(z.Fragment,{}),(0,z.jsx)(`div`,{className:`mt-2`,children:o&&(0,z.jsx)(ve,{onClick:e.onClickShowCurriculumLinks,className:`cursor-pointer d-inline-block fw-semibold text-info`,children:(0,z.jsx)(xe,{namespace:An,phrase:`seeCurriculumLinks`})})})]})}),(()=>{let t=e.theme?.data?.images??{};return _.keys(t).filter(e=>!_.isEmpty(t[e])).map(e=>{let n=De.createUrl(t[e]?.url,{size:Ee.Medium});return(0,z.jsx)(`div`,{className:`${yn[e]} ${yn.background} d-none d-lg-block`,style:{backgroundImage:`url('${n}')`}},t[e]?.fileId)})})()]})}var Nn=t(i(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.ImmersiveReader=r():n.ImmersiveReader=r()})(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,`default`,{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=1)}([function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),function(e){e[e.Disable=0]=`Disable`,e[e.Enable=1]=`Enable`}(t.CookiePolicy||={})},function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(2);t.renderButtons=r.renderButtons;var i=n(3);t.close=i.close,t.launchAsync=i.launchAsync,t.CookiePolicy=n(0).CookiePolicy,window.addEventListener(`load`,(function(){var e,t;window.hasOwnProperty(`Promise`)||(e=`https://contentstorage.onenote.office.net/onenoteltir/permanent-static-resources/promise-polyfill.min.js`,(t=document.createElement(`script`)).src=e,document.head.appendChild(t)),r.renderButtons()}))},function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r={af:`Indompelende leser`,am:`በህያው ስሜት ፈጣሪ ዕይታ አንባቢ`,ar:`القارئ الشامل`,as:`ইমাৰচিভ ৰিডাৰ`,az:`İmmersiv Oxuyucu`,be:`Імерсіўны чытальнік`,bg:`Концентриран четец`,bn:`মনোগ্রাহী পাঠক`,"bn-bd":`ইমার্সিভ পাঠক`,bs:`Koncentrirani čitalac`,ca:`Lector immersiu`,cs:`Asistivní čtečka`,"cy-gb":`Darllenydd Ymdrwythol`,da:`Forenklet læser`,de:`Plastischer Reader`,el:`Προηγμένο πρόγραμμα ανάγνωσης`,en:`Immersive Reader`,es:`Lector inmersivo`,et:`Süvaluger`,eu:`Irakurgailu murgiltzailea`,fa:`خواننده همه‌جانبه`,fi:`Syventävä lukuohjelma`,fil:`Immersive Reader`,fr:`Lecteur immersif`,"ga-ie":`Léitheoir tumthach`,gd:`An leughadair ùr-nòsach`,gl:`Lector avanzado`,gu:`ઇમર્સિવ રીડર`,ha:`Mai karatu Mai barbazawa`,he:`תצוגת קריאה מודרנית`,hi:`इमर्सिव रीडर`,hr:`Stopljeni čitač`,hu:`Modern olvasó`,hy:`Խորասուզված ընթերցիչ`,id:`Pembaca Imersif`,ig:`Ọgụụ Kenzipụtara`,is:`Aðgengilegt lestrarumhverfi`,it:`Strumento di lettura immersiva`,ja:`イマーシブ リーダー`,ka:`იმერსიული წამკითხველი`,kk:`Иммерсивті оқу құралы`,km:`កម្មវិធីអានពណ៌រំលេចនៅលើអេក្រង់`,kn:`ಇಮ್ಮರ್ಸಿವ್ ಓದುಗ`,ko:`몰입형 리더`,kok:`तंद्री लागिल्लो वाचक`,"ku-arab":`خوێنەری پڕ`,ky:`Курчаган Окугуч`,lb:`Immersive Reader`,lo:`ຕົວອ່ານອິມເມີສີບ`,lt:`Įtraukianti skaitytuvė`,lv:`Tīrskata lasītājs`,mi:`Pūpānui Rumaki`,mk:`Сеопфатен читач`,ml:`ഇമ്മേഴ്‌സീവ് റീഡർ`,mn:`Идэвхтэй уншигч`,mr:`इमर्सिव्ह वाचक`,ms:`Pembaca Imersif`,mt:`Qarrej Immersiv`,ne:`इमेर्सिभ रिडर`,nl:`Insluitende lezer`,"nn-no":`Engasjerande lesar`,no:`Engasjerende leser`,nso:`Go Bala ka Mongwalo o Mokoto`,or:`ଇମରସିଭ୍ ରିଡର୍`,pa:`ਇਮਰਸਿਵ ਰੀਡਰ`,"pa-arab":`گھیرن آلا مطالعہ کار`,pl:`Czytnik immersyjny`,prs:`خواننده نمایش`,pt:`Leitura Avançada`,quc:`Nim ucholajil sik'inel uwach`,quz:`Wankisqa Ñawiq`,ro:`Immersive Reader`,ru:`Иммерсивное средство чтения`,rw:`Insakazasoma`,sd:`امرسو ريڊر`,si:`ගිලෙන සුළු කියවනය`,sk:`Imerzná čítačka`,sl:`Potopni bralnik`,sq:`Lexuesi kredhës`,"sr-cyrl-ba":`Концентрисани читалац`,"sr-cyrl-rs":`Концентрисани читалац`,"sr-latn-rs":`Koncentrisani čitalac`,sv:`Avancerad läsare`,sw:`Kisomaji cha Kuzamisha`,ta:`அற்புதமான ரீடர்`,te:`మంత్రముగ్ధులను చేసే పఠన సాధనం`,"tg-cyrl-tj":`Хонандаи фарогир`,th:`โปรแกรมช่วยอ่าน`,ti:`ኣንባቢ ሕሉው ስምዒት ፈጣሪ`,tk:`Giňişleýin okaýjy`,tn:`Sebadi sa Imesife`,tr:`Tam Ekran Okuyucu`,tt:`Чолгап алучы уку чарасы`,"ug-cn":`چۆكمە ئوقۇغۇچ`,uk:`Занурення в текст`,ur:`امرسیو مطالعہ کار`,uz:`Immersiv mutolaa vositasi`,vi:`Trình đọc Chân thực`,wo:`Jàngukaay bu Rafet`,xh:`Isifundi Esikhulu`,yo:`Ìwò Alámùtán`,zh:`沉浸式阅读器`,"zh-hant":`沈浸式閱讀程式`,zu:`Isifundi Sokuzizwisa`};function i(e){var t=document.createElement(`img`);t.src=`https://contentstorage.onenote.office.net/onenoteltir/permanent-static-resources/immersive-reader-icon.svg`;var n=e.getAttribute(`data-icon-px-size`)||`20`;t.style.height=t.style.width=n+`px`,t.style.verticalAlign=`middle`,t.style.marginTop=`-2px`,t.alt=s(e.getAttribute(`data-locale`)||`en`),e.appendChild(t)}function a(e){var t=document.createElement(`span`);t.style.marginLeft=`8px`,e.appendChild(t)}function o(e){var t=document.createElement(`span`);t.textContent=s(e.getAttribute(`data-locale`)||`en`),e.appendChild(t)}function s(e){return e=e.toLowerCase(),r[e]?r[e]:e===`zh-hk`||e===`zh-mo`||e===`zh-tw`?r[`zh-hant`]:(e=e.substring(0,e.lastIndexOf(`-`)),r[e]?r[e]:(e=e.substring(0,e.lastIndexOf(`-`)),r[e]?r[e]:r.en))}t.renderButtons=function(e){var t=document.createElement(`style`);t.innerHTML=`.immersive-reader-button{cursor:pointer;display:inline-block;padding:5px;} .immersive-reader-button:hover{background:rgba(0,0,0,.05);border-radius:2px`,document.head.appendChild(t);var n=[].slice.call(document.getElementsByClassName(`immersive-reader-button`));e&&e.elements&&(n=e.elements);for(var r=0,c=n;r<c.length;r++){var l=c[r];l.setAttribute(`role`,`button`);var u=l.getAttribute(`data-locale`)||`en`;switch(l.setAttribute(`aria-label`,s(u)),l.getAttribute(`data-button-style`)||`icon`){case`icon`:i(l);break;case`text`:o(l);break;case`iconAndText`:i(l),a(l),o(l)}}}},function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,`__esModule`,{value:!0});var i=n(0),a=n(4),o={};function s(e){return e?RegExp(`^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])$`).test(e):!1}o[a.ErrorCode.TokenExpired]=`The access token supplied is expired.`,o[a.ErrorCode.Throttled]=`You have exceeded your quota.`,o[a.ErrorCode.ServerError]=`An error occurred when calling the server to process the text.`,o[a.ErrorCode.InvalidSubdomain]=`The subdomain supplied is invalid.`,t.launchAsync=function(e,t,n,c){return new Promise((function(l,u){if(e)if(n)if(n.chunks)if(n.chunks.length)if(s(t)||c&&c.customDomain){var d=Date.now();(c=r({uiZIndex:1e3,timeout:15e3,useWebview:!1,allowFullscreen:!0,hideExitButton:!1,cookiePolicy:i.CookiePolicy.Disable},c)).uiZIndex&&typeof c.uiZIndex==`number`||(c.uiZIndex=1e3);var f=null,p=document.createElement(`div`),m=c.useWebview?document.createElement(`webview`):document.createElement(`iframe`),h=document.createElement(`style`);h.innerHTML=`body{height:100%;overflow:hidden;}`;var g=function(){f&&=(window.clearTimeout(f),null)},_=function(){document.body.contains(p)&&document.body.removeChild(p),window.removeEventListener(`message`,y),g(),h.parentNode&&h.parentNode.removeChild(h)},v=function(){_(),c.onExit&&c.onExit()};_();var y=function(r){if(r&&r.data){if(r.data===`ImmersiveReader-ReadyForContent`){g();var i={cogSvcsAccessToken:e,cogSvcsSubdomain:t,request:n,launchToPostMessageSentDurationInMs:Date.now()-d};m.contentWindow.postMessage(JSON.stringify({messageType:`Content`,messageValue:i}),`*`)}else if(r.data===`ImmersiveReader-Exit`)v();else if(r.data.startsWith(`ImmersiveReader-LaunchResponse:`)){var s=null,c=null,f=null;try{f=JSON.parse(r.data.substring(31))}catch{}f&&f.success?s={container:p,sessionId:f.sessionId}:c=f&&!f.success?{code:f.errorCode,message:o[f.errorCode],sessionId:f.sessionId}:{code:a.ErrorCode.ServerError,message:o[a.ErrorCode.ServerError]},s?(g(),l(s)):c&&(v(),u(c))}}};window.addEventListener(`message`,y),f=window.setTimeout((function(){_(),u({code:a.ErrorCode.Timeout,message:`Page failed to load after timeout (`+c.timeout+` ms)`})}),c.timeout),c.allowFullscreen&&m.setAttribute(`allowfullscreen`,``),m.style.cssText=`position: static; width: 100vw; height: 100vh; left: 0; top: 0; border-width: 0`,c.useWebview&&m.addEventListener(`loadstop`,(function(){m.contentWindow.postMessage(JSON.stringify({messageType:`WebviewHost`}),`*`)}));var b=(c.customDomain?c.customDomain:`https://`+t+`.cognitiveservices.azure.com/immersivereader/webapp/v1.0/`)+`reader?exitCallback=ImmersiveReader-Exit&sdkPlatform=js&sdkVersion=1.0.0`;b+=`&cookiePolicy=`+(c.cookiePolicy===i.CookiePolicy.Enable?`enable`:`disable`),c.hideExitButton&&(b+=`&hideExitButton=true`),c.uiLang&&(b+=`&omkt=`+c.uiLang),m.src=b,p.style.cssText=`position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; border-width: 0; -webkit-perspective: 1px; z-index: `+c.uiZIndex+`; background: white; overflow: hidden`,p.appendChild(m),document.body.appendChild(p),document.head.appendChild(h)}else u({code:a.ErrorCode.InvalidSubdomain,message:o[a.ErrorCode.InvalidSubdomain]});else u({code:a.ErrorCode.BadArgument,message:`Chunks must not be empty`});else u({code:a.ErrorCode.BadArgument,message:`Chunks must not be null`});else u({code:a.ErrorCode.BadArgument,message:`Content must not be null`});else u({code:a.ErrorCode.BadArgument,message:`Token must not be null`})}))},t.close=function(){window.postMessage(`ImmersiveReader-Exit`,`*`)},t.isValidSubdomain=s},function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),function(e){e.BadArgument=`BadArgument`,e.Timeout=`Timeout`,e.TokenExpired=`TokenExpired`,e.Throttled=`Throttled`,e.ServerError=`ServerError`,e.InvalidSubdomain=`InvalidSubdomain`}(t.ErrorCode||={})}])}))}))()),Pn=Fe(),Fn={button:`_button_6xsqi_1`},In={reader:null,fetched:!1},Ln=`shared.immersiveReader`;function Rn(e){let[t,n]=R.useState(In.reader);!In.reader&&!In.fetched&&(In.fetched=!0,A({resource:`/api/integrations/token/immersive-reader`,type:ue.GET,success:r,error:()=>{}}));function r(e){In.reader=e,n(e),window.setTimeout(()=>{In.reader=null,In.fetched=!1},9e5)}if(!t)return(0,z.jsx)(z.Fragment,{});e.title||=p.getPhrase(Ln,`titleFallback`);function i(){f.isFunction(e.onLaunch)&&e.onLaunch(),te.logUserAction(e.analyticsData,e.analyticsOptions);let n={title:e.title,chunks:[{content:e.text,mimeType:e.html?`text/html`:`text/plain`}]},{subdomain:r,token:i}=t;Nn.launchAsync(i,r,n,{uiZIndex:5e3,onExit:()=>{f.isFunction(e.onExit)&&e.onExit()}})}return(0,z.jsx)(`span`,{className:`${Fn.button} ${e.className||``}`,onClick:i,children:(0,z.jsxs)(`svg`,{viewBox:`0 0 40 37`,children:[(0,z.jsx)(`path`,{d:`M37.4,0.9 L37.4,9.6 L35.4,9.6 L35.4,2.9 L24.4,2.9 C22.9,3.3 20,4.5 20,6 L20,17.2 L18,17.2 L18,6 C18,5 15.6,3.6 13.8,2.9 L2,2.9 L2,29 L12.4,29 L12.4,31 L0,31 L0,0.9 L14.1,0.9 L14.3,1 C15,1.2 17.5,2.2 18.9,3.7 C20.5,1.9 23.5,1.1 23.9,1 L24.1,1 L37.4,1 L37.4,0.9 Z`,fill:`#000000`}),(0,z.jsx)(`path`,{d:`M27.4,37 L25.8,37 L18.4,29.4 L14,29.4 L14,21 L18.4,20.9 L26.1,13 L27.4,13 L27.4,37 Z M16,27.4 L19.2,27.4 L25.3,33.7 L25.3,16.6 L19.2,22.9 L15.9,22.9 L15.9,27.4 L16,27.4 Z`,fill:`#0197F2`}),(0,z.jsx)(`path`,{d:`M31.3,32.7 L29.6,31.7 C29.6,31.7 31.7,28.3 31.7,25.2 C31.7,21.9 29.6,18.5 29.6,18.4 L31.3,17.4 C31.4,17.6 33.7,21.3 33.7,25.2 C33.7,28.8 31.4,32.6 31.3,32.7 Z`,fill:`#0197F2`}),(0,z.jsx)(`path`,{d:`M36.4,36.2 L34.8,35 C34.8,35 38,30.8 38,25.2 C38,19.6 34.8,15.4 34.8,15.4 L36.4,14.2 C36.5,14.4 40,19 40,25.3 C40,31.5 36.5,36 36.4,36.2 Z`,fill:`#0197F2`})]})})}function zn(e){let{page:t,totalPages:n}=e,r=Pe.isNumber(t)&&t>0&&t<n&&t+1,i=Pe.isNumber(t)&&t>1&&t-1,a={};if(r&&r<=n&&(a.next=r.toString()),i&&(a.previous=i.toString()),!_.isEmpty(a))return a}var Bn={isEmpty(e){return e&&!(e.data&&e.data.length)},length(e){return e&&e.data&&e.data.length},at(e,t){if(!(!e||!e.data||!e.data.length||t>e.data.length))return e.data[t]},get(e,t){if(!(!e||!e.data||!e.data.length))return e.data.find(e=>e.id&&e.id.toString()===t)},flattenCollections(e){if(!e||!e.length)return;let t=[];return e.forEach(e=>{t=[...t,...e.data]}),t},getNextCursor(e){return e.pagination&&e.pagination.cursors&&e.pagination.cursors.next},convertLegacyPaginatedCollection(e){if(e)return{data:e.data,pagination:{cursors:zn(e.pagination),limit:e.pagination.pageSize}}},hasData(e){return!Bn.isEmpty(e)}};function Vn(e){return L.isVideo(e)?e:L.isClip(e)?e._parentVideo:null}function Hn(e){let t=Bn.hasData,n=Vn(e);return n?t(n.productionCompanies)||t(n.producers)||t(n.distributors)||t(n.directors):!1}var Un={closeButton:`_closeButton_1bg8h_1`,descriptionBorder:`_descriptionBorder_1bg8h_7`},Wn=`shared.videoDetails`,Gn=p.encloseNamespace(Wn);function Kn(e){let{label:t,items:n,className:r}=e;return n&&n.data&&n.data.length?(0,z.jsxs)(`div`,{className:r,children:[t,`: `,n.data.map(e=>e.name).join(`, `)]}):(0,z.jsx)(z.Fragment,{})}function qn(e){let{video:t}=e;if(!L.isVideo(t)&&!L.isClip(t))return(0,z.jsx)(z.Fragment,{});let n=L.getParentVideo(t);return(0,z.jsxs)(`div`,{className:t.description?`col-md-5 ps-md-3 pt-3 pt-md-0`:`col-12`,children:[(0,z.jsx)(`h2`,{className:`h6 mb-1`,children:(0,z.jsx)(xe,{phrase:`details`})}),!!n.productionYear&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`productionYear`,options:{year:n.productionYear}})}),(0,z.jsx)(Kn,{label:Gn(`productionCompanies`,{smartCount:n.productionCompanies?.data?.length}),items:n.productionCompanies,className:`mb-1`}),(0,z.jsx)(Kn,{label:Gn(`distributors`,{smartCount:n.distributors?.data?.length}),items:n.distributors,className:`mb-1`}),(0,z.jsx)(Kn,{label:Gn(`producers`,{smartCount:n.producers?.data?.length}),items:n.producers,className:`mb-1`}),(0,z.jsx)(Kn,{label:Gn(`directors`,{smartCount:n.directors?.data?.length}),items:n.directors,className:`mb-1`}),!!n.dateBroadcast&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`dateBroadcast`,options:{date:oe.format(n.dateBroadcast,`DD/MM/YYYY`)}})}),!!n.channel&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`channel`,options:{channel:n.channel.name}})}),L.canViewUploadDate(e.video)&&(0,z.jsx)(`div`,{className:`mb-1`,children:(0,z.jsx)(xe,{phrase:`dateUploaded`,options:{date:oe.format(t.dateCreated,`DD/MM/YYYY`)}})})]})}function Jn(e){let{video:t,maxHeight:n=368}=e,r=L.getParentVideo(t),i=!!e.video.description,a=Hn(e.video)||!!r.productionYear||!!r.dateBroadcast||!!r.channel||L.canViewUploadDate(e.video),o=typeof e.onClickClose==`function`,s=typeof e.onClickShowCurriculumLinks==`function`;function c(){return e.hideTags||L.isInteractive(e.video)||!e.video.tags?.data?.length?null:e.video.tags.data}return!i&&!a?(0,z.jsx)(z.Fragment,{}):(0,z.jsx)(Se.Provider,{value:Wn,children:(0,z.jsxs)(`div`,{className:`rounded border p-3 mb-3 position-relative`,children:[(0,z.jsx)(Pn.Scrollbars,{autoHeight:!0,autoHeightMax:n,children:(0,z.jsxs)(`div`,{className:`row g-0`,children:[i&&(0,z.jsxs)(`div`,{className:a?`${Un.descriptionBorder} pe-3 col-md-7`:`col-12`,children:[(0,z.jsxs)(`div`,{className:`d-flex align-items-center`,children:[(0,z.jsx)(`h2`,{className:`h6 mb-1`,children:(0,z.jsx)(xe,{phrase:`description`})}),(0,z.jsx)(Rn,{text:t.description,title:t.name,className:`ps-2`,onLaunch:e.onLaunchImmersiveReader,onExit:e.onExitImmersiveReader,analyticsOptions:{location:ee.PlayPage,entity:D.Video,actionType:h.Click,descriptor:x.LaunchImmersiveReader},analyticsData:{id:t.id,type:`description`}})]}),(0,z.jsx)(`p`,{className:`mb-0`,dangerouslySetInnerHTML:{__html:ht.linkifyText(e.video.description,{nl2br:!0})}}),(0,z.jsx)(gn,{tags:c(),...mn.getTagActionProps(e.getTagAppLink,null,e.suppressInteractivity),className:`mt-1`}),s&&(0,z.jsx)(ve,{onClick:e.onClickShowCurriculumLinks,className:`cursor-pointer d-inline-block fw-semibold text-info mt-2 mb-1`,children:(0,z.jsx)(xe,{namespace:Wn,phrase:`seeCurriculumLinks`})})]}),a&&(0,z.jsx)(qn,{...e})]})}),o&&(0,z.jsx)(`button`,{type:`button`,className:`btn-close ${Un.closeButton}`,"aria-label":`Close`,onClick:e.onClickClose})]})})}function Yn(){return(0,z.jsx)(`div`,{className:`p-3 mb-3 border rounded`,children:(0,z.jsxs)(`div`,{className:`row`,children:[(0,z.jsxs)(`div`,{className:`pe-3 col-md-7 border-right`,children:[(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`12rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`4.5rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background`,style:{height:`1.5rem`,width:`15rem`}})]}),(0,z.jsxs)(`div`,{className:`col-md-5 ps-md-3 pt-3 pt-md-0`,children:[(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`7rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`10rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2`,style:{height:`1.5rem`,width:`12rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`3rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`4rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`3.5rem`}}),(0,z.jsx)(`div`,{className:`partial-loading-background mb-2 me-2 d-inline-block`,style:{height:`1.5rem`,width:`4.5rem`}})]})]})})}var Xn=`shared.playPage`;function Zn(){let e=p.encloseNamespace(Xn);return(0,z.jsxs)(`div`,{className:`alert bg-light-blue p-3 rounded-3 d-flex justify-content-between align-items-center`,children:[(0,z.jsx)(d,{svg:kt,size:l.Standard,className:`me-2 svg-container`}),(0,z.jsxs)(`div`,{className:`w-100`,children:[(0,z.jsx)(`p`,{className:`fw-semibold mb-0`,children:e(`archivedInfoTitle`)}),(0,z.jsx)(`p`,{className:`mb-1`,children:e(`archivedInfo`)})]})]})}var Qn={series:`_series_1xytj_1`};function $n(e){let t=wt(e.video.subjectPresentationAudiences?.data,e.audiences);return(0,z.jsxs)(`section`,{className:`position-relative`,children:[(0,z.jsxs)(`div`,{className:`d-inline-block`,children:[(0,z.jsx)(Et,{type:`productionCompany`,video:e.video,appLink:e.getSubTextAppLink(e.video),className:`${Qn.series} text-truncate mw-100`,analyticsOptions:{location:ee.PlayPage}}),(0,z.jsx)(`h1`,{className:`h4 d-inline-flex align-items-center mb-2 mt-n1 mw-100 mb-0 pt-2`,children:(0,z.jsx)(`span`,{className:`align-self-center`,children:e.video.name})})]}),t&&(0,z.jsx)(Ct,{className:`mb-3`,children:(0,z.jsx)(Tt,{audience:t,className:`bg-white text-dark`,border:`dark`})})]})}var er={mask:`_mask_vq9tb_1`,centeredIcon:`_centeredIcon_vq9tb_10`,bgImage:`_bgImage_vq9tb_21`,centeredOverlay:`_centeredOverlay_vq9tb_24`};function tr(e){let t=De.createUrl(L.getThumbnail(e.video)?.url??``,{size:Ee.Large});return(0,z.jsx)(`div`,{className:`position-relative responsive-img ${er.bgImage}`,style:{backgroundImage:`url('${t}')`},children:(0,z.jsxs)(ye,{appLink:e.appLink,analyticsOptions:{actionType:h.Click,location:ee.PlayPage,entity:D.AppLink,workflowPhase:g.Start,descriptor:re.SignUp},analyticsData:{},children:[(0,z.jsx)(d,{svg:St,className:er.centeredIcon}),(0,z.jsx)(`div`,{className:er.mask})]})})}var nr=()=>{let[,e]=R.useState(Date.now());return()=>{e(Date.now())}},rr=3,ir=300,ar=class{constructor(e){this.hasLogged=!1,this.options=e,this.player=e.player,this.analyticsLocation=e.analyticsLocation,this.onTimeUpdate=this.onTimeUpdate.bind(this),this.initialize()}initialize(){this.bindListeners()}bindListeners(){this.player.on(`timeupdate`,this.onTimeUpdate),this.player.one(`dispose`,()=>{this.player.off(`timeupdate`,this.onTimeUpdate)})}unbindListeners(){this.player.off(`timeupdate`,this.onTimeUpdate)}setAnalyticsLocation(e){this.analyticsLocation=e}onTimeUpdate(){if(!(this.player.currentTime()<rr||this.hasLogged)&&this.player.getPlayerMode()!==`hover`)try{let e=`m:${this.options.video.id}`;if(this.hasCoolDownTime()&&he.cacheExists(e))return;te.logUserAction(this.getAnalyticsData(),{actionType:h.Stream,entity:L.getAnalyticsEntity(this.options.video),location:this.analyticsLocation}),this.hasCoolDownTime()&&he.cacheSet(e,null,ir)}finally{this.hasLogged=!0,this.unbindListeners()}}hasCoolDownTime(){return L.isVideo(this.options.video)}getAnalyticsData(){let e={name:this.options.video.name};return this.options.shareId&&(e.shareId=this.options.shareId),L.isVideo(this.options.video)&&(e.id=this.options.video.id),L.isClip(this.options.video)&&(e.id=this.options.video._parentVideo?.id,e.clip={id:this.options.video.id}),L.isInteractive(this.options.video)&&(e.id=this.options.video._parentVideo?.id,e.interactive={id:this.options.video.id}),e}},or=i(((e,t)=>{t.exports=typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{}})),sr=i(((e,t)=>{t.exports={}})),cr=i(((e,t)=>{var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},r=sr(),i;typeof document<`u`?i=document:(i=n[`__GLOBAL_DOCUMENT_CACHE@4`],i||=n[`__GLOBAL_DOCUMENT_CACHE@4`]=r),t.exports=i})),lr=i(((e,t)=>{t.exports=r;var n=Object.prototype.toString;function r(e){if(!e)return!1;var t=n.call(e);return t===`[object Function]`||typeof e==`function`&&t!==`[object RegExp]`||typeof window<`u`&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}})),ur=i(((e,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(e,t){if(e){if(typeof e==`string`)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}t.exports=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},t.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var n=this.typeToInterceptorsMap_.get(e);return n.has(t)?!1:(n.add(t),!0)},t.removeInterceptor=function(e,t){var n=this.typeToInterceptorsMap_.get(e);return n&&n.has(t)?(n.delete(t),!0):!1},t.clearInterceptorsByType=function(e){return this.typeToInterceptorsMap_.get(e)?(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0):!1},t.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},t.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},t.execute=function(e,t){for(var r=n(this.getForType(e)),i;!(i=r()).done;){var a=i.value;try{t=a(t)}catch{}}return t},e}()})),dr=i(((e,t)=>{var n=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=e===void 0?{}:e,n=t.maxAttempts,i=t.delayFactor,a=t.fuzzFactor,o=t.initialDelay;return new r({maxAttempts:n||this.maxAttempts_,delayFactor:i||this.delayFactor_,fuzzFactor:a||this.fuzzFactor_,initialDelay:o||this.initialDelay_})},e}(),r=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_+=e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}();t.exports=n})),fr=i(((e,t)=>{var n=or(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),pr=i(((e,t)=>{var n=or(),r=dt(),i=lr(),a=ur(),o=dr();d.httpHandler=fr(),d.requestInterceptorsStorage=new a,d.responseInterceptorsStorage=new a,d.retryManager=new o;var s=function(e){var t={};return e&&e.trim().split(`
3
3
  `).forEach(function(e){var n=e.indexOf(`:`),r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}),t};t.exports=d,t.exports.default=d,d.XMLHttpRequest=n.XMLHttpRequest||m,d.XDomainRequest=`withCredentials`in new d.XMLHttpRequest?d.XMLHttpRequest:n.XDomainRequest,c([`get`,`put`,`post`,`patch`,`head`,`delete`],function(e){d[e===`delete`?`del`:e]=function(t,n,r){return n=u(t,n,r),n.method=e.toUpperCase(),f(n)}});function c(e,t){for(var n=0;n<e.length;n++)t(e[n])}function l(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function u(e,t,n){var a=e;return i(t)?(n=t,typeof e==`string`&&(a={uri:e})):a=r({},t,{uri:e}),a.callback=n,a}function d(e,t,n){return t=u(e,t,n),f(t)}function f(e){if(e.callback===void 0)throw Error(`callback argument missing`);if(e.requestType&&d.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},n=d.requestInterceptorsStorage.execute(e.requestType,t);e.uri=n.uri,e.headers=n.headers,e.body=n.body,e.metadata=n.metadata,e.retry=n.retry,e.timeout=n.timeout}var r=!1,i=function(t,n,i){r||(r=!0,e.callback(t,n,i))};function a(){m.readyState===4&&!d.responseInterceptorsStorage.getIsEnabled()&&setTimeout(u,0)}function o(){var e=void 0;if(e=m.response?m.response:m.responseText||p(m),S)try{e=JSON.parse(e)}catch{}return e}function c(t){if(clearTimeout(C),clearTimeout(e.retryTimeout),t instanceof Error||(t=Error(``+(t||`Unknown XMLHttpRequest Error`))),t.statusCode=0,!g&&d.retryManager.getIsEnabled()&&e.retry&&e.retry.shouldRetry()){e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=m,f(e)},e.retry.getCurrentFuzzedDelay());return}if(e.requestType&&d.responseInterceptorsStorage.getIsEnabled()){var n={headers:w.headers||{},body:w.body,responseUrl:m.responseURL,responseType:m.responseType},r=d.responseInterceptorsStorage.execute(e.requestType,n);w.body=r.body,w.headers=r.headers}return i(t,w)}function u(){if(!g){var t;clearTimeout(C),clearTimeout(e.retryTimeout),t=e.useXDR&&m.status===void 0?200:m.status===1223?204:m.status;var n=w,r=null;if(t===0?r=Error(`Internal XMLHttpRequest Error`):(n={body:o(),statusCode:t,method:v,headers:{},url:_,rawRequest:m},m.getAllResponseHeaders&&(n.headers=s(m.getAllResponseHeaders()))),e.requestType&&d.responseInterceptorsStorage.getIsEnabled()){var a={headers:n.headers||{},body:n.body,responseUrl:m.responseURL,responseType:m.responseType},c=d.responseInterceptorsStorage.execute(e.requestType,a);n.body=c.body,n.headers=c.headers}return i(r,n,n.body)}}var m=e.xhr||null;m||=e.cors||e.useXDR?new d.XDomainRequest:new d.XMLHttpRequest;var h,g,_=m.url=e.uri||e.url,v=m.method=e.method||`GET`,y=e.body||e.data,b=m.headers=e.headers||{},x=!!e.sync,S=!1,C,w={body:void 0,headers:{},statusCode:0,method:v,url:_,rawRequest:m};if(`json`in e&&e.json!==!1&&(S=!0,b.accept||b.Accept||(b.Accept=`application/json`),v!==`GET`&&v!==`HEAD`&&(b[`content-type`]||b[`Content-Type`]||(b[`Content-Type`]=`application/json`),y=JSON.stringify(e.json===!0?y:e.json))),m.onreadystatechange=a,m.onload=u,m.onerror=c,m.onprogress=function(){},m.onabort=function(){g=!0,clearTimeout(e.retryTimeout)},m.ontimeout=c,m.open(v,_,!x,e.username,e.password),x||(m.withCredentials=!!e.withCredentials),!x&&e.timeout>0&&(C=setTimeout(function(){if(!g){g=!0,m.abort(`timeout`);var e=Error(`XMLHttpRequest timeout`);e.code=`ETIMEDOUT`,c(e)}},e.timeout)),m.setRequestHeader)for(h in b)b.hasOwnProperty(h)&&m.setRequestHeader(h,b[h]);else if(e.headers&&!l(e.headers))throw Error(`Headers cannot be set on an XDomainRequest object`);return`responseType`in e&&(m.responseType=e.responseType),`beforeSend`in e&&typeof e.beforeSend==`function`&&e.beforeSend(m),m.send(y||null),m}function p(e){try{if(e.responseType===`document`)return e.responseXML;var t=e.responseXML&&e.responseXML.documentElement.nodeName===`parsererror`;if(e.responseType===``&&!t)return e.responseXML}catch{}return null}function m(){}})),mr=i(((e,t)=>{var n=cr(),r=Object.create||(function(){function e(){}return function(t){if(arguments.length!==1)throw Error(`Object.create shim only accepts one parameter.`);return e.prototype=t,new e}})();function i(e,t){this.name=`ParsingError`,this.code=e.code,this.message=t||e.message}i.prototype=r(Error.prototype),i.prototype.constructor=i,i.Errors={BadSignature:{code:0,message:`Malformed WebVTT signature.`},BadTimeStamp:{code:1,message:`Malformed time stamp.`}};function a(e){function t(e,t,n,r){return(e|0)*3600+(t|0)*60+(n|0)+(r|0)/1e3}var n=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(`:`,``),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function o(){this.values=r(null)}o.prototype={set:function(e,t){!this.get(e)&&t!==``&&(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100)?(this.set(e,t),!0):!1}};function s(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if(typeof i[a]==`string`){var o=i[a].split(n);o.length===2&&t(o[0].trim(),o[1].trim())}}function c(e,t,n){var r=e;function c(){var t=a(e);if(t===null)throw new i(i.Errors.BadTimeStamp,`Malformed timestamp: `+r);return e=e.replace(/^[^\sa-zA-Z-]+/,``),t}function l(e,t){var r=new o;s(e,function(e,t){switch(e){case`region`:for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case`vertical`:r.alt(e,t,[`rl`,`lr`]);break;case`line`:var a=t.split(`,`),o=a[0];r.integer(e,o),r.percent(e,o)&&r.set(`snapToLines`,!1),r.alt(e,o,[`auto`]),a.length===2&&r.alt(`lineAlign`,a[1],[`start`,`center`,`end`]);break;case`position`:a=t.split(`,`),r.percent(e,a[0]),a.length===2&&r.alt(`positionAlign`,a[1],[`start`,`center`,`end`]);break;case`size`:r.percent(e,t);break;case`align`:r.alt(e,t,[`start`,`center`,`end`,`left`,`right`]);break}},/:/,/\s/),t.region=r.get(`region`,null),t.vertical=r.get(`vertical`,``);try{t.line=r.get(`line`,`auto`)}catch{}t.lineAlign=r.get(`lineAlign`,`start`),t.snapToLines=r.get(`snapToLines`,!0),t.size=r.get(`size`,100);try{t.align=r.get(`align`,`center`)}catch{t.align=r.get(`align`,`middle`)}try{t.position=r.get(`position`,`auto`)}catch{t.position=r.get(`position`,{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get(`positionAlign`,{start:`start`,left:`start`,center:`center`,middle:`center`,end:`end`,right:`end`},t.align)}function u(){e=e.replace(/^\s+/,``)}if(u(),t.startTime=c(),u(),e.substr(0,3)!==`-->`)throw new i(i.Errors.BadTimeStamp,`Malformed time stamp (time stamps must be separated by '-->'): `+r);e=e.substr(3),u(),t.endTime=c(),u(),l(e,t)}var l=n.createElement&&n.createElement(`textarea`),u={c:`span`,i:`i`,b:`b`,u:`u`,ruby:`ruby`,rt:`rt`,v:`span`,lang:`span`},d={white:`rgba(255,255,255,1)`,lime:`rgba(0,255,0,1)`,cyan:`rgba(0,255,255,1)`,red:`rgba(255,0,0,1)`,yellow:`rgba(255,255,0,1)`,magenta:`rgba(255,0,255,1)`,blue:`rgba(0,0,255,1)`,black:`rgba(0,0,0,1)`},f={v:`title`,lang:`lang`},p={rt:`ruby`};function m(e,t){function n(){if(!t)return null;function e(e){return t=t.substr(e.length),e}var n=t.match(/^([^<]*)(<[^>]*>?)?/);return e(n[1]?n[1]:n[2])}function r(e){return l.innerHTML=e,e=l.textContent,l.textContent=``,e}function i(e,t){return!p[t.localName]||p[t.localName]===e.localName}function o(t,n){var r=u[t];if(!r)return null;var i=e.document.createElement(r),a=f[t];return a&&n&&(i[a]=n.trim()),i}for(var s=e.document.createElement(`div`),c=s,m,h=[];(m=n())!==null;){if(m[0]===`<`){if(m[1]===`/`){h.length&&h[h.length-1]===m.substr(2).replace(`>`,``)&&(h.pop(),c=c.parentNode);continue}var g=a(m.substr(1,m.length-2)),_;if(g){_=e.document.createProcessingInstruction(`timestamp`,g),c.appendChild(_);continue}var v=m.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v||(_=o(v[1],v[3]),!_)||!i(c,_))continue;if(v[2]){var y=v[2].split(`.`);y.forEach(function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(d.hasOwnProperty(n)){var r=t?`background-color`:`color`,i=d[n];_.style[r]=i}}),_.className=y.join(` `)}h.push(v[1]),c.appendChild(_),c=_;continue}c.appendChild(e.document.createTextNode(r(m)))}return s}var h=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function g(e){for(var t=0;t<h.length;t++){var n=h[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function _(e){var t=[],n=``,r;if(!e||!e.childNodes)return`ltr`;function i(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function a(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var r=n.match(/^.*(\n|\r)/);return r?(e.length=0,r[0]):n}if(t.tagName===`ruby`)return a(e);if(t.childNodes)return i(e,t),a(e)}for(i(t,e);n=a(t);)for(var o=0;o<n.length;o++)if(r=n.charCodeAt(o),g(r))return`rtl`;return`ltr`}function v(e){if(typeof e.line==`number`&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;i<n.length&&n[i]!==t;i++)n[i].mode===`showing`&&r++;return++r*-1}function y(){}y.prototype.applyStyles=function(e,t){for(var n in t||=this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},y.prototype.formatStyle=function(e,t){return e===0?0:e+t};function b(e,t,n){y.call(this),this.cue=t,this.cueDiv=m(e,t.text);var r={color:`rgba(255, 255, 255, 1)`,backgroundColor:`rgba(0, 0, 0, 0.8)`,position:`relative`,left:0,right:0,top:0,bottom:0,display:`inline`,writingMode:t.vertical===``?`horizontal-tb`:t.vertical===`lr`?`vertical-lr`:`vertical-rl`,unicodeBidi:`plaintext`};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement(`div`),r={direction:_(this.cueDiv),writingMode:t.vertical===``?`horizontal-tb`:t.vertical===`lr`?`vertical-lr`:`vertical-rl`,unicodeBidi:`plaintext`,textAlign:t.align===`middle`?`center`:t.align,font:n.font,whiteSpace:`pre-line`,position:`absolute`},this.applyStyles(r),this.div.appendChild(this.cueDiv);var i=0;switch(t.positionAlign){case`start`:case`line-left`:i=t.position;break;case`center`:i=t.position-t.size/2;break;case`end`:case`line-right`:i=t.position-t.size;break}t.vertical===``?this.applyStyles({left:this.formatStyle(i,`%`),width:this.formatStyle(t.size,`%`)}):this.applyStyles({top:this.formatStyle(i,`%`),height:this.formatStyle(t.size,`%`)}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,`px`),bottom:this.formatStyle(e.bottom,`px`),left:this.formatStyle(e.left,`px`),right:this.formatStyle(e.right,`px`),height:this.formatStyle(e.height,`px`),width:this.formatStyle(e.width,`px`)})}}b.prototype=r(y.prototype),b.prototype.constructor=b;function x(e){var t,n,r,i;if(e.div){n=e.div.offsetHeight,r=e.div.offsetWidth,i=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||i,this.height=e.height||n,this.bottom=e.bottom||i+(e.height||n),this.width=e.width||r,this.lineHeight=t===void 0?e.lineHeight:t}x.prototype.move=function(e,t){switch(t=t===void 0?this.lineHeight:t,e){case`+x`:this.left+=t,this.right+=t;break;case`-x`:this.left-=t,this.right-=t;break;case`+y`:this.top+=t,this.bottom+=t;break;case`-y`:this.top-=t,this.bottom-=t;break}},x.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},x.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},x.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},x.prototype.overlapsOppositeAxis=function(e,t){switch(t){case`+x`:return this.left<e.left;case`-x`:return this.right>e.right;case`+y`:return this.top<e.top;case`-y`:return this.bottom>e.bottom}},x.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},x.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},x.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e,{left:e.left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}};function S(e,t,n,r){function i(e,t){for(var i,a=new x(e),o=1,s=0;s<t.length;s++){for(;e.overlapsOppositeAxis(n,t[s])||e.within(n)&&e.overlapsAny(r);)e.move(t[s]);if(e.within(n))return e;var c=e.intersectPercentage(n);o>c&&(i=new x(e),o=c),e=new x(a)}return i||a}var a=new x(t),o=t.cue,s=v(o),c=[];if(o.snapToLines){var l;switch(o.vertical){case``:c=[`+y`,`-y`],l=`height`;break;case`rl`:c=[`+x`,`-x`],l=`width`;break;case`lr`:c=[`-x`,`+x`],l=`width`;break}var u=a.lineHeight,d=u*Math.round(s),f=n[l]+u,p=c[0];Math.abs(d)>f&&(d=d<0?-1:1,d*=Math.ceil(f/u)*u),s<0&&(d+=o.vertical===``?n.height:n.width,c=c.reverse()),a.move(p,d)}else{var m=a.lineHeight/n.height*100;switch(o.lineAlign){case`center`:s-=m/2;break;case`end`:s-=m;break}switch(o.vertical){case``:t.applyStyles({top:t.formatStyle(s,`%`)});break;case`rl`:t.applyStyles({left:t.formatStyle(s,`%`)});break;case`lr`:t.applyStyles({right:t.formatStyle(s,`%`)});break}c=[`+y`,`-x`,`+x`,`-y`],a=new x(t)}var h=i(a,c);t.move(h.toCSSCompatValues(n))}function C(){}C.StringDecoder=function(){return{decode:function(e){if(!e)return``;if(typeof e!=`string`)throw Error(`Error - expected string data.`);return decodeURIComponent(encodeURIComponent(e))}}},C.convertCueToDOMTree=function(e,t){return!e||!t?null:m(e,t)};var w=.05,T=`sans-serif`,E=`1.5%`;C.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement(`div`);r.style.position=`absolute`,r.style.left=`0`,r.style.right=`0`,r.style.top=`0`,r.style.bottom=`0`,r.style.margin=E,n.appendChild(r);function i(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}if(!i(t)){for(var a=0;a<t.length;a++)r.appendChild(t[a].displayState);return}var o=[],s=x.getSimpleBoxPosition(r),c={font:Math.round(s.height*w*100)/100+`px `+T};(function(){for(var n,i,a=0;a<t.length;a++)i=t[a],n=new b(e,i,c),r.appendChild(n.div),S(e,n,s,o),i.displayState=n.div,o.push(x.getSimpleBoxPosition(n))})()},C.Parser=function(e,t,n){n||(n=t,t={}),t||={},this.window=e,this.vttjs=t,this.state=`INITIAL`,this.buffer=``,this.decoder=n||new TextDecoder(`utf8`),this.regionList=[]},C.Parser.prototype={reportOrThrowError:function(e){if(e instanceof i)this.onparsingerror&&this.onparsingerror(e);else throw e},parse:function(e){var t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){for(var e=t.buffer,n=0;n<e.length&&e[n]!==`\r`&&e[n]!==`
4
4
  `;)++n;var r=e.substr(0,n);return e[n]===`\r`&&++n,e[n]===`
@@ -229,7 +229,7 @@ ${qh(e)}`),t.map&&!t.map.bytes&&(this.logger_(`going to request init segment.`),
229
229
  fill='currentColor'
230
230
  />
231
231
  </svg>
232
- `,Ev=class extends Cv{constructor(e,t){super(e,t)}createEl(){let e=wv.prototype.createEl.call(this,`button`,{className:this.buildCSSClass()},{type:`button`,title:this.controlText_});return e.innerHTML=Tv,this.createControlTextEl(e),e}handleClick(e){e.stopPropagation(),e.preventDefault(),this.options_?.onClick&&this.options_.onClick()}buildCSSClass(){return`cv-remove-video-button`}};q.registerComponent(`removeVideoButton`,Ev),Ev.prototype.controlText_=`Remove from watch history`;var Dv=`cvplayer-playback-quality:v2`,Ov=`cvplayer-localcache-playback-quality:v2`,kv=class{static isQualityUserPreference(){let e=localStorage.getItem(Dv),t=localStorage.getItem(Ov);return!!(e||t)}static getPlayerMode(e){let t=e.isFullscreen?.()??!1,n=e.usingPlugin?.(`playerModePlugin`)?e.playerModePlugin()?.isHovering?.()??!1:!1,r=e.usingPlugin?.(`theatreModePlugin`)?e.theatreModePlugin()?.getTheatreMode?.()??!1:!1;return t?`fullscreen`:n?`hover`:r?`theatre`:`default`}static findQualityLevel(e,t){for(let n=0;n<e.length;n++)if(e[n].quality<=t)return e[n];let n=e[e.length-1];if(!n)throw Error(`No quality levels available`);return n}static enableQualityLevel(e,t){for(let n=0;n<e.length;n++){let r=e[n];r.enabled=r.id===t}}},Av=function(e){return e.Default=`play`,e.Hover=`hover`,e}({}),jv=q.getPlugin(`plugin`),Mv=`cv-preview-mode`,Nv=`cv-force-16-9`,Pv=class extends jv{constructor(e,t){super(e),this.hasSeeked=!1,this.buttonAdded=!1,this.mode=null,this.defaultDisplayMode=`normal`,this.onQualityReady=null,t?.defaultDisplayMode&&(this.defaultDisplayMode=t.defaultDisplayMode),t?.startTime&&(this.startTime=t.startTime),this.onSeek=this.onSeek.bind(this),this.player.one(`seeking`,this.onSeek)}onSeek(){this.hasSeeked=!0}dispose(){this.cleanupQualityListener(),this.player.off(`seeking`,this.onSeek),super.dispose()}getMode(){return this.mode}isHovering(){return this.mode===Av.Hover}setPlayerMode(e,t,n){this.player.trigger(`flushprogress`);let r=this.mode;if(this.mode=e,e===Av.Hover){this.buttonAdded||this.addButtons(t,n),this.player.addClass(Mv),this.applyAspectRatioFix(),this.enableSubtitles(),this.mute(),this.setLowQuality(),this.removeActivityTimeout(),this.player.trigger(`resize`);return}r===Av.Hover&&(this.applyDefaultModeLayout(),this.player.removeClass(Mv),this.player.removeClass(Nv),this.disableSubtitles(),this.unmute(),this.cleanupQualityListener(),this.restorePreviousQuality(),this.restoreActivityTimeout(),this.player.trigger(`resize`),this.hasSeeked||=(this.player.currentTime(this.startTime??0),!1))}applyDefaultModeLayout(){let e=this.player.usingPlugin?.(`theatreModePlugin`);this.defaultDisplayMode===`theatre`?(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!0),this.player.fill(!0)):(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!1),this.player.fluid(!0))}applyAspectRatioFix(){let e=()=>{let e=this.player.videoWidth(),t=this.player.videoHeight();if(e>0&&t>0){let n=e/t;Math.abs(n-16/9)<.01||this.player.addClass(Nv)}};this.player.readyState()>=1?e():this.player.one(`loadedmetadata`,e)}addButtons(e,t){let n=new bv(this.player),r=new Sv(this.player,{onClickHandler:e}),i=new Ev(this.player,{onClick:t});t&&f.isFunction(t)&&this.player.addChild(i),this.player.addChild(n),this.player.addChild(r),this.buttonAdded=!0}enableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}setLowQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().disable();let e=this.player.qualityLevels();if(e.length>0){this.switchToLowestQuality(e);return}this.cleanupQualityListener(),this.onQualityReady=()=>{this.onQualityReady=null,this.switchToLowestQuality(e)},e.one(`change`,this.onQualityReady)})}cleanupQualityListener(){this.onQualityReady&&=(this.player.qualityLevels().off(`change`,this.onQualityReady),null)}switchToLowestQuality(e){let t=e[e.length-1];t&&kv.enableQualityLevel(e,t.id)}restorePreviousQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().applyUserPreferences(),this.player.persistQualitySettingsPlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}};q.registerPlugin(`playerModePlugin`,Pv);var Fv=1e3*60*60*8,Iv=class{constructor(e){this.options=e,this.initialize()}logStream(){let e=`v:${this.options.videoId}`,t=this.getPlayerMetrics();he.cacheExists(e)||(this.collectionApiClient.log({type:h.WebPlayerStream,actionContext:this.getActionContext(),data:{...this.getAnalyticsData(),player:t},eventVersion:S.V3}),he&&he.cacheSet(e,null,300))}logVideoProgress(e,t,n){let r=this.getAnalyticsData(),i=this.getPlayerMetrics(),a=n?h.PreviewStreamProgress:h.StreamProgress,o=e.map(e=>({type:a,actionContext:this.getActionContext(),data:{...r,player:i,progress:e},eventVersion:S.V2}));for(let e of t)o.push({type:h.StreamBuffering,actionContext:this.getActionContext(),data:{...r,player:i,buffering:e},eventVersion:S.V2});this.collectionApiClient.log(o)}logUserAction(e,t){let n={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:n,actionContext:r,eventVersion:t.eventVersion||S.V2})}getAnalyticsData(){let e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache,isQualityUserPreference:kv.isQualityUserPreference()},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);let t=this.getEntityType();return t===D.Interactive?e.interactive={id:+this.options.mediaId}:t===D.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),at.lockWindowSession(this.options.userId,Fv),this.options.player.one(`dispose`,()=>at.unlockWindowSession(this.options.userId))}setupCollectionApiClient(){this.collectionApiClient=new He({productName:`player.web`,productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:rt.shouldLog,formatData:rt.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?y.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case`MasterVideo`:return D.Video;case`MasterInteractive`:return D.Interactive;case`MasterClip`:return D.Clip}}getLocationContext(){switch(this.options.playerType){case`player`:return ee.Player;case`interactive-player`:return ee.InteractivePlayer;case`create-clip-player`:return ee.CreateClipPlayer}}getPlayerMetrics(){let e=this.options.player,t=e.qualityLevels?.();return{mode:kv.getPlayerMode(e),width:e.currentWidth(),height:e.currentHeight(),quality:t?.[t?.selectedIndex]?.id}}},Lv=class extends Error{constructor(e,t){super(t?.title||`Ajax error`),this.url=e,this.response=t}},Rv=new class{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:`GET`,mode:`cors`,headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:`DELETE`,headers:this.getHeaders(t)})}async post(e,t,n,r=!0){let i=await fetch(e,{method:`POST`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}async put(e,t,n,r=!0){let i=await fetch(e,{method:`PUT`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}setToken(e,t){this.tokens[e]=t}hasToken(e){return!!this.tokens[e]}getHeaders(e={}){let t={"Content-Type":`application/json`};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let t;try{t=await e.json()}catch{throw new Lv(e.url)}finally{throw new Lv(e.url,t)}}return await e.json()}},J=t(i(((e,t)=>{function n(e){if(e&&typeof e==`object`){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if(typeof e==`number`)return o[e];var n=String(e),a=r[n.toLowerCase()];if(a)return a;var a=i[n.toLowerCase()];if(a)return a;if(n.length===1)return n.charCodeAt(0)}n.isEventKey=function(e,t){if(e&&typeof e==`object`){var n=e.which||e.keyCode||e.charCode;if(n==null)return!1;if(typeof t==`string`){var a=r[t.toLowerCase()];if(a)return a===n;var a=i[t.toLowerCase()];if(a)return a===n}else if(typeof t==`number`)return t===n;return!1}},e=t.exports=n;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r[`f`+a]=a+111;for(a=0;a<10;a++)r[`numpad `+a]=a+96;var o=e.names=e.title={};for(a in r)o[r[a]]=a;for(var s in i)r[s]=i[s]}))());function zv(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())}function Bv(e){let t=e.theatreModePlugin().getTheatreMode();e.theatreModePlugin().toggleTheatreMode(!t,{shouldLog:!0})}function Vv(e){let t=e.volume(),n=e.lastVolume_();if(t===0){let t=n<.1?.1:n;e.volume(t),e.muted(!1)}else e.muted(!e.muted())}function Hv(e){e.paused()?e.play():e.pause()}function Uv(e,t){e.currentTime(e.currentTime()+t)}function Wv(e,t){t>0&&e.muted()&&e.muted(!1),e.volume(e.volume()+t)}function Gv(e){let t=e.target;return t.tagName.toLowerCase()===`video`||!![`video-js`,`vjs-tech`].find(e=>t.classList.contains(e))}var Kv={f:zv,m:Vv,k:Hv,space:Hv,t:Bv,left:e=>Uv(e,-5),right:e=>Uv(e,5),j:e=>Uv(e,-10),l:e=>Uv(e,10),up:e=>Wv(e,.05),down:e=>Wv(e,-.05)};function qv(e,t,n){if(e.ctrlKey||e.metaKey||e.altKey)return;let r=(0,J.default)(e),i=[`up`,`down`].includes(r);if(i&&!e.shiftKey||!i&&e.shiftKey||r===`t`&&!n.allowTheatreMode||r===`f`&&!n.allowFullscreen||!Kv[r])return;Kv[r](t,e);let a=Gv(e),o=[`space`].includes(r);(a||o)&&(e.preventDefault(),e.stopPropagation())}var Jv=function(e){return e.PhysicallyChapteredVideo=`physically-chaptered-video`,e}({}),Yv={name:`@clickview/player`,version:`1.48.0`,description:`ClickView Player`,main:`dist/player-app.js`,type:`module`,scripts:{"type-check":`tsc --noEmit`,"build-app":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.app.ts`,"build-styles":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.styles.ts`,build:`npm run type-check && npm run build-player && npm run build-interactive-player`,"build-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.player.config.ts`,"build-interactive-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.interactive-player.config.ts`,"build-font":`cross-env NODE_ENV=development npm run start`,storybook:`start-storybook -s ./.storybook/stories/assets -p 6006`,"build-storybook":`build-storybook`,test:`jest`,"test-watch":`jest --watch`,"test-harness":`npm run build && node ../../../node_modules/vite/bin/vite.js --config vite.test-harness.config.ts`,"webpack-dev-server":`cross-env NODE_ENV=development webpack-dev-server --config ./tooling/webpack.config.js`},repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},author:`Matt Trengrove, Cameron Hill, Shale Kuzmanovski`,license:`ISC`,devDependencies:{"@clickview/player-font":`0.0.17`,"@storybook/builder-webpack5":`7.4.0`,"@storybook/manager-webpack5":`6.5.16`,"@storybook/react":`7.4.0`,"@types/chromecast-caf-sender":`1.0.3`,"@types/cropperjs":`1.3.0`,"@types/draft-js":`0.10.44`,"@types/node-polyglot":`0.4.34`,"@types/react-draft-wysiwyg":`1.13.1`,"@types/signalr-no-jquery":`0.1.3`,"@types/simplebar":`5.1.1`,"@types/video.js":`7.3.58`,jest:`29.6.4`,"ts-jest":`29.1.1`,"webpack-dev-server":`4.8.1`},dependencies:{"@microsoft/signalr":`5.0.2`,"@types/react-canvas-draw":`1.2.1`,cropperjs:`1.5.6`,"draft-convert":`2.1.10`,"draft-js":`0.11.7`,keycode:`2.2.0`,"node-polyglot":`2.3.0`,"react-canvas-draw":`1.2.1`,"react-draft-wysiwyg":`1.14.5`,"react-textarea-autosize":`8.3.2`,"signalr-no-jquery":`0.2.0`,simplebar:`5.3.0`,"simplebar-react":`2.3.0`,"video.js":`8.20.0`,"videojs-contrib-quality-levels":`2.0.9`}},Xv=i(((e,t)=>{t.exports=n;function n(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}})),Zv=i(((e,t)=>{var n=or(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),Qv=t(i(((e,t)=>{var n=or(),r=dt(),i=lr();l.httpHandler=Zv();var a=function(e){var t={};return e&&e.trim().split(`
232
+ `,Ev=class extends Cv{constructor(e,t){super(e,t)}createEl(){let e=wv.prototype.createEl.call(this,`button`,{className:this.buildCSSClass()},{type:`button`,title:this.controlText_});return e.innerHTML=Tv,this.createControlTextEl(e),e}handleClick(e){e.stopPropagation(),e.preventDefault(),this.options_?.onClick&&this.options_.onClick()}buildCSSClass(){return`cv-remove-video-button`}};q.registerComponent(`removeVideoButton`,Ev),Ev.prototype.controlText_=`Remove from watch history`;var Dv=`cvplayer-playback-quality:v2`,Ov=`cvplayer-localcache-playback-quality:v2`,kv=class{static isQualityUserPreference(){let e=localStorage.getItem(Dv),t=localStorage.getItem(Ov);return!!(e||t)}static getPlayerMode(e){let t=e.isFullscreen?.()??!1,n=e.usingPlugin?.(`playerModePlugin`)?e.playerModePlugin()?.isHovering?.()??!1:!1,r=e.usingPlugin?.(`theatreModePlugin`)?e.theatreModePlugin()?.getTheatreMode?.()??!1:!1;return t?`fullscreen`:n?`hover`:r?`theatre`:`default`}static findQualityLevel(e,t){for(let n=0;n<e.length;n++)if(e[n].quality<=t)return e[n];let n=e[e.length-1];if(!n)throw Error(`No quality levels available`);return n}static enableQualityLevel(e,t){for(let n=0;n<e.length;n++){let r=e[n];r.enabled=r.id===t}}},Av=function(e){return e.Default=`play`,e.Hover=`hover`,e}({}),jv=q.getPlugin(`plugin`),Mv=`cv-preview-mode`,Nv=`cv-force-16-9`,Pv=class extends jv{constructor(e,t){super(e),this.hasSeeked=!1,this.buttonAdded=!1,this.mode=null,this.defaultDisplayMode=`normal`,this.onQualityReady=null,t?.defaultDisplayMode&&(this.defaultDisplayMode=t.defaultDisplayMode),t?.startTime&&(this.startTime=t.startTime),this.onSeek=this.onSeek.bind(this),this.player.one(`seeking`,this.onSeek)}onSeek(){this.hasSeeked=!0}dispose(){this.cleanupQualityListener(),this.player.off(`seeking`,this.onSeek),super.dispose()}getMode(){return this.mode}isHovering(){return this.mode===Av.Hover}setPlayerMode(e,t,n){this.player.trigger(`flushprogress`);let r=this.mode;if(this.mode=e,e===Av.Hover){this.buttonAdded||this.addButtons(t,n),this.player.addClass(Mv),this.applyAspectRatioFix(),this.enableSubtitles(),this.mute(),this.setLowQuality(),this.removeActivityTimeout(),this.player.trigger(`resize`);return}r===Av.Hover&&(this.applyDefaultModeLayout(),this.player.removeClass(Mv),this.player.removeClass(Nv),this.disableSubtitles(),this.unmute(),this.cleanupQualityListener(),this.restorePreviousQuality(),this.restoreActivityTimeout(),this.player.trigger(`resize`),this.hasSeeked||=(this.player.currentTime(this.startTime??0),!1))}applyDefaultModeLayout(){let e=this.player.usingPlugin?.(`theatreModePlugin`);this.defaultDisplayMode===`theatre`?(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!0),this.player.fill(!0)):(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!1),this.player.fluid(!0))}applyAspectRatioFix(){let e=()=>{let e=this.player.videoWidth(),t=this.player.videoHeight();if(e>0&&t>0){let n=e/t;Math.abs(n-16/9)<.01||this.player.addClass(Nv)}};this.player.readyState()>=1?e():this.player.one(`loadedmetadata`,e)}addButtons(e,t){let n=new bv(this.player),r=new Sv(this.player,{onClickHandler:e}),i=new Ev(this.player,{onClick:t});t&&f.isFunction(t)&&this.player.addChild(i),this.player.addChild(n),this.player.addChild(r),this.buttonAdded=!0}enableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}setLowQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().disable();let e=this.player.qualityLevels();if(e.length>0){this.switchToLowestQuality(e);return}this.cleanupQualityListener(),this.onQualityReady=()=>{this.onQualityReady=null,this.switchToLowestQuality(e)},e.one(`change`,this.onQualityReady)})}cleanupQualityListener(){this.onQualityReady&&=(this.player.qualityLevels().off(`change`,this.onQualityReady),null)}switchToLowestQuality(e){let t=e[e.length-1];t&&kv.enableQualityLevel(e,t.id)}restorePreviousQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().applyUserPreferences(),this.player.persistQualitySettingsPlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}};q.registerPlugin(`playerModePlugin`,Pv);var Fv=1e3*60*60*8,Iv=class{constructor(e){this.options=e,this.initialize()}logStream(){let e=`v:${this.options.videoId}`,t=this.getPlayerMetrics();he.cacheExists(e)||(this.collectionApiClient.log({type:h.WebPlayerStream,actionContext:this.getActionContext(),data:{...this.getAnalyticsData(),player:t},eventVersion:S.V3}),he&&he.cacheSet(e,null,300))}logVideoProgress(e,t,n){let r=this.getAnalyticsData(),i=this.getPlayerMetrics(),a=n?h.PreviewStreamProgress:h.StreamProgress,o=e.map(e=>({type:a,actionContext:this.getActionContext(),data:{...r,player:i,progress:e},eventVersion:S.V2}));for(let e of t)o.push({type:h.StreamBuffering,actionContext:this.getActionContext(),data:{...r,player:i,buffering:e},eventVersion:S.V2});this.collectionApiClient.log(o)}logUserAction(e,t){let n={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:n,actionContext:r,eventVersion:t.eventVersion||S.V2})}getAnalyticsData(){let e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache,isQualityUserPreference:kv.isQualityUserPreference()},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);let t=this.getEntityType();return t===D.Interactive?e.interactive={id:+this.options.mediaId}:t===D.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),at.lockWindowSession(this.options.userId,Fv),this.options.player.one(`dispose`,()=>at.unlockWindowSession(this.options.userId))}setupCollectionApiClient(){this.collectionApiClient=new He({productName:`player.web`,productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:rt.shouldLog,formatData:rt.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?y.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case`MasterVideo`:return D.Video;case`MasterInteractive`:return D.Interactive;case`MasterClip`:return D.Clip}}getLocationContext(){switch(this.options.playerType){case`player`:return ee.Player;case`interactive-player`:return ee.InteractivePlayer;case`create-clip-player`:return ee.CreateClipPlayer}}getPlayerMetrics(){let e=this.options.player,t=e.qualityLevels?.();return{mode:kv.getPlayerMode(e),width:e.currentWidth(),height:e.currentHeight(),quality:t?.[t?.selectedIndex]?.id}}},Lv=class extends Error{constructor(e,t){super(t?.title||`Ajax error`),this.url=e,this.response=t}},Rv=new class{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:`GET`,mode:`cors`,headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:`DELETE`,headers:this.getHeaders(t)})}async post(e,t,n,r=!0){let i=await fetch(e,{method:`POST`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}async put(e,t,n,r=!0){let i=await fetch(e,{method:`PUT`,headers:this.getHeaders(n),body:t,mode:`cors`});if(r)return await this.parseResponse(i)}setToken(e,t){this.tokens[e]=t}hasToken(e){return!!this.tokens[e]}getHeaders(e={}){let t={"Content-Type":`application/json`};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let t;try{t=await e.json()}catch{throw new Lv(e.url)}finally{throw new Lv(e.url,t)}}return await e.json()}},J=t(i(((e,t)=>{function n(e){if(e&&typeof e==`object`){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if(typeof e==`number`)return o[e];var n=String(e),a=r[n.toLowerCase()];if(a)return a;var a=i[n.toLowerCase()];if(a)return a;if(n.length===1)return n.charCodeAt(0)}n.isEventKey=function(e,t){if(e&&typeof e==`object`){var n=e.which||e.keyCode||e.charCode;if(n==null)return!1;if(typeof t==`string`){var a=r[t.toLowerCase()];if(a)return a===n;var a=i[t.toLowerCase()];if(a)return a===n}else if(typeof t==`number`)return t===n;return!1}},e=t.exports=n;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r[`f`+a]=a+111;for(a=0;a<10;a++)r[`numpad `+a]=a+96;var o=e.names=e.title={};for(a in r)o[r[a]]=a;for(var s in i)r[s]=i[s]}))());function zv(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())}function Bv(e){let t=e.theatreModePlugin().getTheatreMode();e.theatreModePlugin().toggleTheatreMode(!t,{shouldLog:!0})}function Vv(e){let t=e.volume(),n=e.lastVolume_();if(t===0){let t=n<.1?.1:n;e.volume(t),e.muted(!1)}else e.muted(!e.muted())}function Hv(e){e.paused()?e.play():e.pause()}function Uv(e,t){e.currentTime(e.currentTime()+t)}function Wv(e,t){t>0&&e.muted()&&e.muted(!1),e.volume(e.volume()+t)}function Gv(e){let t=e.target;return t.tagName.toLowerCase()===`video`||!![`video-js`,`vjs-tech`].find(e=>t.classList.contains(e))}var Kv={f:zv,m:Vv,k:Hv,space:Hv,t:Bv,left:e=>Uv(e,-5),right:e=>Uv(e,5),j:e=>Uv(e,-10),l:e=>Uv(e,10),up:e=>Wv(e,.05),down:e=>Wv(e,-.05)};function qv(e,t,n){if(e.ctrlKey||e.metaKey||e.altKey)return;let r=(0,J.default)(e),i=[`up`,`down`].includes(r);if(i&&!e.shiftKey||!i&&e.shiftKey||r===`t`&&!n.allowTheatreMode||r===`f`&&!n.allowFullscreen||!Kv[r])return;Kv[r](t,e);let a=Gv(e),o=[`space`].includes(r);(a||o)&&(e.preventDefault(),e.stopPropagation())}var Jv=function(e){return e.PhysicallyChapteredVideo=`physically-chaptered-video`,e}({}),Yv={name:`@clickview/player`,version:`1.49.0-rc.1`,description:`ClickView Player`,main:`dist/player-app.js`,type:`module`,scripts:{"type-check":`tsc --noEmit`,"build-app":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.app.ts`,"build-styles":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.styles.ts`,build:`npm run type-check && npm run build-player && npm run build-interactive-player`,"build-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.player.config.ts`,"build-interactive-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.interactive-player.config.ts`,"build-font":`cross-env NODE_ENV=development npm run start`,storybook:`start-storybook -s ./.storybook/stories/assets -p 6006`,"build-storybook":`build-storybook`,test:`jest`,"test-watch":`jest --watch`,"test-harness":`npm run build && node ../../../node_modules/vite/bin/vite.js --config vite.test-harness.config.ts`,"webpack-dev-server":`cross-env NODE_ENV=development webpack-dev-server --config ./tooling/webpack.config.js`},repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},author:`Matt Trengrove, Cameron Hill, Shale Kuzmanovski`,license:`ISC`,devDependencies:{"@clickview/player-font":`0.0.17`,"@storybook/builder-webpack5":`7.4.0`,"@storybook/manager-webpack5":`6.5.16`,"@storybook/react":`7.4.0`,"@types/chromecast-caf-sender":`1.0.3`,"@types/cropperjs":`1.3.0`,"@types/draft-js":`0.10.44`,"@types/node-polyglot":`0.4.34`,"@types/react-draft-wysiwyg":`1.13.1`,"@types/signalr-no-jquery":`0.1.3`,"@types/simplebar":`5.1.1`,"@types/video.js":`7.3.58`,jest:`29.6.4`,"ts-jest":`29.1.1`,"webpack-dev-server":`4.8.1`},dependencies:{"@microsoft/signalr":`5.0.2`,"@types/react-canvas-draw":`1.2.1`,cropperjs:`1.5.6`,"draft-convert":`2.1.10`,"draft-js":`0.11.7`,keycode:`2.2.0`,"node-polyglot":`2.3.0`,"react-canvas-draw":`1.2.1`,"react-draft-wysiwyg":`1.14.5`,"react-textarea-autosize":`8.3.2`,"signalr-no-jquery":`0.2.0`,simplebar:`5.3.0`,"simplebar-react":`2.3.0`,"video.js":`8.20.0`,"videojs-contrib-quality-levels":`2.0.9`}},Xv=i(((e,t)=>{t.exports=n;function n(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}})),Zv=i(((e,t)=>{var n=or(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),Qv=t(i(((e,t)=>{var n=or(),r=dt(),i=lr();l.httpHandler=Zv();var a=function(e){var t={};return e&&e.trim().split(`
233
233
  `).forEach(function(e){var n=e.indexOf(`:`),r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}),t};t.exports=l,t.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||f,l.XDomainRequest=`withCredentials`in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,o([`get`,`put`,`post`,`patch`,`head`,`delete`],function(e){l[e===`delete`?`del`:e]=function(t,n,r){return n=c(t,n,r),n.method=e.toUpperCase(),u(n)}});function o(e,t){for(var n=0;n<e.length;n++)t(e[n])}function s(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function c(e,t,n){var a=e;return i(t)?(n=t,typeof e==`string`&&(a={uri:e})):a=r({},t,{uri:e}),a.callback=n,a}function l(e,t,n){return t=c(e,t,n),u(t)}function u(e){if(e.callback===void 0)throw Error(`callback argument missing`);var t=!1,n=function(n,r,i){t||(t=!0,e.callback(n,r,i))};function r(){u.readyState===4&&setTimeout(c,0)}function i(){var e=void 0;if(e=u.response?u.response:u.responseText||d(u),y)try{e=JSON.parse(e)}catch{}return e}function o(e){return clearTimeout(b),e instanceof Error||(e=Error(``+(e||`Unknown XMLHttpRequest Error`))),e.statusCode=0,n(e,x)}function c(){if(!p){var t;clearTimeout(b),t=e.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var r=x,o=null;return t===0?o=Error(`Internal XMLHttpRequest Error`):(r={body:i(),statusCode:t,method:h,headers:{},url:m,rawRequest:u},u.getAllResponseHeaders&&(r.headers=a(u.getAllResponseHeaders()))),n(o,r,r.body)}}var u=e.xhr||null;u||=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest;var f,p,m=u.url=e.uri||e.url,h=u.method=e.method||`GET`,g=e.body||e.data,_=u.headers=e.headers||{},v=!!e.sync,y=!1,b,x={body:void 0,headers:{},statusCode:0,method:h,url:m,rawRequest:u};if(`json`in e&&e.json!==!1&&(y=!0,_.accept||_.Accept||(_.Accept=`application/json`),h!==`GET`&&h!==`HEAD`&&(_[`content-type`]||_[`Content-Type`]||(_[`Content-Type`]=`application/json`),g=JSON.stringify(e.json===!0?g:e.json))),u.onreadystatechange=r,u.onload=c,u.onerror=o,u.onprogress=function(){},u.onabort=function(){p=!0},u.ontimeout=o,u.open(h,m,!v,e.username,e.password),v||(u.withCredentials=!!e.withCredentials),!v&&e.timeout>0&&(b=setTimeout(function(){if(!p){p=!0,u.abort(`timeout`);var e=Error(`XMLHttpRequest timeout`);e.code=`ETIMEDOUT`,o(e)}},e.timeout)),u.setRequestHeader)for(f in _)_.hasOwnProperty(f)&&u.setRequestHeader(f,_[f]);else if(e.headers&&!s(e.headers))throw Error(`Headers cannot be set on an XDomainRequest object`);return`responseType`in e&&(u.responseType=e.responseType),`beforeSend`in e&&typeof e.beforeSend==`function`&&e.beforeSend(u),u.send(g||null),u}function d(e){try{if(e.responseType===`document`)return e.responseXML;var t=e.responseXML&&e.responseXML.documentElement.nodeName===`parsererror`;if(e.responseType===``&&!t)return e.responseXML}catch{}return null}function f(){}}))()),$v=t(Xv());function ey(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ey=function(){return!!e})()}function ty(e,t,n){if(ey())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&M(i,n.prototype),i}function ny(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&M(e,t)}var ry=t(i(((e,t)=>{(function(n){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n||={},e=e.trim(),t=t.trim(),!t){if(!n.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw Error(`Error trying to parse base URL.`);return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw Error(`Error trying to parse relative URL.`);if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw Error(`Error trying to parse base URL.`);if(!o.netLoc&&o.path&&o.path[0]!==`/`){var c=i.exec(o.path);o.netLoc=c[1],o.path=c[2]}o.netLoc&&!o.path&&(o.path=`/`);var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,a.path[0]!==`/`))if(!a.path)l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));else{var u=o.path,d=u.substring(0,u.lastIndexOf(`/`)+1)+a.path;l.path=s.normalizePath(d)}return l.path===null&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||``,netLoc:t[2]||``,path:t[3]||``,params:t[4]||``,query:t[5]||``,fragment:t[6]||``}:null},normalizePath:function(e){for(e=e.split(``).reverse().join(``).replace(a,``);e.length!==(e=e.replace(o,``)).length;);return e.split(``).reverse().join(``)},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};typeof e==`object`&&typeof t==`object`?t.exports=s:typeof define==`function`&&define.amd?define([],function(){return s}):typeof e==`object`?e.URLToolkit=s:n.URLToolkit=s})(e)}))()),iy=`http://example.com`,ay=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=V.default.location&&V.default.location.href||``);var n=typeof V.default.URL==`function`,r=/^\/\//.test(e),i=!V.default.location&&!/\/\//i.test(e);if(n?e=new V.default.URL(e,V.default.location||iy):/\/\//i.test(e)||(e=ry.default.buildAbsoluteURL(V.default.location&&V.default.location.href||``,e)),n){var a=new URL(t,e);return i?a.href.slice(iy.length):r?a.href.slice(a.protocol.length):a.href}return ry.default.buildAbsoluteURL(e,t)},oy=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}(),sy=function(e){return V.default.atob?V.default.atob(e):Buffer.from(e,`base64`).toString(`binary`)};function cy(e){for(var t=sy(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var ly=function(e){j(t,e);function t(){var t=e.call(this)||this;return t.buffer=``,t}var n=t.prototype;return n.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf(`
234
234
  `);t>-1;t=this.buffer.indexOf(`
235
235
  `))this.trigger(`data`,this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(oy),uy=` `,dy=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||``),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},fy=function(){return RegExp(`(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))`)},py=function(e){for(var t=e.split(fy()),n={},r=t.length,i;r--;)t[r]!==``&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^['"](.*)['"]$/g,`$1`),n[i[0]]=i[1]);return n},my=function(e){j(t,e);function t(){var t=e.call(this)||this;return t.customParsers=[],t.tagMappers=[],t}var n=t.prototype;return n.push=function(e){var t=this,n,r;if(e=e.trim(),e.length!==0){if(e[0]!==`#`){this.trigger(`data`,{type:`uri`,uri:e});return}this.tagMappers.reduce(function(t,n){var r=n(e);return r===e?t:t.concat([r])},[e]).forEach(function(e){for(var i=0;i<t.customParsers.length;i++)if(t.customParsers[i].call(t,e))return;if(e.indexOf(`#EXT`)!==0){t.trigger(`data`,{type:`comment`,text:e.slice(1)});return}if(e=e.replace(`\r`,``),n=/^#EXTM3U/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`m3u`});return}if(n=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`inf`},n[1]&&(r.duration=parseFloat(n[1])),n[2]&&(r.title=n[2]),t.trigger(`data`,r);return}if(n=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`targetduration`},n[1]&&(r.duration=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`version`},n[1]&&(r.version=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`media-sequence`},n[1]&&(r.number=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`discontinuity-sequence`},n[1]&&(r.number=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`playlist-type`},n[1]&&(r.playlistType=n[1]),t.trigger(`data`,r);return}if(n=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e),n){r=m(dy(n[1]),{type:`tag`,tagType:`byterange`}),t.trigger(`data`,r);return}if(n=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e),n){r={type:`tag`,tagType:`allow-cache`},n[1]&&(r.allowed=!/NO/.test(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-MAP:?(.*)$/.exec(e),n){if(r={type:`tag`,tagType:`map`},n[1]){var a=py(n[1]);a.URI&&(r.uri=a.URI),a.BYTERANGE&&(r.byterange=dy(a.BYTERANGE))}t.trigger(`data`,r);return}if(n=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e),n){if(r={type:`tag`,tagType:`stream-inf`},n[1]){if(r.attributes=py(n[1]),r.attributes.RESOLUTION){var o=r.attributes.RESOLUTION.split(`x`),s={};o[0]&&(s.width=parseInt(o[0],10)),o[1]&&(s.height=parseInt(o[1],10)),r.attributes.RESOLUTION=s}r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes[`FRAME-RATE`]&&(r.attributes[`FRAME-RATE`]=parseFloat(r.attributes[`FRAME-RATE`])),r.attributes[`PROGRAM-ID`]&&(r.attributes[`PROGRAM-ID`]=parseInt(r.attributes[`PROGRAM-ID`],10))}t.trigger(`data`,r);return}if(n=/^#EXT-X-MEDIA:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`media`},n[1]&&(r.attributes=py(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-ENDLIST/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`endlist`});return}if(n=/^#EXT-X-DISCONTINUITY/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`discontinuity`});return}if(n=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`program-date-time`},n[1]&&(r.dateTimeString=n[1],r.dateTimeObject=new Date(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-KEY:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`key`},n[1]&&(r.attributes=py(n[1]),r.attributes.IV&&(r.attributes.IV.substring(0,2).toLowerCase()===`0x`&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),t.trigger(`data`,r);return}if(n=/^#EXT-X-START:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`start`},n[1]&&(r.attributes=py(n[1]),r.attributes[`TIME-OFFSET`]=parseFloat(r.attributes[`TIME-OFFSET`]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-out-cont`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-out`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-in`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-SKIP:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`skip`},r.attributes=py(n[1]),r.attributes.hasOwnProperty(`SKIPPED-SEGMENTS`)&&(r.attributes[`SKIPPED-SEGMENTS`]=parseInt(r.attributes[`SKIPPED-SEGMENTS`],10)),r.attributes.hasOwnProperty(`RECENTLY-REMOVED-DATERANGES`)&&(r.attributes[`RECENTLY-REMOVED-DATERANGES`]=r.attributes[`RECENTLY-REMOVED-DATERANGES`].split(uy)),t.trigger(`data`,r);return}if(n=/^#EXT-X-PART:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`part`},r.attributes=py(n[1]),[`DURATION`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),[`INDEPENDENT`,`GAP`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))}),r.attributes.hasOwnProperty(`BYTERANGE`)&&(r.attributes.byterange=dy(r.attributes.BYTERANGE)),t.trigger(`data`,r);return}if(n=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`server-control`},r.attributes=py(n[1]),[`CAN-SKIP-UNTIL`,`PART-HOLD-BACK`,`HOLD-BACK`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),[`CAN-SKIP-DATERANGES`,`CAN-BLOCK-RELOAD`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))}),t.trigger(`data`,r);return}if(n=/^#EXT-X-PART-INF:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`part-inf`},r.attributes=py(n[1]),[`PART-TARGET`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),t.trigger(`data`,r);return}if(n=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`preload-hint`},r.attributes=py(n[1]),[`BYTERANGE-START`,`BYTERANGE-LENGTH`].forEach(function(e){if(r.attributes.hasOwnProperty(e)){r.attributes[e]=parseInt(r.attributes[e],10);var t=e===`BYTERANGE-LENGTH`?`length`:`offset`;r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[t]=r.attributes[e],delete r.attributes[e]}}),t.trigger(`data`,r);return}if(n=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`rendition-report`},r.attributes=py(n[1]),[`LAST-MSN`,`LAST-PART`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseInt(r.attributes[e],10))}),t.trigger(`data`,r);return}t.trigger(`data`,{type:`tag`,data:e.slice(4)})})}},n.addParser=function(e){var t=this,n=e.expression,r=e.customType,i=e.dataParser,a=e.segment;typeof i!=`function`&&(i=function(e){return e}),this.customParsers.push(function(e){if(n.exec(e))return t.trigger(`data`,{type:`custom`,data:i(e),customType:r,segment:a}),!0})},n.addTagMapper=function(e){var t=e.expression,n=e.map;this.tagMappers.push(function(e){return t.test(e)?n(e):e})},t}(oy),hy=function(e){return e.toLowerCase().replace(/-(\w)/g,function(e){return e[1].toUpperCase()})},gy=function(e){var t={};return Object.keys(e).forEach(function(n){t[hy(n)]=e[n]}),t},_y=function(e){var t=e.serverControl,n=e.targetDuration,r=e.partTargetDuration;if(t){var i=`#EXT-X-SERVER-CONTROL`,a=`holdBack`,o=`partHoldBack`,s=n&&n*3,c=r&&r*2;n&&!t.hasOwnProperty(a)&&(t[a]=s,this.trigger(`info`,{message:i+` defaulting HOLD-BACK to targetDuration * 3 (`+s+`).`})),s&&t[a]<s&&(this.trigger(`warn`,{message:i+` clamping HOLD-BACK (`+t[a]+`) to targetDuration * 3 (`+s+`)`}),t[a]=s),r&&!t.hasOwnProperty(o)&&(t[o]=r*3,this.trigger(`info`,{message:i+` defaulting PART-HOLD-BACK to partTargetDuration * 3 (`+t[o]+`).`})),r&&t[o]<c&&(this.trigger(`warn`,{message:i+` clamping PART-HOLD-BACK (`+t[o]+`) to partTargetDuration * 2 (`+c+`).`}),t[o]=c)}},vy=function(e){j(t,e);function t(){var t=e.call(this)||this;t.lineStream=new ly,t.parseStream=new my,t.lineStream.pipe(t.parseStream);var n=I(t),r=[],i={},a,o,s=!1,c=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},u=`urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`,d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var f=0,p=0;return t.on(`end`,function(){i.uri||!i.parts&&!i.preloadHints||(!i.map&&a&&(i.map=a),!i.key&&o&&(i.key=o),!i.timeline&&typeof d==`number`&&(i.timeline=d),t.manifest.preloadSegment=i)}),t.parseStream.on(`data`,function(e){var t,h;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,`allowed`in e||(this.trigger(`info`,{message:`defaulting allowCache to YES`}),this.manifest.allowCache=!0)},byterange:function(){var t={};`length`in e&&(i.byterange=t,t.length=e.length,`offset`in e||(e.offset=f)),`offset`in e&&(i.byterange=t,t.offset=e.offset),f=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){`mediaSequence`in this.manifest||(this.manifest.mediaSequence=0,this.trigger(`info`,{message:`defaulting media sequence to zero`})),`discontinuitySequence`in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger(`info`,{message:`defaulting discontinuity sequence to zero`})),e.duration>0&&(i.duration=e.duration),e.duration===0&&(i.duration=.01,this.trigger(`info`,{message:`updating zero segment duration to a small value`})),this.manifest.segments=r},key:function(){if(!e.attributes){this.trigger(`warn`,{message:`ignoring key declaration without attribute list`});return}if(e.attributes.METHOD===`NONE`){o=null;return}if(!e.attributes.URI){this.trigger(`warn`,{message:`ignoring key declaration without URI`});return}if(e.attributes.KEYFORMAT===`com.apple.streamingkeydelivery`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.apple.fps.1_0`]={attributes:e.attributes};return}if(e.attributes.KEYFORMAT===`com.microsoft.playready`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.microsoft.playready`]={uri:e.attributes.URI};return}if(e.attributes.KEYFORMAT===u){if([`SAMPLE-AES`,`SAMPLE-AES-CTR`,`SAMPLE-AES-CENC`].indexOf(e.attributes.METHOD)===-1){this.trigger(`warn`,{message:`invalid key method provided for Widevine`});return}if(e.attributes.METHOD===`SAMPLE-AES-CENC`&&this.trigger(`warn`,{message:`SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead`}),e.attributes.URI.substring(0,23)!==`data:text/plain;base64,`){this.trigger(`warn`,{message:`invalid key URI provided for Widevine`});return}if(!(e.attributes.KEYID&&e.attributes.KEYID.substring(0,2)===`0x`)){this.trigger(`warn`,{message:`invalid key ID provided for Widevine`});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.widevine.alpha`]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:cy(e.attributes.URI.split(`,`)[1])};return}e.attributes.METHOD||this.trigger(`warn`,{message:`defaulting key method to AES-128`}),o={method:e.attributes.METHOD||`AES-128`,uri:e.attributes.URI},e.attributes.IV!==void 0&&(o.iv=e.attributes.IV)},"media-sequence":function(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid media sequence: `+e.number});return}this.manifest.mediaSequence=e.number},"discontinuity-sequence":function(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid discontinuity sequence: `+e.number});return}this.manifest.discontinuitySequence=e.number,d=e.number},"playlist-type":function(){if(!/VOD|EVENT/.test(e.playlistType)){this.trigger(`warn`,{message:`ignoring unknown playlist type: `+e.playlist});return}this.manifest.playlistType=e.playlistType},map:function(){a={},e.uri&&(a.uri=e.uri),e.byterange&&(a.byterange=e.byterange),o&&(a.key=o)},"stream-inf":function(){if(this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!e.attributes){this.trigger(`warn`,{message:`ignoring empty stream-inf attributes`});return}i.attributes||={},m(i.attributes,e.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes[`GROUP-ID`]&&e.attributes.NAME)){this.trigger(`warn`,{message:`ignoring incomplete or missing media group`});return}var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes[`GROUP-ID`]]=n[e.attributes[`GROUP-ID`]]||{},t=n[e.attributes[`GROUP-ID`]],h={default:/yes/i.test(e.attributes.DEFAULT)},h.default?h.autoselect=!0:h.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(h.language=e.attributes.LANGUAGE),e.attributes.URI&&(h.uri=e.attributes.URI),e.attributes[`INSTREAM-ID`]&&(h.instreamId=e.attributes[`INSTREAM-ID`]),e.attributes.CHARACTERISTICS&&(h.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(h.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=h},discontinuity:function(){d+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),i.dateTimeString=e.dateTimeString,i.dateTimeObject=e.dateTimeObject},targetduration:function(){if(!isFinite(e.duration)||e.duration<0){this.trigger(`warn`,{message:`ignoring invalid target duration: `+e.duration});return}this.manifest.targetDuration=e.duration,_y.call(this,this.manifest)},start:function(){if(!e.attributes||isNaN(e.attributes[`TIME-OFFSET`])){this.trigger(`warn`,{message:`ignoring start declaration without appropriate attribute list`});return}this.manifest.start={timeOffset:e.attributes[`TIME-OFFSET`],precise:e.attributes.PRECISE}},"cue-out":function(){i.cueOut=e.data},"cue-out-cont":function(){i.cueOutCont=e.data},"cue-in":function(){i.cueIn=e.data},skip:function(){this.manifest.skip=gy(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-SKIP`,e.attributes,[`SKIPPED-SEGMENTS`])},part:function(){var t=this;s=!0;var n=this.manifest.segments.length,r=gy(e.attributes);i.parts=i.parts||[],i.parts.push(r),r.byterange&&(r.byterange.hasOwnProperty(`offset`)||(r.byterange.offset=p),p=r.byterange.offset+r.byterange.length);var a=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #`+a+` for segment #`+n,e.attributes,[`URI`,`DURATION`]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(e,n){e.hasOwnProperty(`lastPart`)||t.trigger(`warn`,{message:`#EXT-X-RENDITION-REPORT #`+n+` lacks required attribute(s): LAST-PART`})})},"server-control":function(){var t=this.manifest.serverControl=gy(e.attributes);t.hasOwnProperty(`canBlockReload`)||(t.canBlockReload=!1,this.trigger(`info`,{message:`#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false`})),_y.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty(`canSkipUntil`)&&this.trigger(`warn`,{message:`#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set`})},"preload-hint":function(){var t=this.manifest.segments.length,n=gy(e.attributes),r=n.type&&n.type===`PART`;i.preloadHints=i.preloadHints||[],i.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty(`offset`)||(n.byterange.offset=r?p:0,r&&(p=n.byterange.offset+n.byterange.length)));var a=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #`+a+` for segment #`+t,e.attributes,[`TYPE`,`URI`]),n.type)for(var o=0;o<i.preloadHints.length-1;o++){var s=i.preloadHints[o];s.type&&s.type===n.type&&this.trigger(`warn`,{message:`#EXT-X-PRELOAD-HINT #`+a+` for segment #`+t+` has the same TYPE `+n.type+` as preload hint #`+o})}},"rendition-report":function(){var t=gy(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,r=[`LAST-MSN`,`URI`];s&&r.push(`LAST-PART`),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #`+n,e.attributes,r)},"part-inf":function(){this.manifest.partInf=gy(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-PART-INF`,e.attributes,[`PART-TARGET`]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),_y.call(this,this.manifest)}}[e.tagType]||c).call(n)},uri:function(){i.uri=e.uri,r.push(i),this.manifest.targetDuration&&!(`duration`in i)&&(this.trigger(`warn`,{message:`defaulting segment duration to the target duration`}),i.duration=this.manifest.targetDuration),o&&(i.key=o),i.timeline=d,a&&(i.map=a),p=0,i={}},comment:function(){},custom:function(){e.segment?(i.custom=i.custom||{},i.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(n)}),t}var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var r=[];n.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger(`warn`,{message:e+` lacks required attribute(s): `+r.join(`, `)})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push(`
@@ -322,4 +322,4 @@ browserWorkerPolyFill(self);
322
322
  `;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(){}},IW=q.getComponent(`Tech`),LW=class extends IW{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=q(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 X_.findTrackByPredicate(this.videojsPlayer.player_,e=>e.mode===`showing`&&!!e.src)}setSelectedTextTrack(e){X_.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 FW({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(e.src,n?.src)}addRemoteTextTrack(e){return super.addRemoteTextTrack(e,!0)}getCastSession(){return xW.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 q.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!!xW.getOrCreateInstance(t?.instanceId??``).getCastSession()}static isSupported(){return xW.isActive()}};q.registerTech(`devices`,LW);var RW=q.getPlugin(`plugin`),zW=class extends RW{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:h.Select,workflowPhase:g.Complete,descriptor:T.ChangeDevice,entity:D.Device,eventVersion:S.V3})},i=this.options.ctaOptions,a=this.options.vivi,o=this.options.appleTv,s=[];o.enabled||s.push(VU.AppleTv),(!a.enabled||!a.accountConnected)&&s.push(VU.Vivi);let c={onClick:n,onDeviceMenuItemClick:r,ctaOptions:{...i,inactiveIntegrations:s}};this.devicesButton=e.addChild(`DevicesButton`,c)}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-${VU.AppleTv}`),this.player.removeClass(`cv-device-${VU.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(bW))return;let t=new bW({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(uW))return;let t=new uW({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 xW.getOrCreateInstance(this.instanceId)}dispose(){let e=this.getSessionManager();e&&(e.off(`deviceschange`,this.onDevicesChanged),e.off(`castsessionchange`,this.onCastSessionChanged),e.off(`error`,this.onDevicesError),xW.disposeAndRemoveInstance(e),super.dispose())}};q.registerPlugin(`devicesPlugin`,zW);function BW(e){let[t,n]=R.useState(5);if(R.useEffect(()=>{let e=setInterval(()=>{n(e=>e-1)},1e3);return()=>{clearInterval(e)}},[]),R.useEffect(()=>{t===0&&e.onPlayNext()},[t]),!e.nextVideo||!e.onPlayNext)return(0,z.jsx)(z.Fragment,{});let r=Math.ceil(t),i=r===1?`second`:`seconds`;return(0,z.jsx)(z.Fragment,{children:(0,z.jsxs)(`div`,{className:`cv-up-next-container`,children:[(0,z.jsx)(`div`,{className:`cv-cancel-up-next cursor-pointer`,role:`button`,onClick:e.onCancel,children:`×`}),(0,z.jsxs)(`div`,{className:`cv-up-next-heading`,children:[`Up next in `,r,` `,i,`:`]}),(0,z.jsx)(`div`,{className:`cv-up-next-image cursor-pointer`,onClick:e.onPlayNext,style:{backgroundImage:`url(${e.nextVideo?.thumbnailUrl})`}}),(0,z.jsx)(`div`,{className:`cv-up-next-title`,children:e.nextVideo.name})]})})}q.registerComponent(`UpNext`,BV((e,t)=>(0,z.jsx)(BW,{player:e,...t})));var VW=q.getComponent(`MenuItem`),HW=class extends VW{constructor(e,t){super(e,t),this.bindListeners(),this.player_.nextVideoPlugin().getShouldPlayNext()&&this.toggleOn()}bindListeners(){this.onPlayNextChange=this.onPlayNextChange.bind(this),this.player_.on(`cv:playnext`,this.onPlayNextChange)}handleToggle(){let e=this.player_.nextVideoPlugin().getShouldPlayNext();this.player_.nextVideoPlugin().setShouldPlayNext(!e,!0)}onPlayNextChange(e,t){t?this.toggleOn():this.toggleOff()}toggleOn(){q.dom.addClass(this.toggleEl,`on`)}toggleOff(){q.dom.removeClass(this.toggleEl,`on`)}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=q.dom.createEl(`div`,{className:`custom-toggle custom-toggle-info toggle-option float-end`,innerHTML:`<span class="handle"></span></div>`}),this.toggleEl.addEventListener(`click`,this.handleToggle);let r=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item cv-play-next-toggle`,innerHTML:`
323
323
  <span class="vjs-menu-item-text">Play next video</span>
324
324
  <span class="cv-toggle-container"></span>`},n);return r.children[1].appendChild(this.toggleEl),r}dispose(){this.player_.off(`cv:playnext`,this.onPlayNextChange),super.dispose()}};q.registerComponent(`NextVideoMenuItem`,HW);var UW=`cv-persisttest`,WW=`cv-play-next-video`,GW=q.getPlugin(`plugin`),KW=q.getComponent(`NextVideoMenuItem`),qW=class extends GW{constructor(e){super(e),this.setShouldPlayNext=this.setShouldPlayNext.bind(this),this.getShouldPlayNext=this.getShouldPlayNext.bind(this),this.getChapterTrack=this.getChapterTrack.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.hasLocalStorage=this.testHasLocalStorage(),this.shouldPlayNextVideo=!1,this.hasLocalStorage&&(this.shouldPlayNextVideo=window.localStorage.getItem(WW)===`true`),e.ready(()=>{this.initialize()})}initialize(){this.player.isDisposed()||this.bindListeners()}getChapterTrack(){return X_.getTrack(this.player,`chapters`,null)}setNextVideo(e,t,n){this.nextVideo=e,this.callback=n,t&&this.setShouldPlayNext(!0),(this.player.getChild(`collapserator`)?.getChild(`cogButton`)).addItem({ctor:KW,name:`NextVideoMenuItem`})}getShouldPlayNext(){return this.shouldPlayNextVideo}setShouldPlayNext(e,t){this.shouldPlayNextVideo=e,this.player.trigger(`cv:playnext`,e),this.hasLocalStorage&&t&&window.localStorage.setItem(WW,e.toString()),e&&this.player.loopVideoPlugin().loop(!1)}bindListeners(){this.player.on(`timeupdate`,this.onTimeUpdate)}dispose(){this.player.off(`timeupdate`,this.onTimeUpdate),this.hideUpNext(),super.dispose()}onTimeUpdate(){if(!(this.player.pictureInPicture&&this.player.isInPictureInPicture())){if(!this.getShouldPlayNext()){this.hideUpNext();return}if(this.upNextRendered&&this.player.currentTime()<this.player.duration()){this.hideUpNext();return}this.player.ended()&&this.showUpNext()}}showUpNext(){this.upNextRendered||(this.upNextRendered=!0,this.player.addChild(`UpNext`,{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:()=>{this.hideUpNext(),this.setShouldPlayNext(!1)}}))}hideUpNext(){if(!this.upNextRendered)return;this.upNextRendered=!1;let e=this.player.getChild(`UpNext`);e&&(this.player.removeChild(e),e.dispose())}testHasLocalStorage(){try{return window.localStorage.setItem(UW,`persistPlayNext`),window.localStorage.removeItem(UW),!0}catch{return!1}}};q.registerPlugin(`nextVideoPlugin`,qW);function JW(e){return(0,z.jsx)(`div`,{className:`cv-resource-item`,children:(0,z.jsx)(je,{data:e.resource,imageCdnUrl:e.imageCdnUrl,titlePosition:`above`,hideTypeBadge:!0})})}var YW=BV((e,t)=>(0,z.jsx)(JW,{...t})),XW=q.getComponent(`MenuItem`),ZW=class extends XW{constructor(e,t){super(e,t);let n=new YW(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)}},QW=q.getComponent(`MenuButton`),$W=class extends QW{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 z_(this.player_,{label:`Resources`})),this.options_.resources.forEach(t=>{let n=new ZW(this.player(),{resource:t,imageCdnUrl:this.options_.imageCdnUrl,downloadResource:e=>this.downloadResource(e),label:t.name});e.push(n)}),e}downloadResource(t){if(t.type===`link`){e.PageLoad(t.url,!0);return}this.getDownloadIframe().src=t.url}getDownloadIframe(){return this.downloadIframe?this.downloadIframe:(this.downloadIframe=q.dom.createEl(`iframe`),this.downloadIframe.style.display=`none`,q.dom.appendContent(q.dom.$(`body`),this.downloadIframe),this.downloadIframe)}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return``}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}};$W.prototype.controlText_=`Resources`,q.registerComponent(`ResourcesButton`,$W);var eG=q.getPlugin(`plugin`),tG=class extends eG{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})}};q.registerPlugin(`resourcesPlugin`,tG);var nG=q.getPlugin(`plugin`),rG=class extends nG{constructor(e){super(e),this.player.dataLoaded(()=>this.initialize())}initialize(){Le.setCanReload(!1)}dispose(){Le.setCanReload(!0),super.dispose()}};q.registerPlugin(`oldVersionRefreshPlugin`,rG);function iG(e){let{className:t=``,playerApi:n,onReady:r,onDispose:i,...a}=e,o=R.useRef(null);return R.useEffect(()=>{if(!o)return;let e=new MU(o.current,{...a,playerApi:n});return r&&e.ready(()=>{r(NU(e))}),i&&e.one(`dispose`,i),()=>{e?.dispose()}},[e.viewKey]),(0,z.jsx)(`div`,{ref:o,className:t})}function aG(e){let t=e.resources?.data??[],n=e.links?.data??[];return[...t,...n]}function oG(e,t){if(Number.isInteger(+e))return+e;let n=L.getVideoProgress(t);return!n||n>=t.duration/1e3-Ie.VIDEO_START_TIME_CUTOFF?0:n}var sG=38,cG=40,lG=()=>{function e(e){if(e.keyCode===sG||e.keyCode===cG)return e.preventDefault(),!1}R.useEffect(()=>(window.addEventListener(`keydown`,e,!1),()=>{window.removeEventListener(`keydown`,e,!1)}),[])},uG={embeddedPlayer:`_embeddedPlayer_q5kte_1`,placeholder:`_placeholder_q5kte_8`};function dG(e){let t=R.useRef(null),n=R.useRef(null);lG();let r=nr();function i(n){t.current=n,r(),e.onReady&&e.onReady(n),a(n)}function a(t){n.current=new ar({player:t,video:e.video,analyticsLocation:e.embed?ee.EmbeddedPlayer:ee.PlayPage})}return(0,z.jsx)(iG,{className:e.embed?uG.embeddedPlayer:``,pointsOfInterest:e.pointsOfInterest,onReady:i,viewKey:e.viewKey.viewKey,playerApi:new URL(e.config.playerApiUrl),imageCdnUrl:e.config.imageCdnUrl,autoplay:e.autoplay,startTime:oG(e.params.t,e.video),hotkeyElQuerySelector:`body`})}var fG={closeButton:`_closeButton_17q31_1`,dropdown:`_dropdown_17q31_6`},pG=`shared.curriculumLinks`;function mG(e){let{preferredCurriculum:t,availableCurriculums:n,curriculumLinks:r,updateCurriculum:i}=e.curriculums;function a(t){i(t,{shouldLog:!0,locationContext:ee.PlayPage,video:e.video})}return!r?.length&&!e.curriculums.mappedCurriculums.length?(0,z.jsx)(z.Fragment,{}):(0,z.jsx)(`div`,{className:`rounded border position-relative`,children:(0,z.jsx)(Pn.Scrollbars,{autoHeight:!0,autoHeightMax:e.height,children:(0,z.jsxs)(`div`,{className:`p-3`,children:[(0,z.jsx)(`h2`,{className:`h6 h-100`,children:(0,z.jsx)(xe,{namespace:pG,phrase:`heading`})}),(0,z.jsx)(Ft,{availableCurriculums:n,onChangeCurriculum:a,selectedCurriculum:t,className:fG.dropdown}),(0,z.jsx)(Ot,{curriculumLinks:e.curriculums.curriculumLinks,onChangeCurriculum:a,hasCompleted:e.curriculums.hasCompleted,mappedCurriculums:e.curriculums.mappedCurriculums,isFetching:e.curriculums.isFetching,locationContext:ee.PlayPage}),!!e.onClickClose&&(0,z.jsx)(`button`,{type:`button`,className:`btn-close ${fG.closeButton}`,"aria-label":`Close`,onClick:e.onClickClose})]})})})}var hG=`shared.playPage`,gG=p.encloseNamespace(hG);function _G(e){let[t,n]=R.useState(),{canConsume:r}=L.getCanBeConsumed(e.video),i=L.isVideoTypeArchived(e.video),a=kn(e.video,e.glanceTheme),o=R.useRef(!1),[s,c]=R.useState({view:`loading`,referrer:null});R.useEffect(()=>{e.glanceLoaded&&c({view:e.glanceTheme?`v@g`:`details`,referrer:null})},[e.glanceLoaded,e.glanceTheme]);function l(){o.current=!t?.isPaused(),t?.pause()}function u(){o.current&&t?.play()}function d(e){n(e)}function f(){return m?()=>({application:se.VIDEOS,action:me.Videos.SIGN_IN_POPUP}):t=>Me.resource(t,e.video?.id)}let p=aG(e.video),m=!e.currentUser.isAuthenticated;return(0,z.jsxs)(Se.Provider,{value:hG,children:[i&&(0,z.jsx)(Zn,{}),(0,z.jsxs)(`section`,{className:`mb-2`,children:[r&&(0,z.jsx)(dG,{video:e.video,config:e.config,pointsOfInterest:e.pointsOfInterest,viewKey:e.viewKey,onReady:d,params:e.params,autoplay:!0}),(0,z.jsx)(`div`,{className:m?``:`d-none`,children:(0,z.jsx)(tr,{video:e.video,appLink:{application:se.VIDEOS,action:me.Videos.SIGN_IN_POPUP}})})]}),(0,z.jsx)($n,{video:e.video,audiences:e.audiences,getSubTextAppLink:e.commonVideoProps.getSubTextAppLink}),(0,z.jsx)(`section`,{className:`${s.view===`v@g`?`d-block`:`d-none`}`,children:(0,z.jsx)(Mn,{theme:e.glanceTheme,video:e.video,pointsOfInterest:e.pointsOfInterest,onClickShowDescription:()=>c({view:`details`,referrer:`v@g`}),onClickShowCurriculumLinks:e.curriculums.mappedCurriculums.length&&(()=>c({view:`curriculumLinks`,referrer:`v@g`})),setStartTime:e=>t.currentTime(e),getTagAppLink:Me.tag,suppressInteractivity:!e.currentUser.isAuthenticated})}),(0,z.jsx)(`section`,{className:`${s.view===`details`?`d-block`:`d-none`}`,children:(0,z.jsx)(Jn,{video:e.video,onLaunchImmersiveReader:l,onExitImmersiveReader:u,onClickClose:a&&(()=>c({view:`v@g`,referrer:`details`})),onClickShowCurriculumLinks:e.curriculums.mappedCurriculums.length&&(()=>c({view:`curriculumLinks`,referrer:`details`})),getTagAppLink:Me.tag,suppressInteractivity:!e.currentUser.isAuthenticated})}),(0,z.jsx)(`section`,{className:`${s.view===`curriculumLinks`?`d-block pb-3`:`d-none`}`,children:(0,z.jsx)(mG,{height:Ie.MINIMUM_GLANCE_HEIGHT,curriculums:e.curriculums,onClickClose:(()=>c({view:s.referrer,referrer:`curriculumLinks`})),video:e.video})}),(0,z.jsx)(`section`,{className:`${s.view===`loading`?`d-block`:`d-none`}`,children:(0,z.jsx)(Yn,{})}),!!p?.length&&(0,z.jsx)(`section`,{className:`pb-3`,children:(0,z.jsx)(Ae,{name:gG(`resources`,{count:p.length}),contents:ke.PlayPageResources,collection:p,prefetched:!0,childComponent:Oe,extraChildComponentProps:{imageCdnUrl:e.config.imageCdnUrl,imageErrorFallbackUrl:ge.Fallbacks.RESOURCE_THUMBNAIL,actionBehaviour:e.currentUser.isAuthenticated?`normal`:`public`,location:`play-page`,titlePosition:`above`,hideTypeBadge:!0},getChildAppLink:f(),analyticsOptions:e.currentUser.isAuthenticated?{}:{workflowPhase:g.Start,descriptor:re.SignUp},analyticsData:{widgetId:`resources`}})})]})}function vG(e,t){let n=e,r=t,i=Mt(e&&(e=>n(e).key));return(0,R.useEffect)(()=>{i&&i.shouldInitialFetch&&t&&r()},[i?.shouldInitialFetch,t]),(0,R.useEffect)(()=>{!i||!i.nextCursor||i.isFetching||!t||r(i.nextCursor)},[i?.nextCursor,i?.isFetching,t]),i}function yG(e){let t=le();function n(t){return ft.pointsOfInterest(e,t)}function r(e){t(n(e))}return vG(!!e&&n,!!e&&r),Mt(!!e&&(e=>n(e).key))}var bG=p.encloseNamespace(`streamableVideos.play`),xG={notFound:Rt,forbidden:{privacy:Ht}};function SG(e){let{commonVideoProps:t}=Dt(),r=ce(ft.video(e.id)),i=ce(pe.currentUser()),o=ce(i.data?.isAuthenticated&&Ut.createViewKey(e.id,It.MasterObject)),s=ce(Be.config()),c=ce(Ve.streamableLearning()),l=ce(nt.streamablePresentation()),u=ce(l.data&&lt.audiencesByPresentationId(l.data.id)),d=!!r.data?.glance?.theme,f=ce(d&&Wt.themeImages(r.data.glance.theme,r.data.glance.type)),p=ce(r.statusCode===n.Forbidden&&ft.video(e.id,ut.StripMetadata)),m=Pt(e.id),h=yG(e.id);P(we.getVideoMetadata({content:r.data,phraseContext:{phraseHandler:bG,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:xt.getCanonicalLink({customAppLink:{application:se.VIDEOS,action:me.Videos.PLAY_VIDEO,args:[r.data?.id,C.slugify(r.data?.name)]}}),allowIndexing:!0,product:Ie.PRODUCT_NAME})),Nt(r,xG,{forbidden:!0}),pn(p);let g=r.data&&(!i.data?.isAuthenticated||o.data)&&i.hasCompleted&&s.hasCompleted&&h.hasCompleted;return R.useEffect(()=>{!r.data||!c.data||r.data.libraries?.data.find(e=>e.id===c.data.objectId)||a.throw(new ae)},[r.hasCompleted,c.hasCompleted]),g?(0,z.jsx)(`div`,{className:`px-4`,children:(0,z.jsx)(_G,{video:r.data,viewKey:o.data,config:s.data,glanceTheme:f.data,glanceLoaded:!d||f.hasCompleted,curriculums:m,currentUser:i.data,pointsOfInterest:h.items,audiences:u.data,params:e.params,commonVideoProps:t})}):(0,z.jsx)(z.Fragment,{})}export{SG as PlayView};
325
- //# sourceMappingURL=DrDQfaFN2.chunk.js.map
325
+ //# sourceMappingURL=BjbY4Fbp2.chunk.js.map