@clickview/lite 0.2.0-rc.3 → 0.2.1-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.
- package/dist/bundles.json +3 -3
- package/dist/css/137-lite-30208db4b8.chunk.css +2 -0
- package/dist/css/{lite-app-a0ac1afb80.css → lite-app-7036360794.css} +2 -2
- package/dist/en.json +1 -1
- package/dist/scripts/{0-de369ef142-lite.chunk.js → 0-c62781af86-lite.chunk.js} +1 -1
- package/dist/scripts/{10-45b17097c8-lite.chunk.js → 10-cc57458423-lite.chunk.js} +1 -1
- package/dist/scripts/{100-eecc65ee7b-lite.chunk.js → 100-6ae1bfc812-lite.chunk.js} +1 -1
- package/dist/scripts/{101-969e067dff-lite.chunk.js → 101-1bc6d93406-lite.chunk.js} +1 -1
- package/dist/scripts/{102-8f55dfa78a-lite.chunk.js → 102-ff5bdae54d-lite.chunk.js} +1 -1
- package/dist/scripts/103-3f8951bb14-lite.chunk.js +1 -0
- package/dist/scripts/104-f830b81a82-lite.chunk.js +1 -0
- package/dist/scripts/{105-aff5f12a02-lite.chunk.js → 105-e04b7c51f7-lite.chunk.js} +1 -1
- package/dist/scripts/{106-7ae6ae8e11-lite.chunk.js → 106-916e8d8017-lite.chunk.js} +1 -1
- package/dist/scripts/{107-e4b6c681fc-lite.chunk.js → 107-b475fac8e0-lite.chunk.js} +1 -1
- package/dist/scripts/{108-168d7c65ec-lite.chunk.js → 108-a6ce98f4ef-lite.chunk.js} +1 -1
- package/dist/scripts/{109-2a771085eb-lite.chunk.js → 109-31365f868a-lite.chunk.js} +1 -1
- package/dist/scripts/11-213c4dbaab-lite.chunk.js +1 -0
- package/dist/scripts/{110-ad9a0e3f43-lite.chunk.js → 110-b393be9fb4-lite.chunk.js} +1 -1
- package/dist/scripts/{111-1c380387c7-lite.chunk.js → 111-13d625c829-lite.chunk.js} +1 -1
- package/dist/scripts/{112-44ab8d8405-lite.chunk.js → 112-a64f83e2b2-lite.chunk.js} +1 -1
- package/dist/scripts/{114-d6d555c7ce-lite.chunk.js → 114-39f518fedc-lite.chunk.js} +1 -1
- package/dist/scripts/{115-6c22d78078-lite.chunk.js → 115-26855e73af-lite.chunk.js} +1 -1
- package/dist/scripts/{116-5670473033-lite.chunk.js → 116-7b1c848556-lite.chunk.js} +1 -1
- package/dist/scripts/{117-a61e06673c-lite.chunk.js → 117-5b1ad1fe39-lite.chunk.js} +1 -1
- package/dist/scripts/{118-485d17244f-lite.chunk.js → 118-d0fcc1f77d-lite.chunk.js} +1 -1
- package/dist/scripts/{119-6f62f7a74b-lite.chunk.js → 119-6b8d5e93a3-lite.chunk.js} +1 -1
- package/dist/scripts/{12-f02e317794-lite.chunk.js → 12-489df689b7-lite.chunk.js} +1 -1
- package/dist/scripts/{120-291b839ef6-lite.chunk.js → 120-69f791f18a-lite.chunk.js} +1 -1
- package/dist/scripts/{121-111f2c6723-lite.chunk.js → 121-3e2bfc029d-lite.chunk.js} +1 -1
- package/dist/scripts/{123-d0f5e51411-lite.chunk.js → 123-9a1195ccb0-lite.chunk.js} +1 -1
- package/dist/scripts/124-4f84b5e18e-lite.chunk.js +1 -0
- package/dist/scripts/{125-5573724d87-lite.chunk.js → 125-848349fd67-lite.chunk.js} +1 -1
- package/dist/scripts/{126-92e3e1c2b2-lite.chunk.js → 126-9368da4dca-lite.chunk.js} +1 -1
- package/dist/scripts/{127-a2a692e45f-lite.chunk.js → 127-c60b674b95-lite.chunk.js} +1 -1
- package/dist/scripts/{128-98697824eb-lite.chunk.js → 128-af6d5b8aa3-lite.chunk.js} +1 -1
- package/dist/scripts/{129-a96fbce0a3-lite.chunk.js → 129-64a79c709b-lite.chunk.js} +1 -1
- package/dist/scripts/{13-6e791958c4-lite.chunk.js → 13-d04cac20d4-lite.chunk.js} +1 -1
- package/dist/scripts/{130-7b5df1a9c1-lite.chunk.js → 130-a8ef330df8-lite.chunk.js} +1 -1
- package/dist/scripts/{131-a6f3792c7b-lite.chunk.js → 131-9d2bf75287-lite.chunk.js} +1 -1
- package/dist/scripts/{132-b97e20783e-lite.chunk.js → 132-beaefaa928-lite.chunk.js} +1 -1
- package/dist/scripts/{133-59d6e0875b-lite.chunk.js → 133-f88089f782-lite.chunk.js} +1 -1
- package/dist/scripts/{134-2015b1b8da-lite.chunk.js → 134-6ee2d696a2-lite.chunk.js} +1 -1
- package/dist/scripts/135-f8a112b2ef-lite.chunk.js +1 -0
- package/dist/scripts/136-ab09b3ae2d-lite.chunk.js +1 -0
- package/dist/scripts/137-fa261ba943-lite.chunk.js +1 -0
- package/dist/scripts/{137-418d2e8aae-lite.chunk.js → 138-742f8dc3f2-lite.chunk.js} +1 -1
- package/dist/scripts/{138-36ba62bdc5-lite.chunk.js → 139-a8292f8c36-lite.chunk.js} +1 -1
- package/dist/scripts/{139-6d1ff682c0-lite.chunk.js → 140-d4c1cde824-lite.chunk.js} +1 -1
- package/dist/scripts/{140-b970a7cc5f-lite.chunk.js → 141-6537b7dfba-lite.chunk.js} +1 -1
- package/dist/scripts/{141-9fe43daf80-lite.chunk.js → 142-146d74b05e-lite.chunk.js} +1 -1
- package/dist/scripts/{142-c60445933a-lite.chunk.js → 143-dfa4462f96-lite.chunk.js} +1 -1
- package/dist/scripts/{143-eb42112644-lite.chunk.js → 144-838fb2a352-lite.chunk.js} +1 -1
- package/dist/scripts/{144-6f9e989dbf-lite.chunk.js → 145-56aef28238-lite.chunk.js} +1 -1
- package/dist/scripts/{145-4b61ddafd1-lite.chunk.js → 146-efeb25ec96-lite.chunk.js} +1 -1
- package/dist/scripts/{146-9c645c9226-lite.chunk.js → 147-bb168e6950-lite.chunk.js} +1 -1
- package/dist/scripts/{147-8777fa0e93-lite.chunk.js → 148-eb56458acf-lite.chunk.js} +1 -1
- package/dist/scripts/{148-f8eb7f0459-lite.chunk.js → 149-300b66a754-lite.chunk.js} +1 -1
- package/dist/scripts/{149-d7e4a7e5a3-lite.chunk.js → 150-e7def31bdf-lite.chunk.js} +1 -1
- package/dist/scripts/{150-fa3a0a676b-lite.chunk.js → 151-1dfe688220-lite.chunk.js} +1 -1
- package/dist/scripts/{151-38df2b678b-lite.chunk.js → 152-413b3c442c-lite.chunk.js} +1 -1
- package/dist/scripts/{152-100761c2e6-lite.chunk.js → 153-85cdfc8571-lite.chunk.js} +1 -1
- package/dist/scripts/{153-f2810c6250-lite.chunk.js → 154-c92b5bbe92-lite.chunk.js} +1 -1
- package/dist/scripts/{154-cb3915ce35-lite.chunk.js → 155-ebb67a68a6-lite.chunk.js} +1 -1
- package/dist/scripts/{155-6850ebcf20-lite.chunk.js → 156-7e09cc2045-lite.chunk.js} +1 -1
- package/dist/scripts/{156-7e84445b1f-lite.chunk.js → 157-b4ea7c07fd-lite.chunk.js} +1 -1
- package/dist/scripts/{157-a05b80a1f2-lite.chunk.js → 158-a10163af3f-lite.chunk.js} +1 -1
- package/dist/scripts/{158-a60801ed0d-lite.chunk.js → 159-3604dba399-lite.chunk.js} +1 -1
- package/dist/scripts/{16-53c2851019-lite.chunk.js → 16-8f72ffa72a-lite.chunk.js} +1 -1
- package/dist/scripts/{159-7eaddfef65-lite.chunk.js → 160-87bddc7630-lite.chunk.js} +1 -1
- package/dist/scripts/{160-cd425dc13b-lite.chunk.js → 161-0787e357b2-lite.chunk.js} +1 -1
- package/dist/scripts/{161-d1a312b70a-lite.chunk.js → 162-4cc0e4cca8-lite.chunk.js} +1 -1
- package/dist/scripts/{162-a0f401c51a-lite.chunk.js → 163-170e46f12b-lite.chunk.js} +1 -1
- package/dist/scripts/{163-78f2f17d93-lite.chunk.js → 164-f1bc62445f-lite.chunk.js} +1 -1
- package/dist/scripts/{164-0ee9709a34-lite.chunk.js → 165-e68ca47f92-lite.chunk.js} +1 -1
- package/dist/scripts/{165-fb8c7169c5-lite.chunk.js → 166-6e5a223853-lite.chunk.js} +1 -1
- package/dist/scripts/{166-ddb0846b51-lite.chunk.js → 167-02bbe8dc99-lite.chunk.js} +1 -1
- package/dist/scripts/{167-63b9034d76-lite.chunk.js → 168-1f0aeecbb7-lite.chunk.js} +1 -1
- package/dist/scripts/{168-6d70343ff9-lite.chunk.js → 169-f44f60afe4-lite.chunk.js} +1 -1
- package/dist/scripts/{17-20f6155495-lite.chunk.js → 17-5050eb9e05-lite.chunk.js} +1 -1
- package/dist/scripts/{169-f250e49488-lite.chunk.js → 170-218fdbc595-lite.chunk.js} +1 -1
- package/dist/scripts/{170-7ce673a80f-lite.chunk.js → 171-4157b977d6-lite.chunk.js} +1 -1
- package/dist/scripts/{171-36481c5980-lite.chunk.js → 172-e073e362ea-lite.chunk.js} +1 -1
- package/dist/scripts/{172-d0ee412b8d-lite.chunk.js → 173-9381b3ff59-lite.chunk.js} +1 -1
- package/dist/scripts/{173-4e8c44241f-lite.chunk.js → 174-a17a17fda1-lite.chunk.js} +1 -1
- package/dist/scripts/{174-80aa99dc26-lite.chunk.js → 175-2500e211ce-lite.chunk.js} +1 -1
- package/dist/scripts/{175-64d1fee34a-lite.chunk.js → 176-6d5fdf18ab-lite.chunk.js} +1 -1
- package/dist/scripts/{176-1678f729c1-lite.chunk.js → 177-589f220821-lite.chunk.js} +1 -1
- package/dist/scripts/{177-e3baa55c19-lite.chunk.js → 178-53e40c92ba-lite.chunk.js} +1 -1
- package/dist/scripts/{178-c8992ceb54-lite.chunk.js → 179-e10b41ab81-lite.chunk.js} +1 -1
- package/dist/scripts/{18-a43988a6eb-lite.chunk.js → 18-67053f2983-lite.chunk.js} +1 -1
- package/dist/scripts/{179-5d99a8f058-lite.chunk.js → 180-2adf61b122-lite.chunk.js} +1 -1
- package/dist/scripts/{180-86eac07d84-lite.chunk.js → 181-92f0657c6c-lite.chunk.js} +1 -1
- package/dist/scripts/{181-f71502f92d-lite.chunk.js → 182-5ddef499a9-lite.chunk.js} +1 -1
- package/dist/scripts/{182-a6d9406f32-lite.chunk.js → 183-fb44bfffdc-lite.chunk.js} +1 -1
- package/dist/scripts/{183-dc0afe4738-lite.chunk.js → 184-4d7a834ac7-lite.chunk.js} +1 -1
- package/dist/scripts/185-d39803be39-lite.chunk.js +1 -0
- package/dist/scripts/{185-4f0b3bf262-lite.chunk.js → 186-7eeb2ab173-lite.chunk.js} +1 -1
- package/dist/scripts/{186-758961ddec-lite.chunk.js → 187-52989164eb-lite.chunk.js} +1 -1
- package/dist/scripts/{187-b39398214b-lite.chunk.js → 188-ba25966324-lite.chunk.js} +1 -1
- package/dist/scripts/{188-9010148276-lite.chunk.js → 189-876c0239f3-lite.chunk.js} +1 -1
- package/dist/scripts/{19-1d91840e26-lite.chunk.js → 19-45ede1ff49-lite.chunk.js} +1 -1
- package/dist/scripts/{189-55c3d3122e-lite.chunk.js → 190-5a8bff0e5f-lite.chunk.js} +1 -1
- package/dist/scripts/{190-1399300a26-lite.chunk.js → 191-884622622a-lite.chunk.js} +1 -1
- package/dist/scripts/{191-b2026a4648-lite.chunk.js → 192-2e7da78d02-lite.chunk.js} +1 -1
- package/dist/scripts/{192-f3b3862596-lite.chunk.js → 193-85f9923ab9-lite.chunk.js} +1 -1
- package/dist/scripts/{193-bf2fe324e9-lite.chunk.js → 194-cbbb9609e9-lite.chunk.js} +1 -1
- package/dist/scripts/{2-1a078b5533-lite.chunk.js → 2-d6edbcd1a9-lite.chunk.js} +1 -1
- package/dist/scripts/20-056a5ce1cd-lite.chunk.js +1 -0
- package/dist/scripts/{21-d51ec5d3aa-lite.chunk.js → 21-27b8e205bf-lite.chunk.js} +1 -1
- package/dist/scripts/{22-46fd48a5e8-lite.chunk.js → 22-f92eae258a-lite.chunk.js} +1 -1
- package/dist/scripts/{23-414dcea00f-lite.chunk.js → 23-070447ec03-lite.chunk.js} +1 -1
- package/dist/scripts/{24-83f23854a8-lite.chunk.js → 24-20d68ad7fe-lite.chunk.js} +1 -1
- package/dist/scripts/{25-5cf7badae2-lite.chunk.js → 25-44abea0d42-lite.chunk.js} +1 -1
- package/dist/scripts/{26-b8998b73b0-lite.chunk.js → 26-1c095f3d04-lite.chunk.js} +1 -1
- package/dist/scripts/27-ed0fc57b75-lite.chunk.js +1 -0
- package/dist/scripts/{28-a72c191da9-lite.chunk.js → 28-f40ca2b187-lite.chunk.js} +1 -1
- package/dist/scripts/{3-806d365dc0-lite.chunk.js → 3-605d3346db-lite.chunk.js} +1 -1
- package/dist/scripts/{30-ede4f6176b-lite.chunk.js → 30-b994218c5e-lite.chunk.js} +1 -1
- package/dist/scripts/{34-fdbb601fcb-lite.chunk.js → 34-ecc69a218b-lite.chunk.js} +1 -1
- package/dist/scripts/{35-2b0d38fdca-lite.chunk.js → 35-c8c4c68f12-lite.chunk.js} +1 -1
- package/dist/scripts/{36-73d99a3a1e-lite.chunk.js → 36-648921ad7f-lite.chunk.js} +3 -3
- package/dist/scripts/{37-c02bbe5875-lite.chunk.js → 37-6d9e5addcd-lite.chunk.js} +1 -1
- package/dist/scripts/{38-02b78c08b3-lite.chunk.js → 38-b97b5e6fd7-lite.chunk.js} +1 -1
- package/dist/scripts/{39-367ae23362-lite.chunk.js → 39-ddd8388324-lite.chunk.js} +1 -1
- package/dist/scripts/{4-4b2b96cab3-lite.chunk.js → 4-c42ca1edac-lite.chunk.js} +1 -1
- package/dist/scripts/40-43878d944a-lite.chunk.js +1 -0
- package/dist/scripts/{41-bfe9abb908-lite.chunk.js → 41-407902c1f9-lite.chunk.js} +1 -1
- package/dist/scripts/{42-d8976ddc0c-lite.chunk.js → 42-7995add392-lite.chunk.js} +1 -1
- package/dist/scripts/{43-02e515c250-lite.chunk.js → 43-fad03f0e5b-lite.chunk.js} +1 -1
- package/dist/scripts/{44-519724cf4c-lite.chunk.js → 44-059c3fa7ce-lite.chunk.js} +1 -1
- package/dist/scripts/45-fba1a0e8bd-lite.chunk.js +1 -0
- package/dist/scripts/{46-a5ca901971-lite.chunk.js → 46-1ff1fcfc3d-lite.chunk.js} +1 -1
- package/dist/scripts/47-86bd92026a-lite.chunk.js +1 -0
- package/dist/scripts/{48-25374c7990-lite.chunk.js → 48-c678285425-lite.chunk.js} +1 -1
- package/dist/scripts/{49-cf93597116-lite.chunk.js → 49-d1317b7fb8-lite.chunk.js} +1 -1
- package/dist/scripts/{5-d31db9e482-lite.chunk.js → 5-47e7370ae2-lite.chunk.js} +1 -1
- package/dist/scripts/{50-b0ebdb5af9-lite.chunk.js → 50-7d2219295e-lite.chunk.js} +1 -1
- package/dist/scripts/{51-a3034ac325-lite.chunk.js → 51-f2cd2c28a2-lite.chunk.js} +1 -1
- package/dist/scripts/{52-7610ac1f40-lite.chunk.js → 52-aa8828bd86-lite.chunk.js} +1 -1
- package/dist/scripts/{53-dfac5ae9eb-lite.chunk.js → 53-f3249e2dfc-lite.chunk.js} +1 -1
- package/dist/scripts/{54-a977fc8526-lite.chunk.js → 54-26c7c3074e-lite.chunk.js} +1 -1
- package/dist/scripts/{55-82fa1c903a-lite.chunk.js → 55-f362b3725f-lite.chunk.js} +1 -1
- package/dist/scripts/{56-ae8ce2cd66-lite.chunk.js → 56-83cc1bca40-lite.chunk.js} +1 -1
- package/dist/scripts/{57-e0154b51bc-lite.chunk.js → 57-0aeabd1a89-lite.chunk.js} +1 -1
- package/dist/scripts/{58-13dd178ec4-lite.chunk.js → 58-6d22a20df5-lite.chunk.js} +1 -1
- package/dist/scripts/{59-36a46d4462-lite.chunk.js → 59-5721661713-lite.chunk.js} +1 -1
- package/dist/scripts/{6-c50dc9738f-lite.chunk.js → 6-593a3cb6d1-lite.chunk.js} +1 -1
- package/dist/scripts/{60-47fc0dbf38-lite.chunk.js → 60-6201b1671d-lite.chunk.js} +1 -1
- package/dist/scripts/{61-8edb322f80-lite.chunk.js → 61-a5dc6b0d64-lite.chunk.js} +1 -1
- package/dist/scripts/{62-542339935f-lite.chunk.js → 62-0fd1b83879-lite.chunk.js} +1 -1
- package/dist/scripts/{63-116a841998-lite.chunk.js → 63-8311132bcf-lite.chunk.js} +1 -1
- package/dist/scripts/{64-e43e8df5c0-lite.chunk.js → 64-d119408154-lite.chunk.js} +1 -1
- package/dist/scripts/{65-93594f41de-lite.chunk.js → 65-1056dbc1f8-lite.chunk.js} +2 -2
- package/dist/scripts/{66-ed3ea50c2a-lite.chunk.js → 66-0dead9fdfd-lite.chunk.js} +1 -1
- package/dist/scripts/{67-28d94cd2e2-lite.chunk.js → 67-4c7254e547-lite.chunk.js} +1 -1
- package/dist/scripts/{68-0ee9518dc4-lite.chunk.js → 68-ffd6986abe-lite.chunk.js} +2 -2
- package/dist/scripts/69-79a44b36a4-lite.chunk.js +1 -0
- package/dist/scripts/{70-0906a55641-lite.chunk.js → 70-e034e7645e-lite.chunk.js} +1 -1
- package/dist/scripts/71-b2930ee14a-lite.chunk.js +1 -0
- package/dist/scripts/{72-034851fa69-lite.chunk.js → 72-b57fb53106-lite.chunk.js} +1 -1
- package/dist/scripts/{73-75512e9375-lite.chunk.js → 73-173a1df6a1-lite.chunk.js} +1 -1
- package/dist/scripts/74-51b9ed8efc-lite.chunk.js +1 -0
- package/dist/scripts/{75-feed7f951f-lite.chunk.js → 75-84bfd490c6-lite.chunk.js} +1 -1
- package/dist/scripts/76-c9f8fb6500-lite.chunk.js +1 -0
- package/dist/scripts/77-e9001b1daf-lite.chunk.js +1 -0
- package/dist/scripts/{78-52c527933e-lite.chunk.js → 78-73ee85ce13-lite.chunk.js} +1 -1
- package/dist/scripts/{79-041496e040-lite.chunk.js → 79-1163e52dcd-lite.chunk.js} +1 -1
- package/dist/scripts/{8-c6cba6063d-lite.chunk.js → 8-d37e832850-lite.chunk.js} +1 -1
- package/dist/scripts/{80-da1832139a-lite.chunk.js → 80-e161d68e30-lite.chunk.js} +1 -1
- package/dist/scripts/{81-a10f4cce90-lite.chunk.js → 81-796509d499-lite.chunk.js} +1 -1
- package/dist/scripts/{82-e0a9feb6b6-lite.chunk.js → 82-ed70337b09-lite.chunk.js} +1 -1
- package/dist/scripts/{83-28b0b36e20-lite.chunk.js → 83-f0186c4470-lite.chunk.js} +1 -1
- package/dist/scripts/{84-b2ab125d6e-lite.chunk.js → 84-637e8a8c40-lite.chunk.js} +1 -1
- package/dist/scripts/{85-ab40fadec3-lite.chunk.js → 85-45d5d4e00b-lite.chunk.js} +1 -1
- package/dist/scripts/86-15cd5c1079-lite.chunk.js +1 -0
- package/dist/scripts/87-306b245357-lite.chunk.js +1 -0
- package/dist/scripts/{88-e25b4db7c5-lite.chunk.js → 88-605d84d48d-lite.chunk.js} +1 -1
- package/dist/scripts/{89-c4482bf0d2-lite.chunk.js → 89-9fb17d6cc9-lite.chunk.js} +1 -1
- package/dist/scripts/{9-d026fa51fd-lite.chunk.js → 9-dfd4ad7b1c-lite.chunk.js} +3 -3
- package/dist/scripts/90-e45df48f45-lite.chunk.js +1 -0
- package/dist/scripts/{91-856d92c1cb-lite.chunk.js → 91-534e85869d-lite.chunk.js} +1 -1
- package/dist/scripts/{92-cf94c69f7b-lite.chunk.js → 92-b5bc67a8e4-lite.chunk.js} +1 -1
- package/dist/scripts/{93-5b7348f34d-lite.chunk.js → 93-aa3a213c03-lite.chunk.js} +1 -1
- package/dist/scripts/94-7b5968c20a-lite.chunk.js +1 -0
- package/dist/scripts/{95-f95d64669f-lite.chunk.js → 95-7abca81a3a-lite.chunk.js} +1 -1
- package/dist/scripts/{96-00643028d7-lite.chunk.js → 96-7e0ede4bc1-lite.chunk.js} +1 -1
- package/dist/scripts/97-eabd52dcca-lite.chunk.js +1 -0
- package/dist/scripts/{98-00dc7a8e35-lite.chunk.js → 98-6a957c391c-lite.chunk.js} +1 -1
- package/dist/scripts/{99-65a025e066-lite.chunk.js → 99-bac738f6f0-lite.chunk.js} +1 -1
- package/dist/scripts/{bundle-35cbe4b2e1.min.js → bundle-0581cbd77d.min.js} +12 -12
- package/dist/scripts/{polyfills-187309aef5.min.js → polyfills-6d14b9a49e.min.js} +1 -1
- package/package.json +2 -2
- package/dist/scripts/103-331efa47f9-lite.chunk.js +0 -1
- package/dist/scripts/104-386e85306a-lite.chunk.js +0 -1
- package/dist/scripts/11-4297a17caa-lite.chunk.js +0 -1
- package/dist/scripts/124-d843ddefd2-lite.chunk.js +0 -1
- package/dist/scripts/135-748b8f3d7d-lite.chunk.js +0 -1
- package/dist/scripts/136-a99d472d49-lite.chunk.js +0 -1
- package/dist/scripts/184-965b220122-lite.chunk.js +0 -1
- package/dist/scripts/20-cfce4a1f47-lite.chunk.js +0 -1
- package/dist/scripts/27-d8234c5b47-lite.chunk.js +0 -1
- package/dist/scripts/40-f4b3f5e90b-lite.chunk.js +0 -1
- package/dist/scripts/45-e974d06646-lite.chunk.js +0 -1
- package/dist/scripts/47-19632ed791-lite.chunk.js +0 -1
- package/dist/scripts/69-f2d13d6743-lite.chunk.js +0 -1
- package/dist/scripts/71-62bdb8ac35-lite.chunk.js +0 -1
- package/dist/scripts/74-6e171e22cc-lite.chunk.js +0 -1
- package/dist/scripts/76-61d036675b-lite.chunk.js +0 -1
- package/dist/scripts/77-d91d24c3bf-lite.chunk.js +0 -1
- package/dist/scripts/86-f9f6ceaae6-lite.chunk.js +0 -1
- package/dist/scripts/87-971c1556d9-lite.chunk.js +0 -1
- package/dist/scripts/90-404853d1ae-lite.chunk.js +0 -1
- package/dist/scripts/94-9f39588d84-lite.chunk.js +0 -1
- package/dist/scripts/97-6bfda8ef8d-lite.chunk.js +0 -1
- /package/dist/css/{142-lite-14218ac613.chunk.css → 143-lite-14218ac613.chunk.css} +0 -0
- /package/dist/css/{143-lite-5d9ea175a9.chunk.css → 144-lite-5d9ea175a9.chunk.css} +0 -0
- /package/dist/css/{144-lite-8fc51c67f9.chunk.css → 145-lite-8fc51c67f9.chunk.css} +0 -0
- /package/dist/css/{145-lite-fdc3ceff80.chunk.css → 146-lite-fdc3ceff80.chunk.css} +0 -0
- /package/dist/css/{146-lite-57c23ed816.chunk.css → 147-lite-57c23ed816.chunk.css} +0 -0
- /package/dist/css/{151-lite-859d0b7430.chunk.css → 152-lite-859d0b7430.chunk.css} +0 -0
- /package/dist/css/{152-lite-a199ee0f72.chunk.css → 153-lite-a199ee0f72.chunk.css} +0 -0
- /package/dist/scripts/{113-3c4a46bb3b-lite.chunk.js → 113-fbfcb6e133-lite.chunk.js} +0 -0
- /package/dist/scripts/{29-ee76ae9273-lite.chunk.js → 29-6538fc21bb-lite.chunk.js} +0 -0
- /package/dist/scripts/{7-8de469ba5a-lite.chunk.js → 7-40c943f720-lite.chunk.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp_clickview_lite=window.webpackJsonp_clickview_lite||[]).push([[16],{1136:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(15),o={createViewKey:function(t,e,n){var o={mediaId:t.toString(),mediaIdType:e};return n&&(o.shareContextId=n),{url:"/api/player/create-view-key",key:"view:key:".concat(t,":").concat(e),type:r.a.POST,data:o,expiryTime:28800}}}},1137:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.Share="share",t.MasterObject="masterobject"}(r||(r={}))},1143:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return 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={}))},1156:function(t,e,n){"use strict";var r=n(1224);n.d(e,"InteractiveMode",(function(){return r.a}));n(1248),n(1249),n(1250),n(1251),n(1252),n(1253),n(1254)},1195:function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(0),o=n(1096),a=n(8),i=n(29),c=n(246),u=n(15),l=n(40),s=n(1196),f=n.n(s);function d(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}(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 p(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 m=null,h=!1;function v(t){var e=d(r.useState(m),2),n=e[0],s=e[1];if(m||h||(h=!0,Object(c.ajaxRequest)({resource:"/api/integrations/token/immersive-reader",type:u.a.GET,success:function(t){m=t,s(t),window.setTimeout((function(){m=null,h=!1}),9e5)},error:function(){}})),!n)return r.createElement(r.Fragment,null);return t.title||(t.title=a.a.getPhrase("shared.immersiveReader","titleFallback")),r.createElement("span",{className:"".concat(f.a.button," ").concat(t.className||""),onClick:function(){l.a.isFunction(t.onLaunch)&&t.onLaunch(),i.a.logUserAction(t.analyticsData,t.analyticsOptions);var e={title:t.title,chunks:[{content:t.text,mimeType:t.html?"text/html":"text/plain"}]},r=n.subdomain,a=n.token,c={uiZIndex:5e3,onExit:function(){l.a.isFunction(t.onExit)&&t.onExit()}};o.launchAsync(a,r,e,c)}},r.createElement("svg",{viewBox:"0 0 40 37"},r.createElement("path",{d:"M37.4,0.9 L37.4,9.6 L35.4,9.6 L35.4,2.9 L24.4,2.9 C22.9,3.3 20,4.5 20,6 L20,17.2 L18,17.2 L18,6 C18,5 15.6,3.6 13.8,2.9 L2,2.9 L2,29 L12.4,29 L12.4,31 L0,31 L0,0.9 L14.1,0.9 L14.3,1 C15,1.2 17.5,2.2 18.9,3.7 C20.5,1.9 23.5,1.1 23.9,1 L24.1,1 L37.4,1 L37.4,0.9 Z",fill:"#000000"}),r.createElement("path",{d:"M27.4,37 L25.8,37 L18.4,29.4 L14,29.4 L14,21 L18.4,20.9 L26.1,13 L27.4,13 L27.4,37 Z M16,27.4 L19.2,27.4 L25.3,33.7 L25.3,16.6 L19.2,22.9 L15.9,22.9 L15.9,27.4 L16,27.4 Z",fill:"#0197F2"}),r.createElement("path",{d:"M31.3,32.7 L29.6,31.7 C29.6,31.7 31.7,28.3 31.7,25.2 C31.7,21.9 29.6,18.5 29.6,18.4 L31.3,17.4 C31.4,17.6 33.7,21.3 33.7,25.2 C33.7,28.8 31.4,32.6 31.3,32.7 Z",fill:"#0197F2"}),r.createElement("path",{d:"M36.4,36.2 L34.8,35 C34.8,35 38,30.8 38,25.2 C38,19.6 34.8,15.4 34.8,15.4 L36.4,14.2 C36.5,14.4 40,19 40,25.3 C40,31.5 36.5,36 36.4,36.2 Z",fill:"#0197F2"})))}},1196:function(t,e,n){t.exports={button:"TRYB2"}},1214:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.AddToPlaylist="115005679748",t.LibraryEditor="360001974533",t.VideoAccess="360000153947",t.AddFromOnline="360011718234",t.UploadToLibraryEditor="360012069334",t.PublisherArchive="360011150174",t.PBTErrorCodes="360012421153",t.ManuelReview="360020004534",t.LibraryReview="360000163788",t.PublisherServer="360023108873",t.MigrationOptions="360023109033",t.Integrations="4407268725529",t.Classrooms="4405362551833",t.MakeInteractive="4405370510873"}(r||(r={}))},1224:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.View=0]="View",t[t.Create=1]="Create"}(r||(r={}))},1232:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),o=n.n(r),a=n(119),i=n(63),c=n(20);function u(t){return o.a.createElement(a.a,{title:t.tooltipText,spanHack:!0,spanHackClassName:"d-inline-block"},o.a.createElement(i.a,{svgName:c.b.Info}))}},1248:function(t,e){},1249:function(t,e){},1250:function(t,e){},1251:function(t,e){},1252:function(t,e){},1253:function(t,e){},1254:function(t,e){},1257:function(t,e,n){t.exports={uncheckedBackground:"_3OcAr"}},1258:function(t,e,n){"use strict";var r=n(0),o=n.n(r),a=n(4),i=n(28),c=(n(815),n(816),n(2)),u=n(97),l=n(1156),s=n(1125);n(1356);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})(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}}).apply(this,arguments)}function m(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function v(t){var e=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}}();return function(){var n,r=g(t);if(e){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}function y(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 g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var b=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=v(a);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=o.call(this,t,e)).timepoint_=e.timepoint,n.time_=e.timepoint.visibleAt/1e3;var r=e.timepoint.interactions[0];r||n.hide();var i=s.a.getTypeInfo(r.typeId).bgClassName;return n.$(".vjs-icon-placeholder").classList.add(i),n.controlText(r.name),n.update(),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-item ".concat(p(g(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return p(g(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),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getComponent("Button"));n(1357);function w(t){return(w="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})(t)}function E(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return x(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(t,e)}(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 x(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 I(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 S(){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=k(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(this,arguments)}function k(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=L(t)););return t}function O(t,e){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function C(t){var e=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}}();return function(){var n,r=L(t);if(e){var o=L(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return N(this,n)}}function N(t,e){if(e&&("object"===w(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return j(t)}function j(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function L(t){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var T=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&&O(t,e)}(a,t);var e,n,r,o=C(a);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=o.call(this,t,e)).track_=e.track,n.interactive_=e.interactive,n.onDurationChange=n.onDurationChange.bind(j(n)),n.createInteractionItems=n.createInteractionItems.bind(j(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(S(L(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return S(L(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=this;if(this.track_){E(this.children_).forEach((function(t){e.removeChild(t)}));for(var n=0;n<this.track_.cues.length;n++){var r=this.track_.cues[n],o=this.getTimepointById(r.text);o&&(null===(t=o.interactions)||void 0===t?void 0:t.length)&&this.addChild(new b(this.player_,{timepoint:o}))}}}},{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()}))}}])&&I(e.prototype,n),r&&I(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getComponent("Component")),A=n(290),P=n(1224);function _(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return F(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(t,e)}(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 F(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 R=n(401),M=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 U(t){return!!(null==t?void 0:t.toString().startsWith("new_"))}function D(t){t.error,t.hasChanges,t.submitted,t.spinner;return M(t,["error","hasChanges","submitted","spinner"])}var G=n(341);function q(t){return(q="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})(t)}function B(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */B=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==q(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 W(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 z=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Y=function(){return"/api/domain/v1/interactions/bulk"},$=function(t){return"/api/domain/v1/interactions/bulk/".concat(t)},H=function(t){return"/api/domain/v1/interactions/".concat(t)},V=function(){return"/api/domain/v1/timepoints"},K=function(t){return"/api/domain/v1/timepoints/".concat(t)},Z=function(t){return"/api/domain/v1/timepoints/".concat(t)},J={},Q=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,r;return e=t,(n=[{key:"saveInteraction",value:function(t){return z(this,void 0,void 0,B().mark((function e(){var n,r,o,a,i;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=U(t.id),r=n?Y():$(t.id),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),a=n?G.a.post(r,JSON.stringify(o),J):G.a.put(r,JSON.stringify(o),J),e.next=7,a;case 7:i=e.sent,n&&(t.id=i.id);case 9:case"end":return e.stop()}}),e)})))}},{key:"deleteInteraction",value:function(t){return z(this,void 0,void 0,B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G.a.delete(H(t),J);case 2:case"end":return e.stop()}}),e)})))}},{key:"saveTimepoint",value:function(t){return z(this,void 0,void 0,B().mark((function e(){var n,r;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={interactiveId:t.interactiveId,shouldPause:1,visibleAt:t.visibleAt},e.next=3,G.a.post(V(),JSON.stringify(n),J);case 3:r=e.sent,t.id=r.id;case 5:case"end":return e.stop()}}),e)})))}},{key:"updateTimepoint",value:function(t){return z(this,void 0,void 0,B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G.a.put(Z(t.id),JSON.stringify(t),J);case 2:case"end":return e.stop()}}),e)})))}},{key:"deleteTimepoint",value:function(t){return z(this,void 0,void 0,B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G.a.delete(K(t),J);case 2:case"end":return e.stop()}}),e)})))}}])&&W(e.prototype,n),r&&W(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()),X=n(405),tt=n(275),et=n(241);function nt(t){var e=t.error;return t.error?o.a.createElement("p",{className:"mt-2 small text-danger"},e):o.a.createElement(o.a.Fragment,null)}var rt=n(133);function ot(t){return(ot="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})(t)}function at(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */at=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==ot(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},ct=/[.\?!,;:\-''\(\)]/g;function ut(t){for(var e=t.split("");e.length&&e[0].match(ct);)e.shift();for(;e.length&&e[e.length-1].match(ct);)e.pop();return e.join("")}function lt(t,e){for(var n=t.split(""),r=[],o=[];n.length&&n[0].match(ct);)r.push(n.shift());for(;n.length&&n[n.length-1].match(ct);)o.unshift(n.pop());return r.join("")+e+o.join("")}function st(t){return t.map((function(t){if(!t.selected)return t.text;var e=ut(t.text).length,n=new Array(e).fill("_").join("");return lt(t.text,n)})).join(" ")}function ft(t){return t.map((function(t){var e;return t.selected?null===(e=lt(t.text,"{".concat(t.order,"}")))||void 0===e?void 0:e.trim():t.text})).join(" ")}var dt=n(1240),pt=n(1232);function mt(t){return(mt="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})(t)}function ht(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ht=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==mt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 vt=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var yt=n(32);function gt(t){var e=o.a.useRef(null);function n(){t.onChange(Object.assign(Object.assign({},t.answer),{isCorrect:!t.answer.isCorrect}))}return o.a.createElement("li",{className:"p-1 my-1 w-100 bg-white d-flex align-items-center border rounded"},o.a.createElement("div",{className:"custom-control ".concat(t.isTrueOrFalse?"custom-radio":"custom-checkbox"),onKeyDown:function(t){return"Enter"===t.key&&n()}},o.a.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.a.createElement("label",{ref:e,htmlFor:"multiple-choice--".concat(t.answer.order),className:"cursor-pointer custom-control-label"})),t.isTrueOrFalse?o.a.createElement("label",{className:"mb-0",htmlFor:"multiple-choice--".concat(t.answer.order)},t.answer.name):o.a.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"}))}n(1358);function bt(t){return(bt="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})(t)}function wt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */wt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==bt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Et=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};function xt(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 It(t,e){var n;return Et(this,void 0,void 0,wt().mark((function r(){return wt().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,Q.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})))}function St(t){var e=t.state,n=void 0===e?function(t){var e,n=t.typeId===tt.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,a=t.interaction,i=t.optionsPortalNode,c=t.showFeedback,u=a.typeId===tt.InteractionTypeId.TrueOrFalse;function l(t){var e=n.answers.map((function(e){return e.order!==t.order?Object.assign(Object.assign({},e),{isCorrect:!u&&e.isCorrect}):t}));if(e.find((function(t){return!t.name}))&&(e=function(t){var e=t.find((function(t){return!t.name}));if(t.length>2)return t.filter((function(t){return t.order!==e.order})).map((function(t,e){return Object.assign(Object.assign({},t),{order:e})}));return t.map((function(t){return t.order!==e.order?t:Object.assign(Object.assign({},t),{isCorrect:!1})}))}(e)),!u&&e.length<4&&!e.find((function(t){return!t.name}))){var o=yt.a.last(e);e.push({name:"",order:o.order+1,isCorrect:!1})}r(Object.assign(Object.assign({},n),{answers:e}))}return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"multiple-choice-question"},"Question"),o.a.createElement(et.b,{node:i})),o.a.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.a.createElement(nt,{error:n.error})),o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"multiple-choice-answer"},"Answers"),n.answers.map((function(t){return o.a.createElement(gt,{key:t.order,answer:t,onChange:l,isTrueOrFalse:u})})),n.question&&o.a.createElement(nt,{error:n.error})),c&&u&&o.a.createElement("div",{className:"form-group mb-0"},o.a.createElement("label",{className:"cv-true-or-false-feedback-label cv-interaction-field-label",htmlFor:"true-or-false-feedback"},"Feedback ",o.a.createElement("span",{className:"text-muted"},"(optional)")," ",o.a.createElement(pt.a,{tooltipText:"Provide answer feedback for your students"})),o.a.createElement(dt.a,{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 kt=n(413),Ot=n(30),Ct=n(421);function Nt(){return o.a.createElement("svg",{viewBox:"0 0 43 38",className:"cv-upload-image-icon"},o.a.createElement("g",{transform:"translate(-1193.000000, -185.000000)"},o.a.createElement("g",{transform:"translate(1183.000000, 173.000000)"},o.a.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 jt(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Lt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lt(t,e)}(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 Lt(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 Tt(t){var e=jt(o.a.useState(!1),2),n=e[0],r=e[1],a=jt(o.a.useState(0),2),i=a[0],c=a[1];return o.a.useEffect((function(){0===i&&n&&r(!1)}),[i,n,r]),o.a.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),i>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)}n(1359);function At(t){return(At="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})(t)}function Pt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==At(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var Ft=n(1310),Rt=n(1532),Mt=n(1539),Ut={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.a.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 Dt(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Gt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gt(t,e)}(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 Gt(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 qt(t){var e=Dt(o.a.useState(""),2),n=e[0],r=e[1],a=Dt(o.a.useState(""),2),i=a[0],c=a[1];return o.a.createElement("div",{"aria-haspopup":"true","aria-expanded":t.expanded,"aria-label":"rdw-color-picker"},o.a.createElement("div",{className:"rdw-option-wrapper cv-annotation-toolbar-option cv-annotation-link",onClick:t.onExpandEvent}," "),t.expanded&&o.a.createElement("div",{className:"rdw-link-modal",onClick:function(t){return t.stopPropagation()}},o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-url"},"URL"),o.a.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.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-text"},"Text"),o.a.createElement("input",{id:"cv-annotation-text",className:"form-control",onChange:function(t){return c(t.target.value)},value:i,placeholder:"Enter Text",autoComplete:"off"})),o.a.createElement(rt.a,{onClick:function(){return t.onChange("link",i||n,n,"_blank")},className:"btn btn-dark"},"Add")))}n(1364);function Bt(t){return(Bt="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})(t)}function Wt(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return zt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(t,e)}(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 zt(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 Yt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Yt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Bt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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,Ht,Vt,Kt=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};function Zt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jt=(Zt($t={},tt.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,a=t.interaction,i=t.optionsPortalNode,c=Wt(o.a.useState(function(){var t=a.data.annotation;if(t){var e=Object(Mt.a)(Ut)(t);return Ft.EditorState.createWithContent(e)}return Ft.EditorState.createEmpty()}()),2),u=c[0],l=c[1],s=Wt(o.a.useState(null),2),f=s[0],d=s[1];return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",onClick:function(){return null==f?void 0:f.focusEditor()}},"Annotation"),o.a.createElement(et.b,{node:i})),o.a.createElement("div",{className:"cv-annotation ".concat(function(){if(!u)return!1;var t=u.getCurrentContent();return t.hasText()||"unstyled"!==t.getBlockMap().first().getType()}()?"Editor--hide-placeholder":"")},u&&o.a.createElement(Rt.Editor,{editorState:u,onEditorStateChange:function(t){l(t);var e=t.getCurrentContent();if(e.hasText()){var o=Object(Mt.b)(Ut)(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:qt,options:["link"]}}}),o.a.createElement(nt,{error:n.error}))))})),Zt($t,tt.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,a=t.interaction,i=t.optionsPortalNode;Object(Ct.a)();var c=o.a.useRef(null);function u(t){t&&t[0]&&kt.a.onFileSelect(Ot.c.None,t,(function(t){X.a.renderCropper({src:t.src,alt:"",onClickCrop:l})}))}function l(e){var o=e.split(",")[1];G.a.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.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0"},"Image"),o.a.createElement(et.b,{node:i})),n.url?o.a.createElement("div",{className:"text-center"},o.a.createElement("div",{className:"cv-uploaded-image-container"},o.a.createElement("img",{className:"img img-fluid",src:n.url,alt:n.caption}),o.a.createElement(rt.a,{className:"cv-remove-uploaded-image d-flex justify-content-center align-items-center",onClick:function(){r(Object.assign(Object.assign({},n),{url:""}))}},o.a.createElement("div",{className:"btn btn-link text-light"},"Remove")))):o.a.createElement(Tt,{onDropImage:u},o.a.createElement("div",{className:"cv-image-interaction-upload-container rounded py-4 text-center"},o.a.createElement("div",{className:"svg-container xlg mb-2"},o.a.createElement(Nt,null)),o.a.createElement("p",{className:"mb-0"},"Drag and drop an image file or"),o.a.createElement(rt.a,{type:"button",className:"text-underline d-inline-block",onClick:function(){c.current.value=null,c.current.click(null)}},"upload from your device"),o.a.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 u(t.target.files)}}))),o.a.createElement(nt,{error:n.error})),o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"image-caption"},"Caption ",o.a.createElement("span",{className:"text-muted"},"(optional)")),o.a.createElement("textarea",{id:"image-caption",className:"form-control",placeholder:"Caption your image",value:n.caption||a.data.caption||"",onChange:function(t){r(Object.assign(Object.assign({},n),{caption:t.target.value}))},rows:2})))})),Zt($t,tt.InteractionTypeId.MissingWord,(function(t){var e,n,r,a,i,c,u=t.state,l=void 0===u?(e=t.interaction,a=(null===(n=e.data)||void 0===n?void 0:n.sentence)||"",i=a.split(" ").filter(Boolean),c=i.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=lt(i[e],t.name);i[e]=n,c[e].text=n,c[e].selected=!0})),{fullSentence:i.join(" "),sentence:a,preview:e.name,words:c}):u,s=t.setState,f=t.optionsPortalNode,d=!!l.sentence;return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"missing-word-sentence"},"Sentence"),o.a.createElement(et.b,{node:f})),o.a.createElement("input",{id:"missing-word-sentence",className:"form-control",placeholder:"Enter your sentence here",value:l.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({},l),{fullSentence:e,sentence:ft(n),preview:st(n),words:n}))},autoComplete:"off"})),d&&o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label"},"Select the missing word(s)"),o.a.createElement("ul",{className:"list-unstyled d-flex flex-wrap mx-n1 mb-n1"},l.words.map((function(t,e){var n;return(null===(n=ut(t.text))||void 0===n?void 0:n.trim())?o.a.createElement("li",{key:"".concat(e,"-").concat(t.text)},o.a.createElement(rt.a,{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=l.words.map((function(e){return e.order!==t?e:Object.assign(Object.assign({},e),{selected:!e.selected})})),void s(Object.assign(Object.assign({},l),{words:n,preview:st(n),sentence:ft(n)}));var t,n}},ut(t.text))):o.a.createElement(o.a.Fragment,{key:"".concat(e,"-").concat(t.text)})})))),o.a.createElement("div",null,o.a.createElement("label",{className:"cv-interaction-field-label"},"Preview"),o.a.createElement("p",null,l.preview))),o.a.createElement(nt,{error:l.error}))})),Zt($t,tt.InteractionTypeId.MultipleChoice,St),Zt($t,tt.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,a=t.interaction,i=t.optionsPortalNode,c=t.showFeedback;return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"short-answer-question"},"Question"),o.a.createElement(et.b,{node:i})),o.a.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||a.data.text||"",placeholder:"Enter your question here",autoComplete:"off"}),o.a.createElement(nt,{error:n.error})),c&&o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"short-answer-suggested-response"},"Suggested Response ",o.a.createElement("span",{className:"text-muted"},"(optional)")," ",o.a.createElement(pt.a,{tooltipText:"Provide a suggested response for your students"})),o.a.createElement(dt.a,{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"})))})),Zt($t,tt.InteractionTypeId.TrueOrFalse,St),$t);var Qt=(Zt(Ht={},tt.InteractionTypeId.Annotation,(function(t){var e;return(null===(e=t.annotation)||void 0===e?void 0:e.trim())?null:"Please provide an annotation"})),Zt(Ht,tt.InteractionTypeId.Image,(function(t){return t.url?null:"Please upload an image"})),Zt(Ht,tt.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"})),Zt(Ht,tt.InteractionTypeId.MultipleChoice,xt),Zt(Ht,tt.InteractionTypeId.ShortAnswer,(function(t){var e;return(null===(e=t.question)||void 0===e?void 0:e.trim())?null:"Please provide a question"})),Zt(Ht,tt.InteractionTypeId.TrueOrFalse,xt),Ht);var Xt=(Zt(Vt={},tt.InteractionTypeId.Annotation,(function(t,e){var n;return Kt(this,void 0,void 0,Yt().mark((function r(){return Yt().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,Q.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})))})),Zt(Vt,tt.InteractionTypeId.Image,(function(t,e){var n,r;return _t(this,void 0,void 0,Pt().mark((function o(){return Pt().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,Q.saveInteraction(e);case 6:case"end":return o.stop()}}),o)})))})),Zt(Vt,tt.InteractionTypeId.MissingWord,(function(t,e){return it(this,void 0,void 0,at().mark((function n(){var r;return at().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.data.sentence=ft(t.words),e.name=t.preview,r=t.words.filter((function(t){return t.selected})),e.actionableItems=r.map((function(t){return{name:ut(t.text),order:t.order,isCorrect:!0}})),n.next=6,Q.saveInteraction(e);case 6:case"end":return n.stop()}}),n)})))})),Zt(Vt,tt.InteractionTypeId.MultipleChoice,It),Zt(Vt,tt.InteractionTypeId.ShortAnswer,(function(t,e){var n,r;return vt(this,void 0,void 0,ht().mark((function o(){return ht().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,Q.saveInteraction(e);case 5:case"end":return o.stop()}}),o)})))})),Zt(Vt,tt.InteractionTypeId.TrueOrFalse,It),Vt);function te(t){return Xt[t]}var ee=n(1195),ne=n(1),re=["A","B","C","D"];function oe(t){if(!t.enableImmersiveReader)return o.a.createElement(o.a.Fragment,null);var e=t.interaction,n=t.className,r=s.a.getTypeInfo(e.typeId),a=r.name,i=r.typeName,c="";switch(e.typeId){case tt.InteractionTypeId.Annotation:c=e.data.annotation;break;case tt.InteractionTypeId.Image:c=e.data.caption;break;case tt.InteractionTypeId.MissingWord:c=e.data.sentence.replace(/{([^{}]*)}/g,(function(){return"<u> </u>"}));break;case tt.InteractionTypeId.MultipleChoice:c=e.name,e.actionableItems.map((function(t,e){return c+="<br />".concat(re[e],": ").concat(t.name)}));break;case tt.InteractionTypeId.ShortAnswer:c=e.name;break;case tt.InteractionTypeId.TrueOrFalse:c="True or false: ".concat(e.name)}var u=e.typeId===tt.InteractionTypeId.Annotation||e.typeId===tt.InteractionTypeId.MissingWord||e.typeId===tt.InteractionTypeId.MultipleChoice;return o.a.createElement(ee.a,{title:a,text:c,html:u,className:"pr-2 ".concat(n||""),analyticsData:{id:e.interactiveId,type:i},analyticsOptions:{location:ne.LocationContext.InteractivePlayer,entity:ne.EntityType.Interactive,actionType:ne.UserAction.Click,descriptor:ne.ClickDescriptor.LaunchImmersiveReader}})}n(1365);function ae(t){var e=t.error;return t.error?o.a.createElement("p",{className:"mt-2 small text-danger"},e):o.a.createElement(o.a.Fragment,null)}var ie,ce,ue=n(1143);function le(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function se(){return ue.a.NotApplicable}function fe(t,e){var n=t.actionableItems.filter((function(t){return t.isCorrect}));return n.every((function(t){return!e(t.id)}))?ue.a.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())}))?ue.a.Correct:ue.a.Incorrect}function de(t,e){return t.actionableItems.every((function(t){return!e(t.id)}))?ue.a.UnAnswered:t.actionableItems.filter((function(t){return t.isCorrect})).every((function(t){return e(t.id)===t.name}))?ue.a.Correct:ue.a.Incorrect}function pe(t,e){var n;return t.actionableItems.forEach((function(t){var r=e(t.id);n=r?r.status!==ie.Correct?r.status!==ie.Incorrect?ue.a.AwaitingMarking:ue.a.Incorrect:ue.a.Correct:ue.a.UnAnswered})),n}function me(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 he(t,e){var n=me(t,e);return de(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"}(ie||(ie={}));var ve=(le(ce={},tt.InteractionTypeId.Annotation,se),le(ce,tt.InteractionTypeId.Image,se),le(ce,tt.InteractionTypeId.MissingWord,(function(t,e){var n=me(t,e);return fe(t,(function(t){var e=n(t);return null==e?void 0:e.text}))})),le(ce,tt.InteractionTypeId.MultipleChoice,he),le(ce,tt.InteractionTypeId.ShortAnswer,(function(t,e){return pe(t,me(t,e))})),le(ce,tt.InteractionTypeId.TrueOrFalse,he),ce);var ye={notApplicable:se,awaitingMarking:function(){return ue.a.AwaitingMarking},isMissingWordCorrect:fe,isMultipleChoiceCorrect:de,isShortAnswerMarkedCorrect:pe,isInteractionCorrect:function(t,e){return(0,ve[t.typeId])(t,e)}};n(1366);function ge(t){return(ge="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})(t)}var 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};var we=n(276),Ee=n(63),xe=n(20),Ie=n(388),Se=n(1367),ke=n.n(Se),Oe=["A","B","C","D"];function Ce(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.a.createElement(o.a.Fragment,null,t.interaction.actionableItems.map((function(r,a){var i=t.getSelectedAnswer(r.id);if(t.onlyShowSelectedAnswer&&!i)return o.a.createElement(o.a.Fragment,{key:a});var c=i?"bg-info text-white":t.unCheckedBackground,u=function(){return o.a.createElement(o.a.Fragment,null,Oe[a])};t.showFeedback&&(c=r.isCorrect?"bg-success text-white":"bg-danger text-white ".concat(ke.a.incorrect),t.hideFeedbackIcons||(u=function(){return o.a.createElement(o.a.Fragment,null,r.isCorrect?o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Check}):o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Close}))}));var l=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&n(r,!i)}};return o.a.createElement(o.a.Fragment,{key:a},o.a.createElement("input",{id:r.id,type:e?"radio":"checkbox",name:"multiple-choice",checked:!!i,onChange:function(){return n(r,!i)},disabled:t.showFeedback,hidden:!0,tabIndex:-1}),o.a.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(ke.a.answer,"\n ").concat(c),key:a,htmlFor:r.id},l),o.a.createElement("span",{className:"d-inline-block mr-3 cv-multiple-choice-bullet"},o.a.createElement(u,null)),o.a.createElement("span",{className:"flex-grow-1 pr-4"},r.name),!t.onlyShowSelectedAnswer&&o.a.createElement("span",{className:ke.a.avatarContainer},i&&o.a.createElement(Ie.a,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar}))))})))}Ce.defaultProps={size:"lg",unCheckedBackground:"bg-white"};n(1368);function Ne(t){return(Ne="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})(t)}function je(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Le=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};var Te=n(1369),Ae=n.n(Te);function Pe(t){function e(e){t.onSelectAnswer&&t.onSelectAnswer(e)}return o.a.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 a=t.getSelectedAnswer(n.id),i=a?"bg-info text-white":t.unCheckedBackground,c=function(){return o.a.createElement(o.a.Fragment,null)};t.showFeedback&&(i=n.isCorrect?"bg-success text-white":"bg-danger text-white ".concat(Ae.a.incorrect),t.hideFeedbackIcons||(c=function(){return o.a.createElement(o.a.Fragment,null,n.isCorrect?o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Check}):o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Close}))}));var u=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&e(n)}};return o.a.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(i)},u),o.a.createElement("input",{id:n.id,type:"radio",name:"multiple-choice",checked:!!a,onChange:function(){return e(n)},disabled:t.showFeedback,hidden:!0}),n.name,o.a.createElement("span",{className:"position-absolute p-2 ".concat(Ae.a.feedback)},o.a.createElement(c,null)),o.a.createElement("span",{className:"".concat(Ae.a.avatarContainer).concat("sm"===t.size?" ".concat(Ae.a.avatarContainerSmall):"")},a&&o.a.createElement(Ie.a,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar})))})))}Pe.defaultProps={size:"lg",unCheckedBackground:"bg-white"};var _e,Fe,Re,Me,Ue;function De(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ge=function(){return!0},qe=function(){return!1},Be=(De(_e={},tt.InteractionTypeId.Annotation,qe),De(_e,tt.InteractionTypeId.Image,qe),De(_e,tt.InteractionTypeId.MissingWord,Ge),De(_e,tt.InteractionTypeId.MultipleChoice,Ge),De(_e,tt.InteractionTypeId.ShortAnswer,(function(t){return!!t.data.suggestedResponse})),De(_e,tt.InteractionTypeId.TrueOrFalse,Ge),_e);function We(t){return Be[t]}var ze=(De(Fe={},tt.InteractionTypeId.Annotation,(function(t){var e=t.interaction.data.annotation.replace(/<(a)(.*?)>/g,'<$1 target="_blank" $2>');return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:e}}),o.a.createElement(oe,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),De(Fe,tt.InteractionTypeId.Image,(function(t){var e=t.interaction,n=t.recalculateScroll,r=o.a.useCallback((function(t){t&&(t.onload=function(){n()})}),[]);return o.a.createElement("div",{className:"cv-interactive-question cv-image-interactive"},o.a.createElement("div",{className:"cv-image-container text-center"},o.a.createElement("img",{className:"img-fluid shadow-lg",src:e.data.url,ref:r}),e.data.caption&&o.a.createElement(o.a.Fragment,null,o.a.createElement("p",{className:"mt-3"},e.data.caption,o.a.createElement(oe,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})))))})),De(Fe,tt.InteractionTypeId.MissingWord,(function(t){var e=t.state,n=t.setState,r=t.interaction,a=t.showFeedback,i=r.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat("cv-missing-word-").concat(e,"}")})).split(/{([^{}]*)}/g);function c(t,r){if(r.stopPropagation(),r.target.value){var o,a,i;n((o={},a=t.id,i=r.target.value,a in o?Object.defineProperty(o,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[a]=i,o))}else{var c=e,u=t.id,l=(c[u],be(c,["symbol"===ge(u)?u:u+""]));n(l,!0)}}return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"mb-2"},i.map((function(t,n){var i;if(!t.startsWith("cv-missing-word-"))return t;var u=t.replace("cv-missing-word-",""),l=r.actionableItems.find((function(t){return t.order.toString()===u}));if(l){var s,f,d=e[l.id]||"",p=(s=l.name,(f=document.createElement("canvas").getContext("2d")).font="17pt arial",f.measureText(s).width);if(a){var m=l.name.toLowerCase().toString()===(null===(i=e[l.id])||void 0===i?void 0:i.toLowerCase().toString());return o.a.createElement(o.a.Fragment,{key:n},!m&&o.a.createElement(o.a.Fragment,null,o.a.createElement("del",{className:"text-danger"},d)," "),o.a.createElement("span",{className:"text-success"},l.name))}return o.a.createElement("span",{className:"cv-missing-word-input-container",key:n},o.a.createElement("input",{style:{width:p/16+"rem"},onChange:function(t){return c(l,t)},value:d,disabled:!!e.submitted,className:"cv-missing-word-input",autoComplete:"off"}))}}))),o.a.createElement(ae,{error:e.error}),o.a.createElement(oe,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),De(Fe,tt.InteractionTypeId.MultipleChoice,(function(t){var e=t.state,n=t.setState,r=t.interaction,a=t.showFeedback,i=t.imageApi,c=t.currentUser,u=1===r.actionableItems.filter((function(t){return t.isCorrect})).length;return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,r.name,o.a.createElement(oe,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),!u&&o.a.createElement("p",{className:"text-muted"},o.a.createElement("small",null,"This question has multiple correct answers")),o.a.createElement(Ce,{interaction:r,showFeedback:a,onSelectAnswer:function(t,r){if(!e.submitted)if(u)n(je({},t.id,t.name),!0);else if(r)n(je({},t.id,t.name));else{var o=e,a=t.id,i=(o[a],Le(o,["symbol"===Ne(a)?a:a+""]));n(i,!0)}},getSelectedAnswer:function(t){return e[t]},imageApi:i.toString(),userInitials:we.a.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),o.a.createElement(ae,{error:e.error}))})),De(Fe,tt.InteractionTypeId.ShortAnswer,(function(t){var e=t.interaction,n=t.state,r=t.setState;return t.showFeedback?o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,e.name),o.a.createElement("label",{className:"cv-interaction-field-label"},"My answer"),o.a.createElement("p",null,n[e.actionableItems[0].id]),e.data.suggestedResponse&&o.a.createElement(o.a.Fragment,null,o.a.createElement("label",{className:"cv-interaction-field-label mt-1"},"Teacher's suggested answer"),o.a.createElement("p",null,e.data.suggestedResponse))):o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,e.name,o.a.createElement(oe,{interaction:e,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o.a.createElement(dt.a,{id:"short-answer-answer",className:"form-control mt-2",minRows:3,value:n[e.actionableItems[0].id]||"",onChange:function(t){var o,a,i;r(Object.assign(Object.assign({},n),(o={},a=e.actionableItems[0].id,i=t.target.value,a in o?Object.defineProperty(o,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[a]=i,o)))},disabled:!!n.submitted}),o.a.createElement(ae,{error:n.error}))})),De(Fe,tt.InteractionTypeId.TrueOrFalse,(function(t){var e=t.state,n=t.setState,r=t.interaction,a=t.showFeedback,i=t.imageApi,c=t.currentUser,u=r.actionableItems.find((function(t){return t.isCorrect}));return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,r.name,o.a.createElement(oe,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o.a.createElement(Pe,{className:"justify-content-center",interaction:r,showFeedback:a,onSelectAnswer:function(t){var r,o,a;e.submitted||n((r={},o=t.id,a=t.name,o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a,r),!0)},getSelectedAnswer:function(t){return e[t]},imageApi:i.toString(),userInitials:we.a.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),a&&o.a.createElement("div",{className:"text-center px-5 mt-3"},o.a.createElement("p",null,"The answer is ",o.a.createElement("strong",null,u.name)),r.data.feedback&&o.a.createElement("p",null,r.data.feedback)),o.a.createElement(ae,{error:e.error}))})),Fe);function Ye(){return""}var $e=(De(Re={},tt.InteractionTypeId.Annotation,Ye),De(Re,tt.InteractionTypeId.Image,Ye),De(Re,tt.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"})),De(Re,tt.InteractionTypeId.MultipleChoice,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),De(Re,tt.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"})),De(Re,tt.InteractionTypeId.TrueOrFalse,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),Re);var He=(De(Me={},tt.InteractionTypeId.Annotation,null),De(Me,tt.InteractionTypeId.Image,null),De(Me,tt.InteractionTypeId.MissingWord,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),De(Me,tt.InteractionTypeId.MultipleChoice,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),De(Me,tt.InteractionTypeId.ShortAnswer,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),De(Me,tt.InteractionTypeId.TrueOrFalse,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),Me);function Ve(t){return He[t]}var Ke=(De(Ue={},tt.InteractionTypeId.Annotation,ye.notApplicable),De(Ue,tt.InteractionTypeId.Image,ye.notApplicable),De(Ue,tt.InteractionTypeId.MissingWord,(function(t,e){return ye.isMissingWordCorrect(e,(function(e){return t[e]}))})),De(Ue,tt.InteractionTypeId.MultipleChoice,(function(t,e){return ye.isMultipleChoiceCorrect(e,(function(e){return t[e]}))})),De(Ue,tt.InteractionTypeId.ShortAnswer,ye.awaitingMarking),De(Ue,tt.InteractionTypeId.TrueOrFalse,(function(t,e){return e.actionableItems.filter((function(t){return t.isCorrect})).every((function(e){return t[e.id]===e.name}))?ue.a.Correct:ue.a.Incorrect})),Ue);function Ze(t){return Ke[t]}function Je(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qe={interactions:{},timepoints:{}};function Xe(t,e){return"interaction"===e.type?{timepoints:t.timepoints,interactions:Object.assign(Object.assign({},t.interactions),Je({},e.id,e.value))}:"timepoint"===e.type?{interactions:t.interactions,timepoints:Object.assign(Object.assign({},t.timepoints),Je({},e.id,e.value))}:void 0}function tn(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return en(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return en(t,e)}(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 en(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 nn={interactionIndex:0},rn=function(t){var e=t.mode,n=t.timepoint,r=t.latestSession,a=e===l.InteractiveMode.Create,i=tn(o.a.useReducer(Xe,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]),(Je(n={},e.actionableItemId,e.data),Je(n,"submitted",!0),n)),t}),{})}:Qe}(r)})),2),c=i[0],u=i[1],s=h(null==n?void 0:n.id),f=null==n?void 0:n.interactions[s.interactionIndex],d="number"==typeof s.nextInteractionIndex?null==n?void 0:n.interactions[s.nextInteractionIndex]:null,p=v(null==f?void 0:f.id),m=v(null==d?void 0:d.id);function h(t){return t&&c.timepoints[t]||nn}function v(t){if(!t)return{};var e=c.interactions[t];return e||a?e:{}}function y(t,e,n){var r=v(t);u({type:"interaction",id:t,value:Object.assign(Object.assign({},n?{}:r),e)})}return{state:c,interaction:f,interactionState:p,timepointState:s,nextInteraction:d,nextInteractionState:m,getTimepointState:h,getInteractionState:v,updateTimepointState:function(t,e){var n=h(t);u({type:"timepoint",id:t,value:Object.assign(Object.assign({},n),e)})},updateInteractionState:y,clearTimepointState:function(t){u({type:"timepoint",id:t,value:void 0})},clearInteractionState:function(t){u({type:"interaction",id:t,value:void 0})},userUpdateInteractionState:function(t,e){y(f.id,Object.assign(Object.assign({},t),{hasChanges:!0,error:null}),e)}}};function on(t){return(on="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})(t)}function an(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */an=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==on(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 cn=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},un=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},ln=!1,sn=function(t){var e=t.interactive,n=t.timepoint,r=t.player,a=t.mode,i=t.resultsService,c=t.latestSession,u=t.analyticsService,f=un(t,["interactive","timepoint","player","mode","resultsService","latestSession","analyticsService"]),d=rn({mode:a,timepoint:n,latestSession:c}),p=d.state,m=d.interaction,h=d.interactionState,v=d.timepointState,y=d.nextInteraction,g=d.nextInteractionState,b=un(d,["state","interaction","interactionState","timepointState","nextInteraction","nextInteractionState"]),w=a===l.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 a=r.interactions[o];if(a.id===t)return{localTimepoint:r,localInteraction:a};o++}n++}return{localInteraction:null,localTimepoint:null}}function x(t){var n=s.a.getTypeInfo(t.typeId);return{id:U(t.id)?void 0:t.id,typeId:t.typeId,type:n.typeName,interactiveId:e.id,timepointId:U(t.timepointId)?void 0:t.timepointId,order:t.order}}function I(t){return cn(this,void 0,void 0,an().mark((function n(){var r,o,a,i,c,l,s;return an().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=E(t),o=r.localInteraction,a=r.localTimepoint,o&&a){n.next=3;break}throw new Error("Could not find the interaction and timepoint for the interactionId ".concat(t));case 3:if(i=x(o),U(o.id)){n.next=10;break}return n.next=7,Q.deleteInteraction(o.id);case 7:u.logUserAction(i,{actionType:ne.UserAction.Delete,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Complete}),n.next=11;break;case 10:u.logUserAction(i,{actionType:ne.UserAction.Create,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Discard});case 11:if(c=a.interactions.findIndex((function(t){return t.id===o.id})),a.interactions.splice(c,1),b.clearInteractionState(o.id),l=b.getTimepointState(a.id),c<l.interactionIndex&&b.updateTimepointState(a.id,{interactionIndex:l.interactionIndex-1}),!(a.interactions.length>0)){n.next=18;break}return n.abrupt("return");case 18:if(U(a.id)){n.next=21;break}return n.next=21,Q.deleteTimepoint(a.id);case 21:s=e.timepoints.findIndex((function(t){return t.id===a.id})),e.timepoints.splice(s,1),f.removeCue(a.visibleAt/1e3),b.clearTimepointState(a.id);case 25:case"end":return n.stop()}}),n)})))}function S(t){if(m){var e=U(m.id);if(e||(null==h?void 0:h.hasChanges)||(null==v?void 0:v.hasChanges)){X.a.render(o.a.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"}]})}else 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}),ln=!1)}return{state:p,interaction:m,interactionState:h,timepointState:v,nextInteraction:y,nextInteractionState:g,skip:O,cancel:function(){return cn(this,void 0,void 0,an().mark((function t(){return an().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),a=o.interactions.find((function(t){return t.id.toString()===n.toString()}));r.currentTime(o.visibleAt/1e3),b.updateTimepointState(o.id,{interactionIndex:o.interactions.indexOf(a)})},discardChanges:S,changeIndex:k,promptDelete:function(t){var e=x(E(t).localInteraction);u.logUserAction(e,{actionType:ne.UserAction.Delete,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Start}),X.a.render(o.a.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 cn(this,void 0,void 0,an().mark((function t(){var e,r,o,a,i,c;return an().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(l=m.typeId,!(e=(0,Qt[l])(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}),!U(n.id)){t.next=15;break}return r=n.id,t.next=12,Q.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,a=te(m.typeId),t.next=20,a(b.getInteractionState(m.id),m);case 20:b.clearInteractionState(o),i=U(o),c=x(m),u.logUserAction(c,{actionType:i?ne.UserAction.Create:ne.UserAction.Edit,entity:ne.EntityType.Interaction,workflowPhase:i?ne.WorkflowPhase.Complete:ne.WorkflowPhase.Save});case 24:case"end":return t.stop()}var l}),t)})))},addInteraction:function(t){var o;r.pause();var a=(null==n?void 0:n.id)||"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),i={id:"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),timepointId:a,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(i);if(u.logUserAction(c,{actionType:ne.UserAction.Create,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Start}),n)return n.interactions.push(i),void k(v.interactionIndex);var l=r.currentTime();e.timepoints||(e.timepoints=[]),e.timepoints.push({id:a,visibleAt:1e3*l,interactiveId:e.id,shouldPause:1,interactions:[i]}),C(),f.addCue(a)},submitInteractionAnswer:function(){return cn(this,void 0,void 0,an().mark((function t(){var r,o,c,s,d;return an().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a===l.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=D(h),p=m.typeId,!(o=(0,$e[p])(r,m))){t.next=14;break}return b.updateInteractionState(m.id,{error:o}),t.abrupt("return");case 14:if(!i||!h.hasChanges){t.next=22;break}if(c=Ve(m.typeId),b.updateInteractionState(m.id,{spinner:!0}),!c){t.next=22;break}return t.next=20,c(r,m,i.save);case 20:s=x(m),u.logUserAction(s,{actionType:ne.UserAction.Answer,entity:ne.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:d=We(m.typeId),d(m)||O();case 29:case"end":return t.stop()}var p}),t)})))},userUpdateInteractionState:b.userUpdateInteractionState,updateTimepointTime:function(t){var o=r.duration(),a=function(t){for(var r=n.visibleAt+1e3*t,o=t>0,a=0;a<e.timepoints.length;a++){var i=e.timepoints[a];r<i.visibleAt-1e3||r>i.visibleAt+1e3||(r=o?i.visibleAt+1001:i.visibleAt-1001,a=0)}return r}(t);if(!(a/1e3>o||a<0)){var i=n.visibleAt;ln||(ln=!0,b.updateTimepointState(n.id,{originalVisibleAt:i,hasChanges:!0})),f.moveTimepoint(a)}},saveTimepoint:function(){return cn(this,void 0,void 0,an().mark((function t(){return an().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!U(n.id)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,Q.updateTimepoint(n);case 4:C(),j();case 6:case"end":return t.stop()}}),t)})))},clearTimepointTimeState:j,reOrderQuestions:function(t){return cn(this,void 0,void 0,an().mark((function e(){var r,o;return an().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,Q.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)})))}}},fn=n(1370),dn=n.n(fn);function pn(t){var e="".concat(t.className," ").concat(dn.a.iconButton);t.children?e+=" ".concat(dn.a.iconWithText):e+=" ".concat(dn.a.iconOnly);var n=o.a.createElement(Ee.a,{svgName:t.svgName,className:dn.a.svg});return o.a.createElement(rt.a,{className:e,onClick:t.onClick},n,t.children)}function mn(t){var e=t.isCreate,n=t.open,r=t.showTypeSelector;return!e||n?o.a.createElement(o.a.Fragment,null):o.a.createElement(pn,{className:"btn btn-outline-dark cv-add-question",onClick:r,svgName:xe.b.Plus},"Add question")}var hn=n(1288),vn=n(409),yn=n(1214);function gn(t){return o.a.createElement("div",{className:"my-5 text-center"},o.a.createElement("h2",{className:"h3"},"Select an interaction to get started"),o.a.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.a.createElement("a",{href:vn.a.getArticle(t.supportSiteUrl.toString(),yn.a.MakeInteractive,t.currentUser.countryCode,"articles"),target:"_blank",className:"btn btn-link text-info"},"How do I make interactives?"))}function bn(t){var e=t.isCreate,n=t.interactive,r=t.interaction,a=t.portalNode,i=t.goToTimepoint,c=t.promptDelete,u=t.supportSiteUrl,l=t.currentUser;if(!a)return o.a.createElement(o.a.Fragment,null);var s=n.timepoints.reduce((function(t,e){return t+e.interactions.length}),0);return o.a.createElement(et.a,{node:a},s?o.a.createElement(o.a.Fragment,null,o.a.createElement("h2",{className:"h4 mt-3"},"Question List (",s,")"),o.a.createElement(hn.a,{interactive:n,maxHeight:300,goToTimepoint:i,selectedInteractionId:null==r?void 0:r.id,onClickDelete:e?c:void 0})):e?o.a.createElement(gn,{currentUser:l,supportSiteUrl:u}):o.a.createElement(o.a.Fragment,null))}var wn=n(1554);function En(t,e){if(e===l.InteractiveMode.Create)return function(t){return Jt[t]}(t);if(e===l.InteractiveMode.View)return function(t){return ze[t]}(t);throw new Error("Cannot find components for the mode ".concat(e))}var xn=n(289);n(1371);function In(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Sn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sn(t,e)}(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 Sn(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 kn=[tt.InteractionTypeId.MissingWord,tt.InteractionTypeId.MultipleChoice,tt.InteractionTypeId.TrueOrFalse,tt.InteractionTypeId.ShortAnswer,tt.InteractionTypeId.Image,tt.InteractionTypeId.Annotation];function On(t){var e=t.addInteraction,n=t.cancelTypeSelector,r=t.player,a=t.timepoint,i=t.open,c=t.isCreate,u=t.interaction,l=In(o.a.useState(Object(xn.a)(r.currentTime()||0)),2),f=l[0],d=l[1];return o.a.useEffect((function(){var t=function(){d(Object(xn.a)(r.currentTime()))};return r.on("timeupdate",t),function(){return r.off("timeupdate",t)}}),[]),u||!c?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"d-flex align-items-center justify-content-center h-100"},o.a.createElement("div",{className:"cv-interactive-type-selector d-flex flex-wrap justify-content-center align-items-center"},o.a.createElement("div",{className:"text-center font-weight-bold w-100 text-body mb-3 cv-add-question-copy"},a?"Add another question at:":"Add a question at:"," ",f),kn.map((function(t,n){var r=s.a.getTypeInfo(t),a=r.name,i=r.bgClassName,c=r.Svg;return o.a.createElement(rt.a,{key:n,className:"cv-type-selector rounded py-2 m-1 ".concat(i),onClick:function(){return e(t)}},o.a.createElement("span",{className:"cv-create-type-icon mb-1"},o.a.createElement(c,null)),o.a.createElement("div",{className:"d-flex align-items-center justify-content-center cv-interaction-type-name px-1"},a))})),(a||i)&&o.a.createElement("div",{className:"text-center w-100 mt-2 ".concat(a?"":"cv-adding-first-cancel")},o.a.createElement(rt.a,{className:"btn btn-link",onClick:n},"Cancel"))))}function Cn(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nn(t,e)}(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 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 jn(t){var e=t.typeId,n=t.currentIndex,r=t.numberOfInteractions,a=t.changeIndex,i=t.player,c=Cn(o.a.useState(Object(xn.a)(i.currentTime()||0)),2),u=c[0],l=c[1];o.a.useEffect((function(){var t=function(){l(Object(xn.a)(i.currentTime()))};return i.on("timeupdate",t),function(){return i.off("timeupdate",t)}}),[]);var f=s.a.getTypeInfo(e),d=f.name,p=f.bgClassName,m=n<r-1;var h=n>0;return o.a.createElement("div",{className:"text-center d-flex justify-content-between align-items-center p-1 ".concat(p)},o.a.createElement(rt.a,{onClick:function(){h&&a(n-1)},className:h?"":"invisible"},o.a.createElement(Ee.a,{size:Ee.b.Medium,svgName:xe.b.ChevronLeft})),o.a.createElement("div",null,o.a.createElement("div",{className:"h6 mb-0"},d),r>1&&o.a.createElement("div",null,n+1," of ",r," at ",u)),o.a.createElement(rt.a,{onClick:function(){m&&a(n+1)},className:m?"":"invisible"},o.a.createElement(Ee.a,{size:Ee.b.Medium,svgName:xe.b.ChevronRight})))}n(1372);function Ln(t){var e=t.typeId,n=s.a.getTypeInfo(e),r=n.name,a=n.prompt,i=n.bgClassName,c=n.Svg;return o.a.createElement("div",{className:"text-center text-body d-flex justify-content-between align-items-center px-3 pt-3"},o.a.createElement("div",{className:"d-flex align-items-center"},o.a.createElement("span",{className:"cv-interaction-icon rounded my-1 text-white ".concat(i)},o.a.createElement(c,null)),o.a.createElement("span",{className:"text-left flex-grow-1"},o.a.createElement("div",{className:"h5 ".concat(a?"":"mb-0")},o.a.createElement("strong",null,r)),a&&o.a.createElement("div",{className:"h6 mb-0"},a))))}function Tn(t){var e=t.isCreate,n=t.interaction,r=t.player,a=t.changeIndex,i=t.timepointState,c=t.timepoint;return e?o.a.createElement(jn,{typeId:n.typeId,changeIndex:a,player:r,currentIndex:i.interactionIndex,numberOfInteractions:c.interactions.length}):o.a.createElement(Ln,{typeId:n.typeId})}var An=n(33);function Pn(t){var e=t.interaction,n=t.interactionState,o=t.onClickContinue,a=t.onClickSave,i=t.onClickCancel,c=t.onClickAddAnother,u=t.onClickDiscard,l=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"},l?r.createElement(rt.a,{className:"btn btn-link",onClick:i},"Cancel"):s?r.createElement(rt.a,{className:"btn btn-link",onClick:u},"Discard"):r.createElement(rt.a,{className:"btn btn-link",onClick:c},"Add another question"),f?r.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):l?s?r.createElement(rt.a,{className:"btn btn-dark ml-2",onClick:a},"Save"):r.createElement(rt.a,{className:"btn btn-dark ml-2 disabled",onClick:function(){}},"Save"):s?r.createElement(rt.a,{className:"btn btn-dark ml-2",onClick:a},"Save"):r.createElement(pn,{className:"btn btn-dark ml-2",onClick:o,svgName:xe.b.Play},"Continue"))}function _n(t){var e=t.typeId,n=t.interactionState,o=t.onClickSkip,a=t.numberOfInteractions,i=t.currentIndex,c=t.changeIndex,u=!!(null==n?void 0:n.submitted),l=!!(null==n?void 0:n.hasChanges),s=!!(null==n?void 0:n.spinner),f=!!Ve(e),d=i<a-1;function p(){d&&c(i+1)}var m=i>0;function h(){l&&t.onClickSubmit()}return r.createElement("div",{className:"cv-timpoint-button-container flex-wrap"},!u&&f&&r.createElement(rt.a,{className:"btn btn-link",onClick:o},"Come back later"),a>1&&i>0&&r.createElement(pn,{className:"btn btn-dark ml-2 ".concat(m?"":"disabled"),onClick:function(){m&&c(i-1)},svgName:xe.b.ChevronUp}),s?r.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):u||!f?1===a||i===a-1?r.createElement(pn,{className:"btn btn-dark ml-2",onClick:o,svgName:xe.b.Play},"Continue"):r.createElement(rt.a,{className:"btn btn-dark ml-2 ".concat(d?"":"disabled"),onClick:p},"Next"):r.createElement(rt.a,{className:"btn btn-dark ml-2 ".concat(l?"":"disabled"),onClick:h},"Save"))}function Fn(t){var e=t.isCreate,n=t.interaction,r=t.interactionState,a=t.continueInteractive,i=t.saveInteraction,c=t.cancel,u=t.addAnotherQuestion,l=t.discardChanges,s=t.submitInteractionAnswer,f=t.skip,d=t.changeIndex,p=t.timepoint,m=t.currentIndex;return o.a.createElement(o.a.Fragment,null,e?o.a.createElement(Pn,{interaction:n,interactionState:r,onClickContinue:a,onClickSave:i,onClickCancel:c,onClickAddAnother:u,onClickDiscard:function(){return l()}}):o.a.createElement(_n,{typeId:n.typeId,interactionState:r,onClickSubmit:s,onClickSkip:f,changeIndex:d,currentIndex:m,numberOfInteractions:p.interactions.length}))}var Rn=n(1113);function Mn(t){var e=t.timepoint,n=t.interaction,r=t.promptDelete,a=t.optionsPortalNode,i=t.setView;if(!n)return o.a.createElement(o.a.Fragment,null);var c=[];if(c.push({label:"Move time point",onClick:function(){return i("move")}}),e.interactions.length>1){var u=U(n.id);c.push({label:"Re-order questions",onClick:function(){return i("reorder")},className:u?"disabled":""})}return c.push({label:"Delete",onClick:function(){return r(n.id)},className:"text-danger"}),o.a.createElement(et.a,{node:a},!!n&&o.a.createElement(Rn.a,{actions:c}))}n(1373),n(1374);function Un(t){return(Un="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})(t)}function Dn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Dn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Un(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Gn(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return qn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(t,e)}(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 qn(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 Bn=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Wn=null,zn=0,Yn=1;function $n(t){var e=t.timepoint,n=t.updateTimepointTime,r=t.saveTimepoint,a=t.back,i=t.clearTimepointTimeState,c=Gn(o.a.useState(Object(xn.a)(e.visibleAt/1e3)),2),u=c[0],l=c[1],s=Gn(o.a.useState(!1),2),f=s[0],d=s[1];function p(t){n(t*Yn),l(Object(xn.a)(e.visibleAt/1e3)),2===++zn?Yn=5:4===zn?Yn=20:6===zn?Yn=60:8===zn&&(Yn=120),Wn||(Wn=window.setInterval((function(){return p(t)}),200),window.addEventListener("mouseup",m))}function m(){window.removeEventListener("mouseup",m),window.clearInterval(Wn),Wn=null,zn=0,Yn=1}return o.a.useEffect((function(){return m}),[]),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"cv-timepoint flex-grow-1"},o.a.createElement("div",{className:"cv-timepoint-padding"},o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0"},"Move time point"),o.a.createElement("div",{className:"text-center mt-3"},o.a.createElement(rt.a,{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===zn&&p(-1)},onKeyUp:m}),o.a.createElement("input",{className:"form-control text-center d-inline-block cv-move-timepoint-input",value:u,onChange:function(){},onKeyDown:function(t){t.stopPropagation(),37===t.keyCode&&0===zn&&p(-1),39===t.keyCode&&0===zn&&p(1)},onKeyUp:m}),o.a.createElement(rt.a,{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===zn&&p(1)},onKeyUp:m}))))),o.a.createElement("div",{className:"cv-timpoint-button-container"},o.a.createElement(rt.a,{className:"btn btn-link",onClick:function(){i(!0),a()}},"Cancel"),f?o.a.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o.a.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o.a.createElement(rt.a,{className:"btn btn-dark",onClick:function(){return Bn(this,void 0,void 0,Dn().mark((function t(){return Dn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.next=3,r();case 3:a();case 4:case"end":return t.stop()}}),t)})))}},"Save")))}var Hn=n(1095),Vn=n(1375),Kn=n.n(Vn),Zn=n(1191);function Jn(t){return(Jn="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})(t)}function Qn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Qn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Jn(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Xn(t){return function(t){if(Array.isArray(t))return nr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||er(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 tr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||er(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 er(t,e){if(t){if("string"==typeof t)return nr(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)?nr(t,e):void 0}}function nr(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 rr=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var or=Object(Hn.SortableElement)((function(t){var e=t.interaction,n=s.a.getTypeInfo(e.typeId).bgClassName;return o.a.createElement("div",{className:"py-2 text-left"},o.a.createElement("span",{className:Kn.a.dragIcon},o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Handle})),o.a.createElement(Zn.a,{interaction:e,iconClassName:"".concat(Kn.a.type," ").concat(n),questionClassName:"".concat(Kn.a.name," clamp-1")}))})),ar=Object(Hn.SortableContainer)((function(t){var e=t.interactions,n=function(){var t=o.a.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.a.createElement("div",Object.assign({tabIndex:0},n),e.map((function(t,e){return o.a.createElement(or,{key:t.id,index:e,interaction:t})})))}));function ir(t){var e=tr(o.a.useState(!1),2),n=e[0],r=e[1],a=tr(o.a.useState(Xn(t.interactions)),2),i=a[0],c=a[1],u=tr(o.a.useState(!1),2),l=u[0],s=u[1];return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"cv-timepoint flex-grow-1"},o.a.createElement("div",{className:"cv-timepoint-padding"},o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0"},"Re-order questions"),o.a.createElement("div",{className:"text-center mt-3"},o.a.createElement(ar,{onSortEnd:function(t){var e=t.oldIndex,n=t.newIndex;e!==n&&(c(Xn(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}(i,e,n))),s(!0))},interactions:i,helperClass:Kn.a.dragging,lockAxis:"y"}))))),o.a.createElement("div",{className:"cv-timpoint-button-container"},o.a.createElement(rt.a,{className:"btn btn-link",onClick:function(){c(Xn(t.interactions)),s(!1),t.back()}},"Cancel"),n?o.a.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o.a.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o.a.createElement(rt.a,{className:"btn btn-dark ".concat(l?"":"disabled"),onClick:function(){return rr(this,void 0,void 0,Qn().mark((function e(){return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return");case 2:return r(!0),e.next=5,t.reOrderQuestions(i);case 5:r(!1),t.back();case 7:case"end":return e.stop()}}),e)})))}},"Save")))}var cr=n(95),ur=n(44);function lr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(t,e)}(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 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=t.isCreate,n=t.interaction,r=t.mode,a=t.immediateFeedback,i=t.interactionState,c=t.shouldFocus,u=t.delayFocus,l=t.open,s=t.timepoint,f=t.userUpdateInteractionState,d=t.submitInteractionAnswer,p=t.saveInteraction,m=o.a.useRef(),h=o.a.useRef(),v=Object(cr.a)(ur.a.XLDown),y=!e||v;function g(){return!!m.current&&(!!c&&!!l)}function b(){m.current&&(m.current.focus(),x(!0))}var w=lr(o.a.useState(!1),2),E=w[0],x=w[1];o.a.useEffect((function(){g()&&(E||(u&&y?window.setTimeout((function(){g()&&b()}),400):b()))}),[m.current,E]);var I=lr(o.a.useState("question"),2),S=I[0],k=I[1],O=o.a.useMemo((function(){return Object(et.c)()}),[]),C=n?En(n.typeId,r):null,N=a;return e||(N=N&&(null==i?void 0:i.submitted)),o.a.createElement(o.a.Fragment,null,o.a.createElement(Mn,Object.assign({optionsPortalNode:O,setView:k},t)),o.a.createElement(wn.a,{style:{height:"100%"},ref:h},o.a.createElement(On,Object.assign({},t)),!!n&&o.a.createElement("div",{className:"d-flex flex-column h-100"},o.a.createElement(Tn,Object.assign({},t)),"question"===S&&o.a.createElement(o.a.Fragment,null,o.a.createElement("form",{className:"cv-timepoint flex-grow-1",tabIndex:-1,onSubmit:function(t){t.preventDefault(),e?p():d()}},o.a.createElement("div",{className:"cv-timepoint-padding"},o.a.createElement("div",{ref:m,tabIndex:0}),o.a.createElement(C,Object.assign({state:i,setState:f,recalculateScroll:function(){h.current.recalculate()},showFeedback:N,optionsPortalNode:O},t)))),o.a.createElement(Fn,Object.assign({},t))),"move"===S&&o.a.createElement($n,Object.assign({back:function(){return k("question")}},t)),"reorder"===S&&o.a.createElement(ir,Object.assign({back:function(){return k("question")},interactions:s.interactions},t)))))}n(1376);function dr(t){var e=t.open,n=t.nextInteraction,r=t.nextInteractionState,a=t.timepointState,i=t.interaction,c=t.delayFocus,u=n&&a.nextInteractionIndex<a.interactionIndex,l=n&&a.nextInteractionIndex>a.interactionIndex,s=l&&a.slideIn,f=u&&a.slideIn;return o.a.createElement("div",{className:"cv-interactive ".concat(e?"cv-open":"")},u&&o.a.createElement("div",{className:"cv-prev-interaction ".concat(a.slideIn?"cv-slide-in":"")},o.a.createElement(fr,Object.assign({},t,{currentIndex:a.nextInteractionIndex,interaction:n,interactionState:r}))),o.a.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.a.createElement(fr,Object.assign({key:null==i?void 0:i.id},t,{currentIndex:a.interactionIndex,shouldFocus:i&&!u&&!l,delayFocus:c}))),l&&o.a.createElement("div",{className:"cv-next-interaction ".concat(a.slideIn?"cv-slide-in":"")},o.a.createElement(fr,Object.assign({},t,{currentIndex:a.nextInteractionIndex,interaction:n,interactionState:r}))))}n(1377);function pr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return mr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mr(t,e)}(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 mr(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 hr(t){var e=t.player,n=t.resultsService,r=t.interactive,a=t.setShowSummary,i=pr(o.a.useState(!1),2),c=i[0],u=i[1],l=t.player.activePlugins_.activityStatusPlugin,s=t.player.activePlugins_.favouritePlugin;function f(){e.currentTime()>r.timepoints[r.timepoints.length-1].visibleAt/1e3+1?u(!0):u(!1)}if(o.a.useEffect((function(){if(n)return e.on("timeupdate",f),function(){return e.off("timeupdate",f)}}),[]),!c)return null;var d="btn btn-outline-dark cv-show-summary";return s&&(d+=" cv-has-favourite-plugin"),l&&(d+=" cv-has-activity-status-plugin"),o.a.createElement(rt.a,{className:d,onClick:function(){a(!0),e.pause(),e.hide()}},e.gradePassbackPlugin().enabled?"Submit answers":"View summary")}var vr=n(1378),yr=n.n(vr);function gr(t){var e=t.interactive,n=t.duration;return n?o.a.createElement(o.a.Fragment,null,e.timepoints.map((function(e,r){if(!e.interactions.length)return o.a.createElement(o.a.Fragment,null);var a=s.a.getTypeInfo(e.interactions[0].typeId).bgClassName,i=e.visibleAt/1e3/n*100;return o.a.createElement("span",{key:r,className:"".concat(yr.a.interaction," ").concat(a),style:{left:"".concat(i,"%")},onClick:function(n){return r=e.id,o=e.interactions[0].id,n.stopPropagation(),void t.goToTimepoint(r,o);var r,o}})}))):o.a.createElement(o.a.Fragment,null)}var br=n(157),wr=n(399),Er=n(1379),xr=n.n(Er);function Ir(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(t,e)}(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 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 kr(t){var e=t.duration,n=t.progress,r=t.player,a=Ir(o.a.useState(n.length),2)[1],i=[];if(n.length){var c=n[0];i.push(c),n.forEach((function(t,e){0!==e&&(c.end.time+1>t.start.time&&c.start.time<t.start.time?c.end=t.end:(c=t,i.push(c)))}))}return o.a.useEffect((function(){var t=function(){a(n.length)};return r.on("progressflush",t),function(){return r.off("progressflush",t)}}),[]),o.a.createElement(o.a.Fragment,null,i.map((function(t,n){var r=t.start.time/e*100,a=100*(1-t.end.time/e);return o.a.createElement("span",{key:n,className:xr.a.progress,style:{left:"".concat(r,"%"),right:"".concat(a,"%")}})})))}function Or(t){return yt.a.last(t.results)}function Cr(t,e){return yt.a.findWhere(null==e?void 0:e.attempts,{id:t})}var Nr,jr=n(1257),Lr=n.n(jr);function Tr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ar=function(){return o.a.createElement(o.a.Fragment,null)},Pr=(Tr(Nr={},tt.InteractionTypeId.Annotation,Ar),Tr(Nr,tt.InteractionTypeId.Image,Ar),Tr(Nr,tt.InteractionTypeId.MissingWord,(function(t){var e=t.interaction.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat("cv-missing-word-").concat(e,"}")})).split(/{([^{}]*)}/g),n="p-2";return t.reportsStyling||(n+=" border rounded"),o.a.createElement("div",{className:n},e.map((function(e,n){if(!e.startsWith("cv-missing-word-"))return e;var r=e.replace("cv-missing-word-",""),a=t.interaction.actionableItems.find((function(t){return t.order.toString()===r}));if(a){var i=t.answers.find((function(t){return t.id==a.id}));if(i){if(!t.showFeedback)return o.a.createElement("strong",{key:n,className:"text-info"},i.text);var c=i.status===ie.Correct;return o.a.createElement(o.a.Fragment,{key:n},!c&&o.a.createElement(o.a.Fragment,null,o.a.createElement("del",{className:"text-danger"},o.a.createElement("strong",null,i.text))," "),o.a.createElement("strong",{className:"text-success"},a.name))}}})))})),Tr(Nr,tt.InteractionTypeId.MultipleChoice,(function(t){var e,n,r,a,i="my-2";return t.reportsStyling&&(i+=" mx-2"),o.a.createElement("div",{className:i},o.a.createElement(Ce,{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?we.a.getInitialsFromFullName(t.anonymisedUserName):we.a.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===(a=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===a?void 0:a.url,onlyShowSelectedAnswer:!t.showAvatar,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat(Lr.a.uncheckedBackground," text-white")}))})),Tr(Nr,tt.InteractionTypeId.TrueOrFalse,(function(t){var e,n,r,a,i="justify-content-start";return t.reportsStyling&&(i="justify-content-center"),o.a.createElement("div",{className:"my-2"},o.a.createElement(Pe,{className:i,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?we.a.getInitialsFromFullName(t.anonymisedUserName):we.a.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===(a=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===a?void 0:a.url,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat(Lr.a.uncheckedBackground," text-white")}))})),Tr(Nr,tt.InteractionTypeId.ShortAnswer,(function(t){var e=yt.a.first(t.answers);if(!e)return o.a.createElement(o.a.Fragment,null);var n="rounded p-2 mb-2";return t.reportsStyling||(n+=" bg-info text-white"),o.a.createElement("div",{className:n},e.text)})),Nr),_r=n(8).a.encloseNamespace("interactives.responseTypes");function Fr(){return o.a.createElement("p",{className:"p-2"},o.a.createElement("em",null,_r("noResponse")))}function Rr(t){return o.a.createElement(o.a.Fragment,null,t.correctness===ue.a.Correct&&o.a.createElement("div",{className:"ml-2 text-success"},o.a.createElement(Ee.a,{svgName:xe.b.Check})),t.correctness===ue.a.Incorrect&&o.a.createElement("div",{className:"ml-2 text-danger"},o.a.createElement(Ee.a,{svgName:xe.b.Close})))}function Mr(t){return o.a.createElement("div",{className:"d-flex align-items-center justify-content-between"},o.a.createElement("strong",null,t.anonymisedUserName||we.a.getFullName(t.studentResults.user)),o.a.createElement(Rr,{correctness:t.correctness}))}function Ur(t){return t.correctness!==ue.a.AwaitingMarking?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"d-flex justify-content-end mt-1"},o.a.createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===ie.Correct?"text-success":"")},o.a.createElement(Ee.a,{svgName:t.markedStatus===ie.Correct?xe.b.CheckCircle:xe.b.CheckCircleOutline,onClick:function(){return t.markInteraction(t.studentAttempt.answers,ie.Correct)}})),o.a.createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===ie.Incorrect?" text-danger":"")},o.a.createElement(Ee.a,{svgName:t.markedStatus===ie.Incorrect?xe.b.CrossCircleFilled:xe.b.CrossCircle,onClick:function(){return t.markInteraction(t.studentAttempt.answers,ie.Incorrect)}})))}var Dr=n(1380),Gr=n.n(Dr);function qr(t){var e,n,r,a,i,c=Pr[t.interaction.typeId];if(!c)return o.a.createElement(o.a.Fragment,null);var u=Or(t.studentResults),l=Cr(t.interaction.id,u),s=ye.isInteractionCorrect(t.interaction,u);return o.a.createElement("div",{className:"rounded ".concat(null!==(e=t.className)&&void 0!==e?e:"")},o.a.createElement("div",{className:"d-flex"},!!t.showStudentDetails&&o.a.createElement("div",{className:"mr-2"},o.a.createElement("div",{className:Gr.a.avatarContainer},o.a.createElement(Ie.a,{imageCdnUrl:t.imageCdnUrl,initials:t.anonymisedUserName?we.a.getInitialsFromFullName(t.anonymisedUserName):we.a.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===(i=null===(a=t.studentResults.user)||void 0===a?void 0:a.avatar)||void 0===i?void 0:i.url}))),o.a.createElement("div",{className:"flex-grow-1"},!!t.showStudentDetails&&o.a.createElement(Mr,{studentResults:t.studentResults,correctness:s,anonymisedUserName:t.anonymisedUserName}),o.a.createElement("div",{className:"d-flex justify-content-between"},o.a.createElement("div",{className:"flex-grow-1 ".concat(t.responseComponentClass?t.responseComponentClass:"")},l?o.a.createElement(c,{interaction:t.interaction,answers:l.answers,imageCdnUrl:t.imageCdnUrl,user:t.studentResults.user,showFeedback:t.showFeedback,showAvatar:t.showAvatar,reportsStyling:t.reportsStyling}):o.a.createElement(Fr,null)),!t.showStudentDetails&&o.a.createElement(Rr,{correctness:s})))),o.a.createElement(Ur,{studentAttempt:l,correctness:s,markInteraction:t.markInteraction,markedStatus:t.markedStatus}))}var Br=n(1381),Wr=n.n(Br);function zr(t){var e=t.studentResults,n=t.interaction,r=t.timepoint,a=t.interactive,i=t.state,c=t.goToTimepoint,u=t.interactionNumber,l=t.imageCdnUrl,s=Or(e),f=Cr(n.id,s),d=i.interactions[n.id],p=Ze(n.typeId)(d||{},n),m=n.typeId!==tt.InteractionTypeId.Annotation&&n.typeId!==tt.InteractionTypeId.Image,h=m;n.typeId===tt.InteractionTypeId.MissingWord&&f&&(h=!1);var v=n.data.suggestedResponse||n.data.feedback;return o.a.createElement("li",{className:"mb-3 position-relative"},o.a.createElement("div",{className:"d-flex flex-wrap mb-2 cursor-pointer",onClick:function(){return c(r.id,n.id)}},a.immediateFeedback&&o.a.createElement("div",{className:Wr.a.feedback},!!f&&(p===ue.a.AwaitingMarking?o.a.createElement("span",{className:"text-muted font-italic"},"Waiting to be marked"):p===ue.a.Correct?o.a.createElement("span",{className:"text-success"},"Correct ",o.a.createElement(Ee.a,{className:"svg-container align-middle",svgName:xe.b.Check})):p===ue.a.Incorrect&&o.a.createElement("span",{className:"text-danger"},"Incorrect ",o.a.createElement(Ee.a,{className:"svg-container align-middle",svgName:xe.b.Close})))),o.a.createElement(Zn.a,{interaction:n,iconClassName:"flex-shrink-0",showQuestion:h,showTypeName:!0,questionClassName:"d-block w-100 mt-2",questionNumber:u})),m&&!f&&o.a.createElement("button",{className:"btn btn-dark",onClick:function(){return c(r.id,n.id)}},"Answer question"),f&&m&&o.a.createElement(qr,{interaction:n,studentResults:e,markedStatus:ie.PendingReview,markInteraction:function(){},imageCdnUrl:l,showFeedback:a.immediateFeedback,showAvatar:!0}),a.immediateFeedback&&f&&v&&o.a.createElement("div",{className:"bg-light rounded p-2"},o.a.createElement("div",null,o.a.createElement("strong",null,n.typeId===tt.InteractionTypeId.TrueOrFalse?"Teacher's feedback":"Teacher's suggested response")),v))}var Yr=n(1382),$r=n.n(Yr);function Hr(t){return function(t){if(Array.isArray(t))return Vr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Vr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vr(t,e)}(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 Vr(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 Kr(t){var e=t.showSummary,n=t.setShowSummary,r=t.state,a=t.interactive,i=t.player,c=t.progress,u=t.portalNode,l=o.a.useRef();function s(){n(!1),i.show(),i.play()}function f(e,n){s(),t.goToTimepoint(e,n)}if(!u||!e)return o.a.createElement(o.a.Fragment,null);var d=function(t){var e=t.interactive,n=t.state,r=0,o=0,a=0,i=!1,c=[];return e.timepoints.forEach((function(t){t.interactions.forEach((function(t){var e=n.interactions[t.id],u=Ze(t.typeId)(e||{},t);u===ue.a.Correct&&r++,u!==ue.a.NotApplicable&&o++,u!==ue.a.NotApplicable&&(null==e?void 0:e.submitted)&&a++,u===ue.a.AwaitingMarking&&(i=!0);var l=D(e||{}),s=Object.keys(l).map((function(t){var e;return{id:t,text:null===(e=l[t])||void 0===e?void 0:e.toString()}}));s.length&&c.push({id:t.id,answeredAt:1,answers:s})}))})),{correctCount:r,total:o,answered:a,studentAttempts:c,awaitingMarking:i}}({interactive:a,state:r}),p=d.correctCount,m=d.total,h=d.answered,v=d.studentAttempts,y=d.awaitingMarking,g={name:t.currentUser.givenName,username:t.currentUser.username,user:{name:t.currentUser.givenName,surname:t.currentUser.familyName,avatar:{url:t.currentUser.avatar}},results:[{id:a.id,attempts:v}]},b=0,w=i.ended(),E=i.duration();return o.a.createElement(et.a,{node:u},o.a.createElement("div",{className:"row pb-3"},o.a.createElement("div",{className:"col-4 col-xs-12"},o.a.createElement(wr.a,{data:i.poster(),imageType:Ot.c.Thumbnails,imageOptions:{size:Ot.b.Medium}})),o.a.createElement("div",{className:"col-8 col-xs-12"},o.a.createElement("span",{className:"float-right"},o.a.createElement(br.a,{svgName:xe.b.Play,className:"btn btn-outline-dark",onClick:function(){s(),i.ended()&&i.currentTime(0)}},w?"Play again":"Continue watching"),i.gradePassbackPlugin().enabled&&o.a.createElement(br.a,{svgName:xe.b.Check,className:"btn btn-dark ml-2",onClick:function(){i.gradePassbackPlugin().submit(p/m,!y)}},"Submit")),o.a.createElement("h1",{className:"h3"},t.title),o.a.createElement("p",null))),o.a.createElement("div",{className:"border rounder px-2 mb-3"},o.a.createElement("div",{className:"cursor-pointer my-4 ".concat($r.a.bar),onClick:function(t){if(l.current){var e=l.current.getBoundingClientRect(),n=(t.pageX-e.left)/e.width*E;s(),i.currentTime(n)}},ref:l},o.a.createElement(kr,{duration:E,progress:c,interactive:a,player:i}),o.a.createElement(gr,{duration:E,interactive:a,goToTimepoint:f}))),o.a.createElement("h2",{className:"h4"},"My Answers"),o.a.createElement("div",{className:"d-flex justify-content-between"},o.a.createElement("span",null,a.immediateFeedback&&o.a.createElement("div",null,"Score: ",p,"/",m),o.a.createElement("div",{className:"mb-3"},"You have answered ",o.a.createElement("strong",{className:h!==m?"text-danger":""},h)," of ",o.a.createElement("strong",null,m)," questions"))),o.a.createElement("div",{className:"row"},o.a.createElement("div",{className:"col-lg-7 col-12"},o.a.createElement("ul",{className:"list-unstyled"},a.timepoints.reduce((function(e,n){return[].concat(Hr(e),Hr(n.interactions.map((function(e){return b++,o.a.createElement(zr,{key:e.id,studentResults:g,interaction:e,timepoint:n,interactive:a,state:r,goToTimepoint:f,interactionNumber:b,imageCdnUrl:t.imageCdnUrl})}))))}),[])))))}function Zr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jr(t,e)}(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 Jr(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 Qr(t){var e=t.resultsService,n=t.player,r=t.onShowSummary,a=Zr(o.a.useState(!1),2),i=a[0],c=a[1];function u(t){c(t),r&&r(t)}function l(){u(!0),n.hide()}return o.a.useEffect((function(){if(e)return n.on("ended",l),function(){return n.off("ended",l)}}),[]),o.a.useEffect((function(){i&&n.isFullscreen()&&n.exitFullscreen()}),[i]),o.a.createElement(o.a.Fragment,null,o.a.createElement(hr,Object.assign({setShowSummary:u},t)),o.a.createElement(Kr,Object.assign({showSummary:i,setShowSummary:u},t)))}n(1383);var Xr=n(1103);function to(t){var e,n,r,a=(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),i=[];return t.onClickEditDetails&&i.push({label:"Edit details",svgName:xe.b.Edit,button:!0,className:"btn btn-outline-dark",onClick:t.onClickEditDetails}),t.onClickPublish&&i.push({label:"Publish",button:!0,className:"btn btn-dark ml-2".concat(a?"":" disabled"),disabled:!a,tooltip:a?"":"Interactives cannot be published without questions",onClick:function(){if(!a)return;t.onClickPublish&&t.onClickPublish()}}),i.length?o.a.createElement(et.a,{node:t.portalNode},o.a.createElement(Xr.a,{actions:i})):o.a.createElement(o.a.Fragment,null)}var eo=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 no(t){var e=t.title,n=t.player,r=t.track,a=t.mode,i=t.interactive,c=t.imageApi,u=t.supportSiteUrl,s=t.actionsPortalNode,f=t.questionListPortalNode,d=t.summaryPortalNode,p=t.resultsService,m=t.currentUser,h=t.progress,v=t.latestSession,y=t.clipOffset,g=t.analyticsService,b=t.enableImmersiveReader,w=function(t){var e=t.player,n=t.track,r=t.interactive,a=t.clipOffset,i=_(o.a.useState(!1),2),c=i[0],u=i[1],l=_(o.a.useState(!1),2),s=l[0],f=l[1],d=_(o.a.useState(null),2),p=d[0],m=d[1];function h(t){return a?t+a:t}function v(t){f(!!t&&c),u(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.a.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:i,mode:a,clipOffset:y}),E=w.open,x=w.timepoint,I=w.wasOpen,S=eo(w,["open","timepoint","wasOpen"]),k=sn(Object.assign({mode:a,interactive:i,timepoint:x,player:n,resultsService:p,latestSession:v,analyticsService:g},S)),O=k.interaction,C=k.interactionState,N=k.nextInteraction,j=k.nextInteractionState,L=k.timepointState,T=k.state,A=eo(k,["interaction","interactionState","nextInteraction","nextInteractionState","timepointState","state"]);!function(t){var e,n=t.mode,r=t.player,a=t.timepoint,i=t.interaction,c=t.discardChanges,u=t.interactionState,s=t.timepointState,f=Object(R.a)(),d=n===l.InteractiveMode.Create;o.a.useEffect((function(){if(d){if(U(null==i?void 0:i.id)||(null==u?void 0:u.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")}}),[i,null==u?void 0:u.hasChanges,null===(e=null==a?void 0:a.interactions)||void 0===e?void 0:e.length,null==s?void 0:s.hasChanges])}({mode:a,player:n,timepoint:x,interaction:O,discardChanges:A.discardChanges,interactionState:C,timepointState:L});var F={mode:a,open:E,isCreate:a===P.a.Create,interaction:O,nextInteraction:N,timepoint:x,interactive:i,interactionState:C,nextInteractionState:j,timepointState:L,player:n};return o.a.createElement(o.a.Fragment,null,!!s&&o.a.createElement(to,{interactive:i,onClickEditDetails:t.onClickEditDetails,onClickPublish:t.onClickPublish,portalNode:s}),o.a.createElement(mn,Object.assign({},F,A)),o.a.createElement(dr,Object.assign({imageApi:c,currentUser:m,immediateFeedback:i.immediateFeedback,delayFocus:!I,enableImmersiveReader:b},F,A,S)),o.a.createElement(Qr,Object.assign({title:e,currentUser:m,state:T,portalNode:d,progress:h,resultsService:p,imageCdnUrl:c.toString(),onShowSummary:t.onShowSummary},F,A)),o.a.createElement(bn,Object.assign({portalNode:f,supportSiteUrl:u,currentUser:m},F,A)))}c.a.registerComponent("Interactive",Object(A.a)((function(t,e){return o.a.createElement(no,Object.assign({player:t},e))})));var ro=n(274),oo=n(279);function ao(t){var e=t.player;function n(){var t=e.getChild("ContinueSession");e.removeChild(t),t.dispose()}function r(){t.continue(!0),n()}var a=[{buttonText:"Start again",variant:"link",onClick:function(){t.continue(!1),n()}},{buttonText:"Continue",variant:"dark",onClick:r}];return o.a.createElement(ro.a,{title:"Continue interactive?",closePopup:r},o.a.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.a.createElement(oo.a,{buttons:a}))}function io(t){return(io="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})(t)}function co(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 uo(t,e){return(uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function lo(t){var e=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}}();return function(){var n,r=fo(t);if(e){var o=fo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return so(this,n)}}function so(t,e){if(e&&("object"===io(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 fo(t){return(fo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}c.a.registerComponent("ContinueSession",Object(A.a)((function(t,e){return o.a.createElement(ao,Object.assign({player:t},e))})));var po=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&&uo(t,e)}(a,t);var e,n,r,o=lo(a);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=o.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),"*")}}])&&co(e.prototype,n),r&&co(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getPlugin("plugin"));c.a.registerPlugin("gradePassbackPlugin",po);n(1384);function mo(t){return(mo="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})(t)}function ho(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 vo(t,e){return(vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function yo(t){var e=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}}();return function(){var n,r=bo(t);if(e){var o=bo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return go(this,n)}}function go(t,e){if(e&&("object"===mo(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 bo(t){return(bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wo=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&&vo(t,e)}(a,t);var e,n,r,o=yo(a);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=o.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(),u.a.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){e.options.analyticsService.logUserAction({},{actionType:ne.UserAction.Click,entity:ne.EntityType.Interactive,descriptor:n?ne.InteractiveSessionDescriptor.ContinueSession:ne.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||l.InteractiveMode.View,latestSession:this.continueSession&&this.options.latestSession})),this.player.controlBar.getChild("progressControl").getChild("SeekBar").addChild(new T(this.player,{interactive:this.options.interactive,track:t}))}}])&&ho(e.prototype,n),r&&ho(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getPlugin("plugin"));c.a.registerPlugin("viewInteractivePlugin",wo);var Eo=n(131);function xo(t){return(xo="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})(t)}function Io(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 So(t,e){return(So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ko(t){var e=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}}();return function(){var n,r=Co(t);if(e){var o=Co(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Oo(this,n)}}function Oo(t,e){if(e&&("object"===xo(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 Co(t){return(Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var No=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&&So(t,e)}(a,t);var e,n,r,o=ko(a);function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.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()}}])&&Io(e.prototype,n),r&&Io(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(n(121).a);function jo(t){return(jo="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})(t)}function Lo(t){return function(t){if(Array.isArray(t))return To(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return To(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return To(t,e)}(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 To(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 Ao(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ao=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==jo(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Po(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 _o=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Fo=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 Eo.a).withUrl("".concat(e.playerApi.origin,"/hubs/interactives"),{withCredentials:!1}).configureLogging(Eo.c.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,r;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 _o(e,void 0,void 0,Ao().mark((function t(){return Ao().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 _o(this,void 0,void 0,Ao().mark((function t(){return Ao().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?a.a.ErrorHelper.throw(new No):(this.retryCount++,this.start())}},{key:"startSession",value:function(){return _o(this,void 0,void 0,Ao().mark((function t(){var e,n,r,o,i,c,u;return Ao().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,i=e.customerId,c=e.shareId,t.prev=3,t.next=6,this.connection.invoke("startSession",n,r,o,i,c);case 6:u=t.sent,this.resultId=u.resultId,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),a.a.ErrorHelper.throw(new No);case 13:case"end":return t.stop()}}),t,this,[[3,10]])})))}},{key:"flush",value:function(){return _o(this,void 0,void 0,Ao().mark((function t(){var e=this;return Ao().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:Lo(this.cache).forEach((function(t){return _o(e,void 0,void 0,Ao().mark((function e(){return Ao().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()}}),t,this)})))}},{key:"save",value:function(t,e){return _o(this,void 0,void 0,Ao().mark((function n(){var r;return Ao().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)})))}}])&&Po(e.prototype,n),r&&Po(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ro=function(t,e){var n,r=t.addTextTrack("metadata","interactive"),o=e.additionalData.interactive,a=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;a&&(n+=a,o+=a),(null===(e=t.interactions)||void 0===e?void 0:e.length)&&r.addCue({startTime:n-.001,endTime:o,text:t.id})})),r},Mo=n(417);function Uo(t){return(Uo="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})(t)}function Do(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Do=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Uo(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Go(t){return function(t){if(Array.isArray(t))return qo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return qo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qo(t,e)}(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 qo(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 Bo(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 Wo(){return(Wo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=zo(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(this,arguments)}function zo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vo(t)););return t}function Yo(t,e){return(Yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function $o(t){var e=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}}();return function(){var n,r=Vo(t);if(e){var o=Vo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ho(this,n)}}function Ho(t,e){if(e&&("object"===Uo(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 Vo(t){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ko=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Zo=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&&Yo(t,e)}(c,t);var e,n,r,o=$o(c);function c(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(n=o.call(this,t,e)).totalProgress=[],G.a.setToken("gateway",n.options.authToken),n.player.one("dispose",(function(){n.resultsService&&n.resultsService.stop()})),n.options.mode===l.InteractiveMode.Create&&n.player.addClass("cv-create-interactives"),n}return e=c,(n=[{key:"getPlayerOptions",value:function(){var t=Wo(Vo(c.prototype),"getPlayerOptions",this).call(this);return t.setMaxHeight=!1,this.options.embed||(t.aspectRatio="16:9"),t}},{key:"onFlushProgress",value:function(t){var e;Wo(Vo(c.prototype),"onFlushProgress",this).call(this,t),this.options.mode!==l.InteractiveMode.Create&&(e=this.totalProgress).push.apply(e,Go(t))}},{key:"additionalSetup",value:function(t){var e=this,n=Object.create(null,{additionalSetup:{get:function(){return Wo(Vo(c.prototype),"additionalSetup",e)}}});return Ko(this,void 0,void 0,Do().mark((function e(){return Do().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.additionalSetup.call(this,t),this.setupUpClipPlugin(t),this.setupViewInteractivePlugin(t);case 3:case"end":return e.stop()}}),e,this)})))}},{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=Ro(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||a.a.ErrorHelper.throw(new i.a("Must provide a currentUser in order to collect interactive results")),this.options.shareId||a.a.ErrorHelper.throw(new i.a("Must provide a shareId in order to collect interactive results")),this.resultsService=new Fo({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})}},{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)}}])&&Bo(e.prototype,n),r&&Bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(Mo.a);n.d(e,"a",(function(){return Qo}));var Jo=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 Qo(t){var e=t.onReady,n=t.className,r=Jo(t,["onReady","className"]),a=o.a.useRef();return o.a.useEffect((function(){var t=new Zo(a.current,r);return e&&t.ready((function(){e(t)})),function(){t.dispose()}}),[]),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{ref:a,className:n}),o.a.createElement("div",{id:"popup-region"}))}},1288:function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r=n(0),o=n.n(r),a=n(282),i=n(1170),c=n(133),u=n(63),l=n(20),s=n(43),f=n(1143),d=n(1191),p=n(1289),m=n.n(p),h="shared.interactiveQuestions";function v(t){var e=t.interaction;switch((0,t.getCorrectness)(e)){case f.a.Correct:return o.a.createElement("span",{className:"text-success"},o.a.createElement(u.a,{size:u.b.Medium,svgName:l.b.Check}));case f.a.Incorrect:return o.a.createElement("span",{className:"text-danger"},o.a.createElement(u.a,{size:u.b.Medium,svgName:l.b.Close}));case f.a.AwaitingMarking:return o.a.createElement("span",{className:"text-muted italic"},o.a.createElement("i",null,o.a.createElement(s.b,{namespace:h,phrase:"pending"})));case f.a.UnAnswered:return o.a.createElement("button",{className:"btn btn-outline-dark"},o.a.createElement(s.b,{namespace:h,phrase:"answer"}));case f.a.Answered:return o.a.createElement("span",{className:"text-muted italic"},o.a.createElement("i",null,o.a.createElement(s.b,{namespace:h,phrase:"answered"})));case f.a.NotApplicable:return o.a.createElement(o.a.Fragment,null)}}function y(t){var e=t.interaction,n=t.visibleAt,r=t.selectedInteractionId,a=t.goToTimepoint,s=t.scrollTo,f=t.isFirstInteraction,p=e.id.toString()===(null==r?void 0:r.toString()),h=o.a.useRef();o.a.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 y=a?"cursor-pointer":"cursor-default";return o.a.createElement("div",{ref:h},o.a.createElement(c.a,{className:"py-2 ".concat(y," ").concat(m.a.row," ").concat(p?m.a.selected:""),onClick:p?function(){}:function(){a&&a(e.id)}},o.a.createElement("span",{className:"".concat(m.a.time," mr-2 ").concat(p?"font-weight-bold":"")},f?i.a.ToDisplayDuration(n):""),o.a.createElement(d.a,{interaction:e,showTypeName:!0,typeNameClassName:m.a.type,questionClassName:m.a.question}),t.onClickDelete&&o.a.createElement(c.a,{onClick:function(n){n.stopPropagation(),t.onClickDelete(e.id)},className:"".concat(m.a.deleteContainer)},o.a.createElement("span",{className:"text-right ".concat(m.a.delete)},o.a.createElement(u.a,{size:u.b.Medium,svgName:l.b.Delete}))),t.getCorrectness&&o.a.createElement("span",{className:"text-right ".concat(m.a.correctness)},o.a.createElement(v,{interaction:e,getCorrectness:t.getCorrectness}))))}function g(t){var e=t.timepoint,n=t.scrollTo,r=t.onClickDelete,a=t.selectedInteractionId,i=t.getCorrectness;function c(n){t.goToTimepoint&&t.goToTimepoint(e.id,n)}return e.interactions?o.a.createElement("div",null,e.interactions.map((function(t,u){return o.a.createElement(y,{interaction:t,visibleAt:e.visibleAt,goToTimepoint:c,onClickDelete:r,scrollTo:n,selectedInteractionId:a,isFirstInteraction:0===u,getCorrectness:i,key:u})}))):o.a.createElement(o.a.Fragment,null)}function b(t){var e=t.interactive,n=t.goToTimepoint,r=t.selectedInteractionId,i=t.maxHeight,c=t.onClickDelete,u=t.getCorrectness,l=o.a.useRef();function s(t,e){if(l.current){var n=l.current.getClientHeight(),r=l.current.getScrollTop(),o=t+r;(o<r||o+e>r+n)&&l.current.scrollTop(o-n/2+e/2)}}var f=n?"border rounded":"";return o.a.createElement(a.Scrollbars,{autoHeight:!0,autoHeightMax:i,className:f,hideTracksWhenNotNeeded:!0,ref:l},o.a.createElement("div",{className:"px-3 py-1"},e.timepoints.map((function(t,e){return o.a.createElement(g,{key:e,timepoint:t,goToTimepoint:n,selectedInteractionId:r,scrollTo:s,onClickDelete:c,getCorrectness:u})}))))}},1289:function(t,e,n){t.exports={time:"_3B2vs",type:"_3lYII",question:"_3WHlt",deleteContainer:"Dqlwr",delete:"_4TtZ",correctness:"_3G9s-",selected:"_20LzY",row:"_3uCfp"}},1356:function(t,e,n){},1357:function(t,e,n){},1358:function(t,e,n){},1359:function(t,e,n){},1364:function(t,e,n){},1365:function(t,e,n){},1366:function(t,e,n){},1367:function(t,e,n){t.exports={incorrect:"_3pK3B",answer:"_2ItYx",avatarContainer:"_3DkKy"}},1368:function(t,e,n){},1369:function(t,e,n){t.exports={feedback:"_2hJr3",avatarContainer:"_2Ukg-",avatarContainerSmall:"_1E7DW",incorrect:"xbaUc"}},1370:function(t,e,n){t.exports={svg:"_17Ny-",iconButton:"x1ePL",iconWithText:"_2BmJR",iconOnly:"_2DnLq"}},1371:function(t,e,n){},1372:function(t,e,n){},1373:function(t,e,n){},1374:function(t,e,n){},1375:function(t,e,n){t.exports={type:"_3N9_3",dragIcon:"_1GfpD",name:"_3s8vL",dragging:"_1qnqN"}},1376:function(t,e,n){},1377:function(t,e,n){},1378:function(t,e,n){t.exports={interaction:"_3SUOU"}},1379:function(t,e,n){t.exports={progress:"_1myQT"}},1380:function(t,e,n){t.exports={avatarContainer:"_27TEu"}},1381:function(t,e,n){t.exports={feedback:"F7uFH"}},1382:function(t,e,n){t.exports={bar:"_2pc-n"}},1383:function(t,e,n){},1384:function(t,e,n){}}]);
|
|
1
|
+
(window.webpackJsonp_clickview_lite=window.webpackJsonp_clickview_lite||[]).push([[16],{1136:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(15),o={createViewKey:function(t,e,n){var o={mediaId:t.toString(),mediaIdType:e};return n&&(o.shareContextId=n),{url:"/api/player/create-view-key",key:"view:key:".concat(t,":").concat(e),type:r.a.POST,data:o,expiryTime:28800}}}},1137:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.Share="share",t.MasterObject="masterobject"}(r||(r={}))},1143:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return 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={}))},1156:function(t,e,n){"use strict";var r=n(1224);n.d(e,"InteractiveMode",(function(){return r.a}));n(1248),n(1249),n(1250),n(1251),n(1252),n(1253),n(1254)},1195:function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(0),o=n(1096),a=n(8),i=n(29),c=n(246),u=n(15),l=n(40),s=n(1196),f=n.n(s);function d(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(t,e)}(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 p(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 m=null,h=!1;function v(t){var e=d(r.useState(m),2),n=e[0],s=e[1];if(m||h||(h=!0,Object(c.ajaxRequest)({resource:"/api/integrations/token/immersive-reader",type:u.a.GET,success:function(t){m=t,s(t),window.setTimeout((function(){m=null,h=!1}),9e5)},error:function(){}})),!n)return r.createElement(r.Fragment,null);return t.title||(t.title=a.a.getPhrase("shared.immersiveReader","titleFallback")),r.createElement("span",{className:"".concat(f.a.button," ").concat(t.className||""),onClick:function(){l.a.isFunction(t.onLaunch)&&t.onLaunch(),i.a.logUserAction(t.analyticsData,t.analyticsOptions);var e={title:t.title,chunks:[{content:t.text,mimeType:t.html?"text/html":"text/plain"}]},r=n.subdomain,a=n.token,c={uiZIndex:5e3,onExit:function(){l.a.isFunction(t.onExit)&&t.onExit()}};o.launchAsync(a,r,e,c)}},r.createElement("svg",{viewBox:"0 0 40 37"},r.createElement("path",{d:"M37.4,0.9 L37.4,9.6 L35.4,9.6 L35.4,2.9 L24.4,2.9 C22.9,3.3 20,4.5 20,6 L20,17.2 L18,17.2 L18,6 C18,5 15.6,3.6 13.8,2.9 L2,2.9 L2,29 L12.4,29 L12.4,31 L0,31 L0,0.9 L14.1,0.9 L14.3,1 C15,1.2 17.5,2.2 18.9,3.7 C20.5,1.9 23.5,1.1 23.9,1 L24.1,1 L37.4,1 L37.4,0.9 Z",fill:"#000000"}),r.createElement("path",{d:"M27.4,37 L25.8,37 L18.4,29.4 L14,29.4 L14,21 L18.4,20.9 L26.1,13 L27.4,13 L27.4,37 Z M16,27.4 L19.2,27.4 L25.3,33.7 L25.3,16.6 L19.2,22.9 L15.9,22.9 L15.9,27.4 L16,27.4 Z",fill:"#0197F2"}),r.createElement("path",{d:"M31.3,32.7 L29.6,31.7 C29.6,31.7 31.7,28.3 31.7,25.2 C31.7,21.9 29.6,18.5 29.6,18.4 L31.3,17.4 C31.4,17.6 33.7,21.3 33.7,25.2 C33.7,28.8 31.4,32.6 31.3,32.7 Z",fill:"#0197F2"}),r.createElement("path",{d:"M36.4,36.2 L34.8,35 C34.8,35 38,30.8 38,25.2 C38,19.6 34.8,15.4 34.8,15.4 L36.4,14.2 C36.5,14.4 40,19 40,25.3 C40,31.5 36.5,36 36.4,36.2 Z",fill:"#0197F2"})))}},1196:function(t,e,n){t.exports={button:"TRYB2"}},1214:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.AddToPlaylist="115005679748",t.LibraryEditor="360001974533",t.VideoAccess="360000153947",t.AddFromOnline="360011718234",t.UploadToLibraryEditor="360012069334",t.PublisherArchive="360011150174",t.PBTErrorCodes="360012421153",t.ManuelReview="360020004534",t.LibraryReview="360000163788",t.PublisherServer="360023108873",t.MigrationOptions="360023109033",t.Integrations="4407268725529",t.Classrooms="4405362551833",t.MakeInteractive="4405370510873"}(r||(r={}))},1224:function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.View=0]="View",t[t.Create=1]="Create"}(r||(r={}))},1232:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),o=n.n(r),a=n(119),i=n(63),c=n(20);function u(t){return o.a.createElement(a.a,{title:t.tooltipText,spanHack:!0,spanHackClassName:"d-inline-block"},o.a.createElement(i.a,{svgName:c.b.Info}))}},1248:function(t,e){},1249:function(t,e){},1250:function(t,e){},1251:function(t,e){},1252:function(t,e){},1253:function(t,e){},1254:function(t,e){},1257:function(t,e,n){t.exports={uncheckedBackground:"_3OcAr"}},1258:function(t,e,n){"use strict";var r=n(0),o=n.n(r),a=n(4),i=n(28),c=(n(815),n(816),n(2)),u=n(97),l=n(1156),s=n(1125);n(1357);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})(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}}).apply(this,arguments)}function m(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function v(t){var e=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}}();return function(){var n,r=g(t);if(e){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}function y(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 g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var b=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=v(a);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=o.call(this,t,e)).timepoint_=e.timepoint,n.time_=e.timepoint.visibleAt/1e3;var r=e.timepoint.interactions[0];r||n.hide();var i=s.a.getTypeInfo(r.typeId).bgClassName;return n.$(".vjs-icon-placeholder").classList.add(i),n.controlText(r.name),n.update(),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-item ".concat(p(g(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return p(g(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),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getComponent("Button"));n(1358);function w(t){return(w="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})(t)}function E(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return x(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(t,e)}(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 x(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 I(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 S(){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=k(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(this,arguments)}function k(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=L(t)););return t}function O(t,e){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function C(t){var e=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}}();return function(){var n,r=L(t);if(e){var o=L(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return N(this,n)}}function N(t,e){if(e&&("object"===w(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return j(t)}function j(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function L(t){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var T=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&&O(t,e)}(a,t);var e,n,r,o=C(a);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=o.call(this,t,e)).track_=e.track,n.interactive_=e.interactive,n.onDurationChange=n.onDurationChange.bind(j(n)),n.createInteractionItems=n.createInteractionItems.bind(j(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(S(L(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return S(L(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=this;if(this.track_){E(this.children_).forEach((function(t){e.removeChild(t)}));for(var n=0;n<this.track_.cues.length;n++){var r=this.track_.cues[n],o=this.getTimepointById(r.text);o&&(null===(t=o.interactions)||void 0===t?void 0:t.length)&&this.addChild(new b(this.player_,{timepoint:o}))}}}},{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()}))}}])&&I(e.prototype,n),r&&I(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getComponent("Component")),A=n(290),P=n(1224);function _(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return F(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(t,e)}(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 F(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 R=n(401),M=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 U(t){return!!(null==t?void 0:t.toString().startsWith("new_"))}function D(t){t.error,t.hasChanges,t.submitted,t.spinner;return M(t,["error","hasChanges","submitted","spinner"])}var G=n(341);function q(t){return(q="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})(t)}function B(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */B=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==q(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 W(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 z=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Y=function(){return"/api/domain/v1/interactions/bulk"},$=function(t){return"/api/domain/v1/interactions/bulk/".concat(t)},H=function(t){return"/api/domain/v1/interactions/".concat(t)},V=function(){return"/api/domain/v1/timepoints"},K=function(t){return"/api/domain/v1/timepoints/".concat(t)},Z=function(t){return"/api/domain/v1/timepoints/".concat(t)},J={},Q=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,r;return e=t,(n=[{key:"saveInteraction",value:function(t){return z(this,void 0,void 0,B().mark((function e(){var n,r,o,a,i;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=U(t.id),r=n?Y():$(t.id),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),a=n?G.a.post(r,JSON.stringify(o),J):G.a.put(r,JSON.stringify(o),J),e.next=7,a;case 7:i=e.sent,n&&(t.id=i.id);case 9:case"end":return e.stop()}}),e)})))}},{key:"deleteInteraction",value:function(t){return z(this,void 0,void 0,B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G.a.delete(H(t),J);case 2:case"end":return e.stop()}}),e)})))}},{key:"saveTimepoint",value:function(t){return z(this,void 0,void 0,B().mark((function e(){var n,r;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={interactiveId:t.interactiveId,shouldPause:1,visibleAt:t.visibleAt},e.next=3,G.a.post(V(),JSON.stringify(n),J);case 3:r=e.sent,t.id=r.id;case 5:case"end":return e.stop()}}),e)})))}},{key:"updateTimepoint",value:function(t){return z(this,void 0,void 0,B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G.a.put(Z(t.id),JSON.stringify(t),J);case 2:case"end":return e.stop()}}),e)})))}},{key:"deleteTimepoint",value:function(t){return z(this,void 0,void 0,B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G.a.delete(K(t),J);case 2:case"end":return e.stop()}}),e)})))}}])&&W(e.prototype,n),r&&W(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()),X=n(405),tt=n(275),et=n(241);function nt(t){var e=t.error;return t.error?o.a.createElement("p",{className:"mt-2 small text-danger"},e):o.a.createElement(o.a.Fragment,null)}var rt=n(133);function ot(t){return(ot="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})(t)}function at(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */at=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==ot(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},ct=/[.\?!,;:\-''\(\)]/g;function ut(t){for(var e=t.split("");e.length&&e[0].match(ct);)e.shift();for(;e.length&&e[e.length-1].match(ct);)e.pop();return e.join("")}function lt(t,e){for(var n=t.split(""),r=[],o=[];n.length&&n[0].match(ct);)r.push(n.shift());for(;n.length&&n[n.length-1].match(ct);)o.unshift(n.pop());return r.join("")+e+o.join("")}function st(t){return t.map((function(t){if(!t.selected)return t.text;var e=ut(t.text).length,n=new Array(e).fill("_").join("");return lt(t.text,n)})).join(" ")}function ft(t){return t.map((function(t){var e;return t.selected?null===(e=lt(t.text,"{".concat(t.order,"}")))||void 0===e?void 0:e.trim():t.text})).join(" ")}var dt=n(1240),pt=n(1232);function mt(t){return(mt="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})(t)}function ht(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ht=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==mt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 vt=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var yt=n(32);function gt(t){var e=o.a.useRef(null);function n(){t.onChange(Object.assign(Object.assign({},t.answer),{isCorrect:!t.answer.isCorrect}))}return o.a.createElement("li",{className:"p-1 my-1 w-100 bg-white d-flex align-items-center border rounded"},o.a.createElement("div",{className:"custom-control ".concat(t.isTrueOrFalse?"custom-radio":"custom-checkbox"),onKeyDown:function(t){return"Enter"===t.key&&n()}},o.a.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.a.createElement("label",{ref:e,htmlFor:"multiple-choice--".concat(t.answer.order),className:"cursor-pointer custom-control-label"})),t.isTrueOrFalse?o.a.createElement("label",{className:"mb-0",htmlFor:"multiple-choice--".concat(t.answer.order)},t.answer.name):o.a.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"}))}n(1359);function bt(t){return(bt="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})(t)}function wt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */wt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==bt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Et=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};function xt(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 It(t,e){var n;return Et(this,void 0,void 0,wt().mark((function r(){return wt().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,Q.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})))}function St(t){var e=t.state,n=void 0===e?function(t){var e,n=t.typeId===tt.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,a=t.interaction,i=t.optionsPortalNode,c=t.showFeedback,u=a.typeId===tt.InteractionTypeId.TrueOrFalse;function l(t){var e=n.answers.map((function(e){return e.order!==t.order?Object.assign(Object.assign({},e),{isCorrect:!u&&e.isCorrect}):t}));if(e.find((function(t){return!t.name}))&&(e=function(t){var e=t.find((function(t){return!t.name}));if(t.length>2)return t.filter((function(t){return t.order!==e.order})).map((function(t,e){return Object.assign(Object.assign({},t),{order:e})}));return t.map((function(t){return t.order!==e.order?t:Object.assign(Object.assign({},t),{isCorrect:!1})}))}(e)),!u&&e.length<4&&!e.find((function(t){return!t.name}))){var o=yt.a.last(e);e.push({name:"",order:o.order+1,isCorrect:!1})}r(Object.assign(Object.assign({},n),{answers:e}))}return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"multiple-choice-question"},"Question"),o.a.createElement(et.b,{node:i})),o.a.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.a.createElement(nt,{error:n.error})),o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"multiple-choice-answer"},"Answers"),n.answers.map((function(t){return o.a.createElement(gt,{key:t.order,answer:t,onChange:l,isTrueOrFalse:u})})),n.question&&o.a.createElement(nt,{error:n.error})),c&&u&&o.a.createElement("div",{className:"form-group mb-0"},o.a.createElement("label",{className:"cv-true-or-false-feedback-label cv-interaction-field-label",htmlFor:"true-or-false-feedback"},"Feedback ",o.a.createElement("span",{className:"text-muted"},"(optional)")," ",o.a.createElement(pt.a,{tooltipText:"Provide answer feedback for your students"})),o.a.createElement(dt.a,{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 kt=n(413),Ot=n(30),Ct=n(421);function Nt(){return o.a.createElement("svg",{viewBox:"0 0 43 38",className:"cv-upload-image-icon"},o.a.createElement("g",{transform:"translate(-1193.000000, -185.000000)"},o.a.createElement("g",{transform:"translate(1183.000000, 173.000000)"},o.a.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 jt(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Lt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lt(t,e)}(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 Lt(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 Tt(t){var e=jt(o.a.useState(!1),2),n=e[0],r=e[1],a=jt(o.a.useState(0),2),i=a[0],c=a[1];return o.a.useEffect((function(){0===i&&n&&r(!1)}),[i,n,r]),o.a.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),i>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)}n(1360);function At(t){return(At="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})(t)}function Pt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==At(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var Ft=n(1312),Rt=n(1532),Mt=n(1539),Ut={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.a.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 Dt(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Gt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gt(t,e)}(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 Gt(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 qt(t){var e=Dt(o.a.useState(""),2),n=e[0],r=e[1],a=Dt(o.a.useState(""),2),i=a[0],c=a[1];return o.a.createElement("div",{"aria-haspopup":"true","aria-expanded":t.expanded,"aria-label":"rdw-color-picker"},o.a.createElement("div",{className:"rdw-option-wrapper cv-annotation-toolbar-option cv-annotation-link",onClick:t.onExpandEvent}," "),t.expanded&&o.a.createElement("div",{className:"rdw-link-modal",onClick:function(t){return t.stopPropagation()}},o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-url"},"URL"),o.a.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.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-text"},"Text"),o.a.createElement("input",{id:"cv-annotation-text",className:"form-control",onChange:function(t){return c(t.target.value)},value:i,placeholder:"Enter Text",autoComplete:"off"})),o.a.createElement(rt.a,{onClick:function(){return t.onChange("link",i||n,n,"_blank")},className:"btn btn-dark"},"Add")))}n(1365);function Bt(t){return(Bt="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})(t)}function Wt(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return zt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(t,e)}(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 zt(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 Yt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Yt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Bt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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,Ht,Vt,Kt=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};function Zt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jt=(Zt($t={},tt.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,a=t.interaction,i=t.optionsPortalNode,c=Wt(o.a.useState(function(){var t=a.data.annotation;if(t){var e=Object(Mt.a)(Ut)(t);return Ft.EditorState.createWithContent(e)}return Ft.EditorState.createEmpty()}()),2),u=c[0],l=c[1],s=Wt(o.a.useState(null),2),f=s[0],d=s[1];return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",onClick:function(){return null==f?void 0:f.focusEditor()}},"Annotation"),o.a.createElement(et.b,{node:i})),o.a.createElement("div",{className:"cv-annotation ".concat(function(){if(!u)return!1;var t=u.getCurrentContent();return t.hasText()||"unstyled"!==t.getBlockMap().first().getType()}()?"Editor--hide-placeholder":"")},u&&o.a.createElement(Rt.Editor,{editorState:u,onEditorStateChange:function(t){l(t);var e=t.getCurrentContent();if(e.hasText()){var o=Object(Mt.b)(Ut)(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:qt,options:["link"]}}}),o.a.createElement(nt,{error:n.error}))))})),Zt($t,tt.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,a=t.interaction,i=t.optionsPortalNode;Object(Ct.a)();var c=o.a.useRef(null);function u(t){t&&t[0]&&kt.a.onFileSelect(Ot.c.None,t,(function(t){X.a.renderCropper({src:t.src,alt:"",onClickCrop:l})}))}function l(e){var o=e.split(",")[1];G.a.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.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0"},"Image"),o.a.createElement(et.b,{node:i})),n.url?o.a.createElement("div",{className:"text-center"},o.a.createElement("div",{className:"cv-uploaded-image-container"},o.a.createElement("img",{className:"img img-fluid",src:n.url,alt:n.caption}),o.a.createElement(rt.a,{className:"cv-remove-uploaded-image d-flex justify-content-center align-items-center",onClick:function(){r(Object.assign(Object.assign({},n),{url:""}))}},o.a.createElement("div",{className:"btn btn-link text-light"},"Remove")))):o.a.createElement(Tt,{onDropImage:u},o.a.createElement("div",{className:"cv-image-interaction-upload-container rounded py-4 text-center"},o.a.createElement("div",{className:"svg-container xlg mb-2"},o.a.createElement(Nt,null)),o.a.createElement("p",{className:"mb-0"},"Drag and drop an image file or"),o.a.createElement(rt.a,{type:"button",className:"text-underline d-inline-block",onClick:function(){c.current.value=null,c.current.click(null)}},"upload from your device"),o.a.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 u(t.target.files)}}))),o.a.createElement(nt,{error:n.error})),o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"image-caption"},"Caption ",o.a.createElement("span",{className:"text-muted"},"(optional)")),o.a.createElement("textarea",{id:"image-caption",className:"form-control",placeholder:"Caption your image",value:n.caption||a.data.caption||"",onChange:function(t){r(Object.assign(Object.assign({},n),{caption:t.target.value}))},rows:2})))})),Zt($t,tt.InteractionTypeId.MissingWord,(function(t){var e,n,r,a,i,c,u=t.state,l=void 0===u?(e=t.interaction,a=(null===(n=e.data)||void 0===n?void 0:n.sentence)||"",i=a.split(" ").filter(Boolean),c=i.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=lt(i[e],t.name);i[e]=n,c[e].text=n,c[e].selected=!0})),{fullSentence:i.join(" "),sentence:a,preview:e.name,words:c}):u,s=t.setState,f=t.optionsPortalNode,d=!!l.sentence;return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"missing-word-sentence"},"Sentence"),o.a.createElement(et.b,{node:f})),o.a.createElement("input",{id:"missing-word-sentence",className:"form-control",placeholder:"Enter your sentence here",value:l.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({},l),{fullSentence:e,sentence:ft(n),preview:st(n),words:n}))},autoComplete:"off"})),d&&o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label"},"Select the missing word(s)"),o.a.createElement("ul",{className:"list-unstyled d-flex flex-wrap mx-n1 mb-n1"},l.words.map((function(t,e){var n;return(null===(n=ut(t.text))||void 0===n?void 0:n.trim())?o.a.createElement("li",{key:"".concat(e,"-").concat(t.text)},o.a.createElement(rt.a,{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=l.words.map((function(e){return e.order!==t?e:Object.assign(Object.assign({},e),{selected:!e.selected})})),void s(Object.assign(Object.assign({},l),{words:n,preview:st(n),sentence:ft(n)}));var t,n}},ut(t.text))):o.a.createElement(o.a.Fragment,{key:"".concat(e,"-").concat(t.text)})})))),o.a.createElement("div",null,o.a.createElement("label",{className:"cv-interaction-field-label"},"Preview"),o.a.createElement("p",null,l.preview))),o.a.createElement(nt,{error:l.error}))})),Zt($t,tt.InteractionTypeId.MultipleChoice,St),Zt($t,tt.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,a=t.interaction,i=t.optionsPortalNode,c=t.showFeedback;return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"form-group"},o.a.createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"short-answer-question"},"Question"),o.a.createElement(et.b,{node:i})),o.a.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||a.data.text||"",placeholder:"Enter your question here",autoComplete:"off"}),o.a.createElement(nt,{error:n.error})),c&&o.a.createElement("div",{className:"form-group"},o.a.createElement("label",{className:"cv-interaction-field-label",htmlFor:"short-answer-suggested-response"},"Suggested Response ",o.a.createElement("span",{className:"text-muted"},"(optional)")," ",o.a.createElement(pt.a,{tooltipText:"Provide a suggested response for your students"})),o.a.createElement(dt.a,{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"})))})),Zt($t,tt.InteractionTypeId.TrueOrFalse,St),$t);var Qt=(Zt(Ht={},tt.InteractionTypeId.Annotation,(function(t){var e;return(null===(e=t.annotation)||void 0===e?void 0:e.trim())?null:"Please provide an annotation"})),Zt(Ht,tt.InteractionTypeId.Image,(function(t){return t.url?null:"Please upload an image"})),Zt(Ht,tt.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"})),Zt(Ht,tt.InteractionTypeId.MultipleChoice,xt),Zt(Ht,tt.InteractionTypeId.ShortAnswer,(function(t){var e;return(null===(e=t.question)||void 0===e?void 0:e.trim())?null:"Please provide a question"})),Zt(Ht,tt.InteractionTypeId.TrueOrFalse,xt),Ht);var Xt=(Zt(Vt={},tt.InteractionTypeId.Annotation,(function(t,e){var n;return Kt(this,void 0,void 0,Yt().mark((function r(){return Yt().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,Q.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})))})),Zt(Vt,tt.InteractionTypeId.Image,(function(t,e){var n,r;return _t(this,void 0,void 0,Pt().mark((function o(){return Pt().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,Q.saveInteraction(e);case 6:case"end":return o.stop()}}),o)})))})),Zt(Vt,tt.InteractionTypeId.MissingWord,(function(t,e){return it(this,void 0,void 0,at().mark((function n(){var r;return at().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.data.sentence=ft(t.words),e.name=t.preview,r=t.words.filter((function(t){return t.selected})),e.actionableItems=r.map((function(t){return{name:ut(t.text),order:t.order,isCorrect:!0}})),n.next=6,Q.saveInteraction(e);case 6:case"end":return n.stop()}}),n)})))})),Zt(Vt,tt.InteractionTypeId.MultipleChoice,It),Zt(Vt,tt.InteractionTypeId.ShortAnswer,(function(t,e){var n,r;return vt(this,void 0,void 0,ht().mark((function o(){return ht().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,Q.saveInteraction(e);case 5:case"end":return o.stop()}}),o)})))})),Zt(Vt,tt.InteractionTypeId.TrueOrFalse,It),Vt);function te(t){return Xt[t]}var ee=n(1195),ne=n(1),re=["A","B","C","D"];function oe(t){if(!t.enableImmersiveReader)return o.a.createElement(o.a.Fragment,null);var e=t.interaction,n=t.className,r=s.a.getTypeInfo(e.typeId),a=r.name,i=r.typeName,c="";switch(e.typeId){case tt.InteractionTypeId.Annotation:c=e.data.annotation;break;case tt.InteractionTypeId.Image:c=e.data.caption;break;case tt.InteractionTypeId.MissingWord:c=e.data.sentence.replace(/{([^{}]*)}/g,(function(){return"<u> </u>"}));break;case tt.InteractionTypeId.MultipleChoice:c=e.name,e.actionableItems.map((function(t,e){return c+="<br />".concat(re[e],": ").concat(t.name)}));break;case tt.InteractionTypeId.ShortAnswer:c=e.name;break;case tt.InteractionTypeId.TrueOrFalse:c="True or false: ".concat(e.name)}var u=e.typeId===tt.InteractionTypeId.Annotation||e.typeId===tt.InteractionTypeId.MissingWord||e.typeId===tt.InteractionTypeId.MultipleChoice;return o.a.createElement(ee.a,{title:a,text:c,html:u,className:"pr-2 ".concat(n||""),analyticsData:{id:e.interactiveId,type:i},analyticsOptions:{location:ne.LocationContext.InteractivePlayer,entity:ne.EntityType.Interactive,actionType:ne.UserAction.Click,descriptor:ne.ClickDescriptor.LaunchImmersiveReader}})}n(1366);function ae(t){var e=t.error;return t.error?o.a.createElement("p",{className:"mt-2 small text-danger"},e):o.a.createElement(o.a.Fragment,null)}var ie,ce,ue=n(1143);function le(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function se(){return ue.a.NotApplicable}function fe(t,e){var n=t.actionableItems.filter((function(t){return t.isCorrect}));return n.every((function(t){return!e(t.id)}))?ue.a.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())}))?ue.a.Correct:ue.a.Incorrect}function de(t,e){return t.actionableItems.every((function(t){return!e(t.id)}))?ue.a.UnAnswered:t.actionableItems.filter((function(t){return t.isCorrect})).every((function(t){return e(t.id)===t.name}))?ue.a.Correct:ue.a.Incorrect}function pe(t,e){var n;return t.actionableItems.forEach((function(t){var r=e(t.id);n=r?r.status!==ie.Correct?r.status!==ie.Incorrect?ue.a.AwaitingMarking:ue.a.Incorrect:ue.a.Correct:ue.a.UnAnswered})),n}function me(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 he(t,e){var n=me(t,e);return de(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"}(ie||(ie={}));var ve=(le(ce={},tt.InteractionTypeId.Annotation,se),le(ce,tt.InteractionTypeId.Image,se),le(ce,tt.InteractionTypeId.MissingWord,(function(t,e){var n=me(t,e);return fe(t,(function(t){var e=n(t);return null==e?void 0:e.text}))})),le(ce,tt.InteractionTypeId.MultipleChoice,he),le(ce,tt.InteractionTypeId.ShortAnswer,(function(t,e){return pe(t,me(t,e))})),le(ce,tt.InteractionTypeId.TrueOrFalse,he),ce);var ye={notApplicable:se,awaitingMarking:function(){return ue.a.AwaitingMarking},isMissingWordCorrect:fe,isMultipleChoiceCorrect:de,isShortAnswerMarkedCorrect:pe,isInteractionCorrect:function(t,e){return(0,ve[t.typeId])(t,e)}};n(1367);function ge(t){return(ge="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})(t)}var 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};var we=n(276),Ee=n(63),xe=n(20),Ie=n(389),Se=n(1368),ke=n.n(Se),Oe=["A","B","C","D"];function Ce(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.a.createElement(o.a.Fragment,null,t.interaction.actionableItems.map((function(r,a){var i=t.getSelectedAnswer(r.id);if(t.onlyShowSelectedAnswer&&!i)return o.a.createElement(o.a.Fragment,{key:a});var c=i?"bg-info text-white":t.unCheckedBackground,u=function(){return o.a.createElement(o.a.Fragment,null,Oe[a])};t.showFeedback&&(c=r.isCorrect?"bg-success text-white":"bg-danger text-white ".concat(ke.a.incorrect),t.hideFeedbackIcons||(u=function(){return o.a.createElement(o.a.Fragment,null,r.isCorrect?o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Check}):o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Close}))}));var l=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&n(r,!i)}};return o.a.createElement(o.a.Fragment,{key:a},o.a.createElement("input",{id:r.id,type:e?"radio":"checkbox",name:"multiple-choice",checked:!!i,onChange:function(){return n(r,!i)},disabled:t.showFeedback,hidden:!0,tabIndex:-1}),o.a.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(ke.a.answer,"\n ").concat(c),key:a,htmlFor:r.id},l),o.a.createElement("span",{className:"d-inline-block mr-3 cv-multiple-choice-bullet"},o.a.createElement(u,null)),o.a.createElement("span",{className:"flex-grow-1 pr-4"},r.name),!t.onlyShowSelectedAnswer&&o.a.createElement("span",{className:ke.a.avatarContainer},i&&o.a.createElement(Ie.a,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar}))))})))}Ce.defaultProps={size:"lg",unCheckedBackground:"bg-white"};n(1369);function Ne(t){return(Ne="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})(t)}function je(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Le=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};var Te=n(1370),Ae=n.n(Te);function Pe(t){function e(e){t.onSelectAnswer&&t.onSelectAnswer(e)}return o.a.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 a=t.getSelectedAnswer(n.id),i=a?"bg-info text-white":t.unCheckedBackground,c=function(){return o.a.createElement(o.a.Fragment,null)};t.showFeedback&&(i=n.isCorrect?"bg-success text-white":"bg-danger text-white ".concat(Ae.a.incorrect),t.hideFeedbackIcons||(c=function(){return o.a.createElement(o.a.Fragment,null,n.isCorrect?o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Check}):o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Close}))}));var u=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&e(n)}};return o.a.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(i)},u),o.a.createElement("input",{id:n.id,type:"radio",name:"multiple-choice",checked:!!a,onChange:function(){return e(n)},disabled:t.showFeedback,hidden:!0}),n.name,o.a.createElement("span",{className:"position-absolute p-2 ".concat(Ae.a.feedback)},o.a.createElement(c,null)),o.a.createElement("span",{className:"".concat(Ae.a.avatarContainer).concat("sm"===t.size?" ".concat(Ae.a.avatarContainerSmall):"")},a&&o.a.createElement(Ie.a,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar})))})))}Pe.defaultProps={size:"lg",unCheckedBackground:"bg-white"};var _e,Fe,Re,Me,Ue;function De(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ge=function(){return!0},qe=function(){return!1},Be=(De(_e={},tt.InteractionTypeId.Annotation,qe),De(_e,tt.InteractionTypeId.Image,qe),De(_e,tt.InteractionTypeId.MissingWord,Ge),De(_e,tt.InteractionTypeId.MultipleChoice,Ge),De(_e,tt.InteractionTypeId.ShortAnswer,(function(t){return!!t.data.suggestedResponse})),De(_e,tt.InteractionTypeId.TrueOrFalse,Ge),_e);function We(t){return Be[t]}var ze=(De(Fe={},tt.InteractionTypeId.Annotation,(function(t){var e=t.interaction.data.annotation.replace(/<(a)(.*?)>/g,'<$1 target="_blank" $2>');return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:e}}),o.a.createElement(oe,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),De(Fe,tt.InteractionTypeId.Image,(function(t){var e=t.interaction,n=t.recalculateScroll,r=o.a.useCallback((function(t){t&&(t.onload=function(){n()})}),[]);return o.a.createElement("div",{className:"cv-interactive-question cv-image-interactive"},o.a.createElement("div",{className:"cv-image-container text-center"},o.a.createElement("img",{className:"img-fluid shadow-lg",src:e.data.url,ref:r}),e.data.caption&&o.a.createElement(o.a.Fragment,null,o.a.createElement("p",{className:"mt-3"},e.data.caption,o.a.createElement(oe,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})))))})),De(Fe,tt.InteractionTypeId.MissingWord,(function(t){var e=t.state,n=t.setState,r=t.interaction,a=t.showFeedback,i=r.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat("cv-missing-word-").concat(e,"}")})).split(/{([^{}]*)}/g);function c(t,r){if(r.stopPropagation(),r.target.value){var o,a,i;n((o={},a=t.id,i=r.target.value,a in o?Object.defineProperty(o,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[a]=i,o))}else{var c=e,u=t.id,l=(c[u],be(c,["symbol"===ge(u)?u:u+""]));n(l,!0)}}return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("div",{className:"mb-2"},i.map((function(t,n){var i;if(!t.startsWith("cv-missing-word-"))return t;var u=t.replace("cv-missing-word-",""),l=r.actionableItems.find((function(t){return t.order.toString()===u}));if(l){var s,f,d=e[l.id]||"",p=(s=l.name,(f=document.createElement("canvas").getContext("2d")).font="17pt arial",f.measureText(s).width);if(a){var m=l.name.toLowerCase().toString()===(null===(i=e[l.id])||void 0===i?void 0:i.toLowerCase().toString());return o.a.createElement(o.a.Fragment,{key:n},!m&&o.a.createElement(o.a.Fragment,null,o.a.createElement("del",{className:"text-danger"},d)," "),o.a.createElement("span",{className:"text-success"},l.name))}return o.a.createElement("span",{className:"cv-missing-word-input-container",key:n},o.a.createElement("input",{style:{width:p/16+"rem"},onChange:function(t){return c(l,t)},value:d,disabled:!!e.submitted,className:"cv-missing-word-input",autoComplete:"off"}))}}))),o.a.createElement(ae,{error:e.error}),o.a.createElement(oe,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),De(Fe,tt.InteractionTypeId.MultipleChoice,(function(t){var e=t.state,n=t.setState,r=t.interaction,a=t.showFeedback,i=t.imageApi,c=t.currentUser,u=1===r.actionableItems.filter((function(t){return t.isCorrect})).length;return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,r.name,o.a.createElement(oe,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),!u&&o.a.createElement("p",{className:"text-muted"},o.a.createElement("small",null,"This question has multiple correct answers")),o.a.createElement(Ce,{interaction:r,showFeedback:a,onSelectAnswer:function(t,r){if(!e.submitted)if(u)n(je({},t.id,t.name),!0);else if(r)n(je({},t.id,t.name));else{var o=e,a=t.id,i=(o[a],Le(o,["symbol"===Ne(a)?a:a+""]));n(i,!0)}},getSelectedAnswer:function(t){return e[t]},imageApi:i.toString(),userInitials:we.a.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),o.a.createElement(ae,{error:e.error}))})),De(Fe,tt.InteractionTypeId.ShortAnswer,(function(t){var e=t.interaction,n=t.state,r=t.setState;return t.showFeedback?o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,e.name),o.a.createElement("label",{className:"cv-interaction-field-label"},"My answer"),o.a.createElement("p",null,n[e.actionableItems[0].id]),e.data.suggestedResponse&&o.a.createElement(o.a.Fragment,null,o.a.createElement("label",{className:"cv-interaction-field-label mt-1"},"Teacher's suggested answer"),o.a.createElement("p",null,e.data.suggestedResponse))):o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,e.name,o.a.createElement(oe,{interaction:e,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o.a.createElement(dt.a,{id:"short-answer-answer",className:"form-control mt-2",minRows:3,value:n[e.actionableItems[0].id]||"",onChange:function(t){var o,a,i;r(Object.assign(Object.assign({},n),(o={},a=e.actionableItems[0].id,i=t.target.value,a in o?Object.defineProperty(o,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[a]=i,o)))},disabled:!!n.submitted}),o.a.createElement(ae,{error:n.error}))})),De(Fe,tt.InteractionTypeId.TrueOrFalse,(function(t){var e=t.state,n=t.setState,r=t.interaction,a=t.showFeedback,i=t.imageApi,c=t.currentUser,u=r.actionableItems.find((function(t){return t.isCorrect}));return o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("p",null,r.name,o.a.createElement(oe,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o.a.createElement(Pe,{className:"justify-content-center",interaction:r,showFeedback:a,onSelectAnswer:function(t){var r,o,a;e.submitted||n((r={},o=t.id,a=t.name,o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a,r),!0)},getSelectedAnswer:function(t){return e[t]},imageApi:i.toString(),userInitials:we.a.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),a&&o.a.createElement("div",{className:"text-center px-5 mt-3"},o.a.createElement("p",null,"The answer is ",o.a.createElement("strong",null,u.name)),r.data.feedback&&o.a.createElement("p",null,r.data.feedback)),o.a.createElement(ae,{error:e.error}))})),Fe);function Ye(){return""}var $e=(De(Re={},tt.InteractionTypeId.Annotation,Ye),De(Re,tt.InteractionTypeId.Image,Ye),De(Re,tt.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"})),De(Re,tt.InteractionTypeId.MultipleChoice,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),De(Re,tt.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"})),De(Re,tt.InteractionTypeId.TrueOrFalse,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),Re);var He=(De(Me={},tt.InteractionTypeId.Annotation,null),De(Me,tt.InteractionTypeId.Image,null),De(Me,tt.InteractionTypeId.MissingWord,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),De(Me,tt.InteractionTypeId.MultipleChoice,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),De(Me,tt.InteractionTypeId.ShortAnswer,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),De(Me,tt.InteractionTypeId.TrueOrFalse,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),Me);function Ve(t){return He[t]}var Ke=(De(Ue={},tt.InteractionTypeId.Annotation,ye.notApplicable),De(Ue,tt.InteractionTypeId.Image,ye.notApplicable),De(Ue,tt.InteractionTypeId.MissingWord,(function(t,e){return ye.isMissingWordCorrect(e,(function(e){return t[e]}))})),De(Ue,tt.InteractionTypeId.MultipleChoice,(function(t,e){return ye.isMultipleChoiceCorrect(e,(function(e){return t[e]}))})),De(Ue,tt.InteractionTypeId.ShortAnswer,ye.awaitingMarking),De(Ue,tt.InteractionTypeId.TrueOrFalse,(function(t,e){return e.actionableItems.filter((function(t){return t.isCorrect})).every((function(e){return t[e.id]===e.name}))?ue.a.Correct:ue.a.Incorrect})),Ue);function Ze(t){return Ke[t]}function Je(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qe={interactions:{},timepoints:{}};function Xe(t,e){return"interaction"===e.type?{timepoints:t.timepoints,interactions:Object.assign(Object.assign({},t.interactions),Je({},e.id,e.value))}:"timepoint"===e.type?{interactions:t.interactions,timepoints:Object.assign(Object.assign({},t.timepoints),Je({},e.id,e.value))}:void 0}function tn(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return en(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return en(t,e)}(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 en(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 nn={interactionIndex:0},rn=function(t){var e=t.mode,n=t.timepoint,r=t.latestSession,a=e===l.InteractiveMode.Create,i=tn(o.a.useReducer(Xe,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]),(Je(n={},e.actionableItemId,e.data),Je(n,"submitted",!0),n)),t}),{})}:Qe}(r)})),2),c=i[0],u=i[1],s=h(null==n?void 0:n.id),f=null==n?void 0:n.interactions[s.interactionIndex],d="number"==typeof s.nextInteractionIndex?null==n?void 0:n.interactions[s.nextInteractionIndex]:null,p=v(null==f?void 0:f.id),m=v(null==d?void 0:d.id);function h(t){return t&&c.timepoints[t]||nn}function v(t){if(!t)return{};var e=c.interactions[t];return e||a?e:{}}function y(t,e,n){var r=v(t);u({type:"interaction",id:t,value:Object.assign(Object.assign({},n?{}:r),e)})}return{state:c,interaction:f,interactionState:p,timepointState:s,nextInteraction:d,nextInteractionState:m,getTimepointState:h,getInteractionState:v,updateTimepointState:function(t,e){var n=h(t);u({type:"timepoint",id:t,value:Object.assign(Object.assign({},n),e)})},updateInteractionState:y,clearTimepointState:function(t){u({type:"timepoint",id:t,value:void 0})},clearInteractionState:function(t){u({type:"interaction",id:t,value:void 0})},userUpdateInteractionState:function(t,e){y(f.id,Object.assign(Object.assign({},t),{hasChanges:!0,error:null}),e)}}};function on(t){return(on="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})(t)}function an(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */an=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==on(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 cn=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},un=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},ln=!1,sn=function(t){var e=t.interactive,n=t.timepoint,r=t.player,a=t.mode,i=t.resultsService,c=t.latestSession,u=t.analyticsService,f=un(t,["interactive","timepoint","player","mode","resultsService","latestSession","analyticsService"]),d=rn({mode:a,timepoint:n,latestSession:c}),p=d.state,m=d.interaction,h=d.interactionState,v=d.timepointState,y=d.nextInteraction,g=d.nextInteractionState,b=un(d,["state","interaction","interactionState","timepointState","nextInteraction","nextInteractionState"]),w=a===l.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 a=r.interactions[o];if(a.id===t)return{localTimepoint:r,localInteraction:a};o++}n++}return{localInteraction:null,localTimepoint:null}}function x(t){var n=s.a.getTypeInfo(t.typeId);return{id:U(t.id)?void 0:t.id,typeId:t.typeId,type:n.typeName,interactiveId:e.id,timepointId:U(t.timepointId)?void 0:t.timepointId,order:t.order}}function I(t){return cn(this,void 0,void 0,an().mark((function n(){var r,o,a,i,c,l,s;return an().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=E(t),o=r.localInteraction,a=r.localTimepoint,o&&a){n.next=3;break}throw new Error("Could not find the interaction and timepoint for the interactionId ".concat(t));case 3:if(i=x(o),U(o.id)){n.next=10;break}return n.next=7,Q.deleteInteraction(o.id);case 7:u.logUserAction(i,{actionType:ne.UserAction.Delete,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Complete}),n.next=11;break;case 10:u.logUserAction(i,{actionType:ne.UserAction.Create,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Discard});case 11:if(c=a.interactions.findIndex((function(t){return t.id===o.id})),a.interactions.splice(c,1),b.clearInteractionState(o.id),l=b.getTimepointState(a.id),c<l.interactionIndex&&b.updateTimepointState(a.id,{interactionIndex:l.interactionIndex-1}),!(a.interactions.length>0)){n.next=18;break}return n.abrupt("return");case 18:if(U(a.id)){n.next=21;break}return n.next=21,Q.deleteTimepoint(a.id);case 21:s=e.timepoints.findIndex((function(t){return t.id===a.id})),e.timepoints.splice(s,1),f.removeCue(a.visibleAt/1e3),b.clearTimepointState(a.id);case 25:case"end":return n.stop()}}),n)})))}function S(t){if(m){var e=U(m.id);if(e||(null==h?void 0:h.hasChanges)||(null==v?void 0:v.hasChanges)){X.a.render(o.a.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"}]})}else 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}),ln=!1)}return{state:p,interaction:m,interactionState:h,timepointState:v,nextInteraction:y,nextInteractionState:g,skip:O,cancel:function(){return cn(this,void 0,void 0,an().mark((function t(){return an().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),a=o.interactions.find((function(t){return t.id.toString()===n.toString()}));r.currentTime(o.visibleAt/1e3),b.updateTimepointState(o.id,{interactionIndex:o.interactions.indexOf(a)})},discardChanges:S,changeIndex:k,promptDelete:function(t){var e=x(E(t).localInteraction);u.logUserAction(e,{actionType:ne.UserAction.Delete,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Start}),X.a.render(o.a.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 cn(this,void 0,void 0,an().mark((function t(){var e,r,o,a,i,c;return an().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(l=m.typeId,!(e=(0,Qt[l])(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}),!U(n.id)){t.next=15;break}return r=n.id,t.next=12,Q.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,a=te(m.typeId),t.next=20,a(b.getInteractionState(m.id),m);case 20:b.clearInteractionState(o),i=U(o),c=x(m),u.logUserAction(c,{actionType:i?ne.UserAction.Create:ne.UserAction.Edit,entity:ne.EntityType.Interaction,workflowPhase:i?ne.WorkflowPhase.Complete:ne.WorkflowPhase.Save});case 24:case"end":return t.stop()}var l}),t)})))},addInteraction:function(t){var o;r.pause();var a=(null==n?void 0:n.id)||"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),i={id:"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),timepointId:a,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(i);if(u.logUserAction(c,{actionType:ne.UserAction.Create,entity:ne.EntityType.Interaction,workflowPhase:ne.WorkflowPhase.Start}),n)return n.interactions.push(i),void k(v.interactionIndex);var l=r.currentTime();e.timepoints||(e.timepoints=[]),e.timepoints.push({id:a,visibleAt:1e3*l,interactiveId:e.id,shouldPause:1,interactions:[i]}),C(),f.addCue(a)},submitInteractionAnswer:function(){return cn(this,void 0,void 0,an().mark((function t(){var r,o,c,s,d;return an().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a===l.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=D(h),p=m.typeId,!(o=(0,$e[p])(r,m))){t.next=14;break}return b.updateInteractionState(m.id,{error:o}),t.abrupt("return");case 14:if(!i||!h.hasChanges){t.next=22;break}if(c=Ve(m.typeId),b.updateInteractionState(m.id,{spinner:!0}),!c){t.next=22;break}return t.next=20,c(r,m,i.save);case 20:s=x(m),u.logUserAction(s,{actionType:ne.UserAction.Answer,entity:ne.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:d=We(m.typeId),d(m)||O();case 29:case"end":return t.stop()}var p}),t)})))},userUpdateInteractionState:b.userUpdateInteractionState,updateTimepointTime:function(t){var o=r.duration(),a=function(t){for(var r=n.visibleAt+1e3*t,o=t>0,a=0;a<e.timepoints.length;a++){var i=e.timepoints[a];r<i.visibleAt-1e3||r>i.visibleAt+1e3||(r=o?i.visibleAt+1001:i.visibleAt-1001,a=0)}return r}(t);if(!(a/1e3>o||a<0)){var i=n.visibleAt;ln||(ln=!0,b.updateTimepointState(n.id,{originalVisibleAt:i,hasChanges:!0})),f.moveTimepoint(a)}},saveTimepoint:function(){return cn(this,void 0,void 0,an().mark((function t(){return an().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!U(n.id)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,Q.updateTimepoint(n);case 4:C(),j();case 6:case"end":return t.stop()}}),t)})))},clearTimepointTimeState:j,reOrderQuestions:function(t){return cn(this,void 0,void 0,an().mark((function e(){var r,o;return an().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,Q.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)})))}}},fn=n(1371),dn=n.n(fn);function pn(t){var e="".concat(t.className," ").concat(dn.a.iconButton);t.children?e+=" ".concat(dn.a.iconWithText):e+=" ".concat(dn.a.iconOnly);var n=o.a.createElement(Ee.a,{svgName:t.svgName,className:dn.a.svg});return o.a.createElement(rt.a,{className:e,onClick:t.onClick},n,t.children)}function mn(t){var e=t.isCreate,n=t.open,r=t.showTypeSelector;return!e||n?o.a.createElement(o.a.Fragment,null):o.a.createElement(pn,{className:"btn btn-outline-dark cv-add-question",onClick:r,svgName:xe.b.Plus},"Add question")}var hn=n(1289),vn=n(409),yn=n(1214);function gn(t){return o.a.createElement("div",{className:"my-5 text-center"},o.a.createElement("h2",{className:"h3"},"Select an interaction to get started"),o.a.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.a.createElement("a",{href:vn.a.getArticle(t.supportSiteUrl.toString(),yn.a.MakeInteractive,t.currentUser.countryCode,"articles"),target:"_blank",className:"btn btn-link text-info"},"How do I make interactives?"))}function bn(t){var e=t.isCreate,n=t.interactive,r=t.interaction,a=t.portalNode,i=t.goToTimepoint,c=t.promptDelete,u=t.supportSiteUrl,l=t.currentUser;if(!a)return o.a.createElement(o.a.Fragment,null);var s=n.timepoints.reduce((function(t,e){return t+e.interactions.length}),0);return o.a.createElement(et.a,{node:a},s?o.a.createElement(o.a.Fragment,null,o.a.createElement("h2",{className:"h4 mt-3"},"Question List (",s,")"),o.a.createElement(hn.a,{interactive:n,maxHeight:300,goToTimepoint:i,selectedInteractionId:null==r?void 0:r.id,onClickDelete:e?c:void 0})):e?o.a.createElement(gn,{currentUser:l,supportSiteUrl:u}):o.a.createElement(o.a.Fragment,null))}var wn=n(1554);function En(t,e){if(e===l.InteractiveMode.Create)return function(t){return Jt[t]}(t);if(e===l.InteractiveMode.View)return function(t){return ze[t]}(t);throw new Error("Cannot find components for the mode ".concat(e))}var xn=n(289);n(1372);function In(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Sn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sn(t,e)}(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 Sn(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 kn=[tt.InteractionTypeId.MissingWord,tt.InteractionTypeId.MultipleChoice,tt.InteractionTypeId.TrueOrFalse,tt.InteractionTypeId.ShortAnswer,tt.InteractionTypeId.Image,tt.InteractionTypeId.Annotation];function On(t){var e=t.addInteraction,n=t.cancelTypeSelector,r=t.player,a=t.timepoint,i=t.open,c=t.isCreate,u=t.interaction,l=In(o.a.useState(Object(xn.a)(r.currentTime()||0)),2),f=l[0],d=l[1];return o.a.useEffect((function(){var t=function(){d(Object(xn.a)(r.currentTime()))};return r.on("timeupdate",t),function(){return r.off("timeupdate",t)}}),[]),u||!c?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"d-flex align-items-center justify-content-center h-100"},o.a.createElement("div",{className:"cv-interactive-type-selector d-flex flex-wrap justify-content-center align-items-center"},o.a.createElement("div",{className:"text-center font-weight-bold w-100 text-body mb-3 cv-add-question-copy"},a?"Add another question at:":"Add a question at:"," ",f),kn.map((function(t,n){var r=s.a.getTypeInfo(t),a=r.name,i=r.bgClassName,c=r.Svg;return o.a.createElement(rt.a,{key:n,className:"cv-type-selector rounded py-2 m-1 ".concat(i),onClick:function(){return e(t)}},o.a.createElement("span",{className:"cv-create-type-icon mb-1"},o.a.createElement(c,null)),o.a.createElement("div",{className:"d-flex align-items-center justify-content-center cv-interaction-type-name px-1"},a))})),(a||i)&&o.a.createElement("div",{className:"text-center w-100 mt-2 ".concat(a?"":"cv-adding-first-cancel")},o.a.createElement(rt.a,{className:"btn btn-link",onClick:n},"Cancel"))))}function Cn(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nn(t,e)}(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 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 jn(t){var e=t.typeId,n=t.currentIndex,r=t.numberOfInteractions,a=t.changeIndex,i=t.player,c=Cn(o.a.useState(Object(xn.a)(i.currentTime()||0)),2),u=c[0],l=c[1];o.a.useEffect((function(){var t=function(){l(Object(xn.a)(i.currentTime()))};return i.on("timeupdate",t),function(){return i.off("timeupdate",t)}}),[]);var f=s.a.getTypeInfo(e),d=f.name,p=f.bgClassName,m=n<r-1;var h=n>0;return o.a.createElement("div",{className:"text-center d-flex justify-content-between align-items-center p-1 ".concat(p)},o.a.createElement(rt.a,{onClick:function(){h&&a(n-1)},className:h?"":"invisible"},o.a.createElement(Ee.a,{size:Ee.b.Medium,svgName:xe.b.ChevronLeft})),o.a.createElement("div",null,o.a.createElement("div",{className:"h6 mb-0"},d),r>1&&o.a.createElement("div",null,n+1," of ",r," at ",u)),o.a.createElement(rt.a,{onClick:function(){m&&a(n+1)},className:m?"":"invisible"},o.a.createElement(Ee.a,{size:Ee.b.Medium,svgName:xe.b.ChevronRight})))}n(1373);function Ln(t){var e=t.typeId,n=s.a.getTypeInfo(e),r=n.name,a=n.prompt,i=n.bgClassName,c=n.Svg;return o.a.createElement("div",{className:"text-center text-body d-flex justify-content-between align-items-center px-3 pt-3"},o.a.createElement("div",{className:"d-flex align-items-center"},o.a.createElement("span",{className:"cv-interaction-icon rounded my-1 text-white ".concat(i)},o.a.createElement(c,null)),o.a.createElement("span",{className:"text-left flex-grow-1"},o.a.createElement("div",{className:"h5 ".concat(a?"":"mb-0")},o.a.createElement("strong",null,r)),a&&o.a.createElement("div",{className:"h6 mb-0"},a))))}function Tn(t){var e=t.isCreate,n=t.interaction,r=t.player,a=t.changeIndex,i=t.timepointState,c=t.timepoint;return e?o.a.createElement(jn,{typeId:n.typeId,changeIndex:a,player:r,currentIndex:i.interactionIndex,numberOfInteractions:c.interactions.length}):o.a.createElement(Ln,{typeId:n.typeId})}var An=n(33);function Pn(t){var e=t.interaction,n=t.interactionState,o=t.onClickContinue,a=t.onClickSave,i=t.onClickCancel,c=t.onClickAddAnother,u=t.onClickDiscard,l=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"},l?r.createElement(rt.a,{className:"btn btn-link",onClick:i},"Cancel"):s?r.createElement(rt.a,{className:"btn btn-link",onClick:u},"Discard"):r.createElement(rt.a,{className:"btn btn-link",onClick:c},"Add another question"),f?r.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):l?s?r.createElement(rt.a,{className:"btn btn-dark ml-2",onClick:a},"Save"):r.createElement(rt.a,{className:"btn btn-dark ml-2 disabled",onClick:function(){}},"Save"):s?r.createElement(rt.a,{className:"btn btn-dark ml-2",onClick:a},"Save"):r.createElement(pn,{className:"btn btn-dark ml-2",onClick:o,svgName:xe.b.Play},"Continue"))}function _n(t){var e=t.typeId,n=t.interactionState,o=t.onClickSkip,a=t.numberOfInteractions,i=t.currentIndex,c=t.changeIndex,u=!!(null==n?void 0:n.submitted),l=!!(null==n?void 0:n.hasChanges),s=!!(null==n?void 0:n.spinner),f=!!Ve(e),d=i<a-1;function p(){d&&c(i+1)}var m=i>0;function h(){l&&t.onClickSubmit()}return r.createElement("div",{className:"cv-timpoint-button-container flex-wrap"},!u&&f&&r.createElement(rt.a,{className:"btn btn-link",onClick:o},"Come back later"),a>1&&i>0&&r.createElement(pn,{className:"btn btn-dark ml-2 ".concat(m?"":"disabled"),onClick:function(){m&&c(i-1)},svgName:xe.b.ChevronUp}),s?r.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):u||!f?1===a||i===a-1?r.createElement(pn,{className:"btn btn-dark ml-2",onClick:o,svgName:xe.b.Play},"Continue"):r.createElement(rt.a,{className:"btn btn-dark ml-2 ".concat(d?"":"disabled"),onClick:p},"Next"):r.createElement(rt.a,{className:"btn btn-dark ml-2 ".concat(l?"":"disabled"),onClick:h},"Save"))}function Fn(t){var e=t.isCreate,n=t.interaction,r=t.interactionState,a=t.continueInteractive,i=t.saveInteraction,c=t.cancel,u=t.addAnotherQuestion,l=t.discardChanges,s=t.submitInteractionAnswer,f=t.skip,d=t.changeIndex,p=t.timepoint,m=t.currentIndex;return o.a.createElement(o.a.Fragment,null,e?o.a.createElement(Pn,{interaction:n,interactionState:r,onClickContinue:a,onClickSave:i,onClickCancel:c,onClickAddAnother:u,onClickDiscard:function(){return l()}}):o.a.createElement(_n,{typeId:n.typeId,interactionState:r,onClickSubmit:s,onClickSkip:f,changeIndex:d,currentIndex:m,numberOfInteractions:p.interactions.length}))}var Rn=n(1113);function Mn(t){var e=t.timepoint,n=t.interaction,r=t.promptDelete,a=t.optionsPortalNode,i=t.setView;if(!n)return o.a.createElement(o.a.Fragment,null);var c=[];if(c.push({label:"Move time point",onClick:function(){return i("move")}}),e.interactions.length>1){var u=U(n.id);c.push({label:"Re-order questions",onClick:function(){return i("reorder")},className:u?"disabled":""})}return c.push({label:"Delete",onClick:function(){return r(n.id)},className:"text-danger"}),o.a.createElement(et.a,{node:a},!!n&&o.a.createElement(Rn.a,{actions:c}))}n(1374),n(1375);function Un(t){return(Un="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})(t)}function Dn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Dn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Un(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Gn(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return qn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(t,e)}(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 qn(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 Bn=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Wn=null,zn=0,Yn=1;function $n(t){var e=t.timepoint,n=t.updateTimepointTime,r=t.saveTimepoint,a=t.back,i=t.clearTimepointTimeState,c=Gn(o.a.useState(Object(xn.a)(e.visibleAt/1e3)),2),u=c[0],l=c[1],s=Gn(o.a.useState(!1),2),f=s[0],d=s[1];function p(t){n(t*Yn),l(Object(xn.a)(e.visibleAt/1e3)),2===++zn?Yn=5:4===zn?Yn=20:6===zn?Yn=60:8===zn&&(Yn=120),Wn||(Wn=window.setInterval((function(){return p(t)}),200),window.addEventListener("mouseup",m))}function m(){window.removeEventListener("mouseup",m),window.clearInterval(Wn),Wn=null,zn=0,Yn=1}return o.a.useEffect((function(){return m}),[]),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"cv-timepoint flex-grow-1"},o.a.createElement("div",{className:"cv-timepoint-padding"},o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0"},"Move time point"),o.a.createElement("div",{className:"text-center mt-3"},o.a.createElement(rt.a,{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===zn&&p(-1)},onKeyUp:m}),o.a.createElement("input",{className:"form-control text-center d-inline-block cv-move-timepoint-input",value:u,onChange:function(){},onKeyDown:function(t){t.stopPropagation(),37===t.keyCode&&0===zn&&p(-1),39===t.keyCode&&0===zn&&p(1)},onKeyUp:m}),o.a.createElement(rt.a,{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===zn&&p(1)},onKeyUp:m}))))),o.a.createElement("div",{className:"cv-timpoint-button-container"},o.a.createElement(rt.a,{className:"btn btn-link",onClick:function(){i(!0),a()}},"Cancel"),f?o.a.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o.a.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o.a.createElement(rt.a,{className:"btn btn-dark",onClick:function(){return Bn(this,void 0,void 0,Dn().mark((function t(){return Dn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.next=3,r();case 3:a();case 4:case"end":return t.stop()}}),t)})))}},"Save")))}var Hn=n(1095),Vn=n(1376),Kn=n.n(Vn),Zn=n(1191);function Jn(t){return(Jn="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})(t)}function Qn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Qn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Jn(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Xn(t){return function(t){if(Array.isArray(t))return nr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||er(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 tr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||er(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 er(t,e){if(t){if("string"==typeof t)return nr(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)?nr(t,e):void 0}}function nr(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 rr=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var or=Object(Hn.SortableElement)((function(t){var e=t.interaction,n=s.a.getTypeInfo(e.typeId).bgClassName;return o.a.createElement("div",{className:"py-2 text-left"},o.a.createElement("span",{className:Kn.a.dragIcon},o.a.createElement(Ee.a,{size:Ee.b.Small,svgName:xe.b.Handle})),o.a.createElement(Zn.a,{interaction:e,iconClassName:"".concat(Kn.a.type," ").concat(n),questionClassName:"".concat(Kn.a.name," clamp-1")}))})),ar=Object(Hn.SortableContainer)((function(t){var e=t.interactions,n=function(){var t=o.a.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.a.createElement("div",Object.assign({tabIndex:0},n),e.map((function(t,e){return o.a.createElement(or,{key:t.id,index:e,interaction:t})})))}));function ir(t){var e=tr(o.a.useState(!1),2),n=e[0],r=e[1],a=tr(o.a.useState(Xn(t.interactions)),2),i=a[0],c=a[1],u=tr(o.a.useState(!1),2),l=u[0],s=u[1];return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"cv-timepoint flex-grow-1"},o.a.createElement("div",{className:"cv-timepoint-padding"},o.a.createElement("div",{className:"cv-interactive-question"},o.a.createElement("label",{className:"cv-interaction-field-label mb-0"},"Re-order questions"),o.a.createElement("div",{className:"text-center mt-3"},o.a.createElement(ar,{onSortEnd:function(t){var e=t.oldIndex,n=t.newIndex;e!==n&&(c(Xn(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}(i,e,n))),s(!0))},interactions:i,helperClass:Kn.a.dragging,lockAxis:"y"}))))),o.a.createElement("div",{className:"cv-timpoint-button-container"},o.a.createElement(rt.a,{className:"btn btn-link",onClick:function(){c(Xn(t.interactions)),s(!1),t.back()}},"Cancel"),n?o.a.createElement(rt.a,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o.a.createElement(An.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o.a.createElement(rt.a,{className:"btn btn-dark ".concat(l?"":"disabled"),onClick:function(){return rr(this,void 0,void 0,Qn().mark((function e(){return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return");case 2:return r(!0),e.next=5,t.reOrderQuestions(i);case 5:r(!1),t.back();case 7:case"end":return e.stop()}}),e)})))}},"Save")))}var cr=n(95),ur=n(44);function lr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(t,e)}(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 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=t.isCreate,n=t.interaction,r=t.mode,a=t.immediateFeedback,i=t.interactionState,c=t.shouldFocus,u=t.delayFocus,l=t.open,s=t.timepoint,f=t.userUpdateInteractionState,d=t.submitInteractionAnswer,p=t.saveInteraction,m=o.a.useRef(),h=o.a.useRef(),v=Object(cr.a)(ur.a.XLDown),y=!e||v;function g(){return!!m.current&&(!!c&&!!l)}function b(){m.current&&(m.current.focus(),x(!0))}var w=lr(o.a.useState(!1),2),E=w[0],x=w[1];o.a.useEffect((function(){g()&&(E||(u&&y?window.setTimeout((function(){g()&&b()}),400):b()))}),[m.current,E]);var I=lr(o.a.useState("question"),2),S=I[0],k=I[1],O=o.a.useMemo((function(){return Object(et.c)()}),[]),C=n?En(n.typeId,r):null,N=a;return e||(N=N&&(null==i?void 0:i.submitted)),o.a.createElement(o.a.Fragment,null,o.a.createElement(Mn,Object.assign({optionsPortalNode:O,setView:k},t)),o.a.createElement(wn.a,{style:{height:"100%"},ref:h},o.a.createElement(On,Object.assign({},t)),!!n&&o.a.createElement("div",{className:"d-flex flex-column h-100"},o.a.createElement(Tn,Object.assign({},t)),"question"===S&&o.a.createElement(o.a.Fragment,null,o.a.createElement("form",{className:"cv-timepoint flex-grow-1",tabIndex:-1,onSubmit:function(t){t.preventDefault(),e?p():d()}},o.a.createElement("div",{className:"cv-timepoint-padding"},o.a.createElement("div",{ref:m,tabIndex:0}),o.a.createElement(C,Object.assign({state:i,setState:f,recalculateScroll:function(){h.current.recalculate()},showFeedback:N,optionsPortalNode:O},t)))),o.a.createElement(Fn,Object.assign({},t))),"move"===S&&o.a.createElement($n,Object.assign({back:function(){return k("question")}},t)),"reorder"===S&&o.a.createElement(ir,Object.assign({back:function(){return k("question")},interactions:s.interactions},t)))))}n(1377);function dr(t){var e=t.open,n=t.nextInteraction,r=t.nextInteractionState,a=t.timepointState,i=t.interaction,c=t.delayFocus,u=n&&a.nextInteractionIndex<a.interactionIndex,l=n&&a.nextInteractionIndex>a.interactionIndex,s=l&&a.slideIn,f=u&&a.slideIn;return o.a.createElement("div",{className:"cv-interactive ".concat(e?"cv-open":"")},u&&o.a.createElement("div",{className:"cv-prev-interaction ".concat(a.slideIn?"cv-slide-in":"")},o.a.createElement(fr,Object.assign({},t,{currentIndex:a.nextInteractionIndex,interaction:n,interactionState:r}))),o.a.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.a.createElement(fr,Object.assign({key:null==i?void 0:i.id},t,{currentIndex:a.interactionIndex,shouldFocus:i&&!u&&!l,delayFocus:c}))),l&&o.a.createElement("div",{className:"cv-next-interaction ".concat(a.slideIn?"cv-slide-in":"")},o.a.createElement(fr,Object.assign({},t,{currentIndex:a.nextInteractionIndex,interaction:n,interactionState:r}))))}n(1378);function pr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return mr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mr(t,e)}(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 mr(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 hr(t){var e=t.player,n=t.resultsService,r=t.interactive,a=t.setShowSummary,i=pr(o.a.useState(!1),2),c=i[0],u=i[1],l=t.player.activePlugins_.activityStatusPlugin,s=t.player.activePlugins_.favouritePlugin;function f(){e.currentTime()>r.timepoints[r.timepoints.length-1].visibleAt/1e3+1?u(!0):u(!1)}if(o.a.useEffect((function(){if(n)return e.on("timeupdate",f),function(){return e.off("timeupdate",f)}}),[]),!c)return null;var d="btn btn-outline-dark cv-show-summary";return s&&(d+=" cv-has-favourite-plugin"),l&&(d+=" cv-has-activity-status-plugin"),o.a.createElement(rt.a,{className:d,onClick:function(){a(!0),e.pause(),e.hide()}},e.gradePassbackPlugin().enabled?"Submit answers":"View summary")}var vr=n(1379),yr=n.n(vr);function gr(t){var e=t.interactive,n=t.duration;return n?o.a.createElement(o.a.Fragment,null,e.timepoints.map((function(e,r){if(!e.interactions.length)return o.a.createElement(o.a.Fragment,null);var a=s.a.getTypeInfo(e.interactions[0].typeId).bgClassName,i=e.visibleAt/1e3/n*100;return o.a.createElement("span",{key:r,className:"".concat(yr.a.interaction," ").concat(a),style:{left:"".concat(i,"%")},onClick:function(n){return r=e.id,o=e.interactions[0].id,n.stopPropagation(),void t.goToTimepoint(r,o);var r,o}})}))):o.a.createElement(o.a.Fragment,null)}var br=n(158),wr=n(399),Er=n(1380),xr=n.n(Er);function Ir(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(t,e)}(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 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 kr(t){var e=t.duration,n=t.progress,r=t.player,a=Ir(o.a.useState(n.length),2)[1],i=[];if(n.length){var c=n[0];i.push(c),n.forEach((function(t,e){0!==e&&(c.end.time+1>t.start.time&&c.start.time<t.start.time?c.end=t.end:(c=t,i.push(c)))}))}return o.a.useEffect((function(){var t=function(){a(n.length)};return r.on("progressflush",t),function(){return r.off("progressflush",t)}}),[]),o.a.createElement(o.a.Fragment,null,i.map((function(t,n){var r=t.start.time/e*100,a=100*(1-t.end.time/e);return o.a.createElement("span",{key:n,className:xr.a.progress,style:{left:"".concat(r,"%"),right:"".concat(a,"%")}})})))}function Or(t){return yt.a.last(t.results)}function Cr(t,e){return yt.a.findWhere(null==e?void 0:e.attempts,{id:t})}var Nr,jr=n(1257),Lr=n.n(jr);function Tr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ar=function(){return o.a.createElement(o.a.Fragment,null)},Pr=(Tr(Nr={},tt.InteractionTypeId.Annotation,Ar),Tr(Nr,tt.InteractionTypeId.Image,Ar),Tr(Nr,tt.InteractionTypeId.MissingWord,(function(t){var e=t.interaction.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat("cv-missing-word-").concat(e,"}")})).split(/{([^{}]*)}/g),n="p-2";return t.reportsStyling||(n+=" border rounded"),o.a.createElement("div",{className:n},e.map((function(e,n){if(!e.startsWith("cv-missing-word-"))return e;var r=e.replace("cv-missing-word-",""),a=t.interaction.actionableItems.find((function(t){return t.order.toString()===r}));if(a){var i=t.answers.find((function(t){return t.id==a.id}));if(i){if(!t.showFeedback)return o.a.createElement("strong",{key:n,className:"text-info"},i.text);var c=i.status===ie.Correct;return o.a.createElement(o.a.Fragment,{key:n},!c&&o.a.createElement(o.a.Fragment,null,o.a.createElement("del",{className:"text-danger"},o.a.createElement("strong",null,i.text))," "),o.a.createElement("strong",{className:"text-success"},a.name))}}})))})),Tr(Nr,tt.InteractionTypeId.MultipleChoice,(function(t){var e,n,r,a,i="my-2";return t.reportsStyling&&(i+=" mx-2"),o.a.createElement("div",{className:i},o.a.createElement(Ce,{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?we.a.getInitialsFromFullName(t.anonymisedUserName):we.a.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===(a=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===a?void 0:a.url,onlyShowSelectedAnswer:!t.showAvatar,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat(Lr.a.uncheckedBackground," text-white")}))})),Tr(Nr,tt.InteractionTypeId.TrueOrFalse,(function(t){var e,n,r,a,i="justify-content-start";return t.reportsStyling&&(i="justify-content-center"),o.a.createElement("div",{className:"my-2"},o.a.createElement(Pe,{className:i,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?we.a.getInitialsFromFullName(t.anonymisedUserName):we.a.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===(a=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===a?void 0:a.url,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat(Lr.a.uncheckedBackground," text-white")}))})),Tr(Nr,tt.InteractionTypeId.ShortAnswer,(function(t){var e=yt.a.first(t.answers);if(!e)return o.a.createElement(o.a.Fragment,null);var n="rounded p-2 mb-2";return t.reportsStyling||(n+=" bg-info text-white"),o.a.createElement("div",{className:n},e.text)})),Nr),_r=n(8).a.encloseNamespace("interactives.responseTypes");function Fr(){return o.a.createElement("p",{className:"p-2"},o.a.createElement("em",null,_r("noResponse")))}function Rr(t){return o.a.createElement(o.a.Fragment,null,t.correctness===ue.a.Correct&&o.a.createElement("div",{className:"ml-2 text-success"},o.a.createElement(Ee.a,{svgName:xe.b.Check})),t.correctness===ue.a.Incorrect&&o.a.createElement("div",{className:"ml-2 text-danger"},o.a.createElement(Ee.a,{svgName:xe.b.Close})))}function Mr(t){return o.a.createElement("div",{className:"d-flex align-items-center justify-content-between"},o.a.createElement("strong",null,t.anonymisedUserName||we.a.getFullName(t.studentResults.user)),o.a.createElement(Rr,{correctness:t.correctness}))}function Ur(t){return t.correctness!==ue.a.AwaitingMarking?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"d-flex justify-content-end mt-1"},o.a.createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===ie.Correct?"text-success":"")},o.a.createElement(Ee.a,{svgName:t.markedStatus===ie.Correct?xe.b.CheckCircle:xe.b.CheckCircleOutline,onClick:function(){return t.markInteraction(t.studentAttempt.answers,ie.Correct)}})),o.a.createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===ie.Incorrect?" text-danger":"")},o.a.createElement(Ee.a,{svgName:t.markedStatus===ie.Incorrect?xe.b.CrossCircleFilled:xe.b.CrossCircle,onClick:function(){return t.markInteraction(t.studentAttempt.answers,ie.Incorrect)}})))}var Dr=n(1381),Gr=n.n(Dr);function qr(t){var e,n,r,a,i,c=Pr[t.interaction.typeId];if(!c)return o.a.createElement(o.a.Fragment,null);var u=Or(t.studentResults),l=Cr(t.interaction.id,u),s=ye.isInteractionCorrect(t.interaction,u);return o.a.createElement("div",{className:"rounded ".concat(null!==(e=t.className)&&void 0!==e?e:"")},o.a.createElement("div",{className:"d-flex"},!!t.showStudentDetails&&o.a.createElement("div",{className:"mr-2"},o.a.createElement("div",{className:Gr.a.avatarContainer},o.a.createElement(Ie.a,{imageCdnUrl:t.imageCdnUrl,initials:t.anonymisedUserName?we.a.getInitialsFromFullName(t.anonymisedUserName):we.a.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===(i=null===(a=t.studentResults.user)||void 0===a?void 0:a.avatar)||void 0===i?void 0:i.url}))),o.a.createElement("div",{className:"flex-grow-1"},!!t.showStudentDetails&&o.a.createElement(Mr,{studentResults:t.studentResults,correctness:s,anonymisedUserName:t.anonymisedUserName}),o.a.createElement("div",{className:"d-flex justify-content-between"},o.a.createElement("div",{className:"flex-grow-1 ".concat(t.responseComponentClass?t.responseComponentClass:"")},l?o.a.createElement(c,{interaction:t.interaction,answers:l.answers,imageCdnUrl:t.imageCdnUrl,user:t.studentResults.user,showFeedback:t.showFeedback,showAvatar:t.showAvatar,reportsStyling:t.reportsStyling}):o.a.createElement(Fr,null)),!t.showStudentDetails&&o.a.createElement(Rr,{correctness:s})))),o.a.createElement(Ur,{studentAttempt:l,correctness:s,markInteraction:t.markInteraction,markedStatus:t.markedStatus}))}var Br=n(1382),Wr=n.n(Br);function zr(t){var e=t.studentResults,n=t.interaction,r=t.timepoint,a=t.interactive,i=t.state,c=t.goToTimepoint,u=t.interactionNumber,l=t.imageCdnUrl,s=Or(e),f=Cr(n.id,s),d=i.interactions[n.id],p=Ze(n.typeId)(d||{},n),m=n.typeId!==tt.InteractionTypeId.Annotation&&n.typeId!==tt.InteractionTypeId.Image,h=m;n.typeId===tt.InteractionTypeId.MissingWord&&f&&(h=!1);var v=n.data.suggestedResponse||n.data.feedback;return o.a.createElement("li",{className:"mb-3 position-relative"},o.a.createElement("div",{className:"d-flex flex-wrap mb-2 cursor-pointer",onClick:function(){return c(r.id,n.id)}},a.immediateFeedback&&o.a.createElement("div",{className:Wr.a.feedback},!!f&&(p===ue.a.AwaitingMarking?o.a.createElement("span",{className:"text-muted font-italic"},"Waiting to be marked"):p===ue.a.Correct?o.a.createElement("span",{className:"text-success"},"Correct ",o.a.createElement(Ee.a,{className:"svg-container align-middle",svgName:xe.b.Check})):p===ue.a.Incorrect&&o.a.createElement("span",{className:"text-danger"},"Incorrect ",o.a.createElement(Ee.a,{className:"svg-container align-middle",svgName:xe.b.Close})))),o.a.createElement(Zn.a,{interaction:n,iconClassName:"flex-shrink-0",showQuestion:h,showTypeName:!0,questionClassName:"d-block w-100 mt-2",questionNumber:u})),m&&!f&&o.a.createElement("button",{className:"btn btn-dark",onClick:function(){return c(r.id,n.id)}},"Answer question"),f&&m&&o.a.createElement(qr,{interaction:n,studentResults:e,markedStatus:ie.PendingReview,markInteraction:function(){},imageCdnUrl:l,showFeedback:a.immediateFeedback,showAvatar:!0}),a.immediateFeedback&&f&&v&&o.a.createElement("div",{className:"bg-light rounded p-2"},o.a.createElement("div",null,o.a.createElement("strong",null,n.typeId===tt.InteractionTypeId.TrueOrFalse?"Teacher's feedback":"Teacher's suggested response")),v))}var Yr=n(1383),$r=n.n(Yr);function Hr(t){return function(t){if(Array.isArray(t))return Vr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Vr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vr(t,e)}(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 Vr(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 Kr(t){var e=t.showSummary,n=t.setShowSummary,r=t.state,a=t.interactive,i=t.player,c=t.progress,u=t.portalNode,l=o.a.useRef();function s(){n(!1),i.show(),i.play()}function f(e,n){s(),t.goToTimepoint(e,n)}if(!u||!e)return o.a.createElement(o.a.Fragment,null);var d=function(t){var e=t.interactive,n=t.state,r=0,o=0,a=0,i=!1,c=[];return e.timepoints.forEach((function(t){t.interactions.forEach((function(t){var e=n.interactions[t.id],u=Ze(t.typeId)(e||{},t);u===ue.a.Correct&&r++,u!==ue.a.NotApplicable&&o++,u!==ue.a.NotApplicable&&(null==e?void 0:e.submitted)&&a++,u===ue.a.AwaitingMarking&&(i=!0);var l=D(e||{}),s=Object.keys(l).map((function(t){var e;return{id:t,text:null===(e=l[t])||void 0===e?void 0:e.toString()}}));s.length&&c.push({id:t.id,answeredAt:1,answers:s})}))})),{correctCount:r,total:o,answered:a,studentAttempts:c,awaitingMarking:i}}({interactive:a,state:r}),p=d.correctCount,m=d.total,h=d.answered,v=d.studentAttempts,y=d.awaitingMarking,g={name:t.currentUser.givenName,username:t.currentUser.username,user:{name:t.currentUser.givenName,surname:t.currentUser.familyName,avatar:{url:t.currentUser.avatar}},results:[{id:a.id,attempts:v}]},b=0,w=i.ended(),E=i.duration();return o.a.createElement(et.a,{node:u},o.a.createElement("div",{className:"row pb-3"},o.a.createElement("div",{className:"col-4 col-xs-12"},o.a.createElement(wr.a,{data:i.poster(),imageType:Ot.c.Thumbnails,imageOptions:{size:Ot.b.Medium}})),o.a.createElement("div",{className:"col-8 col-xs-12"},o.a.createElement("span",{className:"float-right"},o.a.createElement(br.a,{svgName:xe.b.Play,className:"btn btn-outline-dark",onClick:function(){s(),i.ended()&&i.currentTime(0)}},w?"Play again":"Continue watching"),i.gradePassbackPlugin().enabled&&o.a.createElement(br.a,{svgName:xe.b.Check,className:"btn btn-dark ml-2",onClick:function(){i.gradePassbackPlugin().submit(p/m,!y)}},"Submit")),o.a.createElement("h1",{className:"h3"},t.title),o.a.createElement("p",null))),o.a.createElement("div",{className:"border rounder px-2 mb-3"},o.a.createElement("div",{className:"cursor-pointer my-4 ".concat($r.a.bar),onClick:function(t){if(l.current){var e=l.current.getBoundingClientRect(),n=(t.pageX-e.left)/e.width*E;s(),i.currentTime(n)}},ref:l},o.a.createElement(kr,{duration:E,progress:c,interactive:a,player:i}),o.a.createElement(gr,{duration:E,interactive:a,goToTimepoint:f}))),o.a.createElement("h2",{className:"h4"},"My Answers"),o.a.createElement("div",{className:"d-flex justify-content-between"},o.a.createElement("span",null,a.immediateFeedback&&o.a.createElement("div",null,"Score: ",p,"/",m),o.a.createElement("div",{className:"mb-3"},"You have answered ",o.a.createElement("strong",{className:h!==m?"text-danger":""},h)," of ",o.a.createElement("strong",null,m)," questions"))),o.a.createElement("div",{className:"row"},o.a.createElement("div",{className:"col-lg-7 col-12"},o.a.createElement("ul",{className:"list-unstyled"},a.timepoints.reduce((function(e,n){return[].concat(Hr(e),Hr(n.interactions.map((function(e){return b++,o.a.createElement(zr,{key:e.id,studentResults:g,interaction:e,timepoint:n,interactive:a,state:r,goToTimepoint:f,interactionNumber:b,imageCdnUrl:t.imageCdnUrl})}))))}),[])))))}function Zr(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)return;var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Jr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jr(t,e)}(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 Jr(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 Qr(t){var e=t.resultsService,n=t.player,r=t.onShowSummary,a=Zr(o.a.useState(!1),2),i=a[0],c=a[1];function u(t){c(t),r&&r(t)}function l(){u(!0),n.hide()}return o.a.useEffect((function(){if(e)return n.on("ended",l),function(){return n.off("ended",l)}}),[]),o.a.useEffect((function(){i&&n.isFullscreen()&&n.exitFullscreen()}),[i]),o.a.createElement(o.a.Fragment,null,o.a.createElement(hr,Object.assign({setShowSummary:u},t)),o.a.createElement(Kr,Object.assign({showSummary:i,setShowSummary:u},t)))}n(1384);var Xr=n(1103);function to(t){var e,n,r,a=(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),i=[];return t.onClickEditDetails&&i.push({label:"Edit details",svgName:xe.b.Edit,button:!0,className:"btn btn-outline-dark",onClick:t.onClickEditDetails}),t.onClickPublish&&i.push({label:"Publish",button:!0,className:"btn btn-dark ml-2".concat(a?"":" disabled"),disabled:!a,tooltip:a?"":"Interactives cannot be published without questions",onClick:function(){if(!a)return;t.onClickPublish&&t.onClickPublish()}}),i.length?o.a.createElement(et.a,{node:t.portalNode},o.a.createElement(Xr.a,{actions:i})):o.a.createElement(o.a.Fragment,null)}var eo=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 no(t){var e=t.title,n=t.player,r=t.track,a=t.mode,i=t.interactive,c=t.imageApi,u=t.supportSiteUrl,s=t.actionsPortalNode,f=t.questionListPortalNode,d=t.summaryPortalNode,p=t.resultsService,m=t.currentUser,h=t.progress,v=t.latestSession,y=t.clipOffset,g=t.analyticsService,b=t.enableImmersiveReader,w=function(t){var e=t.player,n=t.track,r=t.interactive,a=t.clipOffset,i=_(o.a.useState(!1),2),c=i[0],u=i[1],l=_(o.a.useState(!1),2),s=l[0],f=l[1],d=_(o.a.useState(null),2),p=d[0],m=d[1];function h(t){return a?t+a:t}function v(t){f(!!t&&c),u(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.a.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:i,mode:a,clipOffset:y}),E=w.open,x=w.timepoint,I=w.wasOpen,S=eo(w,["open","timepoint","wasOpen"]),k=sn(Object.assign({mode:a,interactive:i,timepoint:x,player:n,resultsService:p,latestSession:v,analyticsService:g},S)),O=k.interaction,C=k.interactionState,N=k.nextInteraction,j=k.nextInteractionState,L=k.timepointState,T=k.state,A=eo(k,["interaction","interactionState","nextInteraction","nextInteractionState","timepointState","state"]);!function(t){var e,n=t.mode,r=t.player,a=t.timepoint,i=t.interaction,c=t.discardChanges,u=t.interactionState,s=t.timepointState,f=Object(R.a)(),d=n===l.InteractiveMode.Create;o.a.useEffect((function(){if(d){if(U(null==i?void 0:i.id)||(null==u?void 0:u.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")}}),[i,null==u?void 0:u.hasChanges,null===(e=null==a?void 0:a.interactions)||void 0===e?void 0:e.length,null==s?void 0:s.hasChanges])}({mode:a,player:n,timepoint:x,interaction:O,discardChanges:A.discardChanges,interactionState:C,timepointState:L});var F={mode:a,open:E,isCreate:a===P.a.Create,interaction:O,nextInteraction:N,timepoint:x,interactive:i,interactionState:C,nextInteractionState:j,timepointState:L,player:n};return o.a.createElement(o.a.Fragment,null,!!s&&o.a.createElement(to,{interactive:i,onClickEditDetails:t.onClickEditDetails,onClickPublish:t.onClickPublish,portalNode:s}),o.a.createElement(mn,Object.assign({},F,A)),o.a.createElement(dr,Object.assign({imageApi:c,currentUser:m,immediateFeedback:i.immediateFeedback,delayFocus:!I,enableImmersiveReader:b},F,A,S)),o.a.createElement(Qr,Object.assign({title:e,currentUser:m,state:T,portalNode:d,progress:h,resultsService:p,imageCdnUrl:c.toString(),onShowSummary:t.onShowSummary},F,A)),o.a.createElement(bn,Object.assign({portalNode:f,supportSiteUrl:u,currentUser:m},F,A)))}c.a.registerComponent("Interactive",Object(A.a)((function(t,e){return o.a.createElement(no,Object.assign({player:t},e))})));var ro=n(274),oo=n(279);function ao(t){var e=t.player;function n(){var t=e.getChild("ContinueSession");e.removeChild(t),t.dispose()}function r(){t.continue(!0),n()}var a=[{buttonText:"Start again",variant:"link",onClick:function(){t.continue(!1),n()}},{buttonText:"Continue",variant:"dark",onClick:r}];return o.a.createElement(ro.a,{title:"Continue interactive?",closePopup:r},o.a.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.a.createElement(oo.a,{buttons:a}))}function io(t){return(io="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})(t)}function co(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 uo(t,e){return(uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function lo(t){var e=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}}();return function(){var n,r=fo(t);if(e){var o=fo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return so(this,n)}}function so(t,e){if(e&&("object"===io(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 fo(t){return(fo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}c.a.registerComponent("ContinueSession",Object(A.a)((function(t,e){return o.a.createElement(ao,Object.assign({player:t},e))})));var po=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&&uo(t,e)}(a,t);var e,n,r,o=lo(a);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=o.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),"*")}}])&&co(e.prototype,n),r&&co(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getPlugin("plugin"));c.a.registerPlugin("gradePassbackPlugin",po);n(1385);function mo(t){return(mo="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})(t)}function ho(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 vo(t,e){return(vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function yo(t){var e=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}}();return function(){var n,r=bo(t);if(e){var o=bo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return go(this,n)}}function go(t,e){if(e&&("object"===mo(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 bo(t){return(bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wo=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&&vo(t,e)}(a,t);var e,n,r,o=yo(a);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=o.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(),u.a.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){e.options.analyticsService.logUserAction({},{actionType:ne.UserAction.Click,entity:ne.EntityType.Interactive,descriptor:n?ne.InteractiveSessionDescriptor.ContinueSession:ne.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||l.InteractiveMode.View,latestSession:this.continueSession&&this.options.latestSession})),this.player.controlBar.getChild("progressControl").getChild("SeekBar").addChild(new T(this.player,{interactive:this.options.interactive,track:t}))}}])&&ho(e.prototype,n),r&&ho(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.a.getPlugin("plugin"));c.a.registerPlugin("viewInteractivePlugin",wo);var Eo=n(131);function xo(t){return(xo="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})(t)}function Io(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 So(t,e){return(So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ko(t){var e=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}}();return function(){var n,r=Co(t);if(e){var o=Co(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Oo(this,n)}}function Oo(t,e){if(e&&("object"===xo(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 Co(t){return(Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var No=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&&So(t,e)}(a,t);var e,n,r,o=ko(a);function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.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()}}])&&Io(e.prototype,n),r&&Io(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(n(121).a);function jo(t){return(jo="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})(t)}function Lo(t){return function(t){if(Array.isArray(t))return To(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return To(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return To(t,e)}(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 To(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 Ao(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ao=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==jo(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Po(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 _o=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Fo=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 Eo.a).withUrl("".concat(e.playerApi.origin,"/hubs/interactives"),{withCredentials:!1}).configureLogging(Eo.c.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,r;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 _o(e,void 0,void 0,Ao().mark((function t(){return Ao().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 _o(this,void 0,void 0,Ao().mark((function t(){return Ao().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?a.a.ErrorHelper.throw(new No):(this.retryCount++,this.start())}},{key:"startSession",value:function(){return _o(this,void 0,void 0,Ao().mark((function t(){var e,n,r,o,i,c,u;return Ao().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,i=e.customerId,c=e.shareId,t.prev=3,t.next=6,this.connection.invoke("startSession",n,r,o,i,c);case 6:u=t.sent,this.resultId=u.resultId,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),a.a.ErrorHelper.throw(new No);case 13:case"end":return t.stop()}}),t,this,[[3,10]])})))}},{key:"flush",value:function(){return _o(this,void 0,void 0,Ao().mark((function t(){var e=this;return Ao().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:Lo(this.cache).forEach((function(t){return _o(e,void 0,void 0,Ao().mark((function e(){return Ao().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()}}),t,this)})))}},{key:"save",value:function(t,e){return _o(this,void 0,void 0,Ao().mark((function n(){var r;return Ao().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)})))}}])&&Po(e.prototype,n),r&&Po(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ro=function(t,e){var n,r=t.addTextTrack("metadata","interactive"),o=e.additionalData.interactive,a=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;a&&(n+=a,o+=a),(null===(e=t.interactions)||void 0===e?void 0:e.length)&&r.addCue({startTime:n-.001,endTime:o,text:t.id})})),r},Mo=n(417);function Uo(t){return(Uo="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})(t)}function Do(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Do=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=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 u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new I(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;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){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=l(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==Uo(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.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=l(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,a=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 a.next=a}}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,i,"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,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"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 i.type="throw",i.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 a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,s):this.complete(i)},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 Go(t){return function(t){if(Array.isArray(t))return qo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return qo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qo(t,e)}(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 qo(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 Bo(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 Wo(){return(Wo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=zo(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(this,arguments)}function zo(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Vo(t)););return t}function Yo(t,e){return(Yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function $o(t){var e=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}}();return function(){var n,r=Vo(t);if(e){var o=Vo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ho(this,n)}}function Ho(t,e){if(e&&("object"===Uo(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 Vo(t){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ko=function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,c)}u((r=r.apply(t,e||[])).next())}))},Zo=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&&Yo(t,e)}(c,t);var e,n,r,o=$o(c);function c(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(n=o.call(this,t,e)).totalProgress=[],G.a.setToken("gateway",n.options.authToken),n.player.one("dispose",(function(){n.resultsService&&n.resultsService.stop()})),n.options.mode===l.InteractiveMode.Create&&n.player.addClass("cv-create-interactives"),n}return e=c,(n=[{key:"getPlayerOptions",value:function(){var t=Wo(Vo(c.prototype),"getPlayerOptions",this).call(this);return t.setMaxHeight=!1,this.options.embed||(t.aspectRatio="16:9"),t}},{key:"onFlushProgress",value:function(t){var e;Wo(Vo(c.prototype),"onFlushProgress",this).call(this,t),this.options.mode!==l.InteractiveMode.Create&&(e=this.totalProgress).push.apply(e,Go(t))}},{key:"additionalSetup",value:function(t){var e=this,n=Object.create(null,{additionalSetup:{get:function(){return Wo(Vo(c.prototype),"additionalSetup",e)}}});return Ko(this,void 0,void 0,Do().mark((function e(){return Do().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.additionalSetup.call(this,t),this.setupUpClipPlugin(t),this.setupViewInteractivePlugin(t);case 3:case"end":return e.stop()}}),e,this)})))}},{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=Ro(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||a.a.ErrorHelper.throw(new i.a("Must provide a currentUser in order to collect interactive results")),this.options.shareId||a.a.ErrorHelper.throw(new i.a("Must provide a shareId in order to collect interactive results")),this.resultsService=new Fo({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})}},{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)}}])&&Bo(e.prototype,n),r&&Bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(Mo.a);n.d(e,"a",(function(){return Qo}));var Jo=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 Qo(t){var e=t.onReady,n=t.className,r=Jo(t,["onReady","className"]),a=o.a.useRef();return o.a.useEffect((function(){var t=new Zo(a.current,r);return e&&t.ready((function(){e(t)})),function(){t.dispose()}}),[]),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{ref:a,className:n}),o.a.createElement("div",{id:"popup-region"}))}},1289:function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r=n(0),o=n.n(r),a=n(282),i=n(1170),c=n(133),u=n(63),l=n(20),s=n(43),f=n(1143),d=n(1191),p=n(1290),m=n.n(p),h="shared.interactiveQuestions";function v(t){var e=t.interaction;switch((0,t.getCorrectness)(e)){case f.a.Correct:return o.a.createElement("span",{className:"text-success"},o.a.createElement(u.a,{size:u.b.Medium,svgName:l.b.Check}));case f.a.Incorrect:return o.a.createElement("span",{className:"text-danger"},o.a.createElement(u.a,{size:u.b.Medium,svgName:l.b.Close}));case f.a.AwaitingMarking:return o.a.createElement("span",{className:"text-muted italic"},o.a.createElement("i",null,o.a.createElement(s.b,{namespace:h,phrase:"pending"})));case f.a.UnAnswered:return o.a.createElement("button",{className:"btn btn-outline-dark"},o.a.createElement(s.b,{namespace:h,phrase:"answer"}));case f.a.Answered:return o.a.createElement("span",{className:"text-muted italic"},o.a.createElement("i",null,o.a.createElement(s.b,{namespace:h,phrase:"answered"})));case f.a.NotApplicable:return o.a.createElement(o.a.Fragment,null)}}function y(t){var e=t.interaction,n=t.visibleAt,r=t.selectedInteractionId,a=t.goToTimepoint,s=t.scrollTo,f=t.isFirstInteraction,p=e.id.toString()===(null==r?void 0:r.toString()),h=o.a.useRef();o.a.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 y=a?"cursor-pointer":"cursor-default";return o.a.createElement("div",{ref:h},o.a.createElement(c.a,{className:"py-2 ".concat(y," ").concat(m.a.row," ").concat(p?m.a.selected:""),onClick:p?function(){}:function(){a&&a(e.id)}},o.a.createElement("span",{className:"".concat(m.a.time," mr-2 ").concat(p?"font-weight-bold":"")},f?i.a.ToDisplayDuration(n):""),o.a.createElement(d.a,{interaction:e,showTypeName:!0,typeNameClassName:m.a.type,questionClassName:m.a.question}),t.onClickDelete&&o.a.createElement(c.a,{onClick:function(n){n.stopPropagation(),t.onClickDelete(e.id)},className:"".concat(m.a.deleteContainer)},o.a.createElement("span",{className:"text-right ".concat(m.a.delete)},o.a.createElement(u.a,{size:u.b.Medium,svgName:l.b.Delete}))),t.getCorrectness&&o.a.createElement("span",{className:"text-right ".concat(m.a.correctness)},o.a.createElement(v,{interaction:e,getCorrectness:t.getCorrectness}))))}function g(t){var e=t.timepoint,n=t.scrollTo,r=t.onClickDelete,a=t.selectedInteractionId,i=t.getCorrectness;function c(n){t.goToTimepoint&&t.goToTimepoint(e.id,n)}return e.interactions?o.a.createElement("div",null,e.interactions.map((function(t,u){return o.a.createElement(y,{interaction:t,visibleAt:e.visibleAt,goToTimepoint:c,onClickDelete:r,scrollTo:n,selectedInteractionId:a,isFirstInteraction:0===u,getCorrectness:i,key:u})}))):o.a.createElement(o.a.Fragment,null)}function b(t){var e=t.interactive,n=t.goToTimepoint,r=t.selectedInteractionId,i=t.maxHeight,c=t.onClickDelete,u=t.getCorrectness,l=o.a.useRef();function s(t,e){if(l.current){var n=l.current.getClientHeight(),r=l.current.getScrollTop(),o=t+r;(o<r||o+e>r+n)&&l.current.scrollTop(o-n/2+e/2)}}var f=n?"border rounded":"";return o.a.createElement(a.Scrollbars,{autoHeight:!0,autoHeightMax:i,className:f,hideTracksWhenNotNeeded:!0,ref:l},o.a.createElement("div",{className:"px-3 py-1"},e.timepoints.map((function(t,e){return o.a.createElement(g,{key:e,timepoint:t,goToTimepoint:n,selectedInteractionId:r,scrollTo:s,onClickDelete:c,getCorrectness:u})}))))}},1290:function(t,e,n){t.exports={time:"_3B2vs",type:"_3lYII",question:"_3WHlt",deleteContainer:"Dqlwr",delete:"_4TtZ",correctness:"_3G9s-",selected:"_20LzY",row:"_3uCfp"}},1357:function(t,e,n){},1358:function(t,e,n){},1359:function(t,e,n){},1360:function(t,e,n){},1365:function(t,e,n){},1366:function(t,e,n){},1367:function(t,e,n){},1368:function(t,e,n){t.exports={incorrect:"_3pK3B",answer:"_2ItYx",avatarContainer:"_3DkKy"}},1369:function(t,e,n){},1370:function(t,e,n){t.exports={feedback:"_2hJr3",avatarContainer:"_2Ukg-",avatarContainerSmall:"_1E7DW",incorrect:"xbaUc"}},1371:function(t,e,n){t.exports={svg:"_17Ny-",iconButton:"x1ePL",iconWithText:"_2BmJR",iconOnly:"_2DnLq"}},1372:function(t,e,n){},1373:function(t,e,n){},1374:function(t,e,n){},1375:function(t,e,n){},1376:function(t,e,n){t.exports={type:"_3N9_3",dragIcon:"_1GfpD",name:"_3s8vL",dragging:"_1qnqN"}},1377:function(t,e,n){},1378:function(t,e,n){},1379:function(t,e,n){t.exports={interaction:"_3SUOU"}},1380:function(t,e,n){t.exports={progress:"_1myQT"}},1381:function(t,e,n){t.exports={avatarContainer:"_27TEu"}},1382:function(t,e,n){t.exports={feedback:"F7uFH"}},1383:function(t,e,n){t.exports={bar:"_2pc-n"}},1384:function(t,e,n){},1385:function(t,e,n){}}]);
|