@clickview/lite 0.5.1 → 0.5.2-dev.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 (122) hide show
  1. package/dist/bundles.json +2 -2
  2. package/dist/css/{1736-lite-70aac78870.chunk.css → 1736-lite-091405ee5a.chunk.css} +1 -1
  3. package/dist/css/{8416-lite-9434ba512e.chunk.css → 2246-lite-1d44a1ca24.chunk.css} +2 -2
  4. package/dist/css/{2405-lite-f6e8a8bc16.chunk.css → 2405-lite-c1ba28b1e9.chunk.css} +2 -2
  5. package/dist/css/{3994-lite-f48c952d11.chunk.css → 263-lite-6c85e511fc.chunk.css} +5 -3
  6. package/dist/css/{8584-lite-d98ca340e7.chunk.css → 2711-lite-9b6610d234.chunk.css} +4 -4
  7. package/dist/css/{2780-lite-82ab4b0a3b.chunk.css → 2780-lite-838dc2495c.chunk.css} +1 -1
  8. package/dist/css/{3044-lite-f6f7ccd27d.chunk.css → 3044-lite-e7cc081460.chunk.css} +1 -1
  9. package/dist/css/{3601-lite-426b120700.chunk.css → 3601-lite-85c76231a3.chunk.css} +2 -2
  10. package/dist/css/{4512-lite-8ae16de67b.chunk.css → 4512-lite-8e218a8d38.chunk.css} +2 -2
  11. package/dist/css/{7722-lite-37a1bfe443.chunk.css → 5027-lite-515486bea4.chunk.css} +2 -2
  12. package/dist/css/{5266-lite-7a7ac74447.chunk.css → 5266-lite-ac4e1204c4.chunk.css} +2 -2
  13. package/dist/css/{5466-lite-1ca65f3fa2.chunk.css → 5466-lite-35d1cf195e.chunk.css} +2 -2
  14. package/dist/css/{5942-lite-ed7f448bf3.chunk.css → 5942-lite-690bdf22ca.chunk.css} +1 -1
  15. package/dist/css/{6167-lite-436097518f.chunk.css → 6167-lite-9e7e40b145.chunk.css} +2 -2
  16. package/dist/css/{6355-lite-9dc5ba23e3.chunk.css → 6355-lite-47af9787f9.chunk.css} +2 -2
  17. package/dist/css/{9096-lite-8e8ad037b8.chunk.css → 6473-lite-9e7e40b145.chunk.css} +6 -6
  18. package/dist/css/{6570-lite-435d27636f.chunk.css → 6570-lite-78515e047b.chunk.css} +1 -1
  19. package/dist/css/{6715-lite-843cc4be75.chunk.css → 6715-lite-d1c864529a.chunk.css} +2 -2
  20. package/dist/css/{7066-lite-edc09d2bf1.chunk.css → 7066-lite-fa014b8ba1.chunk.css} +2 -2
  21. package/dist/css/{5027-lite-37a1bfe443.chunk.css → 7722-lite-515486bea4.chunk.css} +2 -2
  22. package/dist/css/{8072-lite-1e48afb701.chunk.css → 8072-lite-644b99bc70.chunk.css} +2 -2
  23. package/dist/css/{705-lite-8a0c6befc3.chunk.css → 8408-lite-43c00f7c3f.chunk.css} +12 -8
  24. package/dist/css/{8414-lite-43f262c18d.chunk.css → 8414-lite-c3f9706ce7.chunk.css} +2 -2
  25. package/dist/css/{2246-lite-9434ba512e.chunk.css → 8416-lite-1d44a1ca24.chunk.css} +2 -2
  26. package/dist/css/{2711-lite-ee849b44db.chunk.css → 8584-lite-761da9c3ca.chunk.css} +4 -4
  27. package/dist/css/{9490-lite-db834aaea4.chunk.css → 8618-lite-55e5e08f1f.chunk.css} +4 -4
  28. package/dist/css/{8835-lite-43f262c18d.chunk.css → 8835-lite-c3f9706ce7.chunk.css} +2 -2
  29. package/dist/css/{898-lite-cc5552ac6a.chunk.css → 898-lite-4dad108831.chunk.css} +2 -2
  30. package/dist/css/{6473-lite-436097518f.chunk.css → 9096-lite-2b19219c37.chunk.css} +6 -6
  31. package/dist/css/{8618-lite-7cf276d202.chunk.css → 9490-lite-5eb0c6a883.chunk.css} +4 -4
  32. package/dist/css/{lite-app-20d839f193.css → lite-app-f1a336bcbf.css} +2 -0
  33. package/dist/en.json +1 -1
  34. package/dist/scripts/{1235-ddd3083c87-lite.chunk.js → 1235-ddf5b84b54-lite.chunk.js} +1 -1
  35. package/dist/scripts/{160-42301e68e8-lite.chunk.js → 160-6b533ebc6b-lite.chunk.js} +1 -1
  36. package/dist/scripts/1736-11145bc899-lite.chunk.js +1 -0
  37. package/dist/scripts/2044-e71dfeaff9-lite.chunk.js +1 -0
  38. package/dist/scripts/2215-10604cf449-lite.chunk.js +1 -0
  39. package/dist/scripts/2458-856fac87cf-lite.chunk.js +1 -0
  40. package/dist/scripts/2562-17c7a32919-lite.chunk.js +1 -0
  41. package/dist/scripts/263-ad476a6106-lite.chunk.js +1 -0
  42. package/dist/scripts/2644-3ae6e3a99d-lite.chunk.js +1 -0
  43. package/dist/scripts/{2699-dcc2aa33b4-lite.chunk.js → 2699-9d8c7c4d4b-lite.chunk.js} +1 -1
  44. package/dist/scripts/2780-4d41107fc5-lite.chunk.js +1 -0
  45. package/dist/scripts/3044-5c013d4806-lite.chunk.js +1 -0
  46. package/dist/scripts/{4182-9af74d7719-lite.chunk.js → 4182-7cb03a20bd-lite.chunk.js} +1 -1
  47. package/dist/scripts/4632-e72f884f19-lite.chunk.js +1 -0
  48. package/dist/scripts/{5139-6f43978996-lite.chunk.js → 5139-ac52a338da-lite.chunk.js} +1 -1
  49. package/dist/scripts/{5466-faad2468f4-lite.chunk.js → 5466-ec560e63d0-lite.chunk.js} +1 -1
  50. package/dist/scripts/{584-bb1c311390-lite.chunk.js → 584-78954070b3-lite.chunk.js} +1 -1
  51. package/dist/scripts/5942-6995ca0930-lite.chunk.js +1 -0
  52. package/dist/scripts/5986-244e543047-lite.chunk.js +1 -0
  53. package/dist/scripts/6570-86c3a7b701-lite.chunk.js +1 -0
  54. package/dist/scripts/{6801-14cba66ade-lite.chunk.js → 6801-4b2f240a39-lite.chunk.js} +1 -1
  55. package/dist/scripts/{6856-53ae5e3ed1-lite.chunk.js → 6856-1b11d7154b-lite.chunk.js} +2 -2
  56. package/dist/scripts/7045-1c2dd04ead-lite.chunk.js +1 -0
  57. package/dist/scripts/7318-ff9c0bc9d2-lite.chunk.js +2 -0
  58. package/dist/scripts/{7498-3934685587-lite.chunk.js → 7498-abe2cd1b9a-lite.chunk.js} +1 -1
  59. package/dist/scripts/7545-723fe61d01-lite.chunk.js +1 -0
  60. package/dist/scripts/7760-9ceb04365b-lite.chunk.js +1 -0
  61. package/dist/scripts/{7804-b0fb78215e-lite.chunk.js → 7804-0bd34f87fd-lite.chunk.js} +1 -1
  62. package/dist/scripts/7982-022fe29030-lite.chunk.js +1 -0
  63. package/dist/scripts/8056-8c4d899044-lite.chunk.js +1 -0
  64. package/dist/scripts/8408-01b0b5c342-lite.chunk.js +1 -0
  65. package/dist/scripts/{8618-204eee61a2-lite.chunk.js → 8618-7112eb9b38-lite.chunk.js} +1 -1
  66. package/dist/scripts/8955-7784865484-lite.chunk.js +1 -0
  67. package/dist/scripts/9016-efeba4c43d-lite.chunk.js +1 -0
  68. package/dist/scripts/9096-e432cfe2b0-lite.chunk.js +1 -0
  69. package/dist/scripts/9200-75a67a4588-lite.chunk.js +1 -0
  70. package/dist/scripts/956-608aa358df-lite.chunk.js +1 -0
  71. package/dist/scripts/{9686-cb67f530b3-lite.chunk.js → 9686-42ee28c8f5-lite.chunk.js} +1 -1
  72. package/dist/scripts/bundle-43756c4455.min.js +2 -0
  73. package/dist/scripts/bundle-d2173d2614.min.js +2 -0
  74. package/dist/scripts/bundle-d2173d2614.min.js.LICENSE.txt +33 -0
  75. package/package.json +61 -61
  76. package/dist/scripts/1736-5d3350eace-lite.chunk.js +0 -1
  77. package/dist/scripts/2044-7be628bc71-lite.chunk.js +0 -1
  78. package/dist/scripts/2215-08998bd8fb-lite.chunk.js +0 -1
  79. package/dist/scripts/2458-f79a9422c3-lite.chunk.js +0 -1
  80. package/dist/scripts/2562-f789f3ab41-lite.chunk.js +0 -1
  81. package/dist/scripts/2644-23e6823b34-lite.chunk.js +0 -1
  82. package/dist/scripts/2780-e29dde3053-lite.chunk.js +0 -1
  83. package/dist/scripts/3044-5e456718e6-lite.chunk.js +0 -1
  84. package/dist/scripts/3994-a9d50b2dfb-lite.chunk.js +0 -1
  85. package/dist/scripts/4632-ec79136629-lite.chunk.js +0 -1
  86. package/dist/scripts/5942-5f49e048b9-lite.chunk.js +0 -1
  87. package/dist/scripts/5986-37ec610b54-lite.chunk.js +0 -1
  88. package/dist/scripts/6570-b7bf9658d1-lite.chunk.js +0 -1
  89. package/dist/scripts/7045-dd37be1caa-lite.chunk.js +0 -1
  90. package/dist/scripts/705-132a0130aa-lite.chunk.js +0 -1
  91. package/dist/scripts/7318-aeb78923f9-lite.chunk.js +0 -2
  92. package/dist/scripts/7545-4b21b7ff75-lite.chunk.js +0 -1
  93. package/dist/scripts/7760-2d4f4e766b-lite.chunk.js +0 -1
  94. package/dist/scripts/8056-f8bd03e2fc-lite.chunk.js +0 -1
  95. package/dist/scripts/8955-4e5c6d5a55-lite.chunk.js +0 -1
  96. package/dist/scripts/9016-49b04c0ad3-lite.chunk.js +0 -1
  97. package/dist/scripts/9096-ce2875b0fb-lite.chunk.js +0 -1
  98. package/dist/scripts/9200-6d0f2c533e-lite.chunk.js +0 -1
  99. package/dist/scripts/9374-95e2a1f45a-lite.chunk.js +0 -1
  100. package/dist/scripts/956-43e15a3db2-lite.chunk.js +0 -1
  101. package/dist/scripts/bundle-9cff5647bc.min.js +0 -2
  102. /package/dist/scripts/{2246-58022fb8e3-lite.chunk.js → 2246-d47593859c-lite.chunk.js} +0 -0
  103. /package/dist/scripts/{2405-bcd5adfb90-lite.chunk.js → 2405-96c2bfad6c-lite.chunk.js} +0 -0
  104. /package/dist/scripts/{2711-68fc1dd44e-lite.chunk.js → 2711-9130aa8bbd-lite.chunk.js} +0 -0
  105. /package/dist/scripts/{3601-72c3b7ea12-lite.chunk.js → 3601-0bf95ec80c-lite.chunk.js} +0 -0
  106. /package/dist/scripts/{4512-5c37ad577c-lite.chunk.js → 4512-37aaf32f9c-lite.chunk.js} +0 -0
  107. /package/dist/scripts/{5027-b40bef5a12-lite.chunk.js → 5027-c32e997eba-lite.chunk.js} +0 -0
  108. /package/dist/scripts/{5266-760c910e3a-lite.chunk.js → 5266-06aa8505d9-lite.chunk.js} +0 -0
  109. /package/dist/scripts/{6167-7c9d16278a-lite.chunk.js → 6167-d964559fd4-lite.chunk.js} +0 -0
  110. /package/dist/scripts/{6355-1fffbda6b1-lite.chunk.js → 6355-2bef51aa78-lite.chunk.js} +0 -0
  111. /package/dist/scripts/{6715-2f720bfcc6-lite.chunk.js → 6715-4b0f97374f-lite.chunk.js} +0 -0
  112. /package/dist/scripts/{6856-53ae5e3ed1-lite.chunk.js.LICENSE.txt → 6856-1b11d7154b-lite.chunk.js.LICENSE.txt} +0 -0
  113. /package/dist/scripts/{7066-72cdd0e88e-lite.chunk.js → 7066-f9a52d0f47-lite.chunk.js} +0 -0
  114. /package/dist/scripts/{7318-aeb78923f9-lite.chunk.js.LICENSE.txt → 7318-ff9c0bc9d2-lite.chunk.js.LICENSE.txt} +0 -0
  115. /package/dist/scripts/{8072-af8df53464-lite.chunk.js → 8072-a0eddfd6a3-lite.chunk.js} +0 -0
  116. /package/dist/scripts/{8414-188c1d3add-lite.chunk.js → 8414-1257f4f3f0-lite.chunk.js} +0 -0
  117. /package/dist/scripts/{8416-0791d3e2f5-lite.chunk.js → 8416-6e12a579f0-lite.chunk.js} +0 -0
  118. /package/dist/scripts/{8584-a2e7b25a1f-lite.chunk.js → 8584-6930a805f6-lite.chunk.js} +0 -0
  119. /package/dist/scripts/{8835-7b44462f86-lite.chunk.js → 8835-2e65ba92ab-lite.chunk.js} +0 -0
  120. /package/dist/scripts/{898-5013a218c7-lite.chunk.js → 898-33646d2130-lite.chunk.js} +0 -0
  121. /package/dist/scripts/{9490-261925b498-lite.chunk.js → 9490-671890aa9e-lite.chunk.js} +0 -0
  122. /package/dist/scripts/{bundle-9cff5647bc.min.js.LICENSE.txt → bundle-43756c4455.min.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- /*! For license information please see 6856-53ae5e3ed1-lite.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[6856],{5833:(t,e,n)=>{n.d(e,{I:()=>l});var r=n(1024),o=n.n(r),i=n(36532),a=n(83914),c=n(61252);function l(t){return o().createElement(i.u,{title:t.tooltipText,spanHack:!0,spanHackClassName:"d-inline-block"},o().createElement(a.x,{svgName:c.vn.Info}))}},80181:(t,e,n)=>{n.d(e,{Z:()=>y});var r=n(1024),o=n.n(r),i=n(54976),a=n(93264),c=n(11607),l=n(83914),u=n(61252),s=n(83345),f=n(28972),d=n(86572);var p="shared.interactiveQuestions";function m(t){var e=t.interaction;switch((0,t.getCorrectness)(e)){case f.w.Correct:return o().createElement("span",{className:"text-success"},o().createElement(l.x,{size:l.S.Medium,svgName:u.vn.Check}));case f.w.Incorrect:return o().createElement("span",{className:"text-danger"},o().createElement(l.x,{size:l.S.Medium,svgName:u.vn.Close}));case f.w.AwaitingMarking:return o().createElement("span",{className:"text-muted italic"},o().createElement("i",null,o().createElement(s.x,{namespace:p,phrase:"pending"})));case f.w.UnAnswered:return o().createElement("button",{className:"btn btn-outline-dark"},o().createElement(s.x,{namespace:p,phrase:"answer"}));case f.w.Answered:return o().createElement("span",{className:"text-muted italic"},o().createElement("i",null,o().createElement(s.x,{namespace:p,phrase:"answered"})));case f.w.NotApplicable:return o().createElement(o().Fragment,null)}}function h(t){var e=t.interaction,n=t.visibleAt,r=t.selectedInteractionId,i=t.goToTimepoint,s=t.scrollTo,f=t.isFirstInteraction,p=e.id.toString()===(null==r?void 0:r.toString()),h=o().useRef();o().useEffect((function(){if(p&&h.current){var t=h.current,e=t.getBoundingClientRect(),n=e.top-t.offsetParent.getBoundingClientRect().top;s(n,e.height)}}),[p]);var v=i?"cursor-pointer":"cursor-default";return o().createElement("div",{ref:h},o().createElement(c.L,{className:"py-2 ".concat(v," ").concat("sGk59"," ").concat(p?"tfrDf":""),onClick:p?function(){}:function(){i&&i(e.id)}},o().createElement("span",{className:"".concat("JDp5N"," mr-2 ").concat(p?"font-weight-bold":"")},f?a.T.ToDisplayDuration(n):""),o().createElement(d.y,{interaction:e,showTypeName:!0,typeNameClassName:"AzIWg",questionClassName:"UhEYq"}),t.onClickDelete&&o().createElement(c.L,{onClick:function(n){n.stopPropagation(),t.onClickDelete(e.id)},className:"".concat("wBqoo")},o().createElement("span",{className:"text-right ".concat("OAQQu")},o().createElement(l.x,{size:l.S.Medium,svgName:u.vn.Delete}))),t.getCorrectness&&o().createElement("span",{className:"text-right ".concat("W5sR9")},o().createElement(m,{interaction:e,getCorrectness:t.getCorrectness}))))}function v(t){var e=t.timepoint,n=t.scrollTo,r=t.onClickDelete,i=t.selectedInteractionId,a=t.getCorrectness;function c(n){t.goToTimepoint&&t.goToTimepoint(e.id,n)}return e.interactions?o().createElement("div",null,e.interactions.map((function(t,l){return o().createElement(h,{interaction:t,visibleAt:e.visibleAt,goToTimepoint:c,onClickDelete:r,scrollTo:n,selectedInteractionId:i,isFirstInteraction:0===l,getCorrectness:a,key:l})}))):o().createElement(o().Fragment,null)}function y(t){var e=t.interactive,n=t.goToTimepoint,r=t.selectedInteractionId,a=t.maxHeight,c=t.onClickDelete,l=t.getCorrectness,u=o().useRef();function s(t,e){if(u.current){var n=u.current.getClientHeight(),r=u.current.getScrollTop(),o=t+r;(o<r||o+e>r+n)&&u.current.scrollTop(o-n/2+e/2)}}var f=n?"border rounded":"";return o().createElement(i.Scrollbars,{autoHeight:!0,autoHeightMax:a,className:f,hideTracksWhenNotNeeded:!0,ref:u},o().createElement("div",{className:"px-3 py-1"},e.timepoints.map((function(t,e){return o().createElement(v,{key:e,timepoint:t,goToTimepoint:n,selectedInteractionId:r,scrollTo:s,onClickDelete:c,getCorrectness:l})}))))}},28972:(t,e,n)=>{var r;n.d(e,{w:()=>r}),function(t){t[t.Correct=0]="Correct",t[t.Incorrect=1]="Incorrect",t[t.AwaitingMarking=2]="AwaitingMarking",t[t.Answered=3]="Answered",t[t.UnAnswered=4]="UnAnswered",t[t.NotApplicable=5]="NotApplicable"}(r||(r={}))},99705:(t,e,n)=>{var r;n.d(e,{w:()=>r}),function(t){t.AddToPlaylist="115005679748",t.LibraryEditor="360001974533",t.VideoAccess="360000153947",t.AddFromOnline="360011718234",t.UploadToLibraryEditor="360012069334",t.PBTErrorCodes="360012421153",t.ManuelReview="360020004534",t.LibraryReview="360000163788",t.Integrations="4407268725529",t.Classrooms="4405362551833",t.MakeInteractive="4405370510873"}(r||(r={}))},76343:(t,e,n)=>{var r;n.d(e,{A:()=>r}),function(t){t[t.View=0]="View",t[t.Create=1]="Create"}(r||(r={}))},38314:(t,e,n)=>{n.d(e,{InteractiveMode:()=>r.A});var r=n(76343)},10942:(t,e,n)=>{n.d(e,{S:()=>eo});var r=n(1024),o=n.n(r),i=n(81886),a=n(56050),c=(n(16852),n(91242),n(93262),n(16235)),l=n(10463),u=n(38314),s=n(84120);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=m(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},p.apply(this,arguments)}function m(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function v(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=y(r);if(o){var n=y(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return v(this,t)});function a(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e)).timepoint_=e.timepoint,n.time_=e.timepoint.visibleAt/1e3;var r=e.timepoint.interactions[0];r||n.hide();var o=s.w.getTypeInfo(r.typeId).bgClassName;return n.$(".vjs-icon-placeholder").classList.add(o),n.controlText(r.name),n.update(),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-item ".concat(p(y(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return p(y(a.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),Object.assign(Object.assign({},n),{tabIndex:0}))}},{key:"update",value:function(){var t=this.player_.duration(),e=this.time_/t;this.el().style.left=100*e+"%",e>100||e<0?this.hide():this.show()}},{key:"handleClick",value:function(t){t.stopPropagation(),this.player_.currentTime(this.time_)}}])&&d(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getComponent("Button"));function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(){return x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=I(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},x.apply(this,arguments)}function I(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=C(t)););return t}function S(t,e){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},S(t,e)}function k(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return O(t)}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}var N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&S(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=C(r);if(o){var n=C(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return k(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e)).track_=e.track,n.interactive_=e.interactive,n.onDurationChange=n.onDurationChange.bind(O(n)),n.createInteractionItems=n.createInteractionItems.bind(O(n)),n.createInteractionItems(),n.track_.on("cv:cuechange",n.createInteractionItems),n.player_.on("durationchange",n.onDurationChange),n.player_.on("dispose",(function(){n.track_.off("cv:cuechange"),n.player_.off("durationchange",n.onDurationChange)})),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-items ".concat(x(C(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return x(C(a.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(){this.children_.forEach((function(t){t.update()}))}},{key:"createInteractionItems",value:function(){var t,e,n=this;if(this.track_){(e=this.children_,function(t){if(Array.isArray(t))return w(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(t){n.removeChild(t)}));for(var r=0;r<this.track_.cues.length;r++){var o=this.track_.cues[r],i=this.getTimepointById(o.text);i&&(null===(t=i.interactions)||void 0===t?void 0:t.length)&&this.addChild(new g(this.player_,{timepoint:i}))}}}},{key:"onDurationChange",value:function(){this.update()}},{key:"getTimepointById",value:function(t){var e;return null===(e=this.interactive_.timepoints)||void 0===e?void 0:e.find((function(e){return e.id.toString()===t.toString()}))}}])&&E(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getComponent("Component")),j=n(14735),L=n(76343);function T(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var P=n(89476);function _(t){return!!(null==t?void 0:t.toString().startsWith("new_"))}function F(t){return t.error,t.hasChanges,t.submitted,t.spinner,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["error","hasChanges","submitted","spinner"])}var R=n(2314);function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function U(){U=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==M(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var G=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function c(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((r=r.apply(t,e||[])).next())}))},q=function(t){return"/api/domain/v1/interactions/".concat(t)},B=function(t){return"/api/domain/v1/timepoints/".concat(t)},W={},z=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,(n=[{key:"saveInteraction",value:function(t){return G(this,void 0,void 0,U().mark((function e(){var n,r,o,i,a;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=_(t.id),r=n?"/api/domain/v1/interactions/bulk":(c=t.id,"/api/domain/v1/interactions/bulk/".concat(c)),o={name:t.name,data:t.data,timepointId:t.timepointId,interactiveId:t.interactiveId,typeId:t.typeId,actionableItems:t.actionableItems,order:t.order},n||(o.id=t.id),i=n?R.e.post(r,JSON.stringify(o),W):R.e.put(r,JSON.stringify(o),W),e.next=7,i;case 7:a=e.sent,n&&(t.id=a.id);case 9:case"end":return e.stop()}var c}),e)})))}},{key:"deleteInteraction",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.delete(q(t),W);case 2:case"end":return e.stop()}}),e)})))}},{key:"saveTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){var n,r;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={interactiveId:t.interactiveId,shouldPause:1,visibleAt:t.visibleAt},e.next=3,R.e.post("/api/domain/v1/timepoints",JSON.stringify(n),W);case 3:r=e.sent,t.id=r.id;case 5:case"end":return e.stop()}}),e)})))}},{key:"updateTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.put((n=t.id,"/api/domain/v1/timepoints/".concat(n)),JSON.stringify(t),W);case 2:case"end":return e.stop()}var n}),e)})))}},{key:"deleteTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.delete(B(t),W);case 2:case"end":return e.stop()}}),e)})))}}])&&D(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()),Y=n(497),Z=n(53957),H=n(17082);function $(t){var e=t.error;return t.error?o().createElement("p",{className:"mt-2 small text-danger"},e):o().createElement(o().Fragment,null)}var V=n(11607);function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Q(){Q=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==K(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var J=/[.\?!,;:\-''\(\)]/g;function X(t){for(var e=t.split("");e.length&&e[0].match(J);)e.shift();for(;e.length&&e[e.length-1].match(J);)e.pop();return e.join("")}function tt(t,e){for(var n=t.split(""),r=[],o=[];n.length&&n[0].match(J);)r.push(n.shift());for(;n.length&&n[n.length-1].match(J);)o.unshift(n.pop());return r.join("")+e+o.join("")}function et(t){return t.map((function(t){if(!t.selected)return t.text;var e=X(t.text).length,n=new Array(e).fill("_").join("");return tt(t.text,n)})).join(" ")}function nt(t){return t.map((function(t){var e;return t.selected?null===(e=tt(t.text,"{".concat(t.order,"}")))||void 0===e?void 0:e.trim():t.text})).join(" ")}var rt=n(56108),ot=n(5833);function it(t){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},it(t)}function at(){at=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==it(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var ct=n(75896);function lt(t){var e=o().useRef(null);function n(){t.onChange(Object.assign(Object.assign({},t.answer),{isCorrect:!t.answer.isCorrect}))}return o().createElement("li",{className:"p-1 my-1 w-100 bg-white d-flex align-items-center border rounded"},o().createElement("div",{className:"custom-control ".concat(t.isTrueOrFalse?"custom-radio":"custom-checkbox"),onKeyDown:function(t){return"Enter"===t.key&&n()}},o().createElement("input",{id:"multiple-choice--".concat(t.answer.order),type:t.isTrueOrFalse?"radio":"checkbox",className:"custom-control-input mr-2",name:"multiple-choice-answer",checked:t.answer.isCorrect,onChange:n,disabled:!t.answer.name}),o().createElement("label",{ref:e,htmlFor:"multiple-choice--".concat(t.answer.order),className:"cursor-pointer custom-control-label"})),t.isTrueOrFalse?o().createElement("label",{className:"mb-0",htmlFor:"multiple-choice--".concat(t.answer.order)},t.answer.name):o().createElement("input",{placeholder:"Answer",onChange:function(e){t.onChange(Object.assign(Object.assign({},t.answer),{name:e.target.value}))},value:t.answer.name,className:"border-0 outline-none w-100",autoComplete:"off"}))}function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function st(){st=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==ut(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function ft(t){var e;if(!(null===(e=t.question)||void 0===e?void 0:e.trim()))return"Please provide a question";if(!t.answers.find((function(t){return t.isCorrect})))return"Please select the correct answer";var n=t.answers.filter((function(t){var e;return!!(null===(e=t.name)||void 0===e?void 0:e.trim())}));if(n.length<2)return"Please provide at least two answers";var r=!1,o={};return n.forEach((function(t){r||(o[t.name]?r=!0:o[t.name]=!0)})),r?"There are duplicates in your answers":null}function dt(t,e){var n,r,o,i,a;return r=this,o=void 0,i=void 0,a=st().mark((function r(){return st().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.name=null===(n=t.question)||void 0===n?void 0:n.trim(),e.actionableItems=t.answers.filter((function(t){var e;return!!(null===(e=t.name)||void 0===e?void 0:e.trim())})),t.feedback&&(e.data.feedback=t.feedback),r.next=5,z.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(t){e(t)}}function c(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,c)}l((a=a.apply(r,o||[])).next())}))}function pt(t){var e=t.state,n=void 0===e?function(t){var e,n=t.typeId===Z.InteractionTypeId.TrueOrFalse,r=null===(e=t.actionableItems)||void 0===e?void 0:e.map((function(t){return{order:t.order,name:t.name,isCorrect:t.isCorrect}}));return(null==r?void 0:r.length)?!n&&(null==r?void 0:r.length)<4&&r.push({order:r.length,name:"",isCorrect:!1}):r=[{order:0,name:n?"True":"",isCorrect:!1},{order:1,name:n?"False":"",isCorrect:!1}],{question:t.name||"",answers:r,feedback:t.data.feedback||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=t.showFeedback,l=i.typeId===Z.InteractionTypeId.TrueOrFalse;function u(t){var e,o,i=n.answers.map((function(e){return e.order!==t.order?Object.assign(Object.assign({},e),{isCorrect:!l&&e.isCorrect}):t}));if(i.find((function(t){return!t.name}))&&(o=(e=i).find((function(t){return!t.name})),i=e.length>2?e.filter((function(t){return t.order!==o.order})).map((function(t,e){return Object.assign(Object.assign({},t),{order:e})})):e.map((function(t){return t.order!==o.order?t:Object.assign(Object.assign({},t),{isCorrect:!1})}))),!l&&i.length<4&&!i.find((function(t){return!t.name}))){var a=ct.m.last(i);i.push({name:"",order:a.order+1,isCorrect:!1})}r(Object.assign(Object.assign({},n),{answers:i}))}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"multiple-choice-question"},"Question"),o().createElement(H.t0,{node:a})),o().createElement("input",{id:"multiple-choice-question",className:"form-control",placeholder:"Enter your question here",value:n.question,onChange:function(t){r(Object.assign(Object.assign({},n),{question:t.target.value}))},autoComplete:"off"}),!n.question&&o().createElement($,{error:n.error})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"multiple-choice-answer"},"Answers"),n.answers.map((function(t){return o().createElement(lt,{key:t.order,answer:t,onChange:u,isTrueOrFalse:l})})),n.question&&o().createElement($,{error:n.error})),c&&l&&o().createElement("div",{className:"form-group mb-0"},o().createElement("label",{className:"cv-true-or-false-feedback-label cv-interaction-field-label",htmlFor:"true-or-false-feedback"},"Feedback  ",o().createElement("span",{className:"text-muted"},"(optional)")," ",o().createElement(ot.I,{tooltipText:"Provide answer feedback for your students"})),o().createElement(rt.Z,{id:"true-or-false-feedback",className:"form-control",minRows:2,value:n.feedback||"",onChange:function(t){r(Object.assign(Object.assign({},n),{feedback:t.target.value}))},placeholder:"Give feedback for this question"})))}var mt=n(79483),ht=n(54610),vt=n(45368);function yt(){return o().createElement("svg",{viewBox:"0 0 43 38",className:"cv-upload-image-icon"},o().createElement("g",{transform:"translate(-1193.000000, -185.000000)"},o().createElement("g",{transform:"translate(1183.000000, 173.000000)"},o().createElement("path",{d:"M49.875,12.9166667 C51.3247475,12.9166667 52.5,14.0732644 52.5,15.5 L52.5,46.5 C52.5,47.9267356 51.3247475,49.0833333 49.875,49.0833333 L13.125,49.0833333 C11.6752525,49.0833333 10.5,47.9267356 10.5,46.5 L10.5,15.5 C10.5,14.0732644 11.6752525,12.9166667 13.125,12.9166667 L49.875,12.9166667 Z M49.875,15.5 L13.125,15.5 L13.125,46.5 L49.875,46.5 L49.875,15.5 Z M35.5085905,22.5470241 L45.7260956,38.0470241 C46.1206004,38.6454897 45.9474325,39.445375 45.3393142,39.8336178 C44.731196,40.2218607 43.9184093,40.0514415 43.5239044,39.4529759 L34.3641741,25.5576247 L29.9489593,31.7425222 C29.4803332,32.3989804 28.5233602,32.4806343 27.9469223,31.9133463 L26.3920049,30.38311 L19.425,39.525 C18.9900758,40.0956942 18.167399,40.211354 17.5875,39.7833333 C17.007601,39.3553127 16.8900758,38.5456942 17.325,37.975 L25.2,27.6416667 C25.6792326,27.0128323 26.6132966,26.9475041 27.1780777,27.5033204 L28.6987913,28.9998957 L33.3335357,22.5074778 C33.8680838,21.758675 35.0025121,21.7793009 35.5085905,22.5470241 Z M21,19.375 C23.1746212,19.375 24.9375,21.1098966 24.9375,23.25 C24.9375,25.3901034 23.1746212,27.125 21,27.125 C18.8253788,27.125 17.0625,25.3901034 17.0625,23.25 C17.0625,21.1098966 18.8253788,19.375 21,19.375 Z M21,21.9583333 C20.2751263,21.9583333 19.6875,22.5366322 19.6875,23.25 C19.6875,23.9633678 20.2751263,24.5416667 21,24.5416667 C21.7248737,24.5416667 22.3125,23.9633678 22.3125,23.25 C22.3125,22.5366322 21.7248737,21.9583333 21,21.9583333 Z",id:"Combined-Shape"}))))}function gt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return bt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wt(t){var e=gt(o().useState(!1),2),n=e[0],r=e[1],i=gt(o().useState(0),2),a=i[0],c=i[1];return o().useEffect((function(){0===a&&n&&r(!1)}),[a,n,r]),o().createElement("div",{onDragOver:function(t){t.preventDefault(),t.stopPropagation()},onDragEnter:function(t){t.preventDefault(),t.stopPropagation(),c((function(t){return t+1})),t.dataTransfer.items&&t.dataTransfer.items.length>0&&!n&&r(!0)},onDragLeave:function(t){t.preventDefault(),t.stopPropagation(),c((function(t){return t-1}))},onDrop:function(e){e.preventDefault(),e.stopPropagation(),r(!1),a>0&&c(0),e.dataTransfer.files&&e.dataTransfer.files.length>0&&(t.onDropImage(e.dataTransfer.files),e.dataTransfer.clearData())},className:n?"cv-image-upload-mask":""},t.children)}function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function xt(){xt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Et(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var It=n(6880),St=n(10671),kt=n(84891),Ot={styleToHTML:function(t){return"SUPERSCRIPT"===t?{start:"<sup>",end:"</sup>"}:"SUBSCRIPT"===t?{start:"<sub>",end:"</sub>"}:void 0},entityToHTML:function(t,e){return"LINK"===t.type?o().createElement("a",{href:t.data.url},e):e},htmlToStyle:function(t,e,n){return"sup"===t?n.add("SUPERSCRIPT"):"sub"===t?n.add("SUBSCRIPT"):n},htmlToEntity:function(t,e,n){if("a"===t)return n("LINK","MUTABLE",{url:e.href})}};function Ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Nt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function jt(t){var e=Ct(o().useState(""),2),n=e[0],r=e[1],i=Ct(o().useState(""),2),a=i[0],c=i[1];return o().createElement("div",{"aria-haspopup":"true","aria-expanded":t.expanded,"aria-label":"rdw-color-picker"},o().createElement("div",{className:"rdw-option-wrapper cv-annotation-toolbar-option cv-annotation-link",onClick:t.onExpandEvent}," "),t.expanded&&o().createElement("div",{className:"rdw-link-modal",onClick:function(t){return t.stopPropagation()}},o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-url"},"URL"),o().createElement("input",{id:"cv-annotation-url",className:"form-control",onChange:function(t){return r(t.target.value)},value:n,placeholder:"Enter URL",autoComplete:"off"})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-text"},"Text"),o().createElement("input",{id:"cv-annotation-text",className:"form-control",onChange:function(t){return c(t.target.value)},value:a,placeholder:"Enter Text",autoComplete:"off"})),o().createElement(V.L,{onClick:function(){return t.onChange("link",a||n,n,"_blank")},className:"btn btn-dark"},"Add")))}function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}function Tt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return At(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pt(){Pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Lt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var _t,Ft,Rt;function Mt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ut=(Mt(_t={},Z.InteractionTypeId.Annotation,(function(t){var e=t.state,n=void 0===e?function(t){var e;return{annotation:(null===(e=t.data)||void 0===e?void 0:e.annotation)||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=Tt(o().useState(function(){var t=i.data.annotation;if(t){var e=(0,kt.h4)(Ot)(t);return It.EditorState.createWithContent(e)}return It.EditorState.createEmpty()}()),2),l=c[0],u=c[1],s=Tt(o().useState(null),2),f=s[0],d=s[1];return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",onClick:function(){return null==f?void 0:f.focusEditor()}},"Annotation"),o().createElement(H.t0,{node:a})),o().createElement("div",{className:"cv-annotation ".concat(function(){if(!l)return!1;var t=l.getCurrentContent();return t.hasText()||"unstyled"!==t.getBlockMap().first().getType()}()?"Editor--hide-placeholder":"")},l&&o().createElement(St.Editor,{editorState:l,onEditorStateChange:function(t){u(t);var e=t.getCurrentContent();if(e.hasText()){var o=(0,kt.cn)(Ot)(e);r(Object.assign(Object.assign({},n),{annotation:o}))}else r(Object.assign(Object.assign({},n),{annotation:""}))},toolbarClassName:"cv-annotation-toolbar",editorClassName:"form-control cv-annotation-editor",ref:d,placeholder:"Enter your annotation here",toolbar:{options:["inline","list","link"],inline:{options:["bold","italic","underline","superscript","subscript"],bold:{className:"cv-annotation-toolbar-option cv-annotation-bold",icon:""},italic:{className:"cv-annotation-toolbar-option cv-annotation-italic",icon:""},underline:{className:"cv-annotation-toolbar-option cv-annotation-underline",icon:""},superscript:{className:"cv-annotation-toolbar-option cv-annotation-superscript",icon:""},subscript:{className:"cv-annotation-toolbar-option cv-annotation-subscript",icon:""}},list:{options:["unordered","ordered"],unordered:{className:"cv-annotation-toolbar-option cv-annotation-bullet-list",icon:""},ordered:{className:"cv-annotation-toolbar-option cv-annotation-number-list",icon:""}},link:{component:jt,options:["link"]}}}),o().createElement($,{error:n.error}))))})),Mt(_t,Z.InteractionTypeId.Image,(function(t){var e=t.state,n=void 0===e?function(t){var e;return{url:(null===(e=t.data)||void 0===e?void 0:e.url)||"",caption:t.data.caption}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode;(0,vt.R)();var c=o().useRef(null);function l(t){t&&t[0]&&mt.J.onFileSelect(ht.__.None,t,(function(t){Y.M.renderCropper({src:t.src,alt:"",onClickCrop:u})}))}function u(e){var o=e.split(",")[1];R.e.post("".concat(t.imageApi,"v2/thumbnails/base64"),'"'.concat(o,'"'),{tokenName:"gateway"}).then((function(t){r(Object.assign(Object.assign({},n),{url:t.location}))})).catch((function(){return alert("Something went wrong while trying to upload image. Please try again.")}))}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Image"),o().createElement(H.t0,{node:a})),n.url?o().createElement("div",{className:"text-center"},o().createElement("div",{className:"cv-uploaded-image-container"},o().createElement("img",{className:"img img-fluid",src:n.url,alt:n.caption}),o().createElement(V.L,{className:"cv-remove-uploaded-image d-flex justify-content-center align-items-center",onClick:function(){r(Object.assign(Object.assign({},n),{url:""}))}},o().createElement("div",{className:"btn btn-link text-light"},"Remove")))):o().createElement(wt,{onDropImage:l},o().createElement("div",{className:"cv-image-interaction-upload-container rounded py-4 text-center"},o().createElement("div",{className:"svg-container xlg mb-2"},o().createElement(yt,null)),o().createElement("p",{className:"mb-0"},"Drag and drop an image file or"),o().createElement(V.L,{type:"button",className:"text-underline d-inline-block",onClick:function(){c.current.value=null,c.current.click(null)}},"upload from your device"),o().createElement("input",{type:"file",autoComplete:"off",className:"file-select d-none",multiple:!1,accept:"image/jpg,image/jpeg,image/png",ref:c,onChange:function(t){return l(t.target.files)}}))),o().createElement($,{error:n.error})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"image-caption"},"Caption  ",o().createElement("span",{className:"text-muted"},"(optional)")),o().createElement("textarea",{id:"image-caption",className:"form-control",placeholder:"Caption your image",value:n.caption||i.data.caption||"",onChange:function(t){r(Object.assign(Object.assign({},n),{caption:t.target.value}))},rows:2})))})),Mt(_t,Z.InteractionTypeId.MissingWord,(function(t){var e,n,r,i,a,c,l=t.state,u=void 0===l?(i=(null===(n=(e=t.interaction).data)||void 0===n?void 0:n.sentence)||"",a=i.split(" ").filter(Boolean),c=a.map((function(t,e){return{text:t,order:e,selected:!1}})),null===(r=e.actionableItems)||void 0===r||r.forEach((function(t){var e=t.order,n=tt(a[e],t.name);a[e]=n,c[e].text=n,c[e].selected=!0})),{fullSentence:a.join(" "),sentence:i,preview:e.name,words:c}):l,s=t.setState,f=t.optionsPortalNode,d=!!u.sentence;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"missing-word-sentence"},"Sentence"),o().createElement(H.t0,{node:f})),o().createElement("input",{id:"missing-word-sentence",className:"form-control",placeholder:"Enter your sentence here",value:u.fullSentence||"",onChange:function(t){var e=t.target.value,n=e.split(" ").filter(Boolean).map((function(t,e){return{text:t,order:e,selected:!1}}));s(Object.assign(Object.assign({},u),{fullSentence:e,sentence:nt(n),preview:et(n),words:n}))},autoComplete:"off"})),d&&o().createElement(o().Fragment,null,o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label"},"Select the missing word(s)"),o().createElement("ul",{className:"list-unstyled d-flex flex-wrap mx-n1 mb-n1"},u.words.map((function(t,e){var n;return(null===(n=X(t.text))||void 0===n?void 0:n.trim())?o().createElement("li",{key:"".concat(e,"-").concat(t.text)},o().createElement(V.L,{className:"rounded border p-2 mx-1 mb-1 cursor-pointer ".concat(t.selected?"bg-info text-white":"bg-white"),onClick:function(){return t=e,n=u.words.map((function(e){return e.order!==t?e:Object.assign(Object.assign({},e),{selected:!e.selected})})),void s(Object.assign(Object.assign({},u),{words:n,preview:et(n),sentence:nt(n)}));var t,n}},X(t.text))):o().createElement(o().Fragment,{key:"".concat(e,"-").concat(t.text)})})))),o().createElement("div",null,o().createElement("label",{className:"cv-interaction-field-label"},"Preview"),o().createElement("p",null,u.preview))),o().createElement($,{error:u.error}))})),Mt(_t,Z.InteractionTypeId.MultipleChoice,pt),Mt(_t,Z.InteractionTypeId.ShortAnswer,(function(t){var e=t.state,n=void 0===e?function(t){return{question:t.name,suggestedResponse:t.data.suggestedResponse||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=t.showFeedback;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"short-answer-question"},"Question"),o().createElement(H.t0,{node:a})),o().createElement("input",{id:"short-answer-question",className:"form-control",onChange:function(t){r(Object.assign(Object.assign({},n),{question:t.target.value}))},value:n.question||i.data.text||"",placeholder:"Enter your question here",autoComplete:"off"}),o().createElement($,{error:n.error})),c&&o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"short-answer-suggested-response"},"Suggested Response  ",o().createElement("span",{className:"text-muted"},"(optional)")," ",o().createElement(ot.I,{tooltipText:"Provide a suggested response for your students"})),o().createElement(rt.Z,{id:"short-answer-suggested-response",className:"form-control",minRows:2,value:n.suggestedResponse||"",onChange:function(t){r(Object.assign(Object.assign({},n),{suggestedResponse:t.target.value}))},placeholder:"Give a suggested response for this question"})))})),Mt(_t,Z.InteractionTypeId.TrueOrFalse,pt),_t),Dt=(Mt(Ft={},Z.InteractionTypeId.Annotation,(function(t){var e;return(null===(e=t.annotation)||void 0===e?void 0:e.trim())?null:"Please provide an annotation"})),Mt(Ft,Z.InteractionTypeId.Image,(function(t){return t.url?null:"Please upload an image"})),Mt(Ft,Z.InteractionTypeId.MissingWord,(function(t){var e;return(null===(e=t.sentence)||void 0===e?void 0:e.trim())?t.words.find((function(t){return t.selected}))?null:"Please select a missing word":"Please provide a sentence"})),Mt(Ft,Z.InteractionTypeId.MultipleChoice,ft),Mt(Ft,Z.InteractionTypeId.ShortAnswer,(function(t){var e;return(null===(e=t.question)||void 0===e?void 0:e.trim())?null:"Please provide a question"})),Mt(Ft,Z.InteractionTypeId.TrueOrFalse,ft),Ft),Gt=(Mt(Rt={},Z.InteractionTypeId.Annotation,(function(t,e){var n,r,o,i,a;return r=this,o=void 0,i=void 0,a=Pt().mark((function r(){return Pt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.name="Annotation",e.data.annotation=null===(n=t.annotation)||void 0===n?void 0:n.trim(),e.actionableItems=[{name:"Answer"}],r.next=5,z.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(t){e(t)}}function c(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,c)}l((a=a.apply(r,o||[])).next())}))})),Mt(Rt,Z.InteractionTypeId.Image,(function(t,e){var n,r,o,i,a,c;return o=this,i=void 0,a=void 0,c=xt().mark((function o(){return xt().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e.data.url=t.url,e.name=(null===(n=t.caption)||void 0===n?void 0:n.trim())||"Image",e.data.caption=null===(r=t.caption)||void 0===r?void 0:r.trim(),e.actionableItems=[{name:"Answer"}],o.next=6,z.saveInteraction(e);case 6:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(t,e){function n(t){try{l(c.next(t))}catch(t){e(t)}}function r(t){try{l(c.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}l((c=c.apply(o,i||[])).next())}))})),Mt(Rt,Z.InteractionTypeId.MissingWord,(function(t,e){return n=this,r=void 0,o=void 0,i=Q().mark((function n(){var r;return Q().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.data.sentence=nt(t.words),e.name=t.preview,r=t.words.filter((function(t){return t.selected})),e.actionableItems=r.map((function(t){return{name:X(t.text),order:t.order,isCorrect:!0}})),n.next=6,z.saveInteraction(e);case 6:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(t,e){function a(t){try{l(i.next(t))}catch(t){e(t)}}function c(t){try{l(i.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}l((i=i.apply(n,r||[])).next())}));var n,r,o,i})),Mt(Rt,Z.InteractionTypeId.MultipleChoice,dt),Mt(Rt,Z.InteractionTypeId.ShortAnswer,(function(t,e){var n,r,o,i,a,c;return o=this,i=void 0,a=void 0,c=at().mark((function o(){return at().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e.name=null===(n=t.question)||void 0===n?void 0:n.trim(),e.data.suggestedResponse=null===(r=t.suggestedResponse)||void 0===r?void 0:r.trim(),e.actionableItems=[{name:"Answer"}],o.next=5,z.saveInteraction(e);case 5:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(t,e){function n(t){try{l(c.next(t))}catch(t){e(t)}}function r(t){try{l(c.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}l((c=c.apply(o,i||[])).next())}))})),Mt(Rt,Z.InteractionTypeId.TrueOrFalse,dt),Rt);function qt(t){return Gt[t]}var Bt=n(25723),Wt=n(65858),zt=["A","B","C","D"];function Yt(t){if(!t.enableImmersiveReader)return o().createElement(o().Fragment,null);var e=t.interaction,n=t.className,r=s.w.getTypeInfo(e.typeId),i=r.name,a=r.typeName,c="";switch(e.typeId){case Z.InteractionTypeId.Annotation:c=e.data.annotation;break;case Z.InteractionTypeId.Image:c=e.data.caption;break;case Z.InteractionTypeId.MissingWord:c=e.data.sentence.replace(/{([^{}]*)}/g,(function(){return"<u>&nbsp;&nbsp;&nbsp;&nbsp;</u>"}));break;case Z.InteractionTypeId.MultipleChoice:c=e.name,e.actionableItems.map((function(t,e){return c+="<br />".concat(zt[e],": ").concat(t.name)}));break;case Z.InteractionTypeId.ShortAnswer:c=e.name;break;case Z.InteractionTypeId.TrueOrFalse:c="True or false: ".concat(e.name)}var l=e.typeId===Z.InteractionTypeId.Annotation||e.typeId===Z.InteractionTypeId.MissingWord||e.typeId===Z.InteractionTypeId.MultipleChoice;return o().createElement(Bt.m,{title:i,text:c,html:l,className:"pr-2 ".concat(n||""),analyticsData:{id:e.interactiveId,type:a},analyticsOptions:{location:Wt.LocationContext.InteractivePlayer,entity:Wt.EntityType.Interactive,actionType:Wt.UserAction.Click,descriptor:Wt.ClickDescriptor.LaunchImmersiveReader}})}function Zt(t){var e=t.error;return t.error?o().createElement("p",{className:"mt-2 small text-danger"},e):o().createElement(o().Fragment,null)}var Ht,$t,Vt=n(28972);function Kt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qt(){return Vt.w.NotApplicable}function Jt(t,e){var n=t.actionableItems.filter((function(t){return t.isCorrect}));return n.every((function(t){return!e(t.id)}))?Vt.w.UnAnswered:n.every((function(t){var n;return t.name.trim().toLowerCase()===(null===(n=e(t.id))||void 0===n?void 0:n.trim().toLowerCase())}))?Vt.w.Correct:Vt.w.Incorrect}function Xt(t,e){return t.actionableItems.every((function(t){return!e(t.id)}))?Vt.w.UnAnswered:t.actionableItems.filter((function(t){return t.isCorrect})).every((function(t){return e(t.id)===t.name}))?Vt.w.Correct:Vt.w.Incorrect}function te(t,e){var n;return t.actionableItems.forEach((function(t){var r=e(t.id);n=r?r.status!==Ht.Correct?r.status!==Ht.Incorrect?Vt.w.AwaitingMarking:Vt.w.Incorrect:Vt.w.Correct:Vt.w.UnAnswered})),n}function ee(t,e){return function(n){var r=e.attempts.find((function(e){return e.id===t.id}));return null==r?void 0:r.answers.find((function(t){return t.id===n}))}}function ne(t,e){var n=ee(t,e);return Xt(t,(function(t){var e=n(t);return null==e?void 0:e.text}))}!function(t){t[t.Incorrect=0]="Incorrect",t[t.Correct=1]="Correct",t[t.PendingReview=2]="PendingReview"}(Ht||(Ht={}));var re=(Kt($t={},Z.InteractionTypeId.Annotation,Qt),Kt($t,Z.InteractionTypeId.Image,Qt),Kt($t,Z.InteractionTypeId.MissingWord,(function(t,e){var n=ee(t,e);return Jt(t,(function(t){var e=n(t);return null==e?void 0:e.text}))})),Kt($t,Z.InteractionTypeId.MultipleChoice,ne),Kt($t,Z.InteractionTypeId.ShortAnswer,(function(t,e){return te(t,ee(t,e))})),Kt($t,Z.InteractionTypeId.TrueOrFalse,ne),$t),oe={notApplicable:Qt,awaitingMarking:function(){return Vt.w.AwaitingMarking},isMissingWordCorrect:Jt,isMultipleChoiceCorrect:Xt,isShortAnswerMarkedCorrect:te,isInteractionCorrect:function(t,e){return(0,re[t.typeId])(t,e)}};function ie(t){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(t)}var ae="cv-missing-word-",ce=n(55452),le=n(83914),ue=n(61252),se=n(20789);var fe=["A","B","C","D"];function de(t){var e=1===t.interaction.actionableItems.filter((function(t){return t.isCorrect})).length;function n(e,n){t.onSelectAnswer&&t.onSelectAnswer(e,n)}return o().createElement(o().Fragment,null,t.interaction.actionableItems.map((function(r,i){var a=t.getSelectedAnswer(r.id);if(t.onlyShowSelectedAnswer&&!a)return o().createElement(o().Fragment,{key:i});var c=a?"bg-info text-white":t.unCheckedBackground,l=function(){return o().createElement(o().Fragment,null,fe[i])};t.showFeedback&&(c=r.isCorrect?"bg-success text-white":"bg-danger text-white ".concat("yodaE"),t.hideFeedbackIcons||(l=function(){return o().createElement(o().Fragment,null,r.isCorrect?o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Check}):o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Close}))}));var u=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&n(r,!a)}};return o().createElement(o().Fragment,{key:i},o().createElement("input",{id:r.id,type:e?"radio":"checkbox",name:"multiple-choice",checked:!!a,onChange:function(){return n(r,!a)},disabled:t.showFeedback,hidden:!0,tabIndex:-1}),o().createElement("label",Object.assign({className:"\n d-block\n rounded-lg\n shadow-sm\n mb-2\n ".concat("sm"===t.size?"p-2":"p-3","\n d-flex\n justify-content-between\n position-relative\n ").concat(t.showFeedback?"":"cursor-pointer","\n ").concat("KpbWq","\n ").concat(c),key:i,htmlFor:r.id},u),o().createElement("span",{className:"d-inline-block mr-3 cv-multiple-choice-bullet"},o().createElement(l,null)),o().createElement("span",{className:"flex-grow-1 pr-4"},r.name),!t.onlyShowSelectedAnswer&&o().createElement("span",{className:"uKRg2"},a&&o().createElement(se.q,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar}))))})))}function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function me(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}de.defaultProps={size:"lg",unCheckedBackground:"bg-white"};function he(t){function e(e){t.onSelectAnswer&&t.onSelectAnswer(e)}return o().createElement("div",{className:"d-flex ".concat(t.className?t.className:""," ").concat("sm"===t.size?"mx-n1":"mx-n2")},t.interaction.actionableItems.map((function(n,r){var i=t.getSelectedAnswer(n.id),a=i?"bg-info text-white":t.unCheckedBackground,c=function(){return o().createElement(o().Fragment,null)};t.showFeedback&&(a=n.isCorrect?"bg-success text-white":"bg-danger text-white ".concat("ZCkyL"),t.hideFeedbackIcons||(c=function(){return o().createElement(o().Fragment,null,n.isCorrect?o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Check}):o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Close}))}));var l=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&e(n)}};return o().createElement("label",Object.assign({key:r,htmlFor:n.id,className:"\n d-inline-block\n rounded-lg\n shadow-sm\n my-0\n position-relative\n overflow-hidden\n ".concat("sm"===t.size?"p-4 mx-1 h5":"p-5 mx-2 h4","\n ").concat(t.showFeedback?"":"cursor-pointer","\n ").concat(a)},l),o().createElement("input",{id:n.id,type:"radio",name:"multiple-choice",checked:!!i,onChange:function(){return e(n)},disabled:t.showFeedback,hidden:!0}),n.name,o().createElement("span",{className:"position-absolute p-2 ".concat("CBgCv")},o().createElement(c,null)),o().createElement("span",{className:"".concat("CVTEm").concat("sm"===t.size?" ".concat("tbPTs"):"")},i&&o().createElement(se.q,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar})))})))}var ve,ye,ge,be,we;function Ee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}he.defaultProps={size:"lg",unCheckedBackground:"bg-white"};var xe=function(){return!0},Ie=function(){return!1},Se=(Ee(ve={},Z.InteractionTypeId.Annotation,Ie),Ee(ve,Z.InteractionTypeId.Image,Ie),Ee(ve,Z.InteractionTypeId.MissingWord,xe),Ee(ve,Z.InteractionTypeId.MultipleChoice,xe),Ee(ve,Z.InteractionTypeId.ShortAnswer,(function(t){return!!t.data.suggestedResponse})),Ee(ve,Z.InteractionTypeId.TrueOrFalse,xe),ve);function ke(t){return Se[t]}var Oe=(Ee(ye={},Z.InteractionTypeId.Annotation,(function(t){var e=t.interaction.data.annotation.replace(/<(a)(.*?)>/g,'<$1 target="_blank" $2>');return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:e}}),o().createElement(Yt,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),Ee(ye,Z.InteractionTypeId.Image,(function(t){var e=t.interaction,n=t.recalculateScroll,r=o().useCallback((function(t){t&&(t.onload=function(){n()})}),[]);return o().createElement("div",{className:"cv-interactive-question cv-image-interactive"},o().createElement("div",{className:"cv-image-container text-center"},o().createElement("img",{className:"img-fluid shadow-lg",src:e.data.url,ref:r}),e.data.caption&&o().createElement(o().Fragment,null,o().createElement("p",{className:"mt-3"},e.data.caption,o().createElement(Yt,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})))))})),Ee(ye,Z.InteractionTypeId.MissingWord,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=r.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat(ae).concat(e,"}")})).split(/{([^{}]*)}/g);function c(t,r){if(r.stopPropagation(),r.target.value){var o,i,a;n((o={},i=t.id,a=r.target.value,i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o))}else{var c=e,l=t.id,u=(c[l],function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(c,["symbol"===ie(l)?l:l+""]));n(u,!0)}}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"mb-2"},a.map((function(t,n){var a;if(!t.startsWith(ae))return t;var l=t.replace(ae,""),u=r.actionableItems.find((function(t){return t.order.toString()===l}));if(u){var s,f,d=e[u.id]||"",p=(s=u.name,(f=document.createElement("canvas").getContext("2d")).font="17pt arial",f.measureText(s).width);if(i){var m=u.name.toLowerCase().toString()===(null===(a=e[u.id])||void 0===a?void 0:a.toLowerCase().toString());return o().createElement(o().Fragment,{key:n},!m&&o().createElement(o().Fragment,null,o().createElement("del",{className:"text-danger"},d)," "),o().createElement("span",{className:"text-success"},u.name))}return o().createElement("span",{className:"cv-missing-word-input-container",key:n},o().createElement("input",{style:{width:p/16+"rem"},onChange:function(t){return c(u,t)},value:d,disabled:!!e.submitted,className:"cv-missing-word-input",autoComplete:"off"}))}}))),o().createElement(Zt,{error:e.error}),o().createElement(Yt,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),Ee(ye,Z.InteractionTypeId.MultipleChoice,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=t.imageApi,c=t.currentUser,l=1===r.actionableItems.filter((function(t){return t.isCorrect})).length;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,r.name,o().createElement(Yt,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),!l&&o().createElement("p",{className:"text-muted"},o().createElement("small",null,"This question has multiple correct answers")),o().createElement(de,{interaction:r,showFeedback:i,onSelectAnswer:function(t,r){if(!e.submitted)if(l)n(me({},t.id,t.name),!0);else if(r)n(me({},t.id,t.name));else{var o=e,i=t.id,a=(o[i],function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(o,["symbol"===pe(i)?i:i+""]));n(a,!0)}},getSelectedAnswer:function(t){return e[t]},imageApi:a.toString(),userInitials:ce.l.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),o().createElement(Zt,{error:e.error}))})),Ee(ye,Z.InteractionTypeId.ShortAnswer,(function(t){var e=t.interaction,n=t.state,r=t.setState;return t.showFeedback?o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,e.name),o().createElement("label",{className:"cv-interaction-field-label"},"My answer"),o().createElement("p",null,n[e.actionableItems[0].id]),e.data.suggestedResponse&&o().createElement(o().Fragment,null,o().createElement("label",{className:"cv-interaction-field-label mt-1"},"Teacher's suggested answer"),o().createElement("p",null,e.data.suggestedResponse))):o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,e.name,o().createElement(Yt,{interaction:e,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o().createElement(rt.Z,{id:"short-answer-answer",className:"form-control mt-2",minRows:3,value:n[e.actionableItems[0].id]||"",onChange:function(t){var o,i,a;r(Object.assign(Object.assign({},n),(o={},i=e.actionableItems[0].id,a=t.target.value,i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o)))},disabled:!!n.submitted}),o().createElement(Zt,{error:n.error}))})),Ee(ye,Z.InteractionTypeId.TrueOrFalse,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=t.imageApi,c=t.currentUser,l=r.actionableItems.find((function(t){return t.isCorrect}));return o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,r.name,o().createElement(Yt,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o().createElement(he,{className:"justify-content-center",interaction:r,showFeedback:i,onSelectAnswer:function(t){var r,o,i;e.submitted||n((r={},o=t.id,i=t.name,o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r),!0)},getSelectedAnswer:function(t){return e[t]},imageApi:a.toString(),userInitials:ce.l.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),i&&o().createElement("div",{className:"text-center px-5 mt-3"},o().createElement("p",null,"The answer is ",o().createElement("strong",null,l.name)),r.data.feedback&&o().createElement("p",null,r.data.feedback)),o().createElement(Zt,{error:e.error}))})),ye);function Ce(){return""}var Ne=(Ee(ge={},Z.InteractionTypeId.Annotation,Ce),Ee(ge,Z.InteractionTypeId.Image,Ce),Ee(ge,Z.InteractionTypeId.MissingWord,(function(t,e){var n=Object.keys(t).filter((function(e){var n;return!!(null===(n=t[e])||void 0===n?void 0:n.trim())})).length;return n?n!==e.actionableItems.length?"Please fill in all of the missing words":null:"Please fill in the missing words"})),Ee(ge,Z.InteractionTypeId.MultipleChoice,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),Ee(ge,Z.InteractionTypeId.ShortAnswer,(function(t){return Object.keys(t).filter((function(e){var n;return!!(null===(n=t[e])||void 0===n?void 0:n.trim())})).length?null:"Please provide an answer to the question"})),Ee(ge,Z.InteractionTypeId.TrueOrFalse,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),ge),je=(Ee(be={},Z.InteractionTypeId.Annotation,null),Ee(be,Z.InteractionTypeId.Image,null),Ee(be,Z.InteractionTypeId.MissingWord,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),Ee(be,Z.InteractionTypeId.MultipleChoice,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),Ee(be,Z.InteractionTypeId.ShortAnswer,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),Ee(be,Z.InteractionTypeId.TrueOrFalse,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),be);function Le(t){return je[t]}var Te=(Ee(we={},Z.InteractionTypeId.Annotation,oe.notApplicable),Ee(we,Z.InteractionTypeId.Image,oe.notApplicable),Ee(we,Z.InteractionTypeId.MissingWord,(function(t,e){return oe.isMissingWordCorrect(e,(function(e){return t[e]}))})),Ee(we,Z.InteractionTypeId.MultipleChoice,(function(t,e){return oe.isMultipleChoiceCorrect(e,(function(e){return t[e]}))})),Ee(we,Z.InteractionTypeId.ShortAnswer,oe.awaitingMarking),Ee(we,Z.InteractionTypeId.TrueOrFalse,(function(t,e){return e.actionableItems.filter((function(t){return t.isCorrect})).every((function(e){return t[e.id]===e.name}))?Vt.w.Correct:Vt.w.Incorrect})),we);function Ae(t){return Te[t]}function Pe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _e={interactions:{},timepoints:{}};function Fe(t,e){return"interaction"===e.type?{timepoints:t.timepoints,interactions:Object.assign(Object.assign({},t.interactions),Pe({},e.id,e.value))}:"timepoint"===e.type?{interactions:t.interactions,timepoints:Object.assign(Object.assign({},t.timepoints),Pe({},e.id,e.value))}:void 0}function Re(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Me={interactionIndex:0},Ue=function(t){var e,n,r=t.mode,i=t.timepoint,a=t.latestSession,c=r===u.InteractiveMode.Create,l=o().useReducer(Fe,null,(function(){return function(t){return t?{timepoints:{},interactions:t.actions.reduce((function(t,e){var n;return t[e.interactionId]=Object.assign(Object.assign({},t[e.interactionId]),(Pe(n={},e.actionableItemId,e.data),Pe(n,"submitted",!0),n)),t}),{})}:_e}(a)})),s=(n=2,function(t){if(Array.isArray(t))return t}(e=l)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Re(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=s[0],d=s[1],p=g(null==i?void 0:i.id),m=null==i?void 0:i.interactions[p.interactionIndex],h="number"==typeof p.nextInteractionIndex?null==i?void 0:i.interactions[p.nextInteractionIndex]:null,v=b(null==m?void 0:m.id),y=b(null==h?void 0:h.id);function g(t){return t&&f.timepoints[t]||Me}function b(t){if(!t)return{};var e=f.interactions[t];return e||c?e:{}}function w(t,e,n){var r=b(t);d({type:"interaction",id:t,value:Object.assign(Object.assign({},n?{}:r),e)})}return{state:f,interaction:m,interactionState:v,timepointState:p,nextInteraction:h,nextInteractionState:y,getTimepointState:g,getInteractionState:b,updateTimepointState:function(t,e){var n=g(t);d({type:"timepoint",id:t,value:Object.assign(Object.assign({},n),e)})},updateInteractionState:w,clearTimepointState:function(t){d({type:"timepoint",id:t,value:void 0})},clearInteractionState:function(t){d({type:"interaction",id:t,value:void 0})},userUpdateInteractionState:function(t,e){w(m.id,Object.assign(Object.assign({},t),{hasChanges:!0,error:null}),e)}}};function De(t){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(t)}function Ge(){Ge=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==De(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var qe=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function c(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((r=r.apply(t,e||[])).next())}))},Be=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},We=!1;function ze(t){var e="".concat(t.className," ").concat("Mr0S0");t.children?e+=" ".concat("vHTVo"):e+=" ".concat("vIGn0");var n=o().createElement(le.x,{svgName:t.svgName,className:"cDUaE"});return o().createElement(V.L,{className:e,onClick:t.onClick},n,t.children)}function Ye(t){var e=t.isCreate,n=t.open,r=t.showTypeSelector;return!e||n?o().createElement(o().Fragment,null):o().createElement(ze,{className:"btn btn-outline-dark cv-add-question",onClick:r,svgName:ue.vn.Plus},"Add question")}var Ze=n(80181),He=n(5266),$e=n(99705);function Ve(t){return o().createElement("div",{className:"my-5 text-center"},o().createElement("h2",{className:"h3"},"Select an interaction to get started"),o().createElement("p",{className:"mb-0"},"Choose a point in the video and add a question to interact and engage your students."),!(!t.supportSiteUrl||!t.currentUser)&&o().createElement("a",{href:He.o.getArticle(t.supportSiteUrl.toString(),$e.w.MakeInteractive,t.currentUser.countryCode,"articles"),target:"_blank",className:"btn btn-link text-info"},"How do I make interactives?"))}function Ke(t){var e=t.isCreate,n=t.interactive,r=t.interaction,i=t.portalNode,a=t.goToTimepoint,c=t.promptDelete,l=t.supportSiteUrl,u=t.currentUser;if(!i)return o().createElement(o().Fragment,null);var s=n.timepoints.reduce((function(t,e){return t+e.interactions.length}),0);return o().createElement(H.Nq,{node:i},s?o().createElement(o().Fragment,null,o().createElement("h2",{className:"h4 mt-3"},"Question List (",s,")"),o().createElement(Ze.Z,{interactive:n,maxHeight:300,goToTimepoint:a,selectedInteractionId:null==r?void 0:r.id,onClickDelete:e?c:void 0})):e?o().createElement(Ve,{currentUser:u,supportSiteUrl:l}):o().createElement(o().Fragment,null))}var Qe=n(4234);var Je=n(42503);function Xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var tn=[Z.InteractionTypeId.MissingWord,Z.InteractionTypeId.MultipleChoice,Z.InteractionTypeId.TrueOrFalse,Z.InteractionTypeId.ShortAnswer,Z.InteractionTypeId.Image,Z.InteractionTypeId.Annotation];function en(t){var e,n,r=t.addInteraction,i=t.cancelTypeSelector,a=t.player,c=t.timepoint,l=t.open,u=t.isCreate,f=t.interaction,d=(e=o().useState((0,Je.m)(a.currentTime()||0)),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Xe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=d[0],m=d[1];return o().useEffect((function(){var t=function(){m((0,Je.m)(a.currentTime()))};return a.on("timeupdate",t),function(){return a.off("timeupdate",t)}}),[]),f||!u?o().createElement(o().Fragment,null):o().createElement("div",{className:"d-flex align-items-center justify-content-center h-100"},o().createElement("div",{className:"cv-interactive-type-selector d-flex flex-wrap justify-content-center align-items-center"},o().createElement("div",{className:"text-center font-weight-bold w-100 text-body mb-3 cv-add-question-copy"},c?"Add another question at:":"Add a question at:"," ",p),tn.map((function(t,e){var n=s.w.getTypeInfo(t),i=n.name,a=n.bgClassName,c=n.Svg;return o().createElement(V.L,{key:e,className:"cv-type-selector rounded py-2 m-1 ".concat(a),onClick:function(){return r(t)}},o().createElement("span",{className:"cv-create-type-icon mb-1"},o().createElement(c,null)),o().createElement("div",{className:"d-flex align-items-center justify-content-center cv-interaction-type-name px-1"},i))})),(c||l)&&o().createElement("div",{className:"text-center w-100 mt-2 ".concat(c?"":"cv-adding-first-cancel")},o().createElement(V.L,{className:"btn btn-link",onClick:i},"Cancel"))))}function nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rn(t){var e,n,r=t.typeId,i=t.currentIndex,a=t.numberOfInteractions,c=t.changeIndex,l=t.player,u=(e=o().useState((0,Je.m)(l.currentTime()||0)),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nn(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=u[0],d=u[1];o().useEffect((function(){var t=function(){d((0,Je.m)(l.currentTime()))};return l.on("timeupdate",t),function(){return l.off("timeupdate",t)}}),[]);var p=s.w.getTypeInfo(r),m=p.name,h=p.bgClassName,v=i<a-1,y=i>0;return o().createElement("div",{className:"text-center d-flex justify-content-between align-items-center p-1 ".concat(h)},o().createElement(V.L,{onClick:function(){y&&c(i-1)},className:y?"":"invisible"},o().createElement(le.x,{size:le.S.Medium,svgName:ue.vn.ChevronLeft})),o().createElement("div",null,o().createElement("div",{className:"h6 mb-0"},m),a>1&&o().createElement("div",null,i+1," of ",a," at ",f)),o().createElement(V.L,{onClick:function(){v&&c(i+1)},className:v?"":"invisible"},o().createElement(le.x,{size:le.S.Medium,svgName:ue.vn.ChevronRight})))}function on(t){var e=t.typeId,n=s.w.getTypeInfo(e),r=n.name,i=n.prompt,a=n.bgClassName,c=n.Svg;return o().createElement("div",{className:"text-center text-body d-flex justify-content-between align-items-center px-3 pt-3"},o().createElement("div",{className:"d-flex align-items-center"},o().createElement("span",{className:"cv-interaction-icon rounded my-1 text-white ".concat(a)},o().createElement(c,null)),o().createElement("span",{className:"text-left flex-grow-1"},o().createElement("div",{className:"h5 ".concat(i?"":"mb-0")},o().createElement("strong",null,r)),i&&o().createElement("div",{className:"h6 mb-0"},i))))}function an(t){var e=t.isCreate,n=t.interaction,r=t.player,i=t.changeIndex,a=t.timepointState,c=t.timepoint;return e?o().createElement(rn,{typeId:n.typeId,changeIndex:i,player:r,currentIndex:a.interactionIndex,numberOfInteractions:c.interactions.length}):o().createElement(on,{typeId:n.typeId})}var cn=n(99910);function ln(t){var e=t.interaction,n=t.interactionState,o=t.onClickContinue,i=t.onClickSave,a=t.onClickCancel,c=t.onClickAddAnother,l=t.onClickDiscard,u=_(e.id),s=!!(null==n?void 0:n.hasChanges),f=!!(null==n?void 0:n.spinner);return r.createElement("div",{className:"cv-timpoint-button-container"},u?r.createElement(V.L,{className:"btn btn-link",onClick:a},"Cancel"):s?r.createElement(V.L,{className:"btn btn-link",onClick:l},"Discard"):r.createElement(V.L,{className:"btn btn-link",onClick:c},"Add another question"),f?r.createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):u?s?r.createElement(V.L,{className:"btn btn-dark ml-2",onClick:i},"Save"):r.createElement(V.L,{className:"btn btn-dark ml-2 disabled",onClick:function(){}},"Save"):s?r.createElement(V.L,{className:"btn btn-dark ml-2",onClick:i},"Save"):r.createElement(ze,{className:"btn btn-dark ml-2",onClick:o,svgName:ue.vn.Play},"Continue"))}function un(t){var e=t.typeId,n=t.interactionState,o=t.onClickSkip,i=t.numberOfInteractions,a=t.currentIndex,c=t.changeIndex,l=!!(null==n?void 0:n.submitted),u=!!(null==n?void 0:n.hasChanges),s=!!(null==n?void 0:n.spinner),f=!!Le(e),d=a<i-1;var p=a>0;return r.createElement("div",{className:"cv-timpoint-button-container flex-wrap"},!l&&f&&r.createElement(V.L,{className:"btn btn-link",onClick:o},"Come back later"),i>1&&a>0&&r.createElement(ze,{className:"btn btn-dark ml-2 ".concat(p?"":"disabled"),onClick:function(){p&&c(a-1)},svgName:ue.vn.ChevronUp}),s?r.createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):l||!f?1===i||a===i-1?r.createElement(ze,{className:"btn btn-dark ml-2",onClick:o,svgName:ue.vn.Play},"Continue"):r.createElement(V.L,{className:"btn btn-dark ml-2 ".concat(d?"":"disabled"),onClick:function(){d&&c(a+1)}},"Next"):r.createElement(V.L,{className:"btn btn-dark ml-2 ".concat(u?"":"disabled"),onClick:function(){u&&t.onClickSubmit()}},"Save"))}function sn(t){var e=t.isCreate,n=t.interaction,r=t.interactionState,i=t.continueInteractive,a=t.saveInteraction,c=t.cancel,l=t.addAnotherQuestion,u=t.discardChanges,s=t.submitInteractionAnswer,f=t.onClickSkip,d=t.changeIndex,p=t.timepoint,m=t.currentIndex;return o().createElement(o().Fragment,null,e?o().createElement(ln,{interaction:n,interactionState:r,onClickContinue:i,onClickSave:a,onClickCancel:c,onClickAddAnother:l,onClickDiscard:function(){return u()}}):o().createElement(un,{typeId:n.typeId,interactionState:r,onClickSubmit:s,onClickSkip:f,changeIndex:d,currentIndex:m,numberOfInteractions:p.interactions.length}))}var fn=n(86509);function dn(t){var e=t.timepoint,n=t.interaction,r=t.promptDelete,i=t.optionsPortalNode,a=t.setView;if(!n)return o().createElement(o().Fragment,null);var c=[];if(c.push({label:"Move time point",onClick:function(){return a("move")}}),e.interactions.length>1){var l=_(n.id);c.push({label:"Re-order questions",onClick:function(){return a("reorder")},className:l?"disabled":""})}return c.push({label:"Delete",onClick:function(){return r(n.id)},className:"text-danger"}),o().createElement(H.Nq,{node:i},!!n&&o().createElement(fn.m,{actions:c}))}function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function mn(){mn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==pn(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function hn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var yn=null,gn=0,bn=1;function wn(t){var e=t.timepoint,n=t.updateTimepointTime,r=t.saveTimepoint,i=t.back,a=t.clearTimepointTimeState,c=hn(o().useState((0,Je.m)(e.visibleAt/1e3)),2),l=c[0],u=c[1],s=hn(o().useState(!1),2),f=s[0],d=s[1];function p(t){n(t*bn),u((0,Je.m)(e.visibleAt/1e3)),2==++gn?bn=5:4===gn?bn=20:6===gn?bn=60:8===gn&&(bn=120),yn||(yn=window.setInterval((function(){return p(t)}),200),window.addEventListener("mouseup",m))}function m(){window.removeEventListener("mouseup",m),window.clearInterval(yn),yn=null,gn=0,bn=1}return o().useEffect((function(){return m}),[]),o().createElement(o().Fragment,null,o().createElement("div",{className:"cv-timepoint flex-grow-1"},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{className:"cv-interactive-question"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Move time point"),o().createElement("div",{className:"text-center mt-3"},o().createElement(V.L,{className:"cv-left-arrow d-inline-block cursor-pointer",onClick:function(){},onMouseDown:function(){return p(-1)},onKeyDown:function(t){t.stopPropagation(),13===t.keyCode&&0===gn&&p(-1)},onKeyUp:m}),o().createElement("input",{className:"form-control text-center d-inline-block cv-move-timepoint-input",value:l,onChange:function(){},onKeyDown:function(t){t.stopPropagation(),37===t.keyCode&&0===gn&&p(-1),39===t.keyCode&&0===gn&&p(1)},onKeyUp:m}),o().createElement(V.L,{className:"cv-right-arrow d-inline-block cursor-pointer",onClick:function(){},onMouseDown:function(){return p(1)},onKeyDown:function(t){t.stopPropagation(),13===t.keyCode&&0===gn&&p(1)},onKeyUp:m}))))),o().createElement("div",{className:"cv-timpoint-button-container"},o().createElement(V.L,{className:"btn btn-link",onClick:function(){a(!0),i()}},"Cancel"),f?o().createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o().createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement(V.L,{className:"btn btn-dark",onClick:function(){return t=this,e=void 0,n=void 0,o=mn().mark((function t(){return mn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.next=3,r();case 3:i();case 4:case"end":return t.stop()}}),t)})),new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function c(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}},"Save")))}var En=n(679);var xn=n(86572);function In(t){return In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(t)}function Sn(){Sn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==In(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function kn(t){return function(t){if(Array.isArray(t))return Nn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function On(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||Cn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cn(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var jn=(0,En.SortableElement)((function(t){var e=t.interaction,n=s.w.getTypeInfo(e.typeId).bgClassName;return o().createElement("div",{className:"py-2 text-left"},o().createElement("span",{className:"fB8W8"},o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Handle})),o().createElement(xn.y,{interaction:e,iconClassName:"".concat("GSE1a"," ").concat(n),questionClassName:"".concat("qKMzc"," clamp-1")}))})),Ln=(0,En.SortableContainer)((function(t){var e=t.interactions,n=function(){var t=o().useRef();function e(){document.body.style.cursor="",document.removeEventListener("mouseup",e),t.current&&(t.current.style.cursor="grab")}return{ref:t,style:{cursor:"grab"},onMouseDown:function(){document.body.style.cursor="grabbing",document.addEventListener("mouseup",e),t.current&&(t.current.style.cursor="grabbing")},onMouseUp:e}}();return o().createElement("div",Object.assign({tabIndex:0},n),e.map((function(t,e){return o().createElement(jn,{key:t.id,index:e,interaction:t})})))}));function Tn(t){var e=On(o().useState(!1),2),n=e[0],r=e[1],i=On(o().useState(kn(t.interactions)),2),a=i[0],c=i[1],l=On(o().useState(!1),2),u=l[0],s=l[1];return o().createElement(o().Fragment,null,o().createElement("div",{className:"cv-timepoint flex-grow-1"},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{className:"cv-interactive-question"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Re-order questions"),o().createElement("div",{className:"text-center mt-3"},o().createElement(Ln,{onSortEnd:function(t){var e=t.oldIndex,n=t.newIndex;e!==n&&(c(kn(function(t,e,n){for(;e<0;)e+=t.length;for(;n<0;)n+=t.length;if(n>=t.length)for(var r=n-t.length+1;r--;)t.push(void 0);return t.splice(n,0,t.splice(e,1)[0]),t}(a,e,n))),s(!0))},interactions:a,helperClass:"jGy0h",lockAxis:"y"}))))),o().createElement("div",{className:"cv-timpoint-button-container"},o().createElement(V.L,{className:"btn btn-link",onClick:function(){c(kn(t.interactions)),s(!1),t.back()}},"Cancel"),n?o().createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o().createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement(V.L,{className:"btn btn-dark ".concat(u?"":"disabled"),onClick:function(){return e=this,n=void 0,o=void 0,i=Sn().mark((function e(){return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=2;break}return e.abrupt("return");case 2:return r(!0),e.next=5,t.reOrderQuestions(a);case 5:r(!1),t.back();case 7:case"end":return e.stop()}}),e)})),new(o||(o=Promise))((function(t,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function c(t){try{l(i.throw(t))}catch(t){r(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i}},"Save")))}var An=n(3747),Pn=n(86764);function _n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rn(t){var e=t.isCreate,n=t.interaction,r=t.mode,i=t.immediateFeedback,a=t.interactionState,c=t.shouldFocus,l=t.delayFocus,s=t.open,f=t.timepoint,d=t.userUpdateInteractionState,p=t.submitInteractionAnswer,m=t.saveInteraction,h=t.skip,v=o().useRef(),y=o().useRef(),g=o().useRef(0),b=(0,An.a)(Pn.r.XLDown),w=!e||b;function E(){return!!v.current&&!!c&&!!s}function x(){v.current&&(v.current.focus(),k(!0))}var I=_n(o().useState(!1),2),S=I[0],k=I[1];o().useEffect((function(){E()&&(S||(l&&w?g.current=window.setTimeout((function(){g.current=0,E()&&x()}),400):x()))}),[v.current,S]);var O=_n(o().useState("question"),2),C=O[0],N=O[1],j=o().useMemo((function(){return(0,H.oD)()}),[]),L=n?function(t,e){if(e===u.InteractiveMode.Create)return function(t){return Ut[t]}(t);if(e===u.InteractiveMode.View)return function(t){return Oe[t]}(t);throw new Error("Cannot find components for the mode ".concat(e))}(n.typeId,r):null,T=i;return e||(T=T&&(null==a?void 0:a.submitted)),o().createElement(o().Fragment,null,o().createElement(dn,Object.assign({optionsPortalNode:j,setView:N},t)),o().createElement(Qe.Z,{style:{height:"100%"},ref:y},o().createElement(en,Object.assign({},t)),!!n&&o().createElement("div",{className:"d-flex flex-column h-100"},o().createElement(an,Object.assign({},t)),"question"===C&&o().createElement(o().Fragment,null,o().createElement("form",{className:"cv-timepoint flex-grow-1",tabIndex:-1,onSubmit:function(t){t.preventDefault(),e?m():p()}},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{ref:v,tabIndex:0}),o().createElement(L,Object.assign({state:a,setState:d,recalculateScroll:function(){y.current.recalculate()},showFeedback:T,optionsPortalNode:j},t)))),o().createElement(sn,Object.assign({onClickSkip:function(){g.current&&window.clearTimeout(g.current),h()}},t))),"move"===C&&o().createElement(wn,Object.assign({back:function(){return N("question")}},t)),"reorder"===C&&o().createElement(Tn,Object.assign({back:function(){return N("question")},interactions:f.interactions},t)))))}function Mn(t){var e=t.open,n=t.nextInteraction,r=t.nextInteractionState,i=t.timepointState,a=t.interaction,c=t.delayFocus,l=n&&i.nextInteractionIndex<i.interactionIndex,u=n&&i.nextInteractionIndex>i.interactionIndex,s=u&&i.slideIn,f=l&&i.slideIn;return o().createElement("div",{className:"cv-interactive ".concat(e?"cv-open":"")},l&&o().createElement("div",{className:"cv-prev-interaction ".concat(i.slideIn?"cv-slide-in":"")},o().createElement(Rn,Object.assign({},t,{currentIndex:i.nextInteractionIndex,interaction:n,interactionState:r}))),o().createElement("div",{className:"\n cv-main-slide\n ".concat(s?"cv-slide-out-up":"","\n ").concat(f?"cv-slide-out-down":"","\n ").concat(n?"cv-transitioning":"","\n ")},o().createElement(Rn,Object.assign({key:null==a?void 0:a.id},t,{currentIndex:i.interactionIndex,shouldFocus:a&&!l&&!u,delayFocus:c}))),u&&o().createElement("div",{className:"cv-next-interaction ".concat(i.slideIn?"cv-slide-in":"")},o().createElement(Rn,Object.assign({},t,{currentIndex:i.nextInteractionIndex,interaction:n,interactionState:r}))))}function Un(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Dn(t){var e,n,r=t.player,i=t.resultsService,a=t.interactive,c=t.setShowSummary,l=t.mobile,u=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Un(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Un(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],f=u[1],d=t.player.activePlugins_.activityStatusPlugin,p=t.player.activePlugins_.favouritePlugin;function m(){r.currentTime()>a.timepoints[a.timepoints.length-1].visibleAt/1e3+1?f(!0):f(!1)}if(o().useEffect((function(){if(i&&!l)return r.on("timeupdate",m),function(){return r.off("timeupdate",m)}}),[]),!s)return null;var h="btn btn-outline-dark cv-show-summary";return p&&(h+=" cv-has-favourite-plugin"),d&&(h+=" cv-has-activity-status-plugin"),o().createElement(V.L,{className:h,onClick:function(){c(!0),r.pause(),r.hide()}},r.gradePassbackPlugin().enabled?"Submit answers":"View summary")}function Gn(t){var e=t.interactive,n=t.duration;return n?o().createElement(o().Fragment,null,e.timepoints.map((function(e,r){if(!e.interactions.length)return o().createElement(o().Fragment,null);var i=s.w.getTypeInfo(e.interactions[0].typeId).bgClassName,a=e.visibleAt/1e3/n*100;return o().createElement("span",{key:r,className:"".concat("pUo8u"," ").concat(i),style:{left:"".concat(a,"%")},onClick:function(n){return r=e.id,o=e.interactions[0].id,n.stopPropagation(),void t.goToTimepoint(r,o);var r,o}})}))):o().createElement(o().Fragment,null)}var qn=n(10874),Bn=n(78276);function Wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zn(t){var e,n,r=t.duration,i=t.progress,a=t.player,c=(e=o().useState(i.length),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Wn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wn(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1],l=[];if(i.length){var u=i[0];l.push(u),i.forEach((function(t,e){0!==e&&(u.end.time+1>t.start.time&&u.start.time<t.start.time?u.end=t.end:(u=t,l.push(u)))}))}return o().useEffect((function(){var t=function(){c(i.length)};return a.on("progressflush",t),function(){return a.off("progressflush",t)}}),[]),o().createElement(o().Fragment,null,l.map((function(t,e){var n=t.start.time/r*100,i=100*(1-t.end.time/r);return o().createElement("span",{key:e,className:"BnKli",style:{left:"".concat(n,"%"),right:"".concat(i,"%")}})})))}function Yn(t){return ct.m.last(t.results)}function Zn(t,e){return ct.m.findWhere(null==e?void 0:e.attempts,{id:t})}var Hn="cv-missing-word-";const $n="Y7ls8";var Vn;function Kn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qn=function(){return o().createElement(o().Fragment,null)},Jn=(Kn(Vn={},Z.InteractionTypeId.Annotation,Qn),Kn(Vn,Z.InteractionTypeId.Image,Qn),Kn(Vn,Z.InteractionTypeId.MissingWord,(function(t){var e=t.interaction.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat(Hn).concat(e,"}")})).split(/{([^{}]*)}/g),n="p-2";return t.reportsStyling||(n+=" border rounded"),o().createElement("div",{className:n},e.map((function(e,n){if(!e.startsWith(Hn))return e;var r=e.replace(Hn,""),i=t.interaction.actionableItems.find((function(t){return t.order.toString()===r}));if(i){var a=t.answers.find((function(t){return t.id==i.id}));if(a){if(!t.showFeedback)return o().createElement("strong",{key:n,className:"text-info"},a.text);var c=a.status===Ht.Correct;return o().createElement(o().Fragment,{key:n},!c&&o().createElement(o().Fragment,null,o().createElement("del",{className:"text-danger"},o().createElement("strong",null,a.text))," "),o().createElement("strong",{className:"text-success"},i.name))}}})))})),Kn(Vn,Z.InteractionTypeId.MultipleChoice,(function(t){var e,n,r,i,a="my-2";return t.reportsStyling&&(a+=" mx-2"),o().createElement("div",{className:a},o().createElement(de,{interaction:t.interaction,showFeedback:t.showFeedback,getSelectedAnswer:function(e){var n=t.answers.find((function(t){return t.id==e}));return null==n?void 0:n.text},imageApi:t.imageCdnUrl,userInitials:t.anonymisedUserName?ce.l.getInitialsFromFullName(t.anonymisedUserName):ce.l.getInitials(null===(e=t.user)||void 0===e?void 0:e.name,null===(n=t.user)||void 0===n?void 0:n.surname),userAvatar:t.anonymisedUserName?null:null===(i=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===i?void 0:i.url,onlyShowSelectedAnswer:!t.showAvatar,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat($n," text-white")}))})),Kn(Vn,Z.InteractionTypeId.TrueOrFalse,(function(t){var e,n,r,i,a="justify-content-start";return t.reportsStyling&&(a="justify-content-center"),o().createElement("div",{className:"my-2"},o().createElement(he,{className:a,interaction:t.interaction,showFeedback:t.showFeedback,hideFeedbackIcons:!t.showAvatar,getSelectedAnswer:function(e){var n=t.answers.find((function(t){return t.id==e}));return null==n?void 0:n.text},imageApi:t.imageCdnUrl,userInitials:t.anonymisedUserName?ce.l.getInitialsFromFullName(t.anonymisedUserName):ce.l.getInitials(null===(e=t.user)||void 0===e?void 0:e.name,null===(n=t.user)||void 0===n?void 0:n.surname),userAvatar:t.anonymisedUserName?null:null===(i=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===i?void 0:i.url,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat($n," text-white")}))})),Kn(Vn,Z.InteractionTypeId.ShortAnswer,(function(t){var e=ct.m.first(t.answers);if(!e)return o().createElement(o().Fragment,null);var n="rounded p-2 mb-2";return t.reportsStyling||(n+=" bg-info text-white"),o().createElement("div",{className:n},e.text)})),Vn),Xn=n(23481).T.encloseNamespace("interactives.responseTypes");function tr(){return o().createElement("p",{className:"p-2"},o().createElement("em",null,Xn("noResponse")))}function er(t){return o().createElement(o().Fragment,null,t.correctness===Vt.w.Correct&&o().createElement("div",{className:"ml-2 text-success"},o().createElement(le.x,{svgName:ue.vn.Check})),t.correctness===Vt.w.Incorrect&&o().createElement("div",{className:"ml-2 text-danger"},o().createElement(le.x,{svgName:ue.vn.Close})))}function nr(t){return o().createElement("div",{className:"d-flex align-items-center justify-content-between"},o().createElement("strong",null,t.anonymisedUserName||ce.l.getFullName(t.studentResults.user)),o().createElement(er,{correctness:t.correctness}))}function rr(t){return t.correctness!==Vt.w.AwaitingMarking?o().createElement(o().Fragment,null):o().createElement("div",{className:"d-flex justify-content-end mt-1"},o().createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===Ht.Correct?"text-success":"")},o().createElement(le.x,{svgName:t.markedStatus===Ht.Correct?ue.vn.CheckCircle:ue.vn.CheckCircleOutline,onClick:function(){return t.markInteraction(t.studentAttempt.answers,Ht.Correct)}})),o().createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===Ht.Incorrect?" text-danger":"")},o().createElement(le.x,{svgName:t.markedStatus===Ht.Incorrect?ue.vn.CrossCircleFilled:ue.vn.CrossCircle,onClick:function(){return t.markInteraction(t.studentAttempt.answers,Ht.Incorrect)}})))}function or(t){var e,n,r,i,a,c=Jn[t.interaction.typeId];if(!c)return o().createElement(o().Fragment,null);var l=Yn(t.studentResults),u=Zn(t.interaction.id,l),s=oe.isInteractionCorrect(t.interaction,l);return o().createElement("div",{className:"rounded ".concat(null!==(e=t.className)&&void 0!==e?e:"")},o().createElement("div",{className:"d-flex"},!!t.showStudentDetails&&o().createElement("div",{className:"mr-2"},o().createElement("div",{className:"FEdgT"},o().createElement(se.q,{imageCdnUrl:t.imageCdnUrl,initials:t.anonymisedUserName?ce.l.getInitialsFromFullName(t.anonymisedUserName):ce.l.getInitials(null===(n=t.studentResults.user)||void 0===n?void 0:n.name,null===(r=t.studentResults.user)||void 0===r?void 0:r.surname),imageUrl:t.anonymisedUserName?null:null===(a=null===(i=t.studentResults.user)||void 0===i?void 0:i.avatar)||void 0===a?void 0:a.url}))),o().createElement("div",{className:"flex-grow-1"},!!t.showStudentDetails&&o().createElement(nr,{studentResults:t.studentResults,correctness:s,anonymisedUserName:t.anonymisedUserName}),o().createElement("div",{className:"d-flex justify-content-between"},o().createElement("div",{className:"flex-grow-1 ".concat(t.responseComponentClass?t.responseComponentClass:"")},u?o().createElement(c,{interaction:t.interaction,answers:u.answers,imageCdnUrl:t.imageCdnUrl,user:t.studentResults.user,showFeedback:t.showFeedback,showAvatar:t.showAvatar,reportsStyling:t.reportsStyling}):o().createElement(tr,null)),!t.showStudentDetails&&o().createElement(er,{correctness:s})))),o().createElement(rr,{studentAttempt:u,correctness:s,markInteraction:t.markInteraction,markedStatus:t.markedStatus}))}function ir(t){var e=t.studentResults,n=t.interaction,r=t.timepoint,i=t.interactive,a=t.state,c=t.goToTimepoint,l=t.interactionNumber,u=t.imageCdnUrl,s=Yn(e),f=Zn(n.id,s),d=a.interactions[n.id],p=Ae(n.typeId)(d||{},n),m=n.typeId!==Z.InteractionTypeId.Annotation&&n.typeId!==Z.InteractionTypeId.Image,h=m;n.typeId===Z.InteractionTypeId.MissingWord&&f&&(h=!1);var v=n.data.suggestedResponse||n.data.feedback;return o().createElement("li",{className:"mb-3 position-relative"},o().createElement("div",{className:"d-flex flex-wrap mb-2 cursor-pointer",onClick:function(){return c(r.id,n.id)}},i.immediateFeedback&&o().createElement("div",{className:"O6oD6"},!!f&&(p===Vt.w.AwaitingMarking?o().createElement("span",{className:"text-muted font-italic"},"Waiting to be marked"):p===Vt.w.Correct?o().createElement("span",{className:"text-success"},"Correct ",o().createElement(le.x,{className:"svg-container align-middle",svgName:ue.vn.Check})):p===Vt.w.Incorrect&&o().createElement("span",{className:"text-danger"},"Incorrect ",o().createElement(le.x,{className:"svg-container align-middle",svgName:ue.vn.Close})))),o().createElement(xn.y,{interaction:n,iconClassName:"flex-shrink-0",showQuestion:h,showTypeName:!0,questionClassName:"d-block w-100 mt-2",questionNumber:l})),m&&!f&&o().createElement("button",{className:"btn btn-dark",onClick:function(){return c(r.id,n.id)}},"Answer question"),f&&m&&o().createElement(or,{interaction:n,studentResults:e,markedStatus:Ht.PendingReview,markInteraction:function(){},imageCdnUrl:u,showFeedback:i.immediateFeedback,showAvatar:!0}),i.immediateFeedback&&f&&v&&o().createElement("div",{className:"bg-light rounded p-2"},o().createElement("div",null,o().createElement("strong",null,n.typeId===Z.InteractionTypeId.TrueOrFalse?"Teacher's feedback":"Teacher's suggested response")),v))}function ar(t){return function(t){if(Array.isArray(t))return lr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||cr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(t,e){if(t){if("string"==typeof t)return lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lr(t,e):void 0}}function lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ur(t){var e,n,r=t.showSummary,i=t.setShowSummary,a=t.state,c=t.interactive,l=t.player,u=t.progress,s=t.portalNode,f=o().useRef(),d=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||cr(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=d[0],m=d[1];function h(){i(!1),l.show(),l.play()}function v(e,n){h(),t.goToTimepoint(e,n)}if(!s||!r)return o().createElement(o().Fragment,null);var y=function(t){var e=t.state,n=0,r=0,o=0,i=!1,a=[];return t.interactive.timepoints.forEach((function(t){t.interactions.forEach((function(t){var c=e.interactions[t.id],l=Ae(t.typeId)(c||{},t);l===Vt.w.Correct&&n++,l!==Vt.w.NotApplicable&&r++,l!==Vt.w.NotApplicable&&(null==c?void 0:c.submitted)&&o++,l===Vt.w.AwaitingMarking&&(i=!0);var u=F(c||{}),s=Object.keys(u).map((function(t){var e;return{id:t,text:null===(e=u[t])||void 0===e?void 0:e.toString()}}));s.length&&a.push({id:t.id,answeredAt:1,answers:s})}))})),{correctCount:n,total:r,answered:o,studentAttempts:a,awaitingMarking:i}}({interactive:c,state:a}),g=y.correctCount,b=y.total,w=y.answered,E=y.studentAttempts,x=y.awaitingMarking,I={name:t.currentUser.givenName,username:t.currentUser.username,user:{name:t.currentUser.givenName,surname:t.currentUser.familyName,avatar:{url:t.currentUser.avatar}},results:[{id:c.id,attempts:E}]},S=0,k=l.ended(),O=l.duration();return o().createElement(H.Nq,{node:s},o().createElement("div",{className:"row pb-3"},o().createElement("div",{className:"col-4 col-xs-12"},o().createElement(Bn.Z,{data:l.poster(),imageType:ht.__.Thumbnails,imageOptions:{size:ht.h2.Medium}})),o().createElement("div",{className:"col-8 col-xs-12"},o().createElement("span",{className:"float-right"},o().createElement(qn.h,{svgName:ue.vn.Play,className:"btn btn-outline-dark",onClick:function(){h(),l.ended()&&l.currentTime(0)}},k?"Play again":"Continue watching"),l.gradePassbackPlugin().enabled&&(p?o().createElement(V.L,{className:"btn btn-dark ml-2",onClick:function(){}},o().createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement(qn.h,{svgName:ue.vn.Check,className:"btn btn-dark ml-2",onClick:function(){m(!0),l.gradePassbackPlugin().submit(g/b,!x)}},"Submit"))),o().createElement("h1",{className:"h3"},t.title),o().createElement("p",null))),o().createElement("div",{className:"border rounder px-2 mb-3"},o().createElement("div",{className:"cursor-pointer my-4 ".concat("gxTA_"),onClick:function(t){if(f.current){var e=f.current.getBoundingClientRect(),n=(t.pageX-e.left)/e.width*O;h(),l.currentTime(n)}},ref:f},o().createElement(zn,{duration:O,progress:u,interactive:c,player:l}),o().createElement(Gn,{duration:O,interactive:c,goToTimepoint:v}))),o().createElement("h2",{className:"h4"},"My Answers"),o().createElement("div",{className:"d-flex justify-content-between"},o().createElement("span",null,c.immediateFeedback&&o().createElement("div",null,"Score: ",g,"/",b),o().createElement("div",{className:"mb-3"},"You have answered ",o().createElement("strong",{className:w!==b?"text-danger":""},w)," of ",o().createElement("strong",null,b)," questions"))),o().createElement("div",{className:"row"},o().createElement("div",{className:"col-lg-7 col-12"},o().createElement("ul",{className:"list-unstyled"},c.timepoints.reduce((function(e,n){return[].concat(ar(e),ar(n.interactions.map((function(e){return S++,o().createElement(ir,{key:e.id,studentResults:I,interaction:e,timepoint:n,interactive:c,state:a,goToTimepoint:v,interactionNumber:S,imageCdnUrl:t.imageCdnUrl})}))))}),[])))))}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fr(t){var e,n,r=t.resultsService,i=t.player,a=t.onShowSummary,c=t.mobile,l=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sr(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=l[0],s=l[1];function f(t){s(t),a&&a(t)}function d(){f(!0),i.hide()}return o().useEffect((function(){if(r&&!c)return i.on("ended",d),function(){return i.off("ended",d)}}),[]),o().useEffect((function(){u&&i.isFullscreen()&&i.exitFullscreen()}),[u]),o().createElement(o().Fragment,null,o().createElement(Dn,Object.assign({setShowSummary:f},t)),o().createElement(ur,Object.assign({showSummary:u,setShowSummary:f},t)))}var dr=n(83657);function pr(t){var e,n,r,i=(e=t.interactive,r=0,null===(n=null==e?void 0:e.timepoints)||void 0===n||n.forEach((function(t){var e;return null===(e=t.interactions)||void 0===e?void 0:e.forEach((function(){return r++}))})),r>0),a=[];return t.onClickEditDetails&&a.push({label:"Edit details",svgName:ue.vn.Edit,button:!0,className:"btn btn-outline-dark",onClick:t.onClickEditDetails}),t.onClickPublish&&a.push({label:"Publish",button:!0,className:"btn btn-dark ml-2".concat(i?"":" disabled"),disabled:!i,tooltip:i?"":"Interactives cannot be published without questions",onClick:function(){i&&t.onClickPublish&&t.onClickPublish()}}),a.length?o().createElement(H.Nq,{node:t.portalNode},o().createElement(dr.e,{actions:a})):o().createElement(o().Fragment,null)}var mr=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n};function hr(t){var e=t.title,n=t.player,r=t.track,i=t.mode,a=t.interactive,c=t.imageApi,l=t.supportSiteUrl,f=t.actionsPortalNode,d=t.questionListPortalNode,p=t.summaryPortalNode,m=t.resultsService,h=t.currentUser,v=t.progress,y=t.latestSession,g=t.clipOffset,b=t.analyticsService,w=t.enableImmersiveReader,E=t.mobile,x=function(t){var e=t.player,n=t.track,r=t.interactive,i=t.clipOffset,a=T(o().useState(!1),2),c=a[0],l=a[1],u=T(o().useState(!1),2),s=u[0],f=u[1],d=T(o().useState(null),2),p=d[0],m=d[1];function h(t){return i?t+i:t}function v(t){f(!!t&&c),l(t)}function y(){var t=n.activeCues;if(!t.length)return v(!1),void m(null);var o=r.timepoints.find((function(e){return e.id.toString()===t[0].text.toString()}));if(!o)return v(!1),void m(null);o.shouldPause&&(e.seeking()?e.one("play",(function(){return e.pause()})):e.pause()),v(!0),m(o)}function g(t){for(var e=0;e<n.cues.length;e++){var r=n.cues[e];if(r.text.toString()===t.toString())return r}}return o().useEffect((function(){return n.addEventListener("cuechange",y),function(){return n.removeEventListener("cuechange",y)}})),{open:c,setOpen:v,wasOpen:s,timepoint:p,continueInteractive:function(){v(!1),e.play()},updateCue:function(t,e){var n=g(t);n.text=e.toString(),n.originalCue_.text=e.toString()},addCue:function(t){var r=e.currentTime();n.addCue({startTime:h(r)-.001,endTime:h(r+1),text:t}),n.trigger("cv:cuechange"),e.paused()&&n.trigger("cuechange")},removeCue:function(t){t=h(t);for(var e=0;e<n.cues.length;){var r=n.cues[e];if(r.startTime<=t&&r.endTime>=t){n.removeCue(r),n.trigger("cv:cuechange"),n.trigger("cuechange");break}e++}},moveTimepoint:function(t){var r=g(p.id);if(r){var o=t/1e3;r.startTime=h(o),r.endTime=h(o+1),e.currentTime(o+.5,!0),p.visibleAt=t,n.trigger("cv:cuechange")}},getClipOffset:h}}({player:n,track:r,interactive:a,mode:i,clipOffset:g}),I=x.open,S=x.timepoint,k=x.wasOpen,O=mr(x,["open","timepoint","wasOpen"]),C=function(t){var e=t.interactive,n=t.timepoint,r=t.player,i=t.mode,a=t.resultsService,c=t.latestSession,l=t.analyticsService,f=Be(t,["interactive","timepoint","player","mode","resultsService","latestSession","analyticsService"]),d=Ue({mode:i,timepoint:n,latestSession:c}),p=d.state,m=d.interaction,h=d.interactionState,v=d.timepointState,y=d.nextInteraction,g=d.nextInteractionState,b=Be(d,["state","interaction","interactionState","timepointState","nextInteraction","nextInteractionState"]),w=i===u.InteractiveMode.Create;function E(t){for(var n=0;n<e.timepoints.length;){for(var r=e.timepoints[n],o=0;o<r.interactions.length;){var i=r.interactions[o];if(i.id===t)return{localTimepoint:r,localInteraction:i};o++}n++}return{localInteraction:null,localTimepoint:null}}function x(t){var n=s.w.getTypeInfo(t.typeId);return{id:_(t.id)?void 0:t.id,typeId:t.typeId,type:n.typeName,interactiveId:e.id,timepointId:_(t.timepointId)?void 0:t.timepointId,order:t.order}}function I(t){return qe(this,void 0,void 0,Ge().mark((function n(){var r,o,i,a,c,u,s;return Ge().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=E(t),o=r.localInteraction,i=r.localTimepoint,o&&i){n.next=3;break}throw new Error("Could not find the interaction and timepoint for the interactionId ".concat(t));case 3:if(a=x(o),_(o.id)){n.next=10;break}return n.next=7,z.deleteInteraction(o.id);case 7:null==l||l.logUserAction(a,{actionType:Wt.UserAction.Delete,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Complete}),n.next=11;break;case 10:null==l||l.logUserAction(a,{actionType:Wt.UserAction.Create,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Discard});case 11:if(c=i.interactions.findIndex((function(t){return t.id===o.id})),i.interactions.splice(c,1),b.clearInteractionState(o.id),u=b.getTimepointState(i.id),c<u.interactionIndex&&b.updateTimepointState(i.id,{interactionIndex:u.interactionIndex-1}),!(i.interactions.length>0)){n.next=18;break}return n.abrupt("return");case 18:if(_(i.id)){n.next=21;break}return n.next=21,z.deleteTimepoint(i.id);case 21:s=e.timepoints.findIndex((function(t){return t.id===i.id})),e.timepoints.splice(s,1),f.removeCue(i.visibleAt/1e3),b.clearTimepointState(i.id);case 25:case"end":return n.stop()}}),n)})))}function S(t){if(m){var e=_(m.id);e||(null==h?void 0:h.hasChanges)||(null==v?void 0:v.hasChanges)?Y.M.render(o().createElement("p",null,"Do you want to discard your changes?"),{title:"Unsaved changes",success:function(){(null==v?void 0:v.hasChanges)&&j(!0),e?I(m.id):b.clearInteractionState(m.id),t&&t()},buttons:[{variant:"link",buttonText:"Cancel"},{variant:"danger",success:!0,buttonText:"Discard"}]}):t&&t()}else t&&t()}function k(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(w)S((function(){b.updateTimepointState(n.id,{interactionIndex:t})}));else{var r=function(){b.updateTimepointState(n.id,{nextInteractionIndex:t}),window.requestAnimationFrame((function(){b.updateTimepointState(n.id,{nextInteractionIndex:t,slideIn:!0}),window.setTimeout((function(){b.updateTimepointState(n.id,{interactionIndex:t,nextInteractionIndex:null,slideIn:null})}),400)}))};e?S(r):r()}}function O(){v.interactionIndex+1>=n.interactions.length?f.continueInteractive():k(v.interactionIndex+1,!1)}function C(){e.timepoints.sort((function(t,e){return t.visibleAt>e.visibleAt?1:e.visibleAt>t.visibleAt?-1:0}))}function N(){k(n.interactions.length)}function j(t){(null==v?void 0:v.hasChanges)&&(t&&f.moveTimepoint(v.originalVisibleAt),b.updateTimepointState(n.id,{hasChanges:void 0,originalVisibleAt:void 0}),We=!1)}return{state:p,interaction:m,interactionState:h,timepointState:v,nextInteraction:y,nextInteractionState:g,skip:O,cancel:function(){return qe(this,void 0,void 0,Ge().mark((function t(){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(null==h?void 0:h.hasChanges)){t.next=3;break}return S(),t.abrupt("return");case 3:return t.next=5,I(m.id);case 5:f.setOpen(!0);case 6:case"end":return t.stop()}}),t)})))},addAnotherQuestion:N,goToTimepoint:function(t,n){var o=function(t){for(var n=0;n<e.timepoints.length;){var r=e.timepoints[n];if(r.id===t)return r;n++}return null}(t),i=o.interactions.find((function(t){return t.id.toString()===n.toString()}));r.currentTime(o.visibleAt/1e3),b.updateTimepointState(o.id,{interactionIndex:o.interactions.indexOf(i)})},discardChanges:S,changeIndex:k,promptDelete:function(t){var e=x(E(t).localInteraction);null==l||l.logUserAction(e,{actionType:Wt.UserAction.Delete,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Start}),Y.M.render(o().createElement("p",null,"Are you sure you want to delete this question?"),{title:"Delete question",success:function(){return I(t)},buttons:[{variant:"link",buttonText:"Cancel"},{variant:"danger",success:!0,buttonText:"Delete question"}]})},showTypeSelector:function(){r.pause(),f.setOpen(!0),n&&N()},cancelTypeSelector:function(){n?k(v.interactionIndex-1):(f.setOpen(!1),r.play())},deleteInteraction:I,saveInteraction:function(){return qe(this,void 0,void 0,Ge().mark((function t(){var e,r,o,i,a,c;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w){t.next=2;break}throw new Error("Should not be calling onClickSave while viewing an interactive");case 2:if(u=m.typeId,!(e=(0,Dt[u])(b.getInteractionState(m.id),m))){t.next=7;break}return b.updateInteractionState(m.id,{error:e}),t.abrupt("return");case 7:if(b.updateInteractionState(m.id,{spinner:!0}),!_(n.id)){t.next=15;break}return r=n.id,t.next=12,z.saveTimepoint(n);case 12:f.updateCue(r,n.id),b.clearTimepointState(r),(null==v?void 0:v.hasChanges)&&(C(),j());case 15:return m.timepointId=n.id,o=m.id,i=qt(m.typeId),t.next=20,i(b.getInteractionState(m.id),m);case 20:b.clearInteractionState(o),a=_(o),c=x(m),null==l||l.logUserAction(c,{actionType:a?Wt.UserAction.Create:Wt.UserAction.Edit,entity:Wt.EntityType.Interaction,workflowPhase:a?Wt.WorkflowPhase.Complete:Wt.WorkflowPhase.Save});case 24:case"end":return t.stop()}var u}),t)})))},addInteraction:function(t){var o;r.pause();var i=(null==n?void 0:n.id)||"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),a={id:"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),timepointId:i,typeId:t,order:(null===(o=null==n?void 0:n.interactions)||void 0===o?void 0:o.length)||0,interactiveId:e.id,data:{}},c=x(a);if(null==l||l.logUserAction(c,{actionType:Wt.UserAction.Create,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Start}),n)return n.interactions.push(a),void k(v.interactionIndex);var u=r.currentTime();e.timepoints||(e.timepoints=[]),e.timepoints.push({id:i,visibleAt:1e3*u,interactiveId:e.id,shouldPause:1,interactions:[a]}),C(),f.addCue(i)},submitInteractionAnswer:function(){return qe(this,void 0,void 0,Ge().mark((function t(){var r,o,c,s;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i===u.InteractiveMode.View){t.next=2;break}throw new Error("Should not be calling onClickSubmit while creating an interactive");case 2:if(!h.submitted){t.next=8;break}if(!(v.interactionIndex>=n.interactions.length)){t.next=6;break}return f.continueInteractive(),t.abrupt("return");case 6:return k(v.interactionIndex+1),t.abrupt("return");case 8:if(r=F(h),d=m.typeId,!(o=(0,Ne[d])(r,m))){t.next=14;break}return b.updateInteractionState(m.id,{error:o}),t.abrupt("return");case 14:if(!a||!h.hasChanges){t.next=22;break}if(c=Le(m.typeId),b.updateInteractionState(m.id,{spinner:!0}),!c){t.next=22;break}return t.next=20,c(r,m,a.save);case 20:s=x(m),null==l||l.logUserAction(s,{actionType:Wt.UserAction.Answer,entity:Wt.EntityType.Interaction});case 22:if(b.updateInteractionState(m.id,{submitted:!0,error:null,hasChanges:!1,spinner:!1}),e.immediateFeedback){t.next=26;break}return O(),t.abrupt("return");case 26:ke(m.typeId)(m)||O();case 29:case"end":return t.stop()}var d}),t)})))},userUpdateInteractionState:b.userUpdateInteractionState,updateTimepointTime:function(t){var o=r.duration(),i=function(t){for(var r=n.visibleAt+1e3*t,o=t>0,i=0;i<e.timepoints.length;i++){var a=e.timepoints[i];r<a.visibleAt-1e3||r>a.visibleAt+1e3||(r=o?a.visibleAt+1001:a.visibleAt-1001,i=0)}return r}(t);if(!(i/1e3>o||i<0)){var a=n.visibleAt;We||(We=!0,b.updateTimepointState(n.id,{originalVisibleAt:a,hasChanges:!0})),f.moveTimepoint(i)}},saveTimepoint:function(){return qe(this,void 0,void 0,Ge().mark((function t(){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!_(n.id)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,z.updateTimepoint(n);case 4:C(),j();case 6:case"end":return t.stop()}}),t)})))},clearTimepointTimeState:j,reOrderQuestions:function(t){return qe(this,void 0,void 0,Ge().mark((function e(){var r,o;return Ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=7;break}return e.next=4,z.saveInteraction(Object.assign(Object.assign({},t[r]),{order:r}));case 4:r++,e.next=1;break;case 7:o=n.interactions[v.interactionIndex],n.interactions=t,b.updateTimepointState(n.id,{interactionIndex:t.indexOf(o)});case 10:case"end":return e.stop()}}),e)})))}}}(Object.assign({mode:i,interactive:a,timepoint:S,player:n,resultsService:m,latestSession:y,analyticsService:b},O)),N=C.interaction,j=C.interactionState,A=C.nextInteraction,R=C.nextInteractionState,M=C.timepointState,U=C.state,D=mr(C,["interaction","interactionState","nextInteraction","nextInteractionState","timepointState","state"]);!function(t){var e,n=t.mode,r=t.player,i=t.timepoint,a=t.interaction,c=t.discardChanges,l=t.interactionState,s=t.timepointState,f=(0,P.f)(),d=n===u.InteractiveMode.Create;o().useEffect((function(){if(d){if(_(null==a?void 0:a.id)||(null==l?void 0:l.hasChanges)||(null==s?void 0:s.hasChanges))return f.lock({id:"interactive",title:"Are you sure you want to leave?",text:"Your interactive still has unsaved changes"}),void r.lock((function(t){c(t)}));r.unlock(),f.unlock("interactive")}}),[a,null==l?void 0:l.hasChanges,null===(e=null==i?void 0:i.interactions)||void 0===e?void 0:e.length,null==s?void 0:s.hasChanges])}({mode:i,player:n,timepoint:S,interaction:N,discardChanges:D.discardChanges,interactionState:j,timepointState:M});var G={mode:i,open:I,isCreate:i===L.A.Create,interaction:N,nextInteraction:A,timepoint:S,interactive:a,interactionState:j,nextInteractionState:R,timepointState:M,player:n};return o().createElement(o().Fragment,null,!!f&&o().createElement(pr,{interactive:a,onClickEditDetails:t.onClickEditDetails,onClickPublish:t.onClickPublish,portalNode:f}),o().createElement(Ye,Object.assign({},G,D)),o().createElement(Mn,Object.assign({imageApi:c,currentUser:h,immediateFeedback:a.immediateFeedback,delayFocus:!k,enableImmersiveReader:w},G,D,O)),o().createElement(fr,Object.assign({title:e,currentUser:h,state:U,portalNode:p,progress:v,resultsService:m,imageCdnUrl:c.toString(),onShowSummary:t.onShowSummary,mobile:E},G,D)),o().createElement(Ke,Object.assign({portalNode:d,supportSiteUrl:l,currentUser:h},G,D)))}c.Z.registerComponent("Interactive",(0,j.Z)((function(t,e){return o().createElement(hr,Object.assign({player:t},e))})));var vr=n(9111),yr=n(13876);function gr(t){var e=t.player;function n(){var t=e.getChild("ContinueSession");e.removeChild(t),t.dispose()}function r(){t.continue(!0),n()}var i=[{buttonText:"Start again",variant:"link",onClick:function(){t.continue(!1),n()}},{buttonText:"Continue",variant:"dark",onClick:r}];return o().createElement(vr.G,{title:"Continue interactive?",closePopup:r,dialogClassName:"VVqKz"},o().createElement("p",null,"It looks like you've already started this interactive. Would you like to continue your attempt or start a new one?"),o().createElement(yr.u,{className:"kw8gW",buttons:i}))}function br(t){return br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},br(t)}function wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Er(t,e){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Er(t,e)}function xr(t,e){if(e&&("object"===br(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ir(t){return Ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ir(t)}c.Z.registerComponent("ContinueSession",(0,j.Z)((function(t,e){return o().createElement(gr,Object.assign({player:t},e))})));var Sr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Er(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ir(r);if(o){var n=Ir(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return xr(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=i.call(this,t)).enabled=!1,e.player.ready((function(){return e.initialize()})),e}return e=a,(n=[{key:"initialize",value:function(){this.onReceiveMessage=this.onReceiveMessage.bind(this),window.addEventListener("message",this.onReceiveMessage,!1),window.parent.postMessage(JSON.stringify({type:"cv-app-loaded"}),"*")}},{key:"dispose",value:function(){window.removeEventListener("message",this.onReceiveMessage)}},{key:"onReceiveMessage",value:function(t){var e={};try{e=JSON.parse(t.data)}catch(t){return}"enable-grade-passback"===e.type&&(this.enabled=!0,window.removeEventListener("message",this.onReceiveMessage))}},{key:"submit",value:function(t,e){var n={type:"cv-lms-submit-score",data:{score:t,fullyGraded:e}};window.parent.postMessage(JSON.stringify(n),"*")}}])&&wr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getPlugin("plugin"));function kr(t){return kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(t)}function Or(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Cr(t,e){return Cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cr(t,e)}function Nr(t,e){if(e&&("object"===kr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function jr(t){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jr(t)}c.Z.registerPlugin("gradePassbackPlugin",Sr);var Lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=jr(r);if(o){var n=jr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Nr(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t)).continueSession=!1,n.options=e,t.ready((function(){return n.initialize()})),n}return e=a,(n=[{key:"initialize",value:function(){var t=this;this.player.gradePassbackPlugin(),l.O.useTrack(this.player,"metadata","interactive",this.onTrackLoaded.bind(this)),this.player.addClass("cv-interactive-plugin"),this.options.resultsService&&!this.options.latestSession&&(this.startSession=this.startSession.bind(this),this.player.one("play",this.startSession),this.on("dispose",(function(){t.player.off("play",t.startSession)})))}},{key:"startSession",value:function(){var t,e=null===(t=this.options.latestSession)||void 0===t?void 0:t.resultId;this.continueSession||(e=null),this.options.resultsService.start(e)}},{key:"onTrackLoaded",value:function(t){var e=this;this.options.resultsService&&this.options.latestSession?(this.player.pause(),this.player.addChild("ContinueSession",{continue:function(n){var r;null===(r=e.options.analyticsService)||void 0===r||r.logUserAction({},{actionType:Wt.UserAction.Click,entity:Wt.EntityType.Interactive,descriptor:n?Wt.InteractiveSessionDescriptor.ContinueSession:Wt.InteractiveSessionDescriptor.NewSession}),e.continueSession=n,e.startSession(),e.addChildren(t),e.player.play()}})):this.addChildren(t)}},{key:"addChildren",value:function(t){this.player.addChild("Interactive",Object.assign(Object.assign({},this.options),{track:t,mode:this.options.mode||u.InteractiveMode.View,latestSession:this.continueSession&&this.options.latestSession})),this.player.controlBar.getChild("progressControl").getChild("SeekBar").addChild(new N(this.player,{interactive:this.options.interactive,track:t}))}}])&&Or(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getPlugin("plugin"));c.Z.registerPlugin("viewInteractivePlugin",Lr);var Tr=n(47724);function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function Pr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _r(t,e){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_r(t,e)}function Fr(t,e){if(e&&("object"===Ar(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Rr(t){return Rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rr(t)}var Mr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_r(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Rr(r);if(o){var n=Rr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Fr(this,t)});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,"Could not connect to submit interactive results")}return e=a,(n=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:"Connection issues",text:"There seems to be an issue with your internet connection. Refresh the page to try again. ",buttons:[{text:"Refresh",className:"btn btn-dark",success:!0}]}}},{key:"onDone",value:function(){window.location.reload()}}])&&Pr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(n(47663).S);function Ur(t){return Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(t)}function Dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Gr(){Gr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Ur(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Br=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function c(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((r=r.apply(t,e||[])).next())}))},Wr=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cache=[],this.retryCount=0,this.options=e,this.connection=(new Tr.su).withUrl("".concat(e.playerApi.origin,"/hubs/interactives"),{withCredentials:!1}).configureLogging(Tr.in.Error).withAutomaticReconnect([0,2e3,1e4,3e4]).build(),this.connection.onreconnecting((function(){n.log("reconnecting"),n.isConnected=!1})),this.connection.onreconnected((function(){n.log("reconnected"),n.isConnected=!0,n.flush()})),this.connection.onclose((function(){n.log("connection closed"),n.isConnected=!1,n.reconnect()})),this.save=this.save.bind(this)}var e,n;return e=t,(n=[{key:"start",value:function(t){var e=this;this.isConnected||(t&&(this.resultId=t),this.log("starting"),this.connection.start().then((function(){return Br(e,void 0,void 0,Gr().mark((function t(){return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.log("connected"),this.retryCount=0,this.isConnected=!0,t.next=5,this.startSession();case 5:this.flush();case 6:case"end":return t.stop()}}),t,this)})))})).catch((function(){e.reconnect()})))}},{key:"stop",value:function(){return Br(this,void 0,void 0,Gr().mark((function t(){return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.flush();case 2:this.connection.stop();case 3:case"end":return t.stop()}}),t,this)})))}},{key:"log",value:function(){}},{key:"reconnect",value:function(){this.retryCount>=5?i.Q.ErrorHelper.throw(new Mr):(this.retryCount++,this.start())}},{key:"startSession",value:function(){return Br(this,void 0,void 0,Gr().mark((function t(){var e,n,r,o,a,c,l;return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.resultId){t.next=2;break}return t.abrupt("return");case 2:return e=this.options,n=e.interactiveId,r=e.mediaId,o=e.userId,a=e.customerId,c=e.shareId,t.prev=3,t.next=6,this.connection.invoke("startSession",n,r,o,a,c);case 6:l=t.sent,this.resultId=l.resultId,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),i.Q.ErrorHelper.throw(new Mr);case 13:case"end":return t.stop()}}),t,this,[[3,10]])})))}},{key:"flush",value:function(){return Br(this,void 0,void 0,Gr().mark((function t(){var e=this;return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isConnected&&this.resultId){t.next=2;break}return t.abrupt("return");case 2:if(this.cache.length){t.next=4;break}return t.abrupt("return");case 4:(n=this.cache,function(t){if(Array.isArray(t))return Dr(t)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return Dr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dr(t,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(t){return Br(e,void 0,void 0,Gr().mark((function e(){return Gr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.connection.invoke("saveActions",this.resultId,t.interactionId,t.results);case 3:this.cache.splice(this.cache.indexOf(t),1),this.log("Saved result",t),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Failed to save results",t);case 10:case"end":return e.stop()}}),e,this,[[0,7]])})))}));case 5:case"end":return t.stop()}var n}),t,this)})))}},{key:"save",value:function(t,e){return Br(this,void 0,void 0,Gr().mark((function n(){var r;return Gr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.resultId){n.next=2;break}throw new Error("Session has not started");case 2:return r=e.map((function(t){return{actionableItemId:+t.actionableItemId,value:t.value}})),this.cache.push({interactionId:t,results:r}),n.next=6,this.flush();case 6:case"end":return n.stop()}}),n,this)})))}}])&&qr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),zr=n(48420);function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function Zr(){Zr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Yr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function Hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Vr(){return Vr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=Kr(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Vr.apply(this,arguments)}function Kr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xr(t)););return t}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}function Jr(t,e){if(e&&("object"===Yr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}var to=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qr(t,e)}(l,t);var e,n,r,o,c=(r=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Xr(r);if(o){var n=Xr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Jr(this,t)});function l(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(n=c.call(this,t,e)).totalProgress=[],R.e.setToken("gateway",n.options.authToken),n.player.one("dispose",(function(){n.resultsService&&n.resultsService.stop()})),n.options.mode===u.InteractiveMode.Create&&n.player.addClass("cv-create-interactives"),n}return e=l,n=[{key:"getPlayerOptions",value:function(){var t=Vr(Xr(l.prototype),"getPlayerOptions",this).call(this);return t.setMaxHeight=!1,this.options.embed||(t.aspectRatio="16:9"),t}},{key:"onFlushProgress",value:function(t){var e,n;Vr(Xr(l.prototype),"onFlushProgress",this).call(this,t),this.options.mode!==u.InteractiveMode.Create&&(e=this.totalProgress).push.apply(e,function(t){if(Array.isArray(t))return Hr(t)}(n=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return Hr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hr(t,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}},{key:"additionalSetup",value:function(t){var e,n,r,o,i=this,a=Object.create(null,{additionalSetup:{get:function(){return Vr(Xr(l.prototype),"additionalSetup",i)}}});return e=this,n=void 0,r=void 0,o=Zr().mark((function e(){var n=this;return Zr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.additionalSetup.call(this,t),this.setupUpClipPlugin(t),this.analyticsService||this.options.fetch||this.options.offlinePlaybackObject?this.setupViewInteractivePlugin(t):this.one("config:loaded",(function(){return n.setupViewInteractivePlugin(t)}));case 3:case"end":return e.stop()}}),e,this)})),new(r||(r=Promise))((function(t,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function c(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,c)}l((o=o.apply(e,n||[])).next())}))}},{key:"setupUpClipPlugin",value:function(t){var e;if(null===(e=null==t?void 0:t.additionalData)||void 0===e?void 0:e.clipData){var n=t.additionalData.clipData;this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime})}}},{key:"setupViewInteractivePlugin",value:function(t){var e;this.track=function(t,e){var n,r=t.addTextTrack("metadata","interactive"),o=e.additionalData.interactive,i=null===(n=e.additionalData.clipData)||void 0===n?void 0:n.startTime;return o.timepoints.forEach((function(t){var e,n=t.visibleAt/1e3,o=t.visibleFor?n+t.visibleFor/1e3:n+1;i&&(n+=i,o+=i),(null===(e=t.interactions)||void 0===e?void 0:e.length)&&r.addCue({startTime:n-.001,endTime:o,text:t.id})})),r}(this.player,t);var n=t.additionalData.interactive,r=null===(e=t.additionalData.clipData)||void 0===e?void 0:e.startTime;this.options.collectResults&&(this.options.currentUser||i.Q.ErrorHelper.throw(new a.H("Must provide a currentUser in order to collect interactive results")),this.options.shareId||i.Q.ErrorHelper.throw(new a.H("Must provide a shareId in order to collect interactive results")),this.resultsService=new Wr({interactiveId:n.id,mediaId:t.mediaId,userId:this.options.currentUser.id,customerId:this.options.currentUser.customerId,playerApi:this.options.playerApi,shareId:this.options.shareId})),this.player.viewInteractivePlugin({interactive:n,title:t.title,mode:this.options.mode,imageApi:this.options.imageApi,supportSiteUrl:this.options.supportSiteUrl,resultsService:this.resultsService,actionsPortalNode:this.options.actionsPortalNode,questionListPortalNode:this.options.questionListPortalNode,summaryPortalNode:this.options.summaryPortalNode,currentUser:this.options.currentUser,latestSession:t.additionalData.latestSession,progress:this.totalProgress,clipOffset:r,analyticsService:this.analyticsService,enableImmersiveReader:this.options.enableImmersiveReader,onShowSummary:this.options.onShowSummary,onClickEditDetails:this.options.onClickEditDetails,onClickPublish:this.options.onClickPublish,mobile:this.options.mobile})}},{key:"getAdditionalAnalyticsData",value:function(t){var e,n,r,o;return(null===(n=null===(e=t.additionalData)||void 0===e?void 0:e.clipData)||void 0===n?void 0:n.clipId)?{clip:{id:null===(o=null===(r=t.additionalData)||void 0===r?void 0:r.clipData)||void 0===o?void 0:o.clipId}}:{}}},{key:"getSeekBarOptions",value:function(){return{ignoreChapters:!0}}},{key:"getAnalyticsPlayerType",value:function(){return"interactive-player"}},{key:"setFavourite",value:function(t,e){this.player.favouritePlugin().setFavourite(t,e)}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}],n&&$r(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),l}(zr.r);function eo(t){var e=t.onReady,n=t.className,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["onReady","className"]),i=o().useRef();return o().useEffect((function(){var t=new to(i.current,r);return e&&t.ready((function(){e(t)})),function(){t.dispose()}}),[]),o().createElement(o().Fragment,null,o().createElement("div",{ref:i,className:n}),o().createElement("div",{id:"popup-region"}))}}}]);
1
+ /*! For license information please see 6856-1b11d7154b-lite.chunk.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[6856],{5833:(t,e,n)=>{n.d(e,{I:()=>l});var r=n(1024),o=n.n(r),i=n(36532),a=n(83914),c=n(61252);function l(t){return o().createElement(i.u,{title:t.tooltipText,spanHack:!0,spanHackClassName:"d-inline-block"},o().createElement(a.x,{svgName:c.vn.Info}))}},80181:(t,e,n)=>{n.d(e,{Z:()=>y});var r=n(1024),o=n.n(r),i=n(54976),a=n(93264),c=n(11607),l=n(83914),u=n(61252),s=n(83345),f=n(28972),d=n(86572);var p="shared.interactiveQuestions";function m(t){var e=t.interaction;switch((0,t.getCorrectness)(e)){case f.w.Correct:return o().createElement("span",{className:"text-success"},o().createElement(l.x,{size:l.S.Medium,svgName:u.vn.Check}));case f.w.Incorrect:return o().createElement("span",{className:"text-danger"},o().createElement(l.x,{size:l.S.Medium,svgName:u.vn.Close}));case f.w.AwaitingMarking:return o().createElement("span",{className:"text-muted italic"},o().createElement("i",null,o().createElement(s.x,{namespace:p,phrase:"pending"})));case f.w.UnAnswered:return o().createElement("button",{className:"btn btn-outline-dark"},o().createElement(s.x,{namespace:p,phrase:"answer"}));case f.w.Answered:return o().createElement("span",{className:"text-muted italic"},o().createElement("i",null,o().createElement(s.x,{namespace:p,phrase:"answered"})));case f.w.NotApplicable:return o().createElement(o().Fragment,null)}}function h(t){var e=t.interaction,n=t.visibleAt,r=t.selectedInteractionId,i=t.goToTimepoint,s=t.scrollTo,f=t.isFirstInteraction,p=e.id.toString()===(null==r?void 0:r.toString()),h=o().useRef();o().useEffect((function(){if(p&&h.current){var t=h.current,e=t.getBoundingClientRect(),n=e.top-t.offsetParent.getBoundingClientRect().top;s(n,e.height)}}),[p]);var v=i?"cursor-pointer":"cursor-default";return o().createElement("div",{ref:h},o().createElement(c.L,{className:"py-2 ".concat(v," ").concat("sGk59"," ").concat(p?"tfrDf":""),onClick:p?function(){}:function(){i&&i(e.id)}},o().createElement("span",{className:"".concat("JDp5N"," mr-2 ").concat(p?"font-weight-bold":"")},f?a.T.ToDisplayDuration(n):""),o().createElement(d.y,{interaction:e,showTypeName:!0,typeNameClassName:"AzIWg",questionClassName:"UhEYq"}),t.onClickDelete&&o().createElement(c.L,{onClick:function(n){n.stopPropagation(),t.onClickDelete(e.id)},className:"".concat("wBqoo")},o().createElement("span",{className:"text-right ".concat("OAQQu")},o().createElement(l.x,{size:l.S.Medium,svgName:u.vn.Delete}))),t.getCorrectness&&o().createElement("span",{className:"text-right ".concat("W5sR9")},o().createElement(m,{interaction:e,getCorrectness:t.getCorrectness}))))}function v(t){var e=t.timepoint,n=t.scrollTo,r=t.onClickDelete,i=t.selectedInteractionId,a=t.getCorrectness;function c(n){t.goToTimepoint&&t.goToTimepoint(e.id,n)}return e.interactions?o().createElement("div",null,e.interactions.map((function(t,l){return o().createElement(h,{interaction:t,visibleAt:e.visibleAt,goToTimepoint:c,onClickDelete:r,scrollTo:n,selectedInteractionId:i,isFirstInteraction:0===l,getCorrectness:a,key:l})}))):o().createElement(o().Fragment,null)}function y(t){var e=t.interactive,n=t.goToTimepoint,r=t.selectedInteractionId,a=t.maxHeight,c=t.onClickDelete,l=t.getCorrectness,u=o().useRef();function s(t,e){if(u.current){var n=u.current.getClientHeight(),r=u.current.getScrollTop(),o=t+r;(o<r||o+e>r+n)&&u.current.scrollTop(o-n/2+e/2)}}var f=n?"border rounded":"";return o().createElement(i.Scrollbars,{autoHeight:!0,autoHeightMax:a,className:f,hideTracksWhenNotNeeded:!0,ref:u},o().createElement("div",{className:"px-3 py-1"},e.timepoints.map((function(t,e){return o().createElement(v,{key:e,timepoint:t,goToTimepoint:n,selectedInteractionId:r,scrollTo:s,onClickDelete:c,getCorrectness:l})}))))}},28972:(t,e,n)=>{var r;n.d(e,{w:()=>r}),function(t){t[t.Correct=0]="Correct",t[t.Incorrect=1]="Incorrect",t[t.AwaitingMarking=2]="AwaitingMarking",t[t.Answered=3]="Answered",t[t.UnAnswered=4]="UnAnswered",t[t.NotApplicable=5]="NotApplicable"}(r||(r={}))},99705:(t,e,n)=>{var r;n.d(e,{w:()=>r}),function(t){t.AddToPlaylist="115005679748",t.LibraryEditor="360001974533",t.VideoAccess="360000153947",t.AddFromOnline="360011718234",t.UploadToLibraryEditor="360012069334",t.PBTErrorCodes="360012421153",t.ManuelReview="360020004534",t.LibraryReview="360000163788",t.Integrations="4407268725529",t.Classrooms="4405362551833",t.MakeInteractive="4405370510873"}(r||(r={}))},76343:(t,e,n)=>{var r;n.d(e,{A:()=>r}),function(t){t[t.View=0]="View",t[t.Create=1]="Create"}(r||(r={}))},38314:(t,e,n)=>{n.d(e,{InteractiveMode:()=>r.A});var r=n(76343)},10942:(t,e,n)=>{n.d(e,{S:()=>eo});var r=n(1024),o=n.n(r),i=n(81886),a=n(56050),c=(n(16852),n(91242),n(93262),n(16235)),l=n(10463),u=n(38314),s=n(84120);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=m(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},p.apply(this,arguments)}function m(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function v(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=y(r);if(o){var n=y(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return v(this,t)});function a(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e)).timepoint_=e.timepoint,n.time_=e.timepoint.visibleAt/1e3;var r=e.timepoint.interactions[0];r||n.hide();var o=s.w.getTypeInfo(r.typeId).bgClassName;return n.$(".vjs-icon-placeholder").classList.add(o),n.controlText(r.name),n.update(),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-item ".concat(p(y(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return p(y(a.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),Object.assign(Object.assign({},n),{tabIndex:0}))}},{key:"update",value:function(){var t=this.player_.duration(),e=this.time_/t;this.el().style.left=100*e+"%",e>100||e<0?this.hide():this.show()}},{key:"handleClick",value:function(t){t.stopPropagation(),this.player_.currentTime(this.time_)}}])&&d(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getComponent("Button"));function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(){return x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=I(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},x.apply(this,arguments)}function I(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=C(t)););return t}function S(t,e){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},S(t,e)}function k(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return O(t)}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}var N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&S(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=C(r);if(o){var n=C(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return k(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e)).track_=e.track,n.interactive_=e.interactive,n.onDurationChange=n.onDurationChange.bind(O(n)),n.createInteractionItems=n.createInteractionItems.bind(O(n)),n.createInteractionItems(),n.track_.on("cv:cuechange",n.createInteractionItems),n.player_.on("durationchange",n.onDurationChange),n.player_.on("dispose",(function(){n.track_.off("cv:cuechange"),n.player_.off("durationchange",n.onDurationChange)})),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-items ".concat(x(C(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return x(C(a.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(){this.children_.forEach((function(t){t.update()}))}},{key:"createInteractionItems",value:function(){var t,e,n=this;if(this.track_){(e=this.children_,function(t){if(Array.isArray(t))return w(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(t){n.removeChild(t)}));for(var r=0;r<this.track_.cues.length;r++){var o=this.track_.cues[r],i=this.getTimepointById(o.text);i&&(null===(t=i.interactions)||void 0===t?void 0:t.length)&&this.addChild(new g(this.player_,{timepoint:i}))}}}},{key:"onDurationChange",value:function(){this.update()}},{key:"getTimepointById",value:function(t){var e;return null===(e=this.interactive_.timepoints)||void 0===e?void 0:e.find((function(e){return e.id.toString()===t.toString()}))}}])&&E(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getComponent("Component")),j=n(14735),L=n(76343);function T(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var P=n(89476);function _(t){return!!(null==t?void 0:t.toString().startsWith("new_"))}function F(t){return t.error,t.hasChanges,t.submitted,t.spinner,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["error","hasChanges","submitted","spinner"])}var R=n(2314);function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function U(){U=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==M(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var G=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function c(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((r=r.apply(t,e||[])).next())}))},q=function(t){return"/api/domain/v1/interactions/".concat(t)},B=function(t){return"/api/domain/v1/timepoints/".concat(t)},W={},z=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,(n=[{key:"saveInteraction",value:function(t){return G(this,void 0,void 0,U().mark((function e(){var n,r,o,i,a;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=_(t.id),r=n?"/api/domain/v1/interactions/bulk":(c=t.id,"/api/domain/v1/interactions/bulk/".concat(c)),o={name:t.name,data:t.data,timepointId:t.timepointId,interactiveId:t.interactiveId,typeId:t.typeId,actionableItems:t.actionableItems,order:t.order},n||(o.id=t.id),i=n?R.e.post(r,JSON.stringify(o),W):R.e.put(r,JSON.stringify(o),W),e.next=7,i;case 7:a=e.sent,n&&(t.id=a.id);case 9:case"end":return e.stop()}var c}),e)})))}},{key:"deleteInteraction",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.delete(q(t),W);case 2:case"end":return e.stop()}}),e)})))}},{key:"saveTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){var n,r;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={interactiveId:t.interactiveId,shouldPause:1,visibleAt:t.visibleAt},e.next=3,R.e.post("/api/domain/v1/timepoints",JSON.stringify(n),W);case 3:r=e.sent,t.id=r.id;case 5:case"end":return e.stop()}}),e)})))}},{key:"updateTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.put((n=t.id,"/api/domain/v1/timepoints/".concat(n)),JSON.stringify(t),W);case 2:case"end":return e.stop()}var n}),e)})))}},{key:"deleteTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.delete(B(t),W);case 2:case"end":return e.stop()}}),e)})))}}])&&D(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()),Y=n(497),Z=n(53957),H=n(17082);function $(t){var e=t.error;return t.error?o().createElement("p",{className:"mt-2 small text-danger"},e):o().createElement(o().Fragment,null)}var V=n(11607);function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Q(){Q=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==K(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var J=/[.\?!,;:\-''\(\)]/g;function X(t){for(var e=t.split("");e.length&&e[0].match(J);)e.shift();for(;e.length&&e[e.length-1].match(J);)e.pop();return e.join("")}function tt(t,e){for(var n=t.split(""),r=[],o=[];n.length&&n[0].match(J);)r.push(n.shift());for(;n.length&&n[n.length-1].match(J);)o.unshift(n.pop());return r.join("")+e+o.join("")}function et(t){return t.map((function(t){if(!t.selected)return t.text;var e=X(t.text).length,n=new Array(e).fill("_").join("");return tt(t.text,n)})).join(" ")}function nt(t){return t.map((function(t){var e;return t.selected?null===(e=tt(t.text,"{".concat(t.order,"}")))||void 0===e?void 0:e.trim():t.text})).join(" ")}var rt=n(56108),ot=n(5833);function it(t){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},it(t)}function at(){at=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==it(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var ct=n(75896);function lt(t){var e=o().useRef(null);function n(){t.onChange(Object.assign(Object.assign({},t.answer),{isCorrect:!t.answer.isCorrect}))}return o().createElement("li",{className:"p-1 my-1 w-100 bg-white d-flex align-items-center border rounded"},o().createElement("div",{className:"custom-control ".concat(t.isTrueOrFalse?"custom-radio":"custom-checkbox"),onKeyDown:function(t){return"Enter"===t.key&&n()}},o().createElement("input",{id:"multiple-choice--".concat(t.answer.order),type:t.isTrueOrFalse?"radio":"checkbox",className:"custom-control-input mr-2",name:"multiple-choice-answer",checked:t.answer.isCorrect,onChange:n,disabled:!t.answer.name}),o().createElement("label",{ref:e,htmlFor:"multiple-choice--".concat(t.answer.order),className:"cursor-pointer custom-control-label"})),t.isTrueOrFalse?o().createElement("label",{className:"mb-0",htmlFor:"multiple-choice--".concat(t.answer.order)},t.answer.name):o().createElement("input",{placeholder:"Answer",onChange:function(e){t.onChange(Object.assign(Object.assign({},t.answer),{name:e.target.value}))},value:t.answer.name,className:"border-0 outline-none w-100",autoComplete:"off"}))}function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function st(){st=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==ut(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function ft(t){var e;if(!(null===(e=t.question)||void 0===e?void 0:e.trim()))return"Please provide a question";if(!t.answers.find((function(t){return t.isCorrect})))return"Please select the correct answer";var n=t.answers.filter((function(t){var e;return!!(null===(e=t.name)||void 0===e?void 0:e.trim())}));if(n.length<2)return"Please provide at least two answers";var r=!1,o={};return n.forEach((function(t){r||(o[t.name]?r=!0:o[t.name]=!0)})),r?"There are duplicates in your answers":null}function dt(t,e){var n,r,o,i,a;return r=this,o=void 0,i=void 0,a=st().mark((function r(){return st().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.name=null===(n=t.question)||void 0===n?void 0:n.trim(),e.actionableItems=t.answers.filter((function(t){var e;return!!(null===(e=t.name)||void 0===e?void 0:e.trim())})),t.feedback&&(e.data.feedback=t.feedback),r.next=5,z.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(t){e(t)}}function c(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,c)}l((a=a.apply(r,o||[])).next())}))}function pt(t){var e=t.state,n=void 0===e?function(t){var e,n=t.typeId===Z.InteractionTypeId.TrueOrFalse,r=null===(e=t.actionableItems)||void 0===e?void 0:e.map((function(t){return{order:t.order,name:t.name,isCorrect:t.isCorrect}}));return(null==r?void 0:r.length)?!n&&(null==r?void 0:r.length)<4&&r.push({order:r.length,name:"",isCorrect:!1}):r=[{order:0,name:n?"True":"",isCorrect:!1},{order:1,name:n?"False":"",isCorrect:!1}],{question:t.name||"",answers:r,feedback:t.data.feedback||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=t.showFeedback,l=i.typeId===Z.InteractionTypeId.TrueOrFalse;function u(t){var e,o,i=n.answers.map((function(e){return e.order!==t.order?Object.assign(Object.assign({},e),{isCorrect:!l&&e.isCorrect}):t}));if(i.find((function(t){return!t.name}))&&(o=(e=i).find((function(t){return!t.name})),i=e.length>2?e.filter((function(t){return t.order!==o.order})).map((function(t,e){return Object.assign(Object.assign({},t),{order:e})})):e.map((function(t){return t.order!==o.order?t:Object.assign(Object.assign({},t),{isCorrect:!1})}))),!l&&i.length<4&&!i.find((function(t){return!t.name}))){var a=ct.m.last(i);i.push({name:"",order:a.order+1,isCorrect:!1})}r(Object.assign(Object.assign({},n),{answers:i}))}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"multiple-choice-question"},"Question"),o().createElement(H.t0,{node:a})),o().createElement("input",{id:"multiple-choice-question",className:"form-control",placeholder:"Enter your question here",value:n.question,onChange:function(t){r(Object.assign(Object.assign({},n),{question:t.target.value}))},autoComplete:"off"}),!n.question&&o().createElement($,{error:n.error})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"multiple-choice-answer"},"Answers"),n.answers.map((function(t){return o().createElement(lt,{key:t.order,answer:t,onChange:u,isTrueOrFalse:l})})),n.question&&o().createElement($,{error:n.error})),c&&l&&o().createElement("div",{className:"form-group mb-0"},o().createElement("label",{className:"cv-true-or-false-feedback-label cv-interaction-field-label",htmlFor:"true-or-false-feedback"},"Feedback  ",o().createElement("span",{className:"text-muted"},"(optional)")," ",o().createElement(ot.I,{tooltipText:"Provide answer feedback for your students"})),o().createElement(rt.Z,{id:"true-or-false-feedback",className:"form-control",minRows:2,value:n.feedback||"",onChange:function(t){r(Object.assign(Object.assign({},n),{feedback:t.target.value}))},placeholder:"Give feedback for this question"})))}var mt=n(79483),ht=n(54610),vt=n(45368);function yt(){return o().createElement("svg",{viewBox:"0 0 43 38",className:"cv-upload-image-icon"},o().createElement("g",{transform:"translate(-1193.000000, -185.000000)"},o().createElement("g",{transform:"translate(1183.000000, 173.000000)"},o().createElement("path",{d:"M49.875,12.9166667 C51.3247475,12.9166667 52.5,14.0732644 52.5,15.5 L52.5,46.5 C52.5,47.9267356 51.3247475,49.0833333 49.875,49.0833333 L13.125,49.0833333 C11.6752525,49.0833333 10.5,47.9267356 10.5,46.5 L10.5,15.5 C10.5,14.0732644 11.6752525,12.9166667 13.125,12.9166667 L49.875,12.9166667 Z M49.875,15.5 L13.125,15.5 L13.125,46.5 L49.875,46.5 L49.875,15.5 Z M35.5085905,22.5470241 L45.7260956,38.0470241 C46.1206004,38.6454897 45.9474325,39.445375 45.3393142,39.8336178 C44.731196,40.2218607 43.9184093,40.0514415 43.5239044,39.4529759 L34.3641741,25.5576247 L29.9489593,31.7425222 C29.4803332,32.3989804 28.5233602,32.4806343 27.9469223,31.9133463 L26.3920049,30.38311 L19.425,39.525 C18.9900758,40.0956942 18.167399,40.211354 17.5875,39.7833333 C17.007601,39.3553127 16.8900758,38.5456942 17.325,37.975 L25.2,27.6416667 C25.6792326,27.0128323 26.6132966,26.9475041 27.1780777,27.5033204 L28.6987913,28.9998957 L33.3335357,22.5074778 C33.8680838,21.758675 35.0025121,21.7793009 35.5085905,22.5470241 Z M21,19.375 C23.1746212,19.375 24.9375,21.1098966 24.9375,23.25 C24.9375,25.3901034 23.1746212,27.125 21,27.125 C18.8253788,27.125 17.0625,25.3901034 17.0625,23.25 C17.0625,21.1098966 18.8253788,19.375 21,19.375 Z M21,21.9583333 C20.2751263,21.9583333 19.6875,22.5366322 19.6875,23.25 C19.6875,23.9633678 20.2751263,24.5416667 21,24.5416667 C21.7248737,24.5416667 22.3125,23.9633678 22.3125,23.25 C22.3125,22.5366322 21.7248737,21.9583333 21,21.9583333 Z",id:"Combined-Shape"}))))}function gt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return bt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wt(t){var e=gt(o().useState(!1),2),n=e[0],r=e[1],i=gt(o().useState(0),2),a=i[0],c=i[1];return o().useEffect((function(){0===a&&n&&r(!1)}),[a,n,r]),o().createElement("div",{onDragOver:function(t){t.preventDefault(),t.stopPropagation()},onDragEnter:function(t){t.preventDefault(),t.stopPropagation(),c((function(t){return t+1})),t.dataTransfer.items&&t.dataTransfer.items.length>0&&!n&&r(!0)},onDragLeave:function(t){t.preventDefault(),t.stopPropagation(),c((function(t){return t-1}))},onDrop:function(e){e.preventDefault(),e.stopPropagation(),r(!1),a>0&&c(0),e.dataTransfer.files&&e.dataTransfer.files.length>0&&(t.onDropImage(e.dataTransfer.files),e.dataTransfer.clearData())},className:n?"cv-image-upload-mask":""},t.children)}function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function xt(){xt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Et(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var It=n(6880),St=n(10671),kt=n(84891),Ot={styleToHTML:function(t){return"SUPERSCRIPT"===t?{start:"<sup>",end:"</sup>"}:"SUBSCRIPT"===t?{start:"<sub>",end:"</sub>"}:void 0},entityToHTML:function(t,e){return"LINK"===t.type?o().createElement("a",{href:t.data.url},e):e},htmlToStyle:function(t,e,n){return"sup"===t?n.add("SUPERSCRIPT"):"sub"===t?n.add("SUBSCRIPT"):n},htmlToEntity:function(t,e,n){if("a"===t)return n("LINK","MUTABLE",{url:e.href})}};function Ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Nt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function jt(t){var e=Ct(o().useState(""),2),n=e[0],r=e[1],i=Ct(o().useState(""),2),a=i[0],c=i[1];return o().createElement("div",{"aria-haspopup":"true","aria-expanded":t.expanded,"aria-label":"rdw-color-picker"},o().createElement("div",{className:"rdw-option-wrapper cv-annotation-toolbar-option cv-annotation-link",onClick:t.onExpandEvent}," "),t.expanded&&o().createElement("div",{className:"rdw-link-modal",onClick:function(t){return t.stopPropagation()}},o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-url"},"URL"),o().createElement("input",{id:"cv-annotation-url",className:"form-control",onChange:function(t){return r(t.target.value)},value:n,placeholder:"Enter URL",autoComplete:"off"})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-text"},"Text"),o().createElement("input",{id:"cv-annotation-text",className:"form-control",onChange:function(t){return c(t.target.value)},value:a,placeholder:"Enter Text",autoComplete:"off"})),o().createElement(V.L,{onClick:function(){return t.onChange("link",a||n,n,"_blank")},className:"btn btn-dark"},"Add")))}function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}function Tt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return At(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pt(){Pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Lt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var _t,Ft,Rt;function Mt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ut=(Mt(_t={},Z.InteractionTypeId.Annotation,(function(t){var e=t.state,n=void 0===e?function(t){var e;return{annotation:(null===(e=t.data)||void 0===e?void 0:e.annotation)||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=Tt(o().useState(function(){var t=i.data.annotation;if(t){var e=(0,kt.h4)(Ot)(t);return It.EditorState.createWithContent(e)}return It.EditorState.createEmpty()}()),2),l=c[0],u=c[1],s=Tt(o().useState(null),2),f=s[0],d=s[1];return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",onClick:function(){return null==f?void 0:f.focusEditor()}},"Annotation"),o().createElement(H.t0,{node:a})),o().createElement("div",{className:"cv-annotation ".concat(function(){if(!l)return!1;var t=l.getCurrentContent();return t.hasText()||"unstyled"!==t.getBlockMap().first().getType()}()?"Editor--hide-placeholder":"")},l&&o().createElement(St.Editor,{editorState:l,onEditorStateChange:function(t){u(t);var e=t.getCurrentContent();if(e.hasText()){var o=(0,kt.cn)(Ot)(e);r(Object.assign(Object.assign({},n),{annotation:o}))}else r(Object.assign(Object.assign({},n),{annotation:""}))},toolbarClassName:"cv-annotation-toolbar",editorClassName:"form-control cv-annotation-editor",ref:d,placeholder:"Enter your annotation here",toolbar:{options:["inline","list","link"],inline:{options:["bold","italic","underline","superscript","subscript"],bold:{className:"cv-annotation-toolbar-option cv-annotation-bold",icon:""},italic:{className:"cv-annotation-toolbar-option cv-annotation-italic",icon:""},underline:{className:"cv-annotation-toolbar-option cv-annotation-underline",icon:""},superscript:{className:"cv-annotation-toolbar-option cv-annotation-superscript",icon:""},subscript:{className:"cv-annotation-toolbar-option cv-annotation-subscript",icon:""}},list:{options:["unordered","ordered"],unordered:{className:"cv-annotation-toolbar-option cv-annotation-bullet-list",icon:""},ordered:{className:"cv-annotation-toolbar-option cv-annotation-number-list",icon:""}},link:{component:jt,options:["link"]}}}),o().createElement($,{error:n.error}))))})),Mt(_t,Z.InteractionTypeId.Image,(function(t){var e=t.state,n=void 0===e?function(t){var e;return{url:(null===(e=t.data)||void 0===e?void 0:e.url)||"",caption:t.data.caption}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode;(0,vt.R)();var c=o().useRef(null);function l(t){t&&t[0]&&mt.J.onFileSelect(ht.__.None,t,(function(t){Y.M.renderCropper({src:t.src,alt:"",onClickCrop:u})}))}function u(e){var o=e.split(",")[1];R.e.post("".concat(t.imageApi,"v2/thumbnails/base64"),'"'.concat(o,'"'),{tokenName:"gateway"}).then((function(t){r(Object.assign(Object.assign({},n),{url:t.location}))})).catch((function(){return alert("Something went wrong while trying to upload image. Please try again.")}))}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Image"),o().createElement(H.t0,{node:a})),n.url?o().createElement("div",{className:"text-center"},o().createElement("div",{className:"cv-uploaded-image-container"},o().createElement("img",{className:"img img-fluid",src:n.url,alt:n.caption}),o().createElement(V.L,{className:"cv-remove-uploaded-image d-flex justify-content-center align-items-center",onClick:function(){r(Object.assign(Object.assign({},n),{url:""}))}},o().createElement("div",{className:"btn btn-link text-light"},"Remove")))):o().createElement(wt,{onDropImage:l},o().createElement("div",{className:"cv-image-interaction-upload-container rounded py-4 text-center"},o().createElement("div",{className:"svg-container xlg mb-2"},o().createElement(yt,null)),o().createElement("p",{className:"mb-0"},"Drag and drop an image file or"),o().createElement(V.L,{type:"button",className:"text-underline d-inline-block",onClick:function(){c.current.value=null,c.current.click(null)}},"upload from your device"),o().createElement("input",{type:"file",autoComplete:"off",className:"file-select d-none",multiple:!1,accept:"image/jpg,image/jpeg,image/png",ref:c,onChange:function(t){return l(t.target.files)}}))),o().createElement($,{error:n.error})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"image-caption"},"Caption  ",o().createElement("span",{className:"text-muted"},"(optional)")),o().createElement("textarea",{id:"image-caption",className:"form-control",placeholder:"Caption your image",value:n.caption||i.data.caption||"",onChange:function(t){r(Object.assign(Object.assign({},n),{caption:t.target.value}))},rows:2})))})),Mt(_t,Z.InteractionTypeId.MissingWord,(function(t){var e,n,r,i,a,c,l=t.state,u=void 0===l?(i=(null===(n=(e=t.interaction).data)||void 0===n?void 0:n.sentence)||"",a=i.split(" ").filter(Boolean),c=a.map((function(t,e){return{text:t,order:e,selected:!1}})),null===(r=e.actionableItems)||void 0===r||r.forEach((function(t){var e=t.order,n=tt(a[e],t.name);a[e]=n,c[e].text=n,c[e].selected=!0})),{fullSentence:a.join(" "),sentence:i,preview:e.name,words:c}):l,s=t.setState,f=t.optionsPortalNode,d=!!u.sentence;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"missing-word-sentence"},"Sentence"),o().createElement(H.t0,{node:f})),o().createElement("input",{id:"missing-word-sentence",className:"form-control",placeholder:"Enter your sentence here",value:u.fullSentence||"",onChange:function(t){var e=t.target.value,n=e.split(" ").filter(Boolean).map((function(t,e){return{text:t,order:e,selected:!1}}));s(Object.assign(Object.assign({},u),{fullSentence:e,sentence:nt(n),preview:et(n),words:n}))},autoComplete:"off"})),d&&o().createElement(o().Fragment,null,o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label"},"Select the missing word(s)"),o().createElement("ul",{className:"list-unstyled d-flex flex-wrap mx-n1 mb-n1"},u.words.map((function(t,e){var n;return(null===(n=X(t.text))||void 0===n?void 0:n.trim())?o().createElement("li",{key:"".concat(e,"-").concat(t.text)},o().createElement(V.L,{className:"rounded border p-2 mx-1 mb-1 cursor-pointer ".concat(t.selected?"bg-info text-white":"bg-white"),onClick:function(){return t=e,n=u.words.map((function(e){return e.order!==t?e:Object.assign(Object.assign({},e),{selected:!e.selected})})),void s(Object.assign(Object.assign({},u),{words:n,preview:et(n),sentence:nt(n)}));var t,n}},X(t.text))):o().createElement(o().Fragment,{key:"".concat(e,"-").concat(t.text)})})))),o().createElement("div",null,o().createElement("label",{className:"cv-interaction-field-label"},"Preview"),o().createElement("p",null,u.preview))),o().createElement($,{error:u.error}))})),Mt(_t,Z.InteractionTypeId.MultipleChoice,pt),Mt(_t,Z.InteractionTypeId.ShortAnswer,(function(t){var e=t.state,n=void 0===e?function(t){return{question:t.name,suggestedResponse:t.data.suggestedResponse||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=t.showFeedback;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"short-answer-question"},"Question"),o().createElement(H.t0,{node:a})),o().createElement("input",{id:"short-answer-question",className:"form-control",onChange:function(t){r(Object.assign(Object.assign({},n),{question:t.target.value}))},value:n.question||i.data.text||"",placeholder:"Enter your question here",autoComplete:"off"}),o().createElement($,{error:n.error})),c&&o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"short-answer-suggested-response"},"Suggested Response  ",o().createElement("span",{className:"text-muted"},"(optional)")," ",o().createElement(ot.I,{tooltipText:"Provide a suggested response for your students"})),o().createElement(rt.Z,{id:"short-answer-suggested-response",className:"form-control",minRows:2,value:n.suggestedResponse||"",onChange:function(t){r(Object.assign(Object.assign({},n),{suggestedResponse:t.target.value}))},placeholder:"Give a suggested response for this question"})))})),Mt(_t,Z.InteractionTypeId.TrueOrFalse,pt),_t),Dt=(Mt(Ft={},Z.InteractionTypeId.Annotation,(function(t){var e;return(null===(e=t.annotation)||void 0===e?void 0:e.trim())?null:"Please provide an annotation"})),Mt(Ft,Z.InteractionTypeId.Image,(function(t){return t.url?null:"Please upload an image"})),Mt(Ft,Z.InteractionTypeId.MissingWord,(function(t){var e;return(null===(e=t.sentence)||void 0===e?void 0:e.trim())?t.words.find((function(t){return t.selected}))?null:"Please select a missing word":"Please provide a sentence"})),Mt(Ft,Z.InteractionTypeId.MultipleChoice,ft),Mt(Ft,Z.InteractionTypeId.ShortAnswer,(function(t){var e;return(null===(e=t.question)||void 0===e?void 0:e.trim())?null:"Please provide a question"})),Mt(Ft,Z.InteractionTypeId.TrueOrFalse,ft),Ft),Gt=(Mt(Rt={},Z.InteractionTypeId.Annotation,(function(t,e){var n,r,o,i,a;return r=this,o=void 0,i=void 0,a=Pt().mark((function r(){return Pt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.name="Annotation",e.data.annotation=null===(n=t.annotation)||void 0===n?void 0:n.trim(),e.actionableItems=[{name:"Answer"}],r.next=5,z.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(t){e(t)}}function c(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,c)}l((a=a.apply(r,o||[])).next())}))})),Mt(Rt,Z.InteractionTypeId.Image,(function(t,e){var n,r,o,i,a,c;return o=this,i=void 0,a=void 0,c=xt().mark((function o(){return xt().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e.data.url=t.url,e.name=(null===(n=t.caption)||void 0===n?void 0:n.trim())||"Image",e.data.caption=null===(r=t.caption)||void 0===r?void 0:r.trim(),e.actionableItems=[{name:"Answer"}],o.next=6,z.saveInteraction(e);case 6:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(t,e){function n(t){try{l(c.next(t))}catch(t){e(t)}}function r(t){try{l(c.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}l((c=c.apply(o,i||[])).next())}))})),Mt(Rt,Z.InteractionTypeId.MissingWord,(function(t,e){return n=this,r=void 0,o=void 0,i=Q().mark((function n(){var r;return Q().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.data.sentence=nt(t.words),e.name=t.preview,r=t.words.filter((function(t){return t.selected})),e.actionableItems=r.map((function(t){return{name:X(t.text),order:t.order,isCorrect:!0}})),n.next=6,z.saveInteraction(e);case 6:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(t,e){function a(t){try{l(i.next(t))}catch(t){e(t)}}function c(t){try{l(i.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}l((i=i.apply(n,r||[])).next())}));var n,r,o,i})),Mt(Rt,Z.InteractionTypeId.MultipleChoice,dt),Mt(Rt,Z.InteractionTypeId.ShortAnswer,(function(t,e){var n,r,o,i,a,c;return o=this,i=void 0,a=void 0,c=at().mark((function o(){return at().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e.name=null===(n=t.question)||void 0===n?void 0:n.trim(),e.data.suggestedResponse=null===(r=t.suggestedResponse)||void 0===r?void 0:r.trim(),e.actionableItems=[{name:"Answer"}],o.next=5,z.saveInteraction(e);case 5:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(t,e){function n(t){try{l(c.next(t))}catch(t){e(t)}}function r(t){try{l(c.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}l((c=c.apply(o,i||[])).next())}))})),Mt(Rt,Z.InteractionTypeId.TrueOrFalse,dt),Rt);function qt(t){return Gt[t]}var Bt=n(25723),Wt=n(65858),zt=["A","B","C","D"];function Yt(t){if(!t.enableImmersiveReader)return o().createElement(o().Fragment,null);var e=t.interaction,n=t.className,r=s.w.getTypeInfo(e.typeId),i=r.name,a=r.typeName,c="";switch(e.typeId){case Z.InteractionTypeId.Annotation:c=e.data.annotation;break;case Z.InteractionTypeId.Image:c=e.data.caption;break;case Z.InteractionTypeId.MissingWord:c=e.data.sentence.replace(/{([^{}]*)}/g,(function(){return"<u>&nbsp;&nbsp;&nbsp;&nbsp;</u>"}));break;case Z.InteractionTypeId.MultipleChoice:c=e.name,e.actionableItems.map((function(t,e){return c+="<br />".concat(zt[e],": ").concat(t.name)}));break;case Z.InteractionTypeId.ShortAnswer:c=e.name;break;case Z.InteractionTypeId.TrueOrFalse:c="True or false: ".concat(e.name)}var l=e.typeId===Z.InteractionTypeId.Annotation||e.typeId===Z.InteractionTypeId.MissingWord||e.typeId===Z.InteractionTypeId.MultipleChoice;return o().createElement(Bt.m,{title:i,text:c,html:l,className:"pr-2 ".concat(n||""),analyticsData:{id:e.interactiveId,type:a},analyticsOptions:{location:Wt.LocationContext.InteractivePlayer,entity:Wt.EntityType.Interactive,actionType:Wt.UserAction.Click,descriptor:Wt.ClickDescriptor.LaunchImmersiveReader}})}function Zt(t){var e=t.error;return t.error?o().createElement("p",{className:"mt-2 small text-danger"},e):o().createElement(o().Fragment,null)}var Ht,$t,Vt=n(28972);function Kt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qt(){return Vt.w.NotApplicable}function Jt(t,e){var n=t.actionableItems.filter((function(t){return t.isCorrect}));return n.every((function(t){return!e(t.id)}))?Vt.w.UnAnswered:n.every((function(t){var n;return t.name.trim().toLowerCase()===(null===(n=e(t.id))||void 0===n?void 0:n.trim().toLowerCase())}))?Vt.w.Correct:Vt.w.Incorrect}function Xt(t,e){return t.actionableItems.every((function(t){return!e(t.id)}))?Vt.w.UnAnswered:t.actionableItems.filter((function(t){return t.isCorrect})).every((function(t){return e(t.id)===t.name}))?Vt.w.Correct:Vt.w.Incorrect}function te(t,e){var n;return t.actionableItems.forEach((function(t){var r=e(t.id);n=r?r.status!==Ht.Correct?r.status!==Ht.Incorrect?Vt.w.AwaitingMarking:Vt.w.Incorrect:Vt.w.Correct:Vt.w.UnAnswered})),n}function ee(t,e){return function(n){var r=e.attempts.find((function(e){return e.id===t.id}));return null==r?void 0:r.answers.find((function(t){return t.id===n}))}}function ne(t,e){var n=ee(t,e);return Xt(t,(function(t){var e=n(t);return null==e?void 0:e.text}))}!function(t){t[t.Incorrect=0]="Incorrect",t[t.Correct=1]="Correct",t[t.PendingReview=2]="PendingReview"}(Ht||(Ht={}));var re=(Kt($t={},Z.InteractionTypeId.Annotation,Qt),Kt($t,Z.InteractionTypeId.Image,Qt),Kt($t,Z.InteractionTypeId.MissingWord,(function(t,e){var n=ee(t,e);return Jt(t,(function(t){var e=n(t);return null==e?void 0:e.text}))})),Kt($t,Z.InteractionTypeId.MultipleChoice,ne),Kt($t,Z.InteractionTypeId.ShortAnswer,(function(t,e){return te(t,ee(t,e))})),Kt($t,Z.InteractionTypeId.TrueOrFalse,ne),$t),oe={notApplicable:Qt,awaitingMarking:function(){return Vt.w.AwaitingMarking},isMissingWordCorrect:Jt,isMultipleChoiceCorrect:Xt,isShortAnswerMarkedCorrect:te,isInteractionCorrect:function(t,e){return(0,re[t.typeId])(t,e)}};function ie(t){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(t)}var ae="cv-missing-word-",ce=n(55452),le=n(83914),ue=n(61252),se=n(20789);var fe=["A","B","C","D"];function de(t){var e=1===t.interaction.actionableItems.filter((function(t){return t.isCorrect})).length;function n(e,n){t.onSelectAnswer&&t.onSelectAnswer(e,n)}return o().createElement(o().Fragment,null,t.interaction.actionableItems.map((function(r,i){var a=t.getSelectedAnswer(r.id);if(t.onlyShowSelectedAnswer&&!a)return o().createElement(o().Fragment,{key:i});var c=a?"bg-info text-white":t.unCheckedBackground,l=function(){return o().createElement(o().Fragment,null,fe[i])};t.showFeedback&&(c=r.isCorrect?"bg-success text-white":"bg-danger text-white ".concat("yodaE"),t.hideFeedbackIcons||(l=function(){return o().createElement(o().Fragment,null,r.isCorrect?o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Check}):o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Close}))}));var u=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&n(r,!a)}};return o().createElement(o().Fragment,{key:i},o().createElement("input",{id:r.id,type:e?"radio":"checkbox",name:"multiple-choice",checked:!!a,onChange:function(){return n(r,!a)},disabled:t.showFeedback,hidden:!0,tabIndex:-1}),o().createElement("label",Object.assign({className:"\n d-block\n rounded-lg\n shadow-sm\n mb-2\n ".concat("sm"===t.size?"p-2":"p-3","\n d-flex\n justify-content-between\n position-relative\n ").concat(t.showFeedback?"":"cursor-pointer","\n ").concat("KpbWq","\n ").concat(c),key:i,htmlFor:r.id},u),o().createElement("span",{className:"d-inline-block mr-3 cv-multiple-choice-bullet"},o().createElement(l,null)),o().createElement("span",{className:"flex-grow-1 pr-4"},r.name),!t.onlyShowSelectedAnswer&&o().createElement("span",{className:"uKRg2"},a&&o().createElement(se.q,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar}))))})))}function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function me(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}de.defaultProps={size:"lg",unCheckedBackground:"bg-white"};function he(t){function e(e){t.onSelectAnswer&&t.onSelectAnswer(e)}return o().createElement("div",{className:"d-flex ".concat(t.className?t.className:""," ").concat("sm"===t.size?"mx-n1":"mx-n2")},t.interaction.actionableItems.map((function(n,r){var i=t.getSelectedAnswer(n.id),a=i?"bg-info text-white":t.unCheckedBackground,c=function(){return o().createElement(o().Fragment,null)};t.showFeedback&&(a=n.isCorrect?"bg-success text-white":"bg-danger text-white ".concat("ZCkyL"),t.hideFeedbackIcons||(c=function(){return o().createElement(o().Fragment,null,n.isCorrect?o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Check}):o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Close}))}));var l=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&e(n)}};return o().createElement("label",Object.assign({key:r,htmlFor:n.id,className:"\n d-inline-block\n rounded-lg\n shadow-sm\n my-0\n position-relative\n overflow-hidden\n ".concat("sm"===t.size?"p-4 mx-1 h5":"p-5 mx-2 h4","\n ").concat(t.showFeedback?"":"cursor-pointer","\n ").concat(a)},l),o().createElement("input",{id:n.id,type:"radio",name:"multiple-choice",checked:!!i,onChange:function(){return e(n)},disabled:t.showFeedback,hidden:!0}),n.name,o().createElement("span",{className:"position-absolute p-2 ".concat("CBgCv")},o().createElement(c,null)),o().createElement("span",{className:"".concat("CVTEm").concat("sm"===t.size?" ".concat("tbPTs"):"")},i&&o().createElement(se.q,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar})))})))}var ve,ye,ge,be,we;function Ee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}he.defaultProps={size:"lg",unCheckedBackground:"bg-white"};var xe=function(){return!0},Ie=function(){return!1},Se=(Ee(ve={},Z.InteractionTypeId.Annotation,Ie),Ee(ve,Z.InteractionTypeId.Image,Ie),Ee(ve,Z.InteractionTypeId.MissingWord,xe),Ee(ve,Z.InteractionTypeId.MultipleChoice,xe),Ee(ve,Z.InteractionTypeId.ShortAnswer,(function(t){return!!t.data.suggestedResponse})),Ee(ve,Z.InteractionTypeId.TrueOrFalse,xe),ve);function ke(t){return Se[t]}var Oe=(Ee(ye={},Z.InteractionTypeId.Annotation,(function(t){var e=t.interaction.data.annotation.replace(/<(a)(.*?)>/g,'<$1 target="_blank" $2>');return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:e}}),o().createElement(Yt,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),Ee(ye,Z.InteractionTypeId.Image,(function(t){var e=t.interaction,n=t.recalculateScroll,r=o().useCallback((function(t){t&&(t.onload=function(){n()})}),[]);return o().createElement("div",{className:"cv-interactive-question cv-image-interactive"},o().createElement("div",{className:"cv-image-container text-center"},o().createElement("img",{className:"img-fluid shadow-lg",src:e.data.url,ref:r}),e.data.caption&&o().createElement(o().Fragment,null,o().createElement("p",{className:"mt-3"},e.data.caption,o().createElement(Yt,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})))))})),Ee(ye,Z.InteractionTypeId.MissingWord,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=r.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat(ae).concat(e,"}")})).split(/{([^{}]*)}/g);function c(t,r){if(r.stopPropagation(),r.target.value){var o,i,a;n((o={},i=t.id,a=r.target.value,i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o))}else{var c=e,l=t.id,u=(c[l],function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(c,["symbol"===ie(l)?l:l+""]));n(u,!0)}}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"mb-2"},a.map((function(t,n){var a;if(!t.startsWith(ae))return t;var l=t.replace(ae,""),u=r.actionableItems.find((function(t){return t.order.toString()===l}));if(u){var s,f,d=e[u.id]||"",p=(s=u.name,(f=document.createElement("canvas").getContext("2d")).font="17pt arial",f.measureText(s).width);if(i){var m=u.name.toLowerCase().toString()===(null===(a=e[u.id])||void 0===a?void 0:a.toLowerCase().toString());return o().createElement(o().Fragment,{key:n},!m&&o().createElement(o().Fragment,null,o().createElement("del",{className:"text-danger"},d)," "),o().createElement("span",{className:"text-success"},u.name))}return o().createElement("span",{className:"cv-missing-word-input-container",key:n},o().createElement("input",{style:{width:p/16+"rem"},onChange:function(t){return c(u,t)},value:d,disabled:!!e.submitted,className:"cv-missing-word-input",autoComplete:"off"}))}}))),o().createElement(Zt,{error:e.error}),o().createElement(Yt,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),Ee(ye,Z.InteractionTypeId.MultipleChoice,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=t.imageApi,c=t.currentUser,l=1===r.actionableItems.filter((function(t){return t.isCorrect})).length;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,r.name,o().createElement(Yt,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),!l&&o().createElement("p",{className:"text-muted"},o().createElement("small",null,"This question has multiple correct answers")),o().createElement(de,{interaction:r,showFeedback:i,onSelectAnswer:function(t,r){if(!e.submitted)if(l)n(me({},t.id,t.name),!0);else if(r)n(me({},t.id,t.name));else{var o=e,i=t.id,a=(o[i],function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(o,["symbol"===pe(i)?i:i+""]));n(a,!0)}},getSelectedAnswer:function(t){return e[t]},imageApi:a.toString(),userInitials:ce.l.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),o().createElement(Zt,{error:e.error}))})),Ee(ye,Z.InteractionTypeId.ShortAnswer,(function(t){var e=t.interaction,n=t.state,r=t.setState;return t.showFeedback?o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,e.name),o().createElement("label",{className:"cv-interaction-field-label"},"My answer"),o().createElement("p",null,n[e.actionableItems[0].id]),e.data.suggestedResponse&&o().createElement(o().Fragment,null,o().createElement("label",{className:"cv-interaction-field-label mt-1"},"Teacher's suggested answer"),o().createElement("p",null,e.data.suggestedResponse))):o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,e.name,o().createElement(Yt,{interaction:e,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o().createElement(rt.Z,{id:"short-answer-answer",className:"form-control mt-2",minRows:3,value:n[e.actionableItems[0].id]||"",onChange:function(t){var o,i,a;r(Object.assign(Object.assign({},n),(o={},i=e.actionableItems[0].id,a=t.target.value,i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o)))},disabled:!!n.submitted}),o().createElement(Zt,{error:n.error}))})),Ee(ye,Z.InteractionTypeId.TrueOrFalse,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=t.imageApi,c=t.currentUser,l=r.actionableItems.find((function(t){return t.isCorrect}));return o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,r.name,o().createElement(Yt,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o().createElement(he,{className:"justify-content-center",interaction:r,showFeedback:i,onSelectAnswer:function(t){var r,o,i;e.submitted||n((r={},o=t.id,i=t.name,o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r),!0)},getSelectedAnswer:function(t){return e[t]},imageApi:a.toString(),userInitials:ce.l.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),i&&o().createElement("div",{className:"text-center px-5 mt-3"},o().createElement("p",null,"The answer is ",o().createElement("strong",null,l.name)),r.data.feedback&&o().createElement("p",null,r.data.feedback)),o().createElement(Zt,{error:e.error}))})),ye);function Ce(){return""}var Ne=(Ee(ge={},Z.InteractionTypeId.Annotation,Ce),Ee(ge,Z.InteractionTypeId.Image,Ce),Ee(ge,Z.InteractionTypeId.MissingWord,(function(t,e){var n=Object.keys(t).filter((function(e){var n;return!!(null===(n=t[e])||void 0===n?void 0:n.trim())})).length;return n?n!==e.actionableItems.length?"Please fill in all of the missing words":null:"Please fill in the missing words"})),Ee(ge,Z.InteractionTypeId.MultipleChoice,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),Ee(ge,Z.InteractionTypeId.ShortAnswer,(function(t){return Object.keys(t).filter((function(e){var n;return!!(null===(n=t[e])||void 0===n?void 0:n.trim())})).length?null:"Please provide an answer to the question"})),Ee(ge,Z.InteractionTypeId.TrueOrFalse,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),ge),je=(Ee(be={},Z.InteractionTypeId.Annotation,null),Ee(be,Z.InteractionTypeId.Image,null),Ee(be,Z.InteractionTypeId.MissingWord,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),Ee(be,Z.InteractionTypeId.MultipleChoice,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),Ee(be,Z.InteractionTypeId.ShortAnswer,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),Ee(be,Z.InteractionTypeId.TrueOrFalse,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),be);function Le(t){return je[t]}var Te=(Ee(we={},Z.InteractionTypeId.Annotation,oe.notApplicable),Ee(we,Z.InteractionTypeId.Image,oe.notApplicable),Ee(we,Z.InteractionTypeId.MissingWord,(function(t,e){return oe.isMissingWordCorrect(e,(function(e){return t[e]}))})),Ee(we,Z.InteractionTypeId.MultipleChoice,(function(t,e){return oe.isMultipleChoiceCorrect(e,(function(e){return t[e]}))})),Ee(we,Z.InteractionTypeId.ShortAnswer,oe.awaitingMarking),Ee(we,Z.InteractionTypeId.TrueOrFalse,(function(t,e){return e.actionableItems.filter((function(t){return t.isCorrect})).every((function(e){return t[e.id]===e.name}))?Vt.w.Correct:Vt.w.Incorrect})),we);function Ae(t){return Te[t]}function Pe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _e={interactions:{},timepoints:{}};function Fe(t,e){return"interaction"===e.type?{timepoints:t.timepoints,interactions:Object.assign(Object.assign({},t.interactions),Pe({},e.id,e.value))}:"timepoint"===e.type?{interactions:t.interactions,timepoints:Object.assign(Object.assign({},t.timepoints),Pe({},e.id,e.value))}:void 0}function Re(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Me={interactionIndex:0},Ue=function(t){var e,n,r=t.mode,i=t.timepoint,a=t.latestSession,c=r===u.InteractiveMode.Create,l=o().useReducer(Fe,null,(function(){return function(t){return t?{timepoints:{},interactions:t.actions.reduce((function(t,e){var n;return t[e.interactionId]=Object.assign(Object.assign({},t[e.interactionId]),(Pe(n={},e.actionableItemId,e.data),Pe(n,"submitted",!0),n)),t}),{})}:_e}(a)})),s=(n=2,function(t){if(Array.isArray(t))return t}(e=l)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Re(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=s[0],d=s[1],p=g(null==i?void 0:i.id),m=null==i?void 0:i.interactions[p.interactionIndex],h="number"==typeof p.nextInteractionIndex?null==i?void 0:i.interactions[p.nextInteractionIndex]:null,v=b(null==m?void 0:m.id),y=b(null==h?void 0:h.id);function g(t){return t&&f.timepoints[t]||Me}function b(t){if(!t)return{};var e=f.interactions[t];return e||c?e:{}}function w(t,e,n){var r=b(t);d({type:"interaction",id:t,value:Object.assign(Object.assign({},n?{}:r),e)})}return{state:f,interaction:m,interactionState:v,timepointState:p,nextInteraction:h,nextInteractionState:y,getTimepointState:g,getInteractionState:b,updateTimepointState:function(t,e){var n=g(t);d({type:"timepoint",id:t,value:Object.assign(Object.assign({},n),e)})},updateInteractionState:w,clearTimepointState:function(t){d({type:"timepoint",id:t,value:void 0})},clearInteractionState:function(t){d({type:"interaction",id:t,value:void 0})},userUpdateInteractionState:function(t,e){w(m.id,Object.assign(Object.assign({},t),{hasChanges:!0,error:null}),e)}}};function De(t){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(t)}function Ge(){Ge=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==De(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}var qe=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function c(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((r=r.apply(t,e||[])).next())}))},Be=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},We=!1;function ze(t){var e="".concat(t.className," ").concat("Mr0S0");t.children?e+=" ".concat("vHTVo"):e+=" ".concat("vIGn0");var n=o().createElement(le.x,{svgName:t.svgName,className:"cDUaE"});return o().createElement(V.L,{className:e,onClick:t.onClick},n,t.children)}function Ye(t){var e=t.isCreate,n=t.open,r=t.showTypeSelector;return!e||n?o().createElement(o().Fragment,null):o().createElement(ze,{className:"btn btn-outline-dark cv-add-question",onClick:r,svgName:ue.vn.Plus},"Add question")}var Ze=n(80181),He=n(5266),$e=n(99705);function Ve(t){return o().createElement("div",{className:"my-5 text-center"},o().createElement("h2",{className:"h3"},"Select an interaction to get started"),o().createElement("p",{className:"mb-0"},"Choose a point in the video and add a question to interact and engage your students."),!(!t.supportSiteUrl||!t.currentUser)&&o().createElement("a",{href:He.o.getArticle(t.supportSiteUrl.toString(),$e.w.MakeInteractive,t.currentUser.countryCode,"articles"),target:"_blank",className:"btn btn-link text-info"},"How do I make interactives?"))}function Ke(t){var e=t.isCreate,n=t.interactive,r=t.interaction,i=t.portalNode,a=t.goToTimepoint,c=t.promptDelete,l=t.supportSiteUrl,u=t.currentUser;if(!i)return o().createElement(o().Fragment,null);var s=n.timepoints.reduce((function(t,e){return t+e.interactions.length}),0);return o().createElement(H.Nq,{node:i},s?o().createElement(o().Fragment,null,o().createElement("h2",{className:"h4 mt-3"},"Question List (",s,")"),o().createElement(Ze.Z,{interactive:n,maxHeight:300,goToTimepoint:a,selectedInteractionId:null==r?void 0:r.id,onClickDelete:e?c:void 0})):e?o().createElement(Ve,{currentUser:u,supportSiteUrl:l}):o().createElement(o().Fragment,null))}var Qe=n(4234);var Je=n(42503);function Xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var tn=[Z.InteractionTypeId.MissingWord,Z.InteractionTypeId.MultipleChoice,Z.InteractionTypeId.TrueOrFalse,Z.InteractionTypeId.ShortAnswer,Z.InteractionTypeId.Image,Z.InteractionTypeId.Annotation];function en(t){var e,n,r=t.addInteraction,i=t.cancelTypeSelector,a=t.player,c=t.timepoint,l=t.open,u=t.isCreate,f=t.interaction,d=(e=o().useState((0,Je.m)(a.currentTime()||0)),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Xe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=d[0],m=d[1];return o().useEffect((function(){var t=function(){m((0,Je.m)(a.currentTime()))};return a.on("timeupdate",t),function(){return a.off("timeupdate",t)}}),[]),f||!u?o().createElement(o().Fragment,null):o().createElement("div",{className:"d-flex align-items-center justify-content-center h-100"},o().createElement("div",{className:"cv-interactive-type-selector d-flex flex-wrap justify-content-center align-items-center"},o().createElement("div",{className:"text-center font-weight-bold w-100 text-body mb-3 cv-add-question-copy"},c?"Add another question at:":"Add a question at:"," ",p),tn.map((function(t,e){var n=s.w.getTypeInfo(t),i=n.name,a=n.bgClassName,c=n.Svg;return o().createElement(V.L,{key:e,className:"cv-type-selector rounded py-2 m-1 ".concat(a),onClick:function(){return r(t)}},o().createElement("span",{className:"cv-create-type-icon mb-1"},o().createElement(c,null)),o().createElement("div",{className:"d-flex align-items-center justify-content-center cv-interaction-type-name px-1"},i))})),(c||l)&&o().createElement("div",{className:"text-center w-100 mt-2 ".concat(c?"":"cv-adding-first-cancel")},o().createElement(V.L,{className:"btn btn-link",onClick:i},"Cancel"))))}function nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rn(t){var e,n,r=t.typeId,i=t.currentIndex,a=t.numberOfInteractions,c=t.changeIndex,l=t.player,u=(e=o().useState((0,Je.m)(l.currentTime()||0)),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nn(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=u[0],d=u[1];o().useEffect((function(){var t=function(){d((0,Je.m)(l.currentTime()))};return l.on("timeupdate",t),function(){return l.off("timeupdate",t)}}),[]);var p=s.w.getTypeInfo(r),m=p.name,h=p.bgClassName,v=i<a-1,y=i>0;return o().createElement("div",{className:"text-center d-flex justify-content-between align-items-center p-1 ".concat(h)},o().createElement(V.L,{onClick:function(){y&&c(i-1)},className:y?"":"invisible"},o().createElement(le.x,{size:le.S.Medium,svgName:ue.vn.ChevronLeft})),o().createElement("div",null,o().createElement("div",{className:"h6 mb-0"},m),a>1&&o().createElement("div",null,i+1," of ",a," at ",f)),o().createElement(V.L,{onClick:function(){v&&c(i+1)},className:v?"":"invisible"},o().createElement(le.x,{size:le.S.Medium,svgName:ue.vn.ChevronRight})))}function on(t){var e=t.typeId,n=s.w.getTypeInfo(e),r=n.name,i=n.prompt,a=n.bgClassName,c=n.Svg;return o().createElement("div",{className:"text-center text-body d-flex justify-content-between align-items-center px-3 pt-3"},o().createElement("div",{className:"d-flex align-items-center"},o().createElement("span",{className:"cv-interaction-icon rounded my-1 text-white ".concat(a)},o().createElement(c,null)),o().createElement("span",{className:"text-left flex-grow-1"},o().createElement("div",{className:"h5 ".concat(i?"":"mb-0")},o().createElement("strong",null,r)),i&&o().createElement("div",{className:"h6 mb-0"},i))))}function an(t){var e=t.isCreate,n=t.interaction,r=t.player,i=t.changeIndex,a=t.timepointState,c=t.timepoint;return e?o().createElement(rn,{typeId:n.typeId,changeIndex:i,player:r,currentIndex:a.interactionIndex,numberOfInteractions:c.interactions.length}):o().createElement(on,{typeId:n.typeId})}var cn=n(99910);function ln(t){var e=t.interaction,n=t.interactionState,o=t.onClickContinue,i=t.onClickSave,a=t.onClickCancel,c=t.onClickAddAnother,l=t.onClickDiscard,u=_(e.id),s=!!(null==n?void 0:n.hasChanges),f=!!(null==n?void 0:n.spinner);return r.createElement("div",{className:"cv-timpoint-button-container"},u?r.createElement(V.L,{className:"btn btn-link",onClick:a},"Cancel"):s?r.createElement(V.L,{className:"btn btn-link",onClick:l},"Discard"):r.createElement(V.L,{className:"btn btn-link",onClick:c},"Add another question"),f?r.createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):u?s?r.createElement(V.L,{className:"btn btn-dark ml-2",onClick:i},"Save"):r.createElement(V.L,{className:"btn btn-dark ml-2 disabled",onClick:function(){}},"Save"):s?r.createElement(V.L,{className:"btn btn-dark ml-2",onClick:i},"Save"):r.createElement(ze,{className:"btn btn-dark ml-2",onClick:o,svgName:ue.vn.Play},"Continue"))}function un(t){var e=t.typeId,n=t.interactionState,o=t.onClickSkip,i=t.numberOfInteractions,a=t.currentIndex,c=t.changeIndex,l=!!(null==n?void 0:n.submitted),u=!!(null==n?void 0:n.hasChanges),s=!!(null==n?void 0:n.spinner),f=!!Le(e),d=a<i-1;var p=a>0;return r.createElement("div",{className:"cv-timpoint-button-container flex-wrap"},!l&&f&&r.createElement(V.L,{className:"btn btn-link",onClick:o},"Come back later"),i>1&&a>0&&r.createElement(ze,{className:"btn btn-dark ml-2 ".concat(p?"":"disabled"),onClick:function(){p&&c(a-1)},svgName:ue.vn.ChevronUp}),s?r.createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):l||!f?1===i||a===i-1?r.createElement(ze,{className:"btn btn-dark ml-2",onClick:o,svgName:ue.vn.Play},"Continue"):r.createElement(V.L,{className:"btn btn-dark ml-2 ".concat(d?"":"disabled"),onClick:function(){d&&c(a+1)}},"Next"):r.createElement(V.L,{className:"btn btn-dark ml-2 ".concat(u?"":"disabled"),onClick:function(){u&&t.onClickSubmit()}},"Save"))}function sn(t){var e=t.isCreate,n=t.interaction,r=t.interactionState,i=t.continueInteractive,a=t.saveInteraction,c=t.cancel,l=t.addAnotherQuestion,u=t.discardChanges,s=t.submitInteractionAnswer,f=t.onClickSkip,d=t.changeIndex,p=t.timepoint,m=t.currentIndex;return o().createElement(o().Fragment,null,e?o().createElement(ln,{interaction:n,interactionState:r,onClickContinue:i,onClickSave:a,onClickCancel:c,onClickAddAnother:l,onClickDiscard:function(){return u()}}):o().createElement(un,{typeId:n.typeId,interactionState:r,onClickSubmit:s,onClickSkip:f,changeIndex:d,currentIndex:m,numberOfInteractions:p.interactions.length}))}var fn=n(86509);function dn(t){var e=t.timepoint,n=t.interaction,r=t.promptDelete,i=t.optionsPortalNode,a=t.setView;if(!n)return o().createElement(o().Fragment,null);var c=[];if(c.push({label:"Move time point",onClick:function(){return a("move")}}),e.interactions.length>1){var l=_(n.id);c.push({label:"Re-order questions",onClick:function(){return a("reorder")},className:l?"disabled":""})}return c.push({label:"Delete",onClick:function(){return r(n.id)},className:"text-danger"}),o().createElement(H.Nq,{node:i},!!n&&o().createElement(fn.m,{actions:c}))}function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function mn(){mn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==pn(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function hn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var yn=null,gn=0,bn=1;function wn(t){var e=t.timepoint,n=t.updateTimepointTime,r=t.saveTimepoint,i=t.back,a=t.clearTimepointTimeState,c=hn(o().useState((0,Je.m)(e.visibleAt/1e3)),2),l=c[0],u=c[1],s=hn(o().useState(!1),2),f=s[0],d=s[1];function p(t){n(t*bn),u((0,Je.m)(e.visibleAt/1e3)),2==++gn?bn=5:4===gn?bn=20:6===gn?bn=60:8===gn&&(bn=120),yn||(yn=window.setInterval((function(){return p(t)}),200),window.addEventListener("mouseup",m))}function m(){window.removeEventListener("mouseup",m),window.clearInterval(yn),yn=null,gn=0,bn=1}return o().useEffect((function(){return m}),[]),o().createElement(o().Fragment,null,o().createElement("div",{className:"cv-timepoint flex-grow-1"},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{className:"cv-interactive-question"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Move time point"),o().createElement("div",{className:"text-center mt-3"},o().createElement(V.L,{className:"cv-left-arrow d-inline-block cursor-pointer",onClick:function(){},onMouseDown:function(){return p(-1)},onKeyDown:function(t){t.stopPropagation(),13===t.keyCode&&0===gn&&p(-1)},onKeyUp:m}),o().createElement("input",{className:"form-control text-center d-inline-block cv-move-timepoint-input",value:l,onChange:function(){},onKeyDown:function(t){t.stopPropagation(),37===t.keyCode&&0===gn&&p(-1),39===t.keyCode&&0===gn&&p(1)},onKeyUp:m}),o().createElement(V.L,{className:"cv-right-arrow d-inline-block cursor-pointer",onClick:function(){},onMouseDown:function(){return p(1)},onKeyDown:function(t){t.stopPropagation(),13===t.keyCode&&0===gn&&p(1)},onKeyUp:m}))))),o().createElement("div",{className:"cv-timpoint-button-container"},o().createElement(V.L,{className:"btn btn-link",onClick:function(){a(!0),i()}},"Cancel"),f?o().createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o().createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement(V.L,{className:"btn btn-dark",onClick:function(){return t=this,e=void 0,n=void 0,o=mn().mark((function t(){return mn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.next=3,r();case 3:i();case 4:case"end":return t.stop()}}),t)})),new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function c(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}},"Save")))}var En=n(679);var xn=n(86572);function In(t){return In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(t)}function Sn(){Sn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==In(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function kn(t){return function(t){if(Array.isArray(t))return Nn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function On(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||Cn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cn(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var jn=(0,En.SortableElement)((function(t){var e=t.interaction,n=s.w.getTypeInfo(e.typeId).bgClassName;return o().createElement("div",{className:"py-2 text-left"},o().createElement("span",{className:"fB8W8"},o().createElement(le.x,{size:le.S.Small,svgName:ue.vn.Handle})),o().createElement(xn.y,{interaction:e,iconClassName:"".concat("GSE1a"," ").concat(n),questionClassName:"".concat("qKMzc"," clamp-1")}))})),Ln=(0,En.SortableContainer)((function(t){var e=t.interactions,n=function(){var t=o().useRef();function e(){document.body.style.cursor="",document.removeEventListener("mouseup",e),t.current&&(t.current.style.cursor="grab")}return{ref:t,style:{cursor:"grab"},onMouseDown:function(){document.body.style.cursor="grabbing",document.addEventListener("mouseup",e),t.current&&(t.current.style.cursor="grabbing")},onMouseUp:e}}();return o().createElement("div",Object.assign({tabIndex:0},n),e.map((function(t,e){return o().createElement(jn,{key:t.id,index:e,interaction:t})})))}));function Tn(t){var e=On(o().useState(!1),2),n=e[0],r=e[1],i=On(o().useState(kn(t.interactions)),2),a=i[0],c=i[1],l=On(o().useState(!1),2),u=l[0],s=l[1];return o().createElement(o().Fragment,null,o().createElement("div",{className:"cv-timepoint flex-grow-1"},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{className:"cv-interactive-question"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Re-order questions"),o().createElement("div",{className:"text-center mt-3"},o().createElement(Ln,{onSortEnd:function(t){var e=t.oldIndex,n=t.newIndex;e!==n&&(c(kn(function(t,e,n){for(;e<0;)e+=t.length;for(;n<0;)n+=t.length;if(n>=t.length)for(var r=n-t.length+1;r--;)t.push(void 0);return t.splice(n,0,t.splice(e,1)[0]),t}(a,e,n))),s(!0))},interactions:a,helperClass:"jGy0h",lockAxis:"y"}))))),o().createElement("div",{className:"cv-timpoint-button-container"},o().createElement(V.L,{className:"btn btn-link",onClick:function(){c(kn(t.interactions)),s(!1),t.back()}},"Cancel"),n?o().createElement(V.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o().createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement(V.L,{className:"btn btn-dark ".concat(u?"":"disabled"),onClick:function(){return e=this,n=void 0,o=void 0,i=Sn().mark((function e(){return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=2;break}return e.abrupt("return");case 2:return r(!0),e.next=5,t.reOrderQuestions(a);case 5:r(!1),t.back();case 7:case"end":return e.stop()}}),e)})),new(o||(o=Promise))((function(t,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function c(t){try{l(i.throw(t))}catch(t){r(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i}},"Save")))}var An=n(3747),Pn=n(86764);function _n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rn(t){var e=t.isCreate,n=t.interaction,r=t.mode,i=t.immediateFeedback,a=t.interactionState,c=t.shouldFocus,l=t.delayFocus,s=t.open,f=t.timepoint,d=t.userUpdateInteractionState,p=t.submitInteractionAnswer,m=t.saveInteraction,h=t.skip,v=o().useRef(),y=o().useRef(),g=o().useRef(0),b=(0,An.a)(Pn.r.XLDown),w=!e||b;function E(){return!!v.current&&!!c&&!!s}function x(){v.current&&(v.current.focus(),k(!0))}var I=_n(o().useState(!1),2),S=I[0],k=I[1];o().useEffect((function(){E()&&(S||(l&&w?g.current=window.setTimeout((function(){g.current=0,E()&&x()}),400):x()))}),[v.current,S]);var O=_n(o().useState("question"),2),C=O[0],N=O[1],j=o().useMemo((function(){return(0,H.oD)()}),[]),L=n?function(t,e){if(e===u.InteractiveMode.Create)return function(t){return Ut[t]}(t);if(e===u.InteractiveMode.View)return function(t){return Oe[t]}(t);throw new Error("Cannot find components for the mode ".concat(e))}(n.typeId,r):null,T=i;return e||(T=T&&(null==a?void 0:a.submitted)),o().createElement(o().Fragment,null,o().createElement(dn,Object.assign({optionsPortalNode:j,setView:N},t)),o().createElement(Qe.Z,{style:{height:"100%"},ref:y},o().createElement(en,Object.assign({},t)),!!n&&o().createElement("div",{className:"d-flex flex-column h-100"},o().createElement(an,Object.assign({},t)),"question"===C&&o().createElement(o().Fragment,null,o().createElement("form",{className:"cv-timepoint flex-grow-1",tabIndex:-1,onSubmit:function(t){t.preventDefault(),e?m():p()}},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{ref:v,tabIndex:0}),o().createElement(L,Object.assign({state:a,setState:d,recalculateScroll:function(){y.current.recalculate()},showFeedback:T,optionsPortalNode:j},t)))),o().createElement(sn,Object.assign({onClickSkip:function(){g.current&&window.clearTimeout(g.current),h()}},t))),"move"===C&&o().createElement(wn,Object.assign({back:function(){return N("question")}},t)),"reorder"===C&&o().createElement(Tn,Object.assign({back:function(){return N("question")},interactions:f.interactions},t)))))}function Mn(t){var e=t.open,n=t.nextInteraction,r=t.nextInteractionState,i=t.timepointState,a=t.interaction,c=t.delayFocus,l=n&&i.nextInteractionIndex<i.interactionIndex,u=n&&i.nextInteractionIndex>i.interactionIndex,s=u&&i.slideIn,f=l&&i.slideIn;return o().createElement("div",{className:"cv-interactive ".concat(e?"cv-open":"")},l&&o().createElement("div",{className:"cv-prev-interaction ".concat(i.slideIn?"cv-slide-in":"")},o().createElement(Rn,Object.assign({},t,{currentIndex:i.nextInteractionIndex,interaction:n,interactionState:r}))),o().createElement("div",{className:"\n cv-main-slide\n ".concat(s?"cv-slide-out-up":"","\n ").concat(f?"cv-slide-out-down":"","\n ").concat(n?"cv-transitioning":"","\n ")},o().createElement(Rn,Object.assign({key:null==a?void 0:a.id},t,{currentIndex:i.interactionIndex,shouldFocus:a&&!l&&!u,delayFocus:c}))),u&&o().createElement("div",{className:"cv-next-interaction ".concat(i.slideIn?"cv-slide-in":"")},o().createElement(Rn,Object.assign({},t,{currentIndex:i.nextInteractionIndex,interaction:n,interactionState:r}))))}function Un(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Dn(t){var e,n,r=t.player,i=t.resultsService,a=t.interactive,c=t.setShowSummary,l=t.mobile,u=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Un(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Un(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],f=u[1],d=t.player.activePlugins_.activityStatusPlugin,p=t.player.activePlugins_.favouritePlugin;function m(){r.currentTime()>a.timepoints[a.timepoints.length-1].visibleAt/1e3+1?f(!0):f(!1)}if(o().useEffect((function(){if(i&&!l)return r.on("timeupdate",m),function(){return r.off("timeupdate",m)}}),[]),!s)return null;var h="btn btn-outline-dark cv-show-summary";return p&&(h+=" cv-has-favourite-plugin"),d&&(h+=" cv-has-activity-status-plugin"),o().createElement(V.L,{className:h,onClick:function(){c(!0),r.pause(),r.hide()}},r.gradePassbackPlugin().enabled?"Submit answers":"View summary")}function Gn(t){var e=t.interactive,n=t.duration;return n?o().createElement(o().Fragment,null,e.timepoints.map((function(e,r){if(!e.interactions.length)return o().createElement(o().Fragment,null);var i=s.w.getTypeInfo(e.interactions[0].typeId).bgClassName,a=e.visibleAt/1e3/n*100;return o().createElement("span",{key:r,className:"".concat("pUo8u"," ").concat(i),style:{left:"".concat(a,"%")},onClick:function(n){return r=e.id,o=e.interactions[0].id,n.stopPropagation(),void t.goToTimepoint(r,o);var r,o}})}))):o().createElement(o().Fragment,null)}var qn=n(10874),Bn=n(78276);function Wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zn(t){var e,n,r=t.duration,i=t.progress,a=t.player,c=(e=o().useState(i.length),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Wn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wn(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1],l=[];if(i.length){var u=i[0];l.push(u),i.forEach((function(t,e){0!==e&&(u.end.time+1>t.start.time&&u.start.time<t.start.time?u.end=t.end:(u=t,l.push(u)))}))}return o().useEffect((function(){var t=function(){c(i.length)};return a.on("progressflush",t),function(){return a.off("progressflush",t)}}),[]),o().createElement(o().Fragment,null,l.map((function(t,e){var n=t.start.time/r*100,i=100*(1-t.end.time/r);return o().createElement("span",{key:e,className:"BnKli",style:{left:"".concat(n,"%"),right:"".concat(i,"%")}})})))}function Yn(t){return ct.m.last(t.results)}function Zn(t,e){return ct.m.findWhere(null==e?void 0:e.attempts,{id:t})}var Hn="cv-missing-word-";const $n="Y7ls8";var Vn;function Kn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qn=function(){return o().createElement(o().Fragment,null)},Jn=(Kn(Vn={},Z.InteractionTypeId.Annotation,Qn),Kn(Vn,Z.InteractionTypeId.Image,Qn),Kn(Vn,Z.InteractionTypeId.MissingWord,(function(t){var e=t.interaction.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat(Hn).concat(e,"}")})).split(/{([^{}]*)}/g),n="p-2";return t.reportsStyling||(n+=" border rounded"),o().createElement("div",{className:n},e.map((function(e,n){if(!e.startsWith(Hn))return e;var r=e.replace(Hn,""),i=t.interaction.actionableItems.find((function(t){return t.order.toString()===r}));if(i){var a=t.answers.find((function(t){return t.id==i.id}));if(a){if(!t.showFeedback)return o().createElement("strong",{key:n,className:"text-info"},a.text);var c=a.status===Ht.Correct;return o().createElement(o().Fragment,{key:n},!c&&o().createElement(o().Fragment,null,o().createElement("del",{className:"text-danger"},o().createElement("strong",null,a.text))," "),o().createElement("strong",{className:"text-success"},i.name))}}})))})),Kn(Vn,Z.InteractionTypeId.MultipleChoice,(function(t){var e,n,r,i,a="my-2";return t.reportsStyling&&(a+=" mx-2"),o().createElement("div",{className:a},o().createElement(de,{interaction:t.interaction,showFeedback:t.showFeedback,getSelectedAnswer:function(e){var n=t.answers.find((function(t){return t.id==e}));return null==n?void 0:n.text},imageApi:t.imageCdnUrl,userInitials:t.anonymisedUserName?ce.l.getInitialsFromFullName(t.anonymisedUserName):ce.l.getInitials(null===(e=t.user)||void 0===e?void 0:e.name,null===(n=t.user)||void 0===n?void 0:n.surname),userAvatar:t.anonymisedUserName?null:null===(i=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===i?void 0:i.url,onlyShowSelectedAnswer:!t.showAvatar,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat($n," text-white")}))})),Kn(Vn,Z.InteractionTypeId.TrueOrFalse,(function(t){var e,n,r,i,a="justify-content-start";return t.reportsStyling&&(a="justify-content-center"),o().createElement("div",{className:"my-2"},o().createElement(he,{className:a,interaction:t.interaction,showFeedback:t.showFeedback,hideFeedbackIcons:!t.showAvatar,getSelectedAnswer:function(e){var n=t.answers.find((function(t){return t.id==e}));return null==n?void 0:n.text},imageApi:t.imageCdnUrl,userInitials:t.anonymisedUserName?ce.l.getInitialsFromFullName(t.anonymisedUserName):ce.l.getInitials(null===(e=t.user)||void 0===e?void 0:e.name,null===(n=t.user)||void 0===n?void 0:n.surname),userAvatar:t.anonymisedUserName?null:null===(i=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===i?void 0:i.url,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat($n," text-white")}))})),Kn(Vn,Z.InteractionTypeId.ShortAnswer,(function(t){var e=ct.m.first(t.answers);if(!e)return o().createElement(o().Fragment,null);var n="rounded p-2 mb-2";return t.reportsStyling||(n+=" bg-info text-white"),o().createElement("div",{className:n},e.text)})),Vn),Xn=n(23481).T.encloseNamespace("interactives.responseTypes");function tr(){return o().createElement("p",{className:"p-2"},o().createElement("em",null,Xn("noResponse")))}function er(t){return o().createElement(o().Fragment,null,t.correctness===Vt.w.Correct&&o().createElement("div",{className:"ml-2 text-success"},o().createElement(le.x,{svgName:ue.vn.Check})),t.correctness===Vt.w.Incorrect&&o().createElement("div",{className:"ml-2 text-danger"},o().createElement(le.x,{svgName:ue.vn.Close})))}function nr(t){return o().createElement("div",{className:"d-flex align-items-center justify-content-between"},o().createElement("strong",null,t.anonymisedUserName||ce.l.getFullName(t.studentResults.user)),o().createElement(er,{correctness:t.correctness}))}function rr(t){return t.correctness!==Vt.w.AwaitingMarking?o().createElement(o().Fragment,null):o().createElement("div",{className:"d-flex justify-content-end mt-1"},o().createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===Ht.Correct?"text-success":"")},o().createElement(le.x,{svgName:t.markedStatus===Ht.Correct?ue.vn.CheckCircle:ue.vn.CheckCircleOutline,onClick:function(){return t.markInteraction(t.studentAttempt.answers,Ht.Correct)}})),o().createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===Ht.Incorrect?" text-danger":"")},o().createElement(le.x,{svgName:t.markedStatus===Ht.Incorrect?ue.vn.CrossCircleFilled:ue.vn.CrossCircle,onClick:function(){return t.markInteraction(t.studentAttempt.answers,Ht.Incorrect)}})))}function or(t){var e,n,r,i,a,c=Jn[t.interaction.typeId];if(!c)return o().createElement(o().Fragment,null);var l=Yn(t.studentResults),u=Zn(t.interaction.id,l),s=oe.isInteractionCorrect(t.interaction,l);return o().createElement("div",{className:"rounded ".concat(null!==(e=t.className)&&void 0!==e?e:"")},o().createElement("div",{className:"d-flex"},!!t.showStudentDetails&&o().createElement("div",{className:"mr-2"},o().createElement("div",{className:"FEdgT"},o().createElement(se.q,{imageCdnUrl:t.imageCdnUrl,initials:t.anonymisedUserName?ce.l.getInitialsFromFullName(t.anonymisedUserName):ce.l.getInitials(null===(n=t.studentResults.user)||void 0===n?void 0:n.name,null===(r=t.studentResults.user)||void 0===r?void 0:r.surname),imageUrl:t.anonymisedUserName?null:null===(a=null===(i=t.studentResults.user)||void 0===i?void 0:i.avatar)||void 0===a?void 0:a.url}))),o().createElement("div",{className:"flex-grow-1"},!!t.showStudentDetails&&o().createElement(nr,{studentResults:t.studentResults,correctness:s,anonymisedUserName:t.anonymisedUserName}),o().createElement("div",{className:"d-flex justify-content-between"},o().createElement("div",{className:"flex-grow-1 ".concat(t.responseComponentClass?t.responseComponentClass:"")},u?o().createElement(c,{interaction:t.interaction,answers:u.answers,imageCdnUrl:t.imageCdnUrl,user:t.studentResults.user,showFeedback:t.showFeedback,showAvatar:t.showAvatar,reportsStyling:t.reportsStyling}):o().createElement(tr,null)),!t.showStudentDetails&&o().createElement(er,{correctness:s})))),o().createElement(rr,{studentAttempt:u,correctness:s,markInteraction:t.markInteraction,markedStatus:t.markedStatus}))}function ir(t){var e=t.studentResults,n=t.interaction,r=t.timepoint,i=t.interactive,a=t.state,c=t.goToTimepoint,l=t.interactionNumber,u=t.imageCdnUrl,s=Yn(e),f=Zn(n.id,s),d=a.interactions[n.id],p=Ae(n.typeId)(d||{},n),m=n.typeId!==Z.InteractionTypeId.Annotation&&n.typeId!==Z.InteractionTypeId.Image,h=m;n.typeId===Z.InteractionTypeId.MissingWord&&f&&(h=!1);var v=n.data.suggestedResponse||n.data.feedback;return o().createElement("li",{className:"mb-3 position-relative"},o().createElement("div",{className:"d-flex flex-wrap mb-2 cursor-pointer",onClick:function(){return c(r.id,n.id)}},i.immediateFeedback&&o().createElement("div",{className:"O6oD6"},!!f&&(p===Vt.w.AwaitingMarking?o().createElement("span",{className:"text-muted font-italic"},"Waiting to be marked"):p===Vt.w.Correct?o().createElement("span",{className:"text-success"},"Correct ",o().createElement(le.x,{className:"svg-container align-middle",svgName:ue.vn.Check})):p===Vt.w.Incorrect&&o().createElement("span",{className:"text-danger"},"Incorrect ",o().createElement(le.x,{className:"svg-container align-middle",svgName:ue.vn.Close})))),o().createElement(xn.y,{interaction:n,iconClassName:"flex-shrink-0",showQuestion:h,showTypeName:!0,questionClassName:"d-block w-100 mt-2",questionNumber:l})),m&&!f&&o().createElement("button",{className:"btn btn-dark",onClick:function(){return c(r.id,n.id)}},"Answer question"),f&&m&&o().createElement(or,{interaction:n,studentResults:e,markedStatus:Ht.PendingReview,markInteraction:function(){},imageCdnUrl:u,showFeedback:i.immediateFeedback,showAvatar:!0}),i.immediateFeedback&&f&&v&&o().createElement("div",{className:"bg-light rounded p-2"},o().createElement("div",null,o().createElement("strong",null,n.typeId===Z.InteractionTypeId.TrueOrFalse?"Teacher's feedback":"Teacher's suggested response")),v))}function ar(t){return function(t){if(Array.isArray(t))return lr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||cr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(t,e){if(t){if("string"==typeof t)return lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lr(t,e):void 0}}function lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ur(t){var e,n,r=t.showSummary,i=t.setShowSummary,a=t.state,c=t.interactive,l=t.player,u=t.progress,s=t.portalNode,f=o().useRef(),d=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||cr(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=d[0],m=d[1];function h(){i(!1),l.show(),l.play()}function v(e,n){h(),t.goToTimepoint(e,n)}if(!s||!r)return o().createElement(o().Fragment,null);var y=function(t){var e=t.state,n=0,r=0,o=0,i=!1,a=[];return t.interactive.timepoints.forEach((function(t){t.interactions.forEach((function(t){var c=e.interactions[t.id],l=Ae(t.typeId)(c||{},t);l===Vt.w.Correct&&n++,l!==Vt.w.NotApplicable&&r++,l!==Vt.w.NotApplicable&&(null==c?void 0:c.submitted)&&o++,l===Vt.w.AwaitingMarking&&(i=!0);var u=F(c||{}),s=Object.keys(u).map((function(t){var e;return{id:t,text:null===(e=u[t])||void 0===e?void 0:e.toString()}}));s.length&&a.push({id:t.id,answeredAt:1,answers:s})}))})),{correctCount:n,total:r,answered:o,studentAttempts:a,awaitingMarking:i}}({interactive:c,state:a}),g=y.correctCount,b=y.total,w=y.answered,E=y.studentAttempts,x=y.awaitingMarking,I={name:t.currentUser.givenName,username:t.currentUser.username,user:{name:t.currentUser.givenName,surname:t.currentUser.familyName,avatar:{url:t.currentUser.avatar}},results:[{id:c.id,attempts:E}]},S=0,k=l.ended(),O=l.duration();return o().createElement(H.Nq,{node:s},o().createElement("div",{className:"row pb-3"},o().createElement("div",{className:"col-4 col-xs-12"},o().createElement(Bn.Z,{data:l.poster(),imageType:ht.__.Thumbnails,imageOptions:{size:ht.h2.Medium}})),o().createElement("div",{className:"col-8 col-xs-12"},o().createElement("span",{className:"float-right"},o().createElement(qn.h,{svgName:ue.vn.Play,className:"btn btn-outline-dark",onClick:function(){h(),l.ended()&&l.currentTime(0)}},k?"Play again":"Continue watching"),l.gradePassbackPlugin().enabled&&(p?o().createElement(V.L,{className:"btn btn-dark ml-2",onClick:function(){}},o().createElement(cn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement(qn.h,{svgName:ue.vn.Check,className:"btn btn-dark ml-2",onClick:function(){m(!0),l.gradePassbackPlugin().submit(g/b,!x)}},"Submit"))),o().createElement("h1",{className:"h3"},t.title),o().createElement("p",null))),o().createElement("div",{className:"border rounder px-2 mb-3"},o().createElement("div",{className:"cursor-pointer my-4 ".concat("gxTA_"),onClick:function(t){if(f.current){var e=f.current.getBoundingClientRect(),n=(t.pageX-e.left)/e.width*O;h(),l.currentTime(n)}},ref:f},o().createElement(zn,{duration:O,progress:u,interactive:c,player:l}),o().createElement(Gn,{duration:O,interactive:c,goToTimepoint:v}))),o().createElement("h2",{className:"h4"},"My Answers"),o().createElement("div",{className:"d-flex justify-content-between"},o().createElement("span",null,c.immediateFeedback&&o().createElement("div",null,"Score: ",g,"/",b),o().createElement("div",{className:"mb-3"},"You have answered ",o().createElement("strong",{className:w!==b?"text-danger":""},w)," of ",o().createElement("strong",null,b)," questions"))),o().createElement("div",{className:"row"},o().createElement("div",{className:"col-lg-7 col-12"},o().createElement("ul",{className:"list-unstyled"},c.timepoints.reduce((function(e,n){return[].concat(ar(e),ar(n.interactions.map((function(e){return S++,o().createElement(ir,{key:e.id,studentResults:I,interaction:e,timepoint:n,interactive:c,state:a,goToTimepoint:v,interactionNumber:S,imageCdnUrl:t.imageCdnUrl})}))))}),[])))))}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fr(t){var e,n,r=t.resultsService,i=t.player,a=t.onShowSummary,c=t.mobile,l=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sr(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=l[0],s=l[1];function f(t){s(t),a&&a(t)}function d(){f(!0),i.hide()}return o().useEffect((function(){if(r&&!c)return i.on("ended",d),function(){return i.off("ended",d)}}),[]),o().useEffect((function(){u&&i.isFullscreen()&&i.exitFullscreen()}),[u]),o().createElement(o().Fragment,null,o().createElement(Dn,Object.assign({setShowSummary:f},t)),o().createElement(ur,Object.assign({showSummary:u,setShowSummary:f},t)))}var dr=n(83657);function pr(t){var e,n,r,i=(e=t.interactive,r=0,null===(n=null==e?void 0:e.timepoints)||void 0===n||n.forEach((function(t){var e;return null===(e=t.interactions)||void 0===e?void 0:e.forEach((function(){return r++}))})),r>0),a=[];return t.onClickEditDetails&&a.push({label:"Edit details",svgName:ue.vn.Edit,button:!0,className:"btn btn-outline-dark",onClick:t.onClickEditDetails}),t.onClickPublish&&a.push({label:"Publish",button:!0,className:"btn btn-dark ml-2".concat(i?"":" disabled"),disabled:!i,tooltip:i?"":"Interactives cannot be published without questions",onClick:function(){i&&t.onClickPublish&&t.onClickPublish()}}),a.length?o().createElement(H.Nq,{node:t.portalNode},o().createElement(dr.e,{actions:a})):o().createElement(o().Fragment,null)}var mr=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n};function hr(t){var e=t.title,n=t.player,r=t.track,i=t.mode,a=t.interactive,c=t.imageApi,l=t.supportSiteUrl,f=t.actionsPortalNode,d=t.questionListPortalNode,p=t.summaryPortalNode,m=t.resultsService,h=t.currentUser,v=t.progress,y=t.latestSession,g=t.clipOffset,b=t.analyticsService,w=t.enableImmersiveReader,E=t.mobile,x=function(t){var e=t.player,n=t.track,r=t.interactive,i=t.clipOffset,a=T(o().useState(!1),2),c=a[0],l=a[1],u=T(o().useState(!1),2),s=u[0],f=u[1],d=T(o().useState(null),2),p=d[0],m=d[1];function h(t){return i?t+i:t}function v(t){f(!!t&&c),l(t)}function y(){var t=n.activeCues;if(!t.length)return v(!1),void m(null);var o=r.timepoints.find((function(e){return e.id.toString()===t[0].text.toString()}));if(!o)return v(!1),void m(null);o.shouldPause&&(e.seeking()?e.one("play",(function(){return e.pause()})):e.pause()),v(!0),m(o)}function g(t){for(var e=0;e<n.cues.length;e++){var r=n.cues[e];if(r.text.toString()===t.toString())return r}}return o().useEffect((function(){return n.addEventListener("cuechange",y),function(){return n.removeEventListener("cuechange",y)}})),{open:c,setOpen:v,wasOpen:s,timepoint:p,continueInteractive:function(){v(!1),e.play()},updateCue:function(t,e){var n=g(t);n.text=e.toString(),n.originalCue_.text=e.toString()},addCue:function(t){var r=e.currentTime();n.addCue({startTime:h(r)-.001,endTime:h(r+1),text:t}),n.trigger("cv:cuechange"),e.paused()&&n.trigger("cuechange")},removeCue:function(t){t=h(t);for(var e=0;e<n.cues.length;){var r=n.cues[e];if(r.startTime<=t&&r.endTime>=t){n.removeCue(r),n.trigger("cv:cuechange"),n.trigger("cuechange");break}e++}},moveTimepoint:function(t){var r=g(p.id);if(r){var o=t/1e3;r.startTime=h(o),r.endTime=h(o+1),e.currentTime(o+.5,!0),p.visibleAt=t,n.trigger("cv:cuechange")}},getClipOffset:h}}({player:n,track:r,interactive:a,mode:i,clipOffset:g}),I=x.open,S=x.timepoint,k=x.wasOpen,O=mr(x,["open","timepoint","wasOpen"]),C=function(t){var e=t.interactive,n=t.timepoint,r=t.player,i=t.mode,a=t.resultsService,c=t.latestSession,l=t.analyticsService,f=Be(t,["interactive","timepoint","player","mode","resultsService","latestSession","analyticsService"]),d=Ue({mode:i,timepoint:n,latestSession:c}),p=d.state,m=d.interaction,h=d.interactionState,v=d.timepointState,y=d.nextInteraction,g=d.nextInteractionState,b=Be(d,["state","interaction","interactionState","timepointState","nextInteraction","nextInteractionState"]),w=i===u.InteractiveMode.Create;function E(t){for(var n=0;n<e.timepoints.length;){for(var r=e.timepoints[n],o=0;o<r.interactions.length;){var i=r.interactions[o];if(i.id===t)return{localTimepoint:r,localInteraction:i};o++}n++}return{localInteraction:null,localTimepoint:null}}function x(t){var n=s.w.getTypeInfo(t.typeId);return{id:_(t.id)?void 0:t.id,typeId:t.typeId,type:n.typeName,interactiveId:e.id,timepointId:_(t.timepointId)?void 0:t.timepointId,order:t.order}}function I(t){return qe(this,void 0,void 0,Ge().mark((function n(){var r,o,i,a,c,u,s;return Ge().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=E(t),o=r.localInteraction,i=r.localTimepoint,o&&i){n.next=3;break}throw new Error("Could not find the interaction and timepoint for the interactionId ".concat(t));case 3:if(a=x(o),_(o.id)){n.next=10;break}return n.next=7,z.deleteInteraction(o.id);case 7:null==l||l.logUserAction(a,{actionType:Wt.UserAction.Delete,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Complete}),n.next=11;break;case 10:null==l||l.logUserAction(a,{actionType:Wt.UserAction.Create,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Discard});case 11:if(c=i.interactions.findIndex((function(t){return t.id===o.id})),i.interactions.splice(c,1),b.clearInteractionState(o.id),u=b.getTimepointState(i.id),c<u.interactionIndex&&b.updateTimepointState(i.id,{interactionIndex:u.interactionIndex-1}),!(i.interactions.length>0)){n.next=18;break}return n.abrupt("return");case 18:if(_(i.id)){n.next=21;break}return n.next=21,z.deleteTimepoint(i.id);case 21:s=e.timepoints.findIndex((function(t){return t.id===i.id})),e.timepoints.splice(s,1),f.removeCue(i.visibleAt/1e3),b.clearTimepointState(i.id);case 25:case"end":return n.stop()}}),n)})))}function S(t){if(m){var e=_(m.id);e||(null==h?void 0:h.hasChanges)||(null==v?void 0:v.hasChanges)?Y.M.render(o().createElement("p",null,"Do you want to discard your changes?"),{title:"Unsaved changes",success:function(){(null==v?void 0:v.hasChanges)&&j(!0),e?I(m.id):b.clearInteractionState(m.id),t&&t()},buttons:[{variant:"link",buttonText:"Cancel"},{variant:"danger",success:!0,buttonText:"Discard"}]}):t&&t()}else t&&t()}function k(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(w)S((function(){b.updateTimepointState(n.id,{interactionIndex:t})}));else{var r=function(){b.updateTimepointState(n.id,{nextInteractionIndex:t}),window.requestAnimationFrame((function(){b.updateTimepointState(n.id,{nextInteractionIndex:t,slideIn:!0}),window.setTimeout((function(){b.updateTimepointState(n.id,{interactionIndex:t,nextInteractionIndex:null,slideIn:null})}),400)}))};e?S(r):r()}}function O(){v.interactionIndex+1>=n.interactions.length?f.continueInteractive():k(v.interactionIndex+1,!1)}function C(){e.timepoints.sort((function(t,e){return t.visibleAt>e.visibleAt?1:e.visibleAt>t.visibleAt?-1:0}))}function N(){k(n.interactions.length)}function j(t){(null==v?void 0:v.hasChanges)&&(t&&f.moveTimepoint(v.originalVisibleAt),b.updateTimepointState(n.id,{hasChanges:void 0,originalVisibleAt:void 0}),We=!1)}return{state:p,interaction:m,interactionState:h,timepointState:v,nextInteraction:y,nextInteractionState:g,skip:O,cancel:function(){return qe(this,void 0,void 0,Ge().mark((function t(){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(null==h?void 0:h.hasChanges)){t.next=3;break}return S(),t.abrupt("return");case 3:return t.next=5,I(m.id);case 5:f.setOpen(!0);case 6:case"end":return t.stop()}}),t)})))},addAnotherQuestion:N,goToTimepoint:function(t,n){var o=function(t){for(var n=0;n<e.timepoints.length;){var r=e.timepoints[n];if(r.id===t)return r;n++}return null}(t),i=o.interactions.find((function(t){return t.id.toString()===n.toString()}));r.currentTime(o.visibleAt/1e3),b.updateTimepointState(o.id,{interactionIndex:o.interactions.indexOf(i)})},discardChanges:S,changeIndex:k,promptDelete:function(t){var e=x(E(t).localInteraction);null==l||l.logUserAction(e,{actionType:Wt.UserAction.Delete,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Start}),Y.M.render(o().createElement("p",null,"Are you sure you want to delete this question?"),{title:"Delete question",success:function(){return I(t)},buttons:[{variant:"link",buttonText:"Cancel"},{variant:"danger",success:!0,buttonText:"Delete question"}]})},showTypeSelector:function(){r.pause(),f.setOpen(!0),n&&N()},cancelTypeSelector:function(){n?k(v.interactionIndex-1):(f.setOpen(!1),r.play())},deleteInteraction:I,saveInteraction:function(){return qe(this,void 0,void 0,Ge().mark((function t(){var e,r,o,i,a,c;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w){t.next=2;break}throw new Error("Should not be calling onClickSave while viewing an interactive");case 2:if(u=m.typeId,!(e=(0,Dt[u])(b.getInteractionState(m.id),m))){t.next=7;break}return b.updateInteractionState(m.id,{error:e}),t.abrupt("return");case 7:if(b.updateInteractionState(m.id,{spinner:!0}),!_(n.id)){t.next=15;break}return r=n.id,t.next=12,z.saveTimepoint(n);case 12:f.updateCue(r,n.id),b.clearTimepointState(r),(null==v?void 0:v.hasChanges)&&(C(),j());case 15:return m.timepointId=n.id,o=m.id,i=qt(m.typeId),t.next=20,i(b.getInteractionState(m.id),m);case 20:b.clearInteractionState(o),a=_(o),c=x(m),null==l||l.logUserAction(c,{actionType:a?Wt.UserAction.Create:Wt.UserAction.Edit,entity:Wt.EntityType.Interaction,workflowPhase:a?Wt.WorkflowPhase.Complete:Wt.WorkflowPhase.Save});case 24:case"end":return t.stop()}var u}),t)})))},addInteraction:function(t){var o;r.pause();var i=(null==n?void 0:n.id)||"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),a={id:"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),timepointId:i,typeId:t,order:(null===(o=null==n?void 0:n.interactions)||void 0===o?void 0:o.length)||0,interactiveId:e.id,data:{}},c=x(a);if(null==l||l.logUserAction(c,{actionType:Wt.UserAction.Create,entity:Wt.EntityType.Interaction,workflowPhase:Wt.WorkflowPhase.Start}),n)return n.interactions.push(a),void k(v.interactionIndex);var u=r.currentTime();e.timepoints||(e.timepoints=[]),e.timepoints.push({id:i,visibleAt:1e3*u,interactiveId:e.id,shouldPause:1,interactions:[a]}),C(),f.addCue(i)},submitInteractionAnswer:function(){return qe(this,void 0,void 0,Ge().mark((function t(){var r,o,c,s;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i===u.InteractiveMode.View){t.next=2;break}throw new Error("Should not be calling onClickSubmit while creating an interactive");case 2:if(!h.submitted){t.next=8;break}if(!(v.interactionIndex>=n.interactions.length)){t.next=6;break}return f.continueInteractive(),t.abrupt("return");case 6:return k(v.interactionIndex+1),t.abrupt("return");case 8:if(r=F(h),d=m.typeId,!(o=(0,Ne[d])(r,m))){t.next=14;break}return b.updateInteractionState(m.id,{error:o}),t.abrupt("return");case 14:if(!a||!h.hasChanges){t.next=22;break}if(c=Le(m.typeId),b.updateInteractionState(m.id,{spinner:!0}),!c){t.next=22;break}return t.next=20,c(r,m,a.save);case 20:s=x(m),null==l||l.logUserAction(s,{actionType:Wt.UserAction.Answer,entity:Wt.EntityType.Interaction});case 22:if(b.updateInteractionState(m.id,{submitted:!0,error:null,hasChanges:!1,spinner:!1}),e.immediateFeedback){t.next=26;break}return O(),t.abrupt("return");case 26:ke(m.typeId)(m)||O();case 29:case"end":return t.stop()}var d}),t)})))},userUpdateInteractionState:b.userUpdateInteractionState,updateTimepointTime:function(t){var o=r.duration(),i=function(t){for(var r=n.visibleAt+1e3*t,o=t>0,i=0;i<e.timepoints.length;i++){var a=e.timepoints[i];r<a.visibleAt-1e3||r>a.visibleAt+1e3||(r=o?a.visibleAt+1001:a.visibleAt-1001,i=0)}return r}(t);if(!(i/1e3>o||i<0)){var a=n.visibleAt;We||(We=!0,b.updateTimepointState(n.id,{originalVisibleAt:a,hasChanges:!0})),f.moveTimepoint(i)}},saveTimepoint:function(){return qe(this,void 0,void 0,Ge().mark((function t(){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!_(n.id)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,z.updateTimepoint(n);case 4:C(),j();case 6:case"end":return t.stop()}}),t)})))},clearTimepointTimeState:j,reOrderQuestions:function(t){return qe(this,void 0,void 0,Ge().mark((function e(){var r,o;return Ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=7;break}return e.next=4,z.saveInteraction(Object.assign(Object.assign({},t[r]),{order:r}));case 4:r++,e.next=1;break;case 7:o=n.interactions[v.interactionIndex],n.interactions=t,b.updateTimepointState(n.id,{interactionIndex:t.indexOf(o)});case 10:case"end":return e.stop()}}),e)})))}}}(Object.assign({mode:i,interactive:a,timepoint:S,player:n,resultsService:m,latestSession:y,analyticsService:b},O)),N=C.interaction,j=C.interactionState,A=C.nextInteraction,R=C.nextInteractionState,M=C.timepointState,U=C.state,D=mr(C,["interaction","interactionState","nextInteraction","nextInteractionState","timepointState","state"]);!function(t){var e,n=t.mode,r=t.player,i=t.timepoint,a=t.interaction,c=t.discardChanges,l=t.interactionState,s=t.timepointState,f=(0,P.f)(),d=n===u.InteractiveMode.Create;o().useEffect((function(){if(d){if(_(null==a?void 0:a.id)||(null==l?void 0:l.hasChanges)||(null==s?void 0:s.hasChanges))return f.lock({id:"interactive",title:"Are you sure you want to leave?",text:"Your interactive still has unsaved changes"}),void r.lock((function(t){c(t)}));r.unlock(),f.unlock("interactive")}}),[a,null==l?void 0:l.hasChanges,null===(e=null==i?void 0:i.interactions)||void 0===e?void 0:e.length,null==s?void 0:s.hasChanges])}({mode:i,player:n,timepoint:S,interaction:N,discardChanges:D.discardChanges,interactionState:j,timepointState:M});var G={mode:i,open:I,isCreate:i===L.A.Create,interaction:N,nextInteraction:A,timepoint:S,interactive:a,interactionState:j,nextInteractionState:R,timepointState:M,player:n};return o().createElement(o().Fragment,null,!!f&&o().createElement(pr,{interactive:a,onClickEditDetails:t.onClickEditDetails,onClickPublish:t.onClickPublish,portalNode:f}),o().createElement(Ye,Object.assign({},G,D)),o().createElement(Mn,Object.assign({imageApi:c,currentUser:h,immediateFeedback:a.immediateFeedback,delayFocus:!k,enableImmersiveReader:w},G,D,O)),o().createElement(fr,Object.assign({title:e,currentUser:h,state:U,portalNode:p,progress:v,resultsService:m,imageCdnUrl:c.toString(),onShowSummary:t.onShowSummary,mobile:E},G,D)),o().createElement(Ke,Object.assign({portalNode:d,supportSiteUrl:l,currentUser:h},G,D)))}c.Z.registerComponent("Interactive",(0,j.Z)((function(t,e){return o().createElement(hr,Object.assign({player:t},e))})));var vr=n(9111),yr=n(13876);function gr(t){var e=t.player;function n(){var t=e.getChild("ContinueSession");e.removeChild(t),t.dispose()}function r(){t.continue(!0),n()}var i=[{buttonText:"Start again",variant:"link",onClick:function(){t.continue(!1),n()}},{buttonText:"Continue",variant:"dark",onClick:r}];return o().createElement(vr.G,{title:"Continue interactive?",closePopup:r,dialogClassName:"VVqKz"},o().createElement("p",null,"It looks like you've already started this interactive. Would you like to continue your attempt or start a new one?"),o().createElement(yr.u,{className:"kw8gW",buttons:i}))}function br(t){return br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},br(t)}function wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Er(t,e){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Er(t,e)}function xr(t,e){if(e&&("object"===br(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ir(t){return Ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ir(t)}c.Z.registerComponent("ContinueSession",(0,j.Z)((function(t,e){return o().createElement(gr,Object.assign({player:t},e))})));var Sr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Er(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ir(r);if(o){var n=Ir(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return xr(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=i.call(this,t)).enabled=!1,e.player.ready((function(){return e.initialize()})),e}return e=a,(n=[{key:"initialize",value:function(){this.onReceiveMessage=this.onReceiveMessage.bind(this),window.addEventListener("message",this.onReceiveMessage,!1),window.parent.postMessage(JSON.stringify({type:"cv-app-loaded"}),"*")}},{key:"dispose",value:function(){window.removeEventListener("message",this.onReceiveMessage)}},{key:"onReceiveMessage",value:function(t){var e={};try{e=JSON.parse(t.data)}catch(t){return}"enable-grade-passback"===e.type&&(this.enabled=!0,window.removeEventListener("message",this.onReceiveMessage))}},{key:"submit",value:function(t,e){var n={type:"cv-lms-submit-score",data:{score:t,fullyGraded:e}};window.parent.postMessage(JSON.stringify(n),"*")}}])&&wr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getPlugin("plugin"));function kr(t){return kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(t)}function Or(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Cr(t,e){return Cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cr(t,e)}function Nr(t,e){if(e&&("object"===kr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function jr(t){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jr(t)}c.Z.registerPlugin("gradePassbackPlugin",Sr);var Lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=jr(r);if(o){var n=jr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Nr(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t)).continueSession=!1,n.options=e,t.ready((function(){return n.initialize()})),n}return e=a,(n=[{key:"initialize",value:function(){var t=this;this.player.gradePassbackPlugin(),l.O.useTrack(this.player,"metadata","interactive",this.onTrackLoaded.bind(this)),this.player.addClass("cv-interactive-plugin"),this.options.resultsService&&!this.options.latestSession&&(this.startSession=this.startSession.bind(this),this.player.one("play",this.startSession),this.on("dispose",(function(){t.player.off("play",t.startSession)})))}},{key:"startSession",value:function(){var t,e=null===(t=this.options.latestSession)||void 0===t?void 0:t.resultId;this.continueSession||(e=null),this.options.resultsService.start(e)}},{key:"onTrackLoaded",value:function(t){var e=this;this.options.resultsService&&this.options.latestSession?(this.player.pause(),this.player.addChild("ContinueSession",{continue:function(n){var r;null===(r=e.options.analyticsService)||void 0===r||r.logUserAction({},{actionType:Wt.UserAction.Click,entity:Wt.EntityType.Interactive,descriptor:n?Wt.InteractiveSessionDescriptor.ContinueSession:Wt.InteractiveSessionDescriptor.NewSession}),e.continueSession=n,e.startSession(),e.addChildren(t),e.player.play()}})):this.addChildren(t)}},{key:"addChildren",value:function(t){this.player.addChild("Interactive",Object.assign(Object.assign({},this.options),{track:t,mode:this.options.mode||u.InteractiveMode.View,latestSession:this.continueSession&&this.options.latestSession})),this.player.controlBar.getChild("progressControl").getChild("SeekBar").addChild(new N(this.player,{interactive:this.options.interactive,track:t}))}}])&&Or(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getPlugin("plugin"));c.Z.registerPlugin("viewInteractivePlugin",Lr);var Tr=n(47724);function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function Pr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _r(t,e){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_r(t,e)}function Fr(t,e){if(e&&("object"===Ar(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Rr(t){return Rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rr(t)}var Mr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_r(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Rr(r);if(o){var n=Rr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Fr(this,t)});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,"Could not connect to submit interactive results")}return e=a,(n=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:"Connection issues",text:"There seems to be an issue with your internet connection. Refresh the page to try again. ",buttons:[{text:"Refresh",className:"btn btn-dark",success:!0}]}}},{key:"onDone",value:function(){window.location.reload()}}])&&Pr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(n(47663).S);function Ur(t){return Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(t)}function Dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Gr(){Gr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Ur(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Br=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function c(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}l((r=r.apply(t,e||[])).next())}))},Wr=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cache=[],this.retryCount=0,this.options=e,this.connection=(new Tr.su).withUrl("".concat(e.playerApi.origin,"/hubs/interactives"),{withCredentials:!1}).configureLogging(Tr.in.Error).withAutomaticReconnect([0,2e3,1e4,3e4]).build(),this.connection.onreconnecting((function(){n.log("reconnecting"),n.isConnected=!1})),this.connection.onreconnected((function(){n.log("reconnected"),n.isConnected=!0,n.flush()})),this.connection.onclose((function(){n.log("connection closed"),n.isConnected=!1,n.reconnect()})),this.save=this.save.bind(this)}var e,n;return e=t,(n=[{key:"start",value:function(t){var e=this;this.isConnected||(t&&(this.resultId=t),this.log("starting"),this.connection.start().then((function(){return Br(e,void 0,void 0,Gr().mark((function t(){return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.log("connected"),this.retryCount=0,this.isConnected=!0,t.next=5,this.startSession();case 5:this.flush();case 6:case"end":return t.stop()}}),t,this)})))})).catch((function(){e.reconnect()})))}},{key:"stop",value:function(){return Br(this,void 0,void 0,Gr().mark((function t(){return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.flush();case 2:this.connection.stop();case 3:case"end":return t.stop()}}),t,this)})))}},{key:"log",value:function(){}},{key:"reconnect",value:function(){this.retryCount>=5?i.Q.ErrorHelper.throw(new Mr):(this.retryCount++,this.start())}},{key:"startSession",value:function(){return Br(this,void 0,void 0,Gr().mark((function t(){var e,n,r,o,a,c,l;return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.resultId){t.next=2;break}return t.abrupt("return");case 2:return e=this.options,n=e.interactiveId,r=e.mediaId,o=e.userId,a=e.customerId,c=e.shareId,t.prev=3,t.next=6,this.connection.invoke("startSession",n,r,o,a,c);case 6:l=t.sent,this.resultId=l.resultId,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),i.Q.ErrorHelper.throw(new Mr);case 13:case"end":return t.stop()}}),t,this,[[3,10]])})))}},{key:"flush",value:function(){return Br(this,void 0,void 0,Gr().mark((function t(){var e=this;return Gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isConnected&&this.resultId){t.next=2;break}return t.abrupt("return");case 2:if(this.cache.length){t.next=4;break}return t.abrupt("return");case 4:(n=this.cache,function(t){if(Array.isArray(t))return Dr(t)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return Dr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dr(t,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(t){return Br(e,void 0,void 0,Gr().mark((function e(){return Gr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.connection.invoke("saveActions",this.resultId,t.interactionId,t.results);case 3:this.cache.splice(this.cache.indexOf(t),1),this.log("Saved result",t),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Failed to save results",t);case 10:case"end":return e.stop()}}),e,this,[[0,7]])})))}));case 5:case"end":return t.stop()}var n}),t,this)})))}},{key:"save",value:function(t,e){return Br(this,void 0,void 0,Gr().mark((function n(){var r;return Gr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.resultId){n.next=2;break}throw new Error("Session has not started");case 2:return r=e.map((function(t){return{actionableItemId:+t.actionableItemId,value:t.value}})),this.cache.push({interactionId:t,results:r}),n.next=6,this.flush();case 6:case"end":return n.stop()}}),n,this)})))}}])&&qr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),zr=n(60857);function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function Zr(){Zr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new I(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===s)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s={};function f(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=f.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,c){var l=u(t[o],t,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==Yr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function Hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Vr(){return Vr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=Kr(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Vr.apply(this,arguments)}function Kr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xr(t)););return t}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}function Jr(t,e){if(e&&("object"===Yr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}var to=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qr(t,e)}(l,t);var e,n,r,o,c=(r=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Xr(r);if(o){var n=Xr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Jr(this,t)});function l(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(n=c.call(this,t,e)).totalProgress=[],R.e.setToken("gateway",n.options.authToken),n.player.one("dispose",(function(){n.resultsService&&n.resultsService.stop()})),n.options.mode===u.InteractiveMode.Create&&n.player.addClass("cv-create-interactives"),n}return e=l,n=[{key:"getPlayerOptions",value:function(){var t=Vr(Xr(l.prototype),"getPlayerOptions",this).call(this);return t.setMaxHeight=!1,this.options.embed||(t.aspectRatio="16:9"),t}},{key:"onFlushProgress",value:function(t){var e,n;Vr(Xr(l.prototype),"onFlushProgress",this).call(this,t),this.options.mode!==u.InteractiveMode.Create&&(e=this.totalProgress).push.apply(e,function(t){if(Array.isArray(t))return Hr(t)}(n=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return Hr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hr(t,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}},{key:"additionalSetup",value:function(t){var e,n,r,o,i=this,a=Object.create(null,{additionalSetup:{get:function(){return Vr(Xr(l.prototype),"additionalSetup",i)}}});return e=this,n=void 0,r=void 0,o=Zr().mark((function e(){var n=this;return Zr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.additionalSetup.call(this,t),this.setupUpClipPlugin(t),this.analyticsService||this.options.fetch||this.options.offlinePlaybackObject?this.setupViewInteractivePlugin(t):this.one("config:loaded",(function(){return n.setupViewInteractivePlugin(t)}));case 3:case"end":return e.stop()}}),e,this)})),new(r||(r=Promise))((function(t,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function c(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,c)}l((o=o.apply(e,n||[])).next())}))}},{key:"setupUpClipPlugin",value:function(t){var e;if(null===(e=null==t?void 0:t.additionalData)||void 0===e?void 0:e.clipData){var n=t.additionalData.clipData;this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime})}}},{key:"setupViewInteractivePlugin",value:function(t){var e;this.track=function(t,e){var n,r=t.addTextTrack("metadata","interactive"),o=e.additionalData.interactive,i=null===(n=e.additionalData.clipData)||void 0===n?void 0:n.startTime;return o.timepoints.forEach((function(t){var e,n=t.visibleAt/1e3,o=t.visibleFor?n+t.visibleFor/1e3:n+1;i&&(n+=i,o+=i),(null===(e=t.interactions)||void 0===e?void 0:e.length)&&r.addCue({startTime:n-.001,endTime:o,text:t.id})})),r}(this.player,t);var n=t.additionalData.interactive,r=null===(e=t.additionalData.clipData)||void 0===e?void 0:e.startTime;this.options.collectResults&&(this.options.currentUser||i.Q.ErrorHelper.throw(new a.H("Must provide a currentUser in order to collect interactive results")),this.options.shareId||i.Q.ErrorHelper.throw(new a.H("Must provide a shareId in order to collect interactive results")),this.resultsService=new Wr({interactiveId:n.id,mediaId:t.mediaId,userId:this.options.currentUser.id,customerId:this.options.currentUser.customerId,playerApi:this.options.playerApi,shareId:this.options.shareId})),this.player.viewInteractivePlugin({interactive:n,title:t.title,mode:this.options.mode,imageApi:this.options.imageApi,supportSiteUrl:this.options.supportSiteUrl,resultsService:this.resultsService,actionsPortalNode:this.options.actionsPortalNode,questionListPortalNode:this.options.questionListPortalNode,summaryPortalNode:this.options.summaryPortalNode,currentUser:this.options.currentUser,latestSession:t.additionalData.latestSession,progress:this.totalProgress,clipOffset:r,analyticsService:this.analyticsService,enableImmersiveReader:this.options.enableImmersiveReader,onShowSummary:this.options.onShowSummary,onClickEditDetails:this.options.onClickEditDetails,onClickPublish:this.options.onClickPublish,mobile:this.options.mobile})}},{key:"getAdditionalAnalyticsData",value:function(t){var e,n,r,o;return(null===(n=null===(e=t.additionalData)||void 0===e?void 0:e.clipData)||void 0===n?void 0:n.clipId)?{clip:{id:null===(o=null===(r=t.additionalData)||void 0===r?void 0:r.clipData)||void 0===o?void 0:o.clipId}}:{}}},{key:"getSeekBarOptions",value:function(){return{ignoreChapters:!0}}},{key:"getAnalyticsPlayerType",value:function(){return"interactive-player"}},{key:"setFavourite",value:function(t,e){this.player.favouritePlugin().setFavourite(t,e)}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}],n&&$r(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),l}(zr.r);function eo(t){var e=t.onReady,n=t.className,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["onReady","className"]),i=o().useRef();return o().useEffect((function(){var t=new to(i.current,r);return e&&t.ready((function(){e(t)})),function(){t.dispose()}}),[]),o().createElement(o().Fragment,null,o().createElement("div",{ref:i,className:n}),o().createElement("div",{id:"popup-region"}))}}}]);